<?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=Rmt13</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=Rmt13"/>
	<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/wiki/Special:Contributions/Rmt13"/>
	<updated>2026-05-21T03:09:24Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=543036</id>
		<title>Rep:Mod:hakunamatata</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=543036"/>
		<updated>2016-02-25T19:15:34Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: /* Statistical Physics Calculations of the Heat Capacity */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Introduction to Molecular Dynamics Simulations ==&lt;br /&gt;
===The Classical Particle Approximation and Numerical Integration===&lt;br /&gt;
The verit and verit-velocity algorithms are numerical methods to approximate the average position and velocity respectively of randomly moving particles in a particular medium (solid, liquid, fliud etc.). This position and velocity can be applied to Newtonian mechanics to calculate such properties as the force and potential energy of the system. The algorithms work by splitting the function into discrete time steps, calculating the values of position and velocity at this particular time step, and then effectively &amp;quot;joining the dots&amp;quot; to create an approximate function. These simulations always use the answer from the previous timestep to compute the new timestep, so initial conditions must be given for the first step. Both of the algorithms are shown below and are derived from the Taylor expansion of the position or velocity of the atoms at the timestep &amp;quot;n+1&amp;quot; or &amp;lt;math&amp;gt;t+\delta t&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit Algorithum:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{x}_i\left(t + \delta t\right) \approx 2\mathbf{x}_i\left(t\right) - \mathbf{x}_i\left(t - \delta t\right) + \frac{\mathbf{F}_i\left(t\right)}{m_i}\delta t^2  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit-Velocity Algorithum:&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i\left(t\right)&amp;lt;/math&amp;gt; is the force acting on a particular atom as a function of time&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i\left(t\right)&amp;lt;/math&amp;gt; is the acceleration of the atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The smaller the timestep, the closer the numerical approximation is to the true function, which can be modeled as a classical harmonic oscillator. &#039;&#039;Figure 1.&#039;&#039; in the table below shows the comparison between the two methods at plotting position of an atom as a function of time in &#039;&#039;time&#039;&#039; space. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure 1. &#039;&#039;Plots of position vs time comparing the verit algorithm and harmonic spring results&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure 2. &#039;&#039;Plot of the total classical energy of the system (potential + kinetic)&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory xanalytical.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory energy.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The harmonic spring position values are modeled from the harmonic oscillator or particle on a spring. The equation of &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; is used to calculate these values, where &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; are equal to 1 and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; is equal to zero. As seen on the plot, the curves produced from the two different methods of calculating the position are in good agreement.&lt;br /&gt;
|The potential energy is calculated using the equation &amp;lt;math&amp;gt;U = \frac{1}{2}kx^2&amp;lt;/math&amp;gt;, with a value of k (force constant) given as 1. The kinetic energy is calculated using the velcity from the verit-velocity algorithm using the equation &amp;lt;math&amp;gt;T = \frac{1}{2} mv^2&amp;lt;/math&amp;gt;, where m (mass) is equal to 1. The total energy of the system, &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, is equal to &amp;lt;math&amp;gt;T + U&amp;lt;/math&amp;gt;. The values for &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; (from the potential energy term) and &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; (from the kinetic energy term) are taken from the verit algorithm and verit-velocity algorthim respectively. &lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;Figure 3. &#039;&#039;Plot of the difference (error) between the harmonic spring and verit algorithm data&lt;br /&gt;
!&#039;&#039;Figure 4. &#039;&#039;Plot of the peaks in the error plot in &#039;&#039;figure 3.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory error.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory errorpeaks.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The peaks in the error between the harmonic spring and verit algorithm results are at the point where the position curve crosses the time axis. This is because the harmonic spring data (&amp;lt;math&amp;gt;x(t)&amp;lt;/math&amp;gt;) has a slightly shorter wavelength than that of the verit velocity algorithm, and therefore the difference will get larger with each period of the wave. This is shown by the error getting larger in &#039;&#039;figure 3. &#039;&#039;The period of the plot of the two methods are different because the verit algorithm is much more approximate so does not give the correct solution.&lt;br /&gt;
|The change in the error/difference between the harmonic spring data and verit algorthm data increases linearly and so therefore period of each of the plots in &#039;&#039;figure 1&#039;&#039;. must be constant. &lt;br /&gt;
|}&lt;br /&gt;
The error can also be quantified on a &#039;&#039;phase space&#039;&#039; plot; phase space is momentum or velocity plotted as a function of position. The true solution for motion of an atom is a perfect ellipse, and the more elliptic the shape (less circular) the more momentum or velocity is in the system. A numerical solution, like the verit algorithms, will produce a set of points very close to this ellipse but not perfectly following the curve. A good numerical solution will remain in an elliptical shape, whereas a bad numerical solution, for example one with a large timestep, will spiral away from the true solution. Two examples of such systems using the data from &#039;&#039;figures a-d&#039;&#039; are shown below.  &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure 5. &#039;&#039;Phase plot of the harmonic spring data with a good numerical solution (timestep = 0.1) &lt;br /&gt;
!&#039;&#039;Figure 6. &#039;&#039;Phase plot of the harmonic spring data with a bad numerical solution (timestep = 0.3) &lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory phasegood.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory badphase.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The timestep at which this data is plotted is 0.1, which results in a very small change in the energy, as seen in &#039;&#039;figure b. &#039;&#039;Increasing the time step will increase the variation in the energy. To keep the variation in the total energy of the system under 1%, the time step must be no larger than approximately 0.28. The energy varies more with increasing time step because the jumps in the algorithm  are getting larger due to less data points. The algorithm assumes these points are joined by a straight line and that the halfway point in the jump is the average between the starting and finishing point of the jump. The phase space plot will become less elliptic and the jumps eventually become so large that the plot is no longer a continuous shape.  &lt;br /&gt;
&lt;br /&gt;
It is essential to monitor the energy of a numerically modeled system because a good solution for the motion of an atom has a constant energy and a plot in phase space of a perfect ellipse.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance and Force at Zero Potential===&lt;br /&gt;
From classical mechanics, the force calculated from the Newtonian mechanics above can be used to calculate the potential experienced by an atom in the system. They are related by the equation: &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;
[[File:Rmt 12-6-Lennard-Jones-Potential.png|left|thumb|&#039;&#039;Figure 7. &#039;&#039;The Lennard-Jones Potential]]&lt;br /&gt;
This potential gives the shape and dimension of the potential surface on which the system can be modeled. In this experiment, a simple 1D potential is used to describe the inter atomic forces of a liquid; the Lennard-Jones potential. It has the characteristic features of a short range repulsion potential and harmonic character around the equilibrium bond distance or interatomic separation. The value of &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the inter atomic separation when the potential, &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;, is equal to zero, can be calculated by equating the equation for the Lennard-Jones potential to zero and solving for &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The equation for the Lennard-Jones potential: &amp;lt;math&amp;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;
Equating this to zero: &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;
And rearranging in order to separate the variables: &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;
Rearranging this gives &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in terms of &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt; r^6 = \sigma^6&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r = r_0&amp;lt;/math&amp;gt; in this case.&lt;br /&gt;
&lt;br /&gt;
This, therefore, gives the result that interatomic distance at zero potential, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, is equal to &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; in the Lennard-Jones potential is effectively the diameter of one of the particles in the system being measured; in this case, the solid, liquid or gas we are simulating. This is the point where the potential curve crosses the x-axis on an Energy vs interatomic distance plot. The force, &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt;, at this point on the curve corresponds to the gradient; it is found by calculating the derivative of the curve at this point. &lt;br /&gt;
&lt;br /&gt;
To calculate the force, we must differentiate the equation for the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;U\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As force is equal to the negative differential of the potential energy, the value of the force is: &amp;lt;math&amp;gt;\mathbf{F}_i = 48\epsilon \sigma^{12} r^{-13} - 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting in the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at zero potential from the calculation before: &amp;lt;math&amp;gt;\mathbf{F}_i = \frac{48\epsilon}{\sigma} - \frac{24\epsilon}{\sigma} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The gradient where the Lennard-Jones plot crosses the axis is negative; &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; in the term obtained for &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is negative and therefore the overall value of the force will be negative.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance, Force and Well Depth of the Potential at Equilibrium===&lt;br /&gt;
To calculate the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at the equilibrium position, we need to use the derivative of the potential energy curve. The equilibrium value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is the value at the minimum of the Lennard-Jones curve; when &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Therefore, equating the derivative to zero gives: &amp;lt;math&amp;gt;0 = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rearranging this: &amp;lt;math&amp;gt;48\epsilon \sigma^{12} r^{-13} = 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And simplifying and cancelling gives: &amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6&amp;lt;/math&amp;gt;. Therefore the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at equilibrium is: &amp;lt;math&amp;gt;r_{eq} = \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Physically, this result means that the equilibrium distance is 1.12 times the diameter of one of the particles; the particles have a small gap between them so do not touch. A short range repulsion potential, as seen in the Lennard-Jones curve, is a result of the particles coming into contact. &lt;br /&gt;
&lt;br /&gt;
Again, the force can be calculated from the derivative of the potential curve at the equilibrium point. As the derivative at this point is zero (a minimum on the curve), the force will therefore also be zero.&lt;br /&gt;
&lt;br /&gt;
The well-depth of the potential curve is the difference between zero potential and the potential at the equilibrium bond length. This can be calculated by substituting the value for the equilibrium bond length into the equation for the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;U\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;U\left(r_{eq}\right) = 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;
Cancelling and simplifying this equation gives: &amp;lt;math&amp;gt;U\left(r_{eq}\right) = 4\epsilon \times \frac{1}{4}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the absolute value for the well depth is &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;. The actual value of this potential is &amp;lt;math&amp;gt;-\epsilon&amp;lt;/math&amp;gt;, as the equilibrium bond length gives the most stable configuration of the molecules and therefore suggests attractive interactions are involved in the arrangement of the molecules; this attractive potential is negative. &lt;br /&gt;
&lt;br /&gt;
===Boundary Conditions and the Lennard-Jones Cutoff===&lt;br /&gt;
When simulating a liquid, it is computationally impractical to simulate a realistic liquid. Therefore a smaller &#039;box&#039; containing &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; particles is simulated and the computer program will use &#039;&#039;periodic boundary conditions&#039;&#039; to simulate infinite repetitions of this box. For example, when the atom reaches one edge of the box, applying periodic boundary conditions, it will reappear again at the opposite edge of the box as if they were connected. Applying this logic: an atom at the position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a box of size &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;. Without periodic boundary conditions, we would assume that the atom would end up at the position &amp;lt;math&amp;gt;(1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;. However, in this box, there is no such position and so the particle must reappear at the opposite edge to where it effectively &#039;left&#039; the box. Therefore, it&#039;s ending position will be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The number of particles, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; simulated by the computer is usually between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt;. Physically, this is a very small volume. Considering water, we can calculate the number of molecules in 1 mL or 1 cm^3, a volume which would be considered small in the lab. Taking the concentration of water at standard conditions, &amp;lt;math&amp;gt;55\ mol\ dm^{-3}&amp;lt;/math&amp;gt;, we can convert it to the number of moles per mL: &amp;lt;math&amp;gt;0.055\ mol\ mL^{-1}&amp;lt;/math&amp;gt;. Multiplying this value by Avagadro&#039;s constant (&amp;lt;math&amp;gt;N_A&amp;lt;/math&amp;gt;) gives the number of molcules of water per mL: &amp;lt;math&amp;gt;3.02 \times 10^{22} mL^{-1}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The reverse procedure can be used to compare this to the volume of 10,000 molecules: 10,000 divided by Avagadro&#039;s constant gives the number of moles of water which 10,000 molecules makes up: &amp;lt;math&amp;gt;1.66 \times 10^{-20}\ mol&amp;lt;/math&amp;gt;. Dividing this value by the concentration (from &amp;lt;math&amp;gt;n=cV&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is the number of moles, &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; is the concentration and &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume), gives the volume: &amp;lt;math&amp;gt;3.02 \times 10^{-22}\ dm&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;3.02 \times 10^{-19}\ mL&amp;lt;/math&amp;gt;. Physically, of course, this is far too small a volume to be recorded in the lab.&lt;br /&gt;
 &lt;br /&gt;
Periodic boundary conditions simulate an infinite lattice and therefore, when computing the potential, will calculate an infinite amount of pair interactions. Therefore, it is only practical to calculate the energies up to a certain interatomic distance; the Lennard-Jones cutoff distance. Beyond this point, the potential energy and the integral of the curve beyond this point become insignificant and do not impact on the overall energy; removing interactions beyond this point from the calculations will not effect the accuracy. Multiplying the Lennard-Jones potential with the radial distribution function gives a plot of the probability of finding an atom at a particular interatomic distance. The larger the interatomic distance, the lower the probability and so the energy after the cutoff can be disregarded. The radial distirbution function is dicussed in a later section.&lt;br /&gt;
&lt;br /&gt;
Integrating over the Lennard-Jones curve and applying this cutoff as the lower limit can show how small the integral is:&lt;br /&gt;
&lt;br /&gt;
For a general cutoff of with value &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;I = \int_{x}^\infty U\left(r\right)\mathrm{d}r = \int_{x}^\infty \frac{4\epsilon\sigma^{12}}{r^{12}}\mathrm{d}r - \int_{x}^\infty \frac{4\epsilon\sigma^6}{r^6}\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving this: &amp;lt;math&amp;gt;I = 4\epsilon\sigma^{12} {\frac{-1}{11r^{11}}\,\Bigg\vert\,}_x^\infty - 4\epsilon\sigma^{6} {\frac{-1}{5r^{5}}\,\Bigg\vert\,}_x^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This gives the general solution: &amp;lt;math&amp;gt;I = \frac{4\epsilon\sigma^{12}}{11x^{11}} - \frac{4\epsilon\sigma^{6}}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating this for &amp;lt;math&amp;gt;\epsilon = \sigma = 1&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;I = \frac{4}{11x^{11}} - \frac{4}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt; (or 2 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.025&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt; (or 2.5 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0082&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt; (or 3 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0033&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All values are taken to 2 significant figures. As the cutoff value for the interatomic distance gets larger, the integral gets smaller, and therefore the energy excluded from the calculation becomes smaller, and the second term in the solved integral, &amp;lt;math&amp;gt;I&amp;lt;/math&amp;gt;, dominates the energy value.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
When using the Lennard-Jones potential, it is appropriate to use reduced units for intermolecular distance, energy and temperature, which makes the maths and axes of plots much easier to understand. Reduced units can be calculated by the following relationships:&lt;br /&gt;
&lt;br /&gt;
Intermolecular 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;
&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; are scaling factors. For example, if the parameters for Argon are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\sigma = 0.34 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt; \epsilon\ /\ k_B = 120 K&amp;lt;/math&amp;gt;&lt;br /&gt;
* Lennard-Jones cutoff &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;. The well-depth, &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;, is &amp;lt;math&amp;gt;0.999 kJ mol^{-1} \approx 1 kJ mol^{-1}&amp;lt;/math&amp;gt;. The value of &amp;lt;math&amp;gt;T* = 1.5&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;180 K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The reduced units in this experiment has &amp;lt;math&amp;gt;k_B=1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All simulation computations are run using the computer program LAMMPS.&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
The first aim of the experiment is to determine the most appropriate timestep, &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;, to use in the verit algorithm simulations. This timestep is a balance between the accuracy of the results (the smaller the timestep, the closer to the true function the result will be) and the length of real time over which the simulation is run (the smaller the timestep, the less real time over which the simulation will give a result). The appropriateness of the timestep will be determined by plotting the total free energy of the simulated lattice as a function of time, and seeing how it equilibrates.  &lt;br /&gt;
&lt;br /&gt;
Five different calculations, which simulated the melting of a crystal and subsequent equilibration of the energy of the melted crystal, were run at five different timesteps; 0.001, 0.0025, 0.0075, 0.01 and 0.015. They were described by the NVE or &#039;&#039;&amp;quot;microcanonical ensemble&amp;quot;&#039;&#039;. An ensemble is a collection of samples of a system which are under three thermodynamic constraints (three properties are kept constant); in the microcanonical ensemble, the number of particles, the volume and the total energy is kept constant (NVE). &lt;br /&gt;
&lt;br /&gt;
These calculations simulate a box of 1000 unit cells and use periodic boundary conditions to replicate the simulation to a larger scale. Because these simulations use the numerical methods defined in the previous section, the initial position and velocity of the atoms must be defined in the input file. The Brownian (uncorrelated, random) motion of the atoms in the simulation means that there is no long range order in the system and so the atoms in a real system would start in random positions. However, assigning random starting coordinates to the atoms in a simulated liquid is not a relative process; the coordinates are generate independently of each other. Therefore there is a probability that the coordinates simulated will cause the atoms to overlap, which would give a very large repulsion potential, as seen in the Lennard-Jones potential at very small interatomic distances. This short-range repulsion potential comes from the hard-sphere atomic repulsion model.&lt;br /&gt;
&lt;br /&gt;
The input file also defines the structure and density of the lattice. The number density of lattice points in any lattice is the number of lattice points per volume of the unit cell. In a simple cubic lattice, there is one lattice point in the unit cell. From an sc lattice with a lattice spacing (length of one side of the unit cell) of &amp;lt;math&amp;gt;1.07722&amp;lt;/math&amp;gt;, the number density of the lattice points is calculated by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{1}{1.07722^3} = 0.7999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a face-centered cubic lattice (fcc), there are four lattice points in the unit cell. Rearranging the above relationship, the lattice spacing can be calculated from the number of lattice points in a unit cell and number density, &amp;lt;math&amp;gt;1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Lattice\ spacing = \sqrt[3]{\frac{number\ of\ lattice\ points\ per\ unit\ cell}{number\ density}} = \sqrt[3]{\frac{4}{1.2}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation creates a 3D box which includes 1000 unit cells; 10 unit cells in each dimension. For a simple cubic lattice, because there is one lattice point per unit cell, there will be 1000 atoms created as seen in the input file. The &#039;&#039;create_atom&#039;&#039; command in the input file determines how many boxes are created in the simulation and therefore how determines many atoms will be created. If a face centered cubic lattice is simulated, as there are 4 lattice points per unit cell, 4000 atoms will be created by the &#039;&#039;create_atom&#039;&#039; command. &lt;br /&gt;
&lt;br /&gt;
The input script also contains the following commands which defines the potential surface which is used to model the intermolecular reactions:&lt;br /&gt;
 mass 1 1.0&lt;br /&gt;
This instruction sets the mass type for the atoms being simulated. It takes the general form of “mass I value”, where &#039;&#039;mass&#039;&#039; is the keyword which tells LAMMPS what the input is, &#039;&#039;I&#039;&#039; is the atom type and &#039;&#039;value&#039;&#039; is the mass of the atom. In this case, I is defined by a specific numerical value; 1 as there is only 1 type of atom in the simulation, but it could be defined with an asterisk (1*), which means “all atom types of 1 to n inclusive” if there are &#039;&#039;n&#039;&#039; types of atoms in the simulation. &lt;br /&gt;
 pair_style lj/cut 3.0&lt;br /&gt;
This instruction sets the type of potential which LAMMPS uses in its calculation of pairwise interactions. It takes the general form of “pair_style style args”, where &#039;&#039;pair_style&#039;&#039; is the keyword for LAMMPS, &#039;&#039;style&#039;&#039; defines the potential and any specifications it may have, and &#039;&#039;args&#039;&#039; are the arguments required for this particular potential. In this case, the Lennard-Jones potential has been used (lj) with a cutoff point (cut) of 3σ. The cutoff point is explained in the introduction section. &lt;br /&gt;
 pair_coeff * * 1.0 1.0&lt;br /&gt;
This instruction specifies the coefficients for the pairwise interactions of each pair of atoms, and it takes the general form “pair_coeff I J args”. &#039;&#039;Pair_coeff&#039;&#039; is the keyword, &#039;&#039;I&#039;&#039; and &#039;&#039;J&#039;&#039; are the atom types, and &#039;&#039;args&#039;&#039; are the coefficients which the different atoms types take. In this case, the asterisk in place of I and J refers to all atoms types from 1 to n. The coefficients are the pairwise interactions are 1 for each atom, meaning each atom has an equal contribution to the interaction.&lt;br /&gt;
&lt;br /&gt;
In these initial calculations, the initial conditions for the numerical methods, &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. For this experiment, the verit-velocity algorithm would be the most appropriate, as both the starting position and velocity is specified for this algorithm. &lt;br /&gt;
&lt;br /&gt;
To define the timestep for the algorithm the following code is used defining the timestep as a variable instead of just giving it a definite value&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;
It is much easier to use the variable version of defining the timestep because the length of time over which the simulation is run depends on the time step. By using a variable, the length of the simulation is kept the same, no matter the size of the timestep. It also makes it easier if multiple properties depend on the timestep – only the variable needs to be changed, not all the parts of the script where timestep is defined. &lt;br /&gt;
&lt;br /&gt;
The calculations produce the values for the total energy of the system, temperature and pressure in the output files, which can be plotted against time. How well these values equilibrate determines the appropriateness of the timestep to use in further calculations in the experiment.  &lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!style=&amp;quot;width: 33%;&amp;quot;|&#039;&#039;Figure 8. &#039;&#039;Plot of the equilibration of total energy for five different timesteps&lt;br /&gt;
!style=&amp;quot;width: 33%;&amp;quot;|&#039;&#039;Figure 9. &#039;&#039; Plot of the temperature vs time equilibration for timestep = 0.0025&lt;br /&gt;
!style=&amp;quot;width: 33%;&amp;quot;|&#039;&#039;Figure 9. &#039;&#039; Plot of the pressure vs time equilibration for timestep = 0.0025 &lt;br /&gt;
|- &lt;br /&gt;
|[[File:rmt_totalenergycurve.png|600x600px]]&lt;br /&gt;
|[[File:rmt_tempvstime0025.png|600x600px]]&lt;br /&gt;
|[[File:rmt_pressurevstime0025.png|600x600px]]&lt;br /&gt;
|}&lt;br /&gt;
The largest time step to give an acceptable result is 0.01. However, for any simluation we would expect energy to be independent of the timestep, something which is not true at a timestep greater than 0.0025. Therefore, the most appropriate timestep to use for a balance between accuracy and length of time which the simulation covers is 0.0025. &lt;br /&gt;
&lt;br /&gt;
0.015 is a particularly bad choice of timestep. This is because the verit-velocity algorithm gives only an approximate result to the velocity (kinetic energy term) and position (potential energy term), and so when the timestep becomes too large with respect to the time, the algorithm no longer becomes a suitable way to calculate the energy. As seen in the graph of 0.015, the energy does not equilibrate and diverges.&lt;br /&gt;
&lt;br /&gt;
The plots for temperature and pressure vs time give a good indication of an appropriate pressure and temperature to use for running the simulations under specific conditions in the next section .&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions ==&lt;br /&gt;
The calculations in this section are run in the isobaric-isothermal ensemble, where the number of particles in the system, the pressure and the temperature are kept constant (NpT). This means that the temperature and the pressure are recalculated in every step, so are no longer constant like they were in the NVE ensemble. From the &#039;&#039;equipartition theorem&#039;&#039;, each degree of freedom will contribute &amp;lt;math&amp;gt;\frac{1}{2} k_B T&amp;lt;/math&amp;gt; of energy to the system. As the system is in three dimensions, there are three degrees of translational freedom and so the total internal energy is equal to &amp;lt;math&amp;gt;\frac{3}{2} k_B T&amp;lt;/math&amp;gt;. Equating this to the kinetic energy, &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt;, at the end of every step and rearranging will allow calculation of the temperature after every step. &lt;br /&gt;
&lt;br /&gt;
A target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, is defined in the input script. The system will equilibrate by multiplying the velocity by a factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, in order to accommodate for fluctuations in the overall velocity. This keeps the system at approximately the target temperature and therefore a constant internal energy. If the temperature of the system is greater than the target temperature, the system&#039;s kinetic energy is too high, so &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is reduced to compensate for this. The same is true for is the temperature is lower than the target temperature; &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than one in the next step to increase the kinetic energy which is now too low. The principle is the same for controlling the pressure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; can be derived from equating the kinetic and internal energy of the system at an arbitrary time step:&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;
Expanding the brackets inside the sum and moving the term containing &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; out of the sum: &amp;lt;math&amp;gt;\frac{\gamma^2}{2}\sum_i m_i \left(v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;, we can replace &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt; on the left hand side of the equation with &amp;lt;math&amp;gt;\frac{3}{2} N k_B T&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;\frac{3\gamma^2}{2}N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Simplifying and rearranging for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, gives: &amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As temperature and pressure are no longer constant, the input files require specification of the pressure and the temperature for each of the systems which are simulated. 10 simulations were run at two different pressures with five different temperatures at each pressure. &lt;br /&gt;
* Temperatures: 1.6, 1.9, 2.2, 2.5, 2.8&lt;br /&gt;
* Pressures: 2.5, 3.0&lt;br /&gt;
These pressures were chosen because the data simulated when choosing an appropriate timestep gave a pressure between 2.5 and 3.0 (&#039;&#039;figures 8 and 9&#039;&#039;).  &lt;br /&gt;
&lt;br /&gt;
For the code which computes the thermodynamic potentials, this particular line defines how many steps contribute towards the average of the thermodynamic parameters computed in the calculation: &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;
&#039;&#039;fix&#039;&#039; is the keyword, &#039;&#039;aves&#039;&#039; is the name of the group of fixes which in this case is the average of the thermodynamic values, &#039;&#039;all&#039;&#039; specifies the atoms which the fix is applied to which in this case is all the atoms in the simulated system and &#039;&#039;ave/time&#039;&#039; means that compute global time averages are calculated. The following three numbers have the following meaning:&lt;br /&gt;
&lt;br /&gt;
*100 = use the input values every 100 timesteps&lt;br /&gt;
*1000 = use input values 1000 times for calculating the average&lt;br /&gt;
*100000 = calculate the average every 100000 timesteps&lt;br /&gt;
&lt;br /&gt;
Therefore for the total calculation, which lasts for 100,000 steps, the average will only be calculated once. Assuming 1 value is calculated every timestep, there will be 100,000/100 = 1000 values. &lt;br /&gt;
&lt;br /&gt;
The density data from all ten calculation was plotted on the same graph, along with the density for an &amp;quot;ideal&amp;quot; gas. This density can be derived from the ideal gas law:&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;
Rearranging in terms of density: &amp;lt;math&amp;gt;\frac{N}{V} = \frac{P}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As these simulations are being run under reduced units, we can take &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt;, and so the density of the ideal gas becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the density of the ideal gas is plotted as the pressure divided by the temperature in pressure-temperature phase space.&lt;br /&gt;
[[File:Rmt dvt plot.png|none|thumb|800x800px|&#039;&#039;Figure 11. &#039;&#039;Plot of the variation in density with temperature at a defined pressure for the numerically simulated and ideal systems]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that calculated in the ideal gas law. This is because for an ideal gas, an assumption is made that there are no intermolecular interactions, and therefore forces such as electron repulsion forces are ignored; repulsion forces dominate over attractive ones, as all the atoms in this simulation are the same and so partial charges or dipoles are created. This will mean that the particles move closer together than a real gas and so the density will be larger. This discrepancy between the ideal and non-ideal systems becomes larger at a higher pressure because with a higher pressure, the atoms in the system are closer together and therefore the intermolecular repulsion will become larger. This greater repulsion will in turn have a larger effect on decreasing the density.&lt;br /&gt;
&lt;br /&gt;
== Statistical Physics Calculations of the Heat Capacity ==&lt;br /&gt;
The heat capacity of a system at constant volume can be calculated from the variance in the total energy of the system. The relationship used to calculate the heat capacity is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = 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;\left\langle E^2\right\rangle&amp;lt;/math&amp;gt; is the continuous average of the total square energy at each temperature as a function of temperature. &amp;lt;math&amp;gt;\left\langle E\right\rangle^2&amp;lt;/math&amp;gt; is the continuous average of the total energy at each temperature as a function of temperature squared. The heat capacity is multiplied by &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; in this case because the version of LAMMPS calculates every energy divided by the number of molecules in the system simulated.&lt;br /&gt;
&lt;br /&gt;
The calculations in this sections are run in density-temperature phase space and the ensemble has changed to the canonical ensemble (NVT). A set of input files were written for ten calculations for, like the previous section, two pressures and five different temperatures at each pressure:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 0.2, 0.8&lt;br /&gt;
*Temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{C_V}{V}&amp;lt;/math&amp;gt; was plotted against temperature to determine the relationship in density-temperature phase space. An example of an input file can be found [[Media:nvt_-_0220.in|here]]. The lines which have been changed from the previous input files are at the end of the script:&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 &lt;br /&gt;
 thermo_style custom step etotal temp&lt;br /&gt;
 variable energy equal etotal&lt;br /&gt;
 variable energy2 equal etotal*etotal&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_energy v_energy2 v_temp&lt;br /&gt;
 run 100000&lt;br /&gt;
 &lt;br /&gt;
 variable aveenergy equal f_aves[1]&lt;br /&gt;
 variable aveenergy2 equal f_aves[2]&lt;br /&gt;
 variable avetemp equal f_aves[3]&lt;br /&gt;
 variable heatcapacitydv equal atoms*atoms*(v_aveenergy2-v_aveenergy*v_aveenergy)/(v_avetemp*v_avetemp*vol)&lt;br /&gt;
 &lt;br /&gt;
 print &amp;quot;Averages&amp;quot;&lt;br /&gt;
 print &amp;quot;--------&amp;quot;&lt;br /&gt;
 print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Heat Capacity per Volume: ${heatcapacitydv}&amp;quot;&lt;br /&gt;
The line with the keyword &#039;fix&#039; determines which thermodynamic values are averaged and over how many steps they are averaged. The next section takes these averages as variables and uses them to define the heat capacity which is calculated from the equation at the beginning of this section. Only the energy and temperature are needed to define the heat capacity and so only these values are calculated by the simulation. [[File:Rmt heatcapacitybyv.png|none|thumb|800x800px|&#039;&#039;Figure 12. &#039;&#039;C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V against temperature for the two different pressures 0.2 and 0.8]]As seen in &#039;&#039;figure 11.&#039;&#039;, the heat capacity decreases with temperature for both pressures. It would be expected for an ideal system that as the temperature increases, the heat capacity at constant volume increases and tends to a constant value at very high T of &amp;lt;math&amp;gt;3R&amp;lt;/math&amp;gt;; &amp;lt;math&amp;gt;R&amp;lt;/math&amp;gt; = the universal gas constant. This means increasing the temperature increases the amount of energy being stored in the system and this energy is stored as vibrational energy. However, for a Lennard-Jones liquid, the system being simulated here, the heat capacity decreases with temperature. This is because there are two components to the simulation; the atoms are vibrating in a quasi-harmonic fashion around the equilibrium position and also, they diffuse between neighbouring equilibrium positions in a gas like fashion. As the temperature increases, the amount of diffusion increases and the amount of vibrations decrease, therefore decreasing the ability of the system to take in heat as vibrational energy, resulting in the decrease in heat capacity. &amp;lt;ref&amp;gt;Dima Bolmatov, V. V. Brazhkin, and K. Trachenko &amp;quot;Thermodynamic behaviour of supercritical matter&amp;quot;, Scientific Reports &#039;&#039;&#039;4&#039;&#039;&#039; 2331 (2013)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural Properties and the Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a single atom in a system is a plot of the probability that an atom can be found at a certain distance from the central atom. The peaks in this plot gives the distance of an atom from its nearest neighbours in the Lennard-Jones simulated system. &lt;br /&gt;
&lt;br /&gt;
The calculations in this section simulate a Lennard-Jones solid, liquid and gas and, using the output of the LAMMPS trajectory file, plots both the radial distribution function and its integral using DLV. The temperature and pressure parameters for these calculations were taken from the phase diagram or coexistence curve for a Lennard-Jones system. The parameters used are displayed in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! Temperature, &amp;lt;math&amp;gt;T^*&amp;lt;/math&amp;gt;&lt;br /&gt;
! Pressure, &amp;lt;math&amp;gt;p^*&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| LJ Solid&lt;br /&gt;
| 1.5&lt;br /&gt;
| 1.2&lt;br /&gt;
|-&lt;br /&gt;
| LJ Liquid&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.8&lt;br /&gt;
|-&lt;br /&gt;
| LJ Gas&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.01&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The data obtained from the plots and the radial distribution functions and their integrals were plotted and shown in the table below.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure 13. &#039;&#039;The radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
!&#039;&#039;Figure 14. &#039;&#039;The integrals of the radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt fullrdfs.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt allintegralsrdf.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
[[File:Rmt Nearest neighbours.png|left|thumb|300x300px|&#039;&#039;Figure 15. &#039;&#039;Representation of a cross section of the first three shells of nearest neighbours in an fcc solid. The black atom is the central atom being considered, the blue atoms are the first shell, the orange atoms the second shell and the purple atoms are the third.]]&lt;br /&gt;
The RDF of the solid gives a very irregular curve because of the irregular structure of the lattice. For a simple cubic lattice, a regular structure of the RDF would be expected because of the equal number of atoms in each of the nearest neighbour shells. However, for face-centered cubic lattice, the solid in this simulation, the structure is much more irregular and as the atoms move from their equilibrium position in the lattice due to vibrations, the peaks in the radial distribution will broaden. The irregular heights of the peaks are due to the varying numbers of atoms in each of the nearest neighbour shells for the central atom. The first shell gives the highest peak as it contains the most atoms multiplied by the strongest interaction potential; in total, considering all four surrounding unit cells, this shell contains 12 atoms and ideally takes the geometry of an icosahedron. The second shell is smaller and contains only 6 atoms in an octahedral coordination shape. The following shell again contributes 12 atoms, 3 from each unit cell. This therefore explains why the heights of the peaks in the solid plot in &#039;&#039;figure 12.&#039;&#039; vary. These values can be confirmed by the plot in &#039;&#039;figure 15.&#039;&#039; which is the integral; it cumulatively adds the numbers in each shell. The size of the first &amp;quot;step&amp;quot; is 12; there are 12 atoms in the first shell. The size of the second step is approximately 18; there are 18-12=6 steps in the second shell. The same theory applies for the third shell which gives a value of 13. This is slightly different to the predicted value possibly due to error in the calculation of the radial distribution function and therefore its integral. &lt;br /&gt;
&lt;br /&gt;
The RDF of the liquid has a representation of far fewer shells, which means that there are less atoms in the space close to a &amp;quot;central&amp;quot; atom in the bulk solution. The particles have more energy and therefore do not keep to a regular lattice structure. As they move about, some regularity is maintained around each atom, but only to the extend of two or three shells, meaning there is no long range order in a Lennard-Jones liquid. &lt;br /&gt;
&lt;br /&gt;
The RDF of the gas again omits more shells as there is almost no order in a Lennard-Jones gas. The single peak on this plot considers only the set of atoms closest to the central atom and all others are disregarded as they are too far apart. &lt;br /&gt;
&lt;br /&gt;
Considering &#039;&#039;figure 13.&#039;&#039;, the size of the integral of the radial distribution function decreases from solid to liquid to gas. This makes sense as the number of atoms in the surrounding shells decreases with density of the system; the atoms become further apart. &lt;br /&gt;
&lt;br /&gt;
From the plot of the radial distribution function of the solid, the lattice spacing can be determined. For this, we can consider just the first three peaks of the RDF plot. The lattice spacing refers to the length of one unit cell, and so, using &#039;&#039;figure m&#039;&#039;, we can calculate this using two different methods; a) we can use the distance between the central atom and the first shell of nearest neighbours, and use trigonometry to calculate the lattice spacing. Or alternatively b) we can use the distance between the central atom and the second nearest neighbour shell to get the lattice spacing.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure 16. &#039;&#039;The radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
!&#039;&#039;Figure 17. &#039;&#039;The integral of the radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt solidgr3.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt solidint3.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
Using method a) (with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; as the distance between the central atom and the nearest neighbour: Lattice spacing = &amp;lt;math&amp;gt;\frac{r}{cos({\frac{\pi}{4}})} = \frac{1.02}{cos({\frac{\pi}{4}})} \approx 1.44&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using method b): Lattice spacing &amp;lt;math&amp;gt;\approx 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can take an average between the two get an approximate value for the lattice spacing &amp;lt;math&amp;gt;\approx\ 1.46&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These values for distance are all in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
The ability of atoms to move around in a solid liquid or gas can be characterised by the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. In this section, we will explore two different ways to calculate the diffusion coefficient and compare the results. &lt;br /&gt;
&lt;br /&gt;
=== The Mean Squared Displacement ===&lt;br /&gt;
The diffusion coefficient can be measured easily be calculating the mean squared displacement of atoms in the solution; the diffusion coefficient is proportional to the first derivative of the mean squared displacement. By plotting the mean squared displacement as a function of time, the gradient can be taken to calculate the diffusion coefficient when its has equilibrated and become linear.&lt;br /&gt;
&lt;br /&gt;
The temperature and density parameters used were the same as in the previous section:&lt;br /&gt;
* Solid: T=1.5, D=1.2&lt;br /&gt;
* Liquid: T=1.1, D=0.8&lt;br /&gt;
* Gas: T=1.1, D=0.01&lt;br /&gt;
&lt;br /&gt;
Mean density squared calculations for 8,000 atoms were run for all three Lennard-Jones phases and the data plotted as function of timestep below. The data from a simulation containing 1,000,000 atoms was plotted for comparision.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!Plots for the 8,000 atom data (&#039;&#039;figures 18-20)&#039;&#039;&lt;br /&gt;
!Plots for the 1,000,000 atom data (&#039;&#039;figures 21-23)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|[[File:Rmt_MSDsolid.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt_MAsolid.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|[[File:Rmt MSDliquid.png|700x700px]]&lt;br /&gt;
|[[File:Rmt MAliquid.png|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|[[File:Rmt MSDgas.png|700x700px]]&lt;br /&gt;
|[[File:Rmt dataplots 25894 image001.png|700x700px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The exact relationship between the mean squared displacement and the diffusion coefficient is:&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;
Taking the gradients of each of the curves at the point at which they become linear and dividing by six will give the diffusion coefficient for each set of data. The gradient also needs to be converted to a function of time; this is done by dividing by the timestep, which in this case is 0.002:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom data diffusion coefficients, &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
!1,000,000 atom data diffusion coefficients &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 0.9999&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|Gradient = 0.0972&lt;br /&gt;
Amount of data used to calculate gradient: timestep 4300-5000, &amp;lt;math&amp;gt;R^2 = 0.9998&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{48.6}{6} = \mathbf{8.1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient = 0.0386&lt;br /&gt;
Amount of data used to calculate gradient: timestep 4000-5000, &amp;lt;math&amp;gt;R^2 = 0.1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{19.6}{6} = \mathbf{3.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For both of the solid approximations, the diffusion coefficient can be approximated as zero. This is because, when equilibrated, the function has a constant value of around 0.2 for the mean squared displacement. A gradient with a value of zero means that the atoms take an infinite amount of time to change their mean squared displacement or move away from their equilibrium position, and so this means that we can approximate in this system, there will be no diffusion. In real system, however, this is not the case; diffusion occurs but it is very slow. A plot for a real system will give a very shallow positive gradient.&lt;br /&gt;
&lt;br /&gt;
The liquid approximations are very well correlated. This is because in both cases, the mean squared displacement of particles in a liquid increases linearly with time and the gradient of both plots are almost identical. We can assume from this that identical starting conditions for temperature and pressure were used to calculate this data. Also, we can estimate that 8,000 atoms is a large enough simulation to give an accurate result for the diffusion coefficient for the Lennard-Jones liquid.&lt;br /&gt;
&lt;br /&gt;
The gas approximations are very different. This is most probably due to the fact that the density specified in each of the calculations is different. The 8,000 data can be estimated to be a much lower density because the diffusion coefficient is faster and this means diffusion will happen faster; at a higher density a particle will take longer to diffuse over a given distance. Because of the difference in density, the two values of the diffusion coefficient cannot be qualitatively compared. The reason for the initial deviation for linearity in the gas plots is due to the momentum of the particles initially dominating over the diffusion and the diffusion coefficient is dependent on time. As the system equilibrates, the diffusion coefficient becomes constant and the plots become linear.&lt;br /&gt;
&lt;br /&gt;
=== The Velocity Autocorrelation Function ===&lt;br /&gt;
&lt;br /&gt;
Another way to calculate the diffusion coefficient is by using the velocity correlation function, which determines how the velocity of an atom changes with time. The function determines the time when the velocity becomes uncorrelated (&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;), i.e. the difference between the velocity at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; and at time &amp;lt;math&amp;gt;t+\tau&amp;lt;/math&amp;gt;. By integrating over this function, we can find the diffusion coefficient. &lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function: &amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can also be written as the integral: &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;
Using the function which defines the position of a classical harmonic oscillator, we can differentiate this to give the equation for the velocity which we can plug into the integral:&lt;br /&gt;
&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;
&amp;lt;math&amp;gt;dv{x(t)}{t} = v(t) = -A\omega sin(\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also needed for the integral:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t+\tau) = -A\omega sin(\omega(t+\tau)+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v^2(t) = A^2\omega^2 sin^2(\omega t +\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Putting all this into the integral to find the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega sin(\omega t + \phi) \times A\omega sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} A^2\omega^2 sin^2(\omega t +\tau)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A^2\omega^2&amp;lt;/math&amp;gt; can be take out of each of the integrals and cancelled. A substituion can then be made to make solving the integral much simpler:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = \omega t + \phi&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \omega\tau&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the integral becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a) \times sin(a+b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the compound angle rule &amp;lt;math&amp;gt;sin(a+b)=sin(a)cos(b)+cos(a)sin(b)&amp;lt;/math&amp;gt;, the integral can be simplified to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a)sin(a)cos(b) + sin(a)cos(a)sin(b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Separating out into two integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)\frac{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the rule &amp;lt;math&amp;gt;sin(a)cos(a) = \frac{1}{2}sin(2a)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} \frac{1}{2}(sin(2a))\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because the function &amp;lt;math&amp;gt;\frac{1}{2}sin(2a)&amp;lt;/math&amp;gt; is symmetric over all space, the second term in this equation becomes zero. Therefore, the integral simplifies to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b) = cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same calculations from the mean squared displacement section gave an output of the velocity autocorrelation function. The function for the Lennard-Jones solid, liquid and gas were plotted against the timestep along with the approximate function for the velocity autocorrelation function, &amp;lt;math&amp;gt;cos(\omega\tau)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\omega = \frac{1}{2\pi}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure 24. &#039;&#039;Plots for the velocity autocorrelation function of a Lennard-Jones solid, liquid and gas; 8,000 atoms&lt;br /&gt;
!&#039;&#039;Figure 25. &#039;&#039;Plots for the velocity autocorrelation function of a Lennard-Jones solid, liquid and gas, 1,000,000 atoms&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt VACF 5721 image001.png|800x800px|]]&lt;br /&gt;
|[[File:Rmt MAVACF.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plots for the velocity autocorrelation function show how the time correlation of velocity decreases with time due to collisions with other atoms in the system. The Lennard-Jones solid oscillates around the VACF=0 axis with the oscillations becoming progressively more damped with time. The long range of the oscillations is due to the order in the system. Every time the plot crosses the VACF=0 axis, the velocity of the atom changes direction which is due to a collision with another atom. Every collision for every atom is completely uncorrelated so the change in velocity of one atom as it collides is independent of another change in velocity of another colliding atom. Overall, momentum must be conserved and so overall change of velocity in the system must be conserved. &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones liquid oscillations are damped much quicker; an atom in the liquid only collides with one atom before the velocity becomes uncorrelated with respect to time. The Lennard-Jones gas never reaches the VACF=0 axis as the atoms are too far apart to collide. Because the velocity autocorrelation function never equilibrates, using this method to calculate the diffusion coefficient is inaccurate because the particles in the gas never come into contact with each other.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillating system is so different to the Lennard-Jones systems because the atoms remain in their equilibrium position and vibrate around the same position, never coming into contact with another atom. Because of this, the correlation with time never decreases so the function infinitely oscillates as a sine function.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated from: &amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty C\left(\tau\right)\mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the approximate value for the diffusion coefficient using the velocity autocorrelation function is &amp;lt;math&amp;gt;D = \frac{1}{3}cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The running integral of the velocity autocorrelation functions was plotted using the &#039;&#039;trapesium rule&#039;&#039;, and so the final value on the integral plot is proportional to the diffusion coefficient.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom VACF integral &#039;&#039;(figures 26-28)&#039;&#039;&lt;br /&gt;
!1,000,000 VACF integral (&#039;&#039;figures 29-31)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|[[File:Rmt mysi.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt masi.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|[[File:Rmt myli.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt mali.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|[[File:Rmt mygi.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt ligi.png|frameless|700x700px]]&lt;br /&gt;
|}&lt;br /&gt;
The diffusion coefficients for each of the plots above are tabulated below using the final data point from the integral plot. This is the integral over the whole graph using the trapesium rule. This must be corrected for the timestep; the value is multiplied by 0.002. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom data diffusion coefficients, &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
!1,000,000 atom data diffusion coefficients &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;-0.00055&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{-0.00055}{6} = -0.00018 \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.00014&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.00014}{6} = 0.000046 \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.242&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.242}{6} = \mathbf{0.0807}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.270&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.270}{6} = \mathbf{0.0901}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;25.6&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{25.6}{6} = \mathbf{8.55}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;9.81&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{9.81}{6} = \mathbf{3.27}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
The biggest source of error in these plots is that we assume both the 8,000 atom data and the 1,000,000 atom data take the same amount of time to converge. &#039;&#039;Figure z. &#039;&#039;shows that 5000 timesteps is not long enough for the velocity autocorrelation coefficient for 8,000 atoms to converge as far as 1,000,000 atom data does in this length of time. As the molecular dynamics simulations simulate random motion, this could induce fluctuations in the velocity autocorrelation plot which could increase or decrease the integral introduction another source of error.&lt;br /&gt;
&lt;br /&gt;
Again, the diffusion coefficient of the Lennard-Jones solid can be assumed to be zero for the same reason as the mean squared displacement data. The diffusion coefficient of the liquid is lower for both sets of data when calculated using the velocity autocorrelation function, and the diffusion coefficient is higher for both sets of data.&lt;br /&gt;
&lt;br /&gt;
== Summary ==&lt;br /&gt;
A simple Lennard-Jones liquid was simulated for different temperatures, pressures and densities at an optimised timestep of 0.0025. It was found that density of a system decreases with temperature due to particles increasing their kinetic energy and therefore the particles move further apart. The density of an ideal gas is much higher than that of the simulated Lennard-Jones potentials because of lack of repulsive interatomic forces.&lt;br /&gt;
&lt;br /&gt;
It was also found that heat capacity of a Lennard-Jones liquid decreases with increasing temperature, and heat capacity is lower at a lower density. This is due to diffusion dominating atomic vibrations as temperature increases and so ability of a system to absorb heat as vibrational energy decreases with temperature.&lt;br /&gt;
&lt;br /&gt;
It was also found that the radial distribution function and its integral can be plotted to calculate the lattice spacing of a Lennard-Jones solid and the amount of atoms in each nearest neighbour shell respectively. The lattice spacing was calculated as &amp;lt;math&amp;gt;\approx\ 1.46&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient for a Lennard-Jones solid, liquid and gas can be calculate using the mean squared displacement or the velocity autocorrelation function. The velocity autocorrelation function was found to be a less reliable method for the gas because the function does not converge in the amount of timesteps that were calculated. &lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=543033</id>
		<title>Rep:Mod:hakunamatata</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=543033"/>
		<updated>2016-02-25T19:14:37Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Introduction to Molecular Dynamics Simulations ==&lt;br /&gt;
===The Classical Particle Approximation and Numerical Integration===&lt;br /&gt;
The verit and verit-velocity algorithms are numerical methods to approximate the average position and velocity respectively of randomly moving particles in a particular medium (solid, liquid, fliud etc.). This position and velocity can be applied to Newtonian mechanics to calculate such properties as the force and potential energy of the system. The algorithms work by splitting the function into discrete time steps, calculating the values of position and velocity at this particular time step, and then effectively &amp;quot;joining the dots&amp;quot; to create an approximate function. These simulations always use the answer from the previous timestep to compute the new timestep, so initial conditions must be given for the first step. Both of the algorithms are shown below and are derived from the Taylor expansion of the position or velocity of the atoms at the timestep &amp;quot;n+1&amp;quot; or &amp;lt;math&amp;gt;t+\delta t&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit Algorithum:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{x}_i\left(t + \delta t\right) \approx 2\mathbf{x}_i\left(t\right) - \mathbf{x}_i\left(t - \delta t\right) + \frac{\mathbf{F}_i\left(t\right)}{m_i}\delta t^2  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit-Velocity Algorithum:&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i\left(t\right)&amp;lt;/math&amp;gt; is the force acting on a particular atom as a function of time&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i\left(t\right)&amp;lt;/math&amp;gt; is the acceleration of the atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The smaller the timestep, the closer the numerical approximation is to the true function, which can be modeled as a classical harmonic oscillator. &#039;&#039;Figure 1.&#039;&#039; in the table below shows the comparison between the two methods at plotting position of an atom as a function of time in &#039;&#039;time&#039;&#039; space. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure 1. &#039;&#039;Plots of position vs time comparing the verit algorithm and harmonic spring results&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure 2. &#039;&#039;Plot of the total classical energy of the system (potential + kinetic)&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory xanalytical.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory energy.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The harmonic spring position values are modeled from the harmonic oscillator or particle on a spring. The equation of &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; is used to calculate these values, where &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; are equal to 1 and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; is equal to zero. As seen on the plot, the curves produced from the two different methods of calculating the position are in good agreement.&lt;br /&gt;
|The potential energy is calculated using the equation &amp;lt;math&amp;gt;U = \frac{1}{2}kx^2&amp;lt;/math&amp;gt;, with a value of k (force constant) given as 1. The kinetic energy is calculated using the velcity from the verit-velocity algorithm using the equation &amp;lt;math&amp;gt;T = \frac{1}{2} mv^2&amp;lt;/math&amp;gt;, where m (mass) is equal to 1. The total energy of the system, &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, is equal to &amp;lt;math&amp;gt;T + U&amp;lt;/math&amp;gt;. The values for &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; (from the potential energy term) and &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; (from the kinetic energy term) are taken from the verit algorithm and verit-velocity algorthim respectively. &lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;Figure 3. &#039;&#039;Plot of the difference (error) between the harmonic spring and verit algorithm data&lt;br /&gt;
!&#039;&#039;Figure 4. &#039;&#039;Plot of the peaks in the error plot in &#039;&#039;figure 3.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory error.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory errorpeaks.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The peaks in the error between the harmonic spring and verit algorithm results are at the point where the position curve crosses the time axis. This is because the harmonic spring data (&amp;lt;math&amp;gt;x(t)&amp;lt;/math&amp;gt;) has a slightly shorter wavelength than that of the verit velocity algorithm, and therefore the difference will get larger with each period of the wave. This is shown by the error getting larger in &#039;&#039;figure 3. &#039;&#039;The period of the plot of the two methods are different because the verit algorithm is much more approximate so does not give the correct solution.&lt;br /&gt;
|The change in the error/difference between the harmonic spring data and verit algorthm data increases linearly and so therefore period of each of the plots in &#039;&#039;figure 1&#039;&#039;. must be constant. &lt;br /&gt;
|}&lt;br /&gt;
The error can also be quantified on a &#039;&#039;phase space&#039;&#039; plot; phase space is momentum or velocity plotted as a function of position. The true solution for motion of an atom is a perfect ellipse, and the more elliptic the shape (less circular) the more momentum or velocity is in the system. A numerical solution, like the verit algorithms, will produce a set of points very close to this ellipse but not perfectly following the curve. A good numerical solution will remain in an elliptical shape, whereas a bad numerical solution, for example one with a large timestep, will spiral away from the true solution. Two examples of such systems using the data from &#039;&#039;figures a-d&#039;&#039; are shown below.  &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure 5. &#039;&#039;Phase plot of the harmonic spring data with a good numerical solution (timestep = 0.1) &lt;br /&gt;
!&#039;&#039;Figure 6. &#039;&#039;Phase plot of the harmonic spring data with a bad numerical solution (timestep = 0.3) &lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory phasegood.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory badphase.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The timestep at which this data is plotted is 0.1, which results in a very small change in the energy, as seen in &#039;&#039;figure b. &#039;&#039;Increasing the time step will increase the variation in the energy. To keep the variation in the total energy of the system under 1%, the time step must be no larger than approximately 0.28. The energy varies more with increasing time step because the jumps in the algorithm  are getting larger due to less data points. The algorithm assumes these points are joined by a straight line and that the halfway point in the jump is the average between the starting and finishing point of the jump. The phase space plot will become less elliptic and the jumps eventually become so large that the plot is no longer a continuous shape.  &lt;br /&gt;
&lt;br /&gt;
It is essential to monitor the energy of a numerically modeled system because a good solution for the motion of an atom has a constant energy and a plot in phase space of a perfect ellipse.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance and Force at Zero Potential===&lt;br /&gt;
From classical mechanics, the force calculated from the Newtonian mechanics above can be used to calculate the potential experienced by an atom in the system. They are related by the equation: &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;
[[File:Rmt 12-6-Lennard-Jones-Potential.png|left|thumb|&#039;&#039;Figure 7. &#039;&#039;The Lennard-Jones Potential]]&lt;br /&gt;
This potential gives the shape and dimension of the potential surface on which the system can be modeled. In this experiment, a simple 1D potential is used to describe the inter atomic forces of a liquid; the Lennard-Jones potential. It has the characteristic features of a short range repulsion potential and harmonic character around the equilibrium bond distance or interatomic separation. The value of &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the inter atomic separation when the potential, &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;, is equal to zero, can be calculated by equating the equation for the Lennard-Jones potential to zero and solving for &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The equation for the Lennard-Jones potential: &amp;lt;math&amp;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;
Equating this to zero: &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;
And rearranging in order to separate the variables: &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;
Rearranging this gives &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in terms of &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt; r^6 = \sigma^6&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r = r_0&amp;lt;/math&amp;gt; in this case.&lt;br /&gt;
&lt;br /&gt;
This, therefore, gives the result that interatomic distance at zero potential, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, is equal to &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; in the Lennard-Jones potential is effectively the diameter of one of the particles in the system being measured; in this case, the solid, liquid or gas we are simulating. This is the point where the potential curve crosses the x-axis on an Energy vs interatomic distance plot. The force, &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt;, at this point on the curve corresponds to the gradient; it is found by calculating the derivative of the curve at this point. &lt;br /&gt;
&lt;br /&gt;
To calculate the force, we must differentiate the equation for the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;U\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As force is equal to the negative differential of the potential energy, the value of the force is: &amp;lt;math&amp;gt;\mathbf{F}_i = 48\epsilon \sigma^{12} r^{-13} - 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting in the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at zero potential from the calculation before: &amp;lt;math&amp;gt;\mathbf{F}_i = \frac{48\epsilon}{\sigma} - \frac{24\epsilon}{\sigma} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The gradient where the Lennard-Jones plot crosses the axis is negative; &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; in the term obtained for &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is negative and therefore the overall value of the force will be negative.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance, Force and Well Depth of the Potential at Equilibrium===&lt;br /&gt;
To calculate the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at the equilibrium position, we need to use the derivative of the potential energy curve. The equilibrium value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is the value at the minimum of the Lennard-Jones curve; when &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Therefore, equating the derivative to zero gives: &amp;lt;math&amp;gt;0 = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rearranging this: &amp;lt;math&amp;gt;48\epsilon \sigma^{12} r^{-13} = 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And simplifying and cancelling gives: &amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6&amp;lt;/math&amp;gt;. Therefore the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at equilibrium is: &amp;lt;math&amp;gt;r_{eq} = \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Physically, this result means that the equilibrium distance is 1.12 times the diameter of one of the particles; the particles have a small gap between them so do not touch. A short range repulsion potential, as seen in the Lennard-Jones curve, is a result of the particles coming into contact. &lt;br /&gt;
&lt;br /&gt;
Again, the force can be calculated from the derivative of the potential curve at the equilibrium point. As the derivative at this point is zero (a minimum on the curve), the force will therefore also be zero.&lt;br /&gt;
&lt;br /&gt;
The well-depth of the potential curve is the difference between zero potential and the potential at the equilibrium bond length. This can be calculated by substituting the value for the equilibrium bond length into the equation for the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;U\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;U\left(r_{eq}\right) = 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;
Cancelling and simplifying this equation gives: &amp;lt;math&amp;gt;U\left(r_{eq}\right) = 4\epsilon \times \frac{1}{4}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the absolute value for the well depth is &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;. The actual value of this potential is &amp;lt;math&amp;gt;-\epsilon&amp;lt;/math&amp;gt;, as the equilibrium bond length gives the most stable configuration of the molecules and therefore suggests attractive interactions are involved in the arrangement of the molecules; this attractive potential is negative. &lt;br /&gt;
&lt;br /&gt;
===Boundary Conditions and the Lennard-Jones Cutoff===&lt;br /&gt;
When simulating a liquid, it is computationally impractical to simulate a realistic liquid. Therefore a smaller &#039;box&#039; containing &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; particles is simulated and the computer program will use &#039;&#039;periodic boundary conditions&#039;&#039; to simulate infinite repetitions of this box. For example, when the atom reaches one edge of the box, applying periodic boundary conditions, it will reappear again at the opposite edge of the box as if they were connected. Applying this logic: an atom at the position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a box of size &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;. Without periodic boundary conditions, we would assume that the atom would end up at the position &amp;lt;math&amp;gt;(1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;. However, in this box, there is no such position and so the particle must reappear at the opposite edge to where it effectively &#039;left&#039; the box. Therefore, it&#039;s ending position will be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The number of particles, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; simulated by the computer is usually between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt;. Physically, this is a very small volume. Considering water, we can calculate the number of molecules in 1 mL or 1 cm^3, a volume which would be considered small in the lab. Taking the concentration of water at standard conditions, &amp;lt;math&amp;gt;55\ mol\ dm^{-3}&amp;lt;/math&amp;gt;, we can convert it to the number of moles per mL: &amp;lt;math&amp;gt;0.055\ mol\ mL^{-1}&amp;lt;/math&amp;gt;. Multiplying this value by Avagadro&#039;s constant (&amp;lt;math&amp;gt;N_A&amp;lt;/math&amp;gt;) gives the number of molcules of water per mL: &amp;lt;math&amp;gt;3.02 \times 10^{22} mL^{-1}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The reverse procedure can be used to compare this to the volume of 10,000 molecules: 10,000 divided by Avagadro&#039;s constant gives the number of moles of water which 10,000 molecules makes up: &amp;lt;math&amp;gt;1.66 \times 10^{-20}\ mol&amp;lt;/math&amp;gt;. Dividing this value by the concentration (from &amp;lt;math&amp;gt;n=cV&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is the number of moles, &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; is the concentration and &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume), gives the volume: &amp;lt;math&amp;gt;3.02 \times 10^{-22}\ dm&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;3.02 \times 10^{-19}\ mL&amp;lt;/math&amp;gt;. Physically, of course, this is far too small a volume to be recorded in the lab.&lt;br /&gt;
 &lt;br /&gt;
Periodic boundary conditions simulate an infinite lattice and therefore, when computing the potential, will calculate an infinite amount of pair interactions. Therefore, it is only practical to calculate the energies up to a certain interatomic distance; the Lennard-Jones cutoff distance. Beyond this point, the potential energy and the integral of the curve beyond this point become insignificant and do not impact on the overall energy; removing interactions beyond this point from the calculations will not effect the accuracy. Multiplying the Lennard-Jones potential with the radial distribution function gives a plot of the probability of finding an atom at a particular interatomic distance. The larger the interatomic distance, the lower the probability and so the energy after the cutoff can be disregarded. The radial distirbution function is dicussed in a later section.&lt;br /&gt;
&lt;br /&gt;
Integrating over the Lennard-Jones curve and applying this cutoff as the lower limit can show how small the integral is:&lt;br /&gt;
&lt;br /&gt;
For a general cutoff of with value &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;I = \int_{x}^\infty U\left(r\right)\mathrm{d}r = \int_{x}^\infty \frac{4\epsilon\sigma^{12}}{r^{12}}\mathrm{d}r - \int_{x}^\infty \frac{4\epsilon\sigma^6}{r^6}\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving this: &amp;lt;math&amp;gt;I = 4\epsilon\sigma^{12} {\frac{-1}{11r^{11}}\,\Bigg\vert\,}_x^\infty - 4\epsilon\sigma^{6} {\frac{-1}{5r^{5}}\,\Bigg\vert\,}_x^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This gives the general solution: &amp;lt;math&amp;gt;I = \frac{4\epsilon\sigma^{12}}{11x^{11}} - \frac{4\epsilon\sigma^{6}}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating this for &amp;lt;math&amp;gt;\epsilon = \sigma = 1&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;I = \frac{4}{11x^{11}} - \frac{4}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt; (or 2 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.025&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt; (or 2.5 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0082&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt; (or 3 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0033&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All values are taken to 2 significant figures. As the cutoff value for the interatomic distance gets larger, the integral gets smaller, and therefore the energy excluded from the calculation becomes smaller, and the second term in the solved integral, &amp;lt;math&amp;gt;I&amp;lt;/math&amp;gt;, dominates the energy value.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
When using the Lennard-Jones potential, it is appropriate to use reduced units for intermolecular distance, energy and temperature, which makes the maths and axes of plots much easier to understand. Reduced units can be calculated by the following relationships:&lt;br /&gt;
&lt;br /&gt;
Intermolecular 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;
&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; are scaling factors. For example, if the parameters for Argon are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\sigma = 0.34 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt; \epsilon\ /\ k_B = 120 K&amp;lt;/math&amp;gt;&lt;br /&gt;
* Lennard-Jones cutoff &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;. The well-depth, &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;, is &amp;lt;math&amp;gt;0.999 kJ mol^{-1} \approx 1 kJ mol^{-1}&amp;lt;/math&amp;gt;. The value of &amp;lt;math&amp;gt;T* = 1.5&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;180 K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The reduced units in this experiment has &amp;lt;math&amp;gt;k_B=1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All simulation computations are run using the computer program LAMMPS.&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
The first aim of the experiment is to determine the most appropriate timestep, &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;, to use in the verit algorithm simulations. This timestep is a balance between the accuracy of the results (the smaller the timestep, the closer to the true function the result will be) and the length of real time over which the simulation is run (the smaller the timestep, the less real time over which the simulation will give a result). The appropriateness of the timestep will be determined by plotting the total free energy of the simulated lattice as a function of time, and seeing how it equilibrates.  &lt;br /&gt;
&lt;br /&gt;
Five different calculations, which simulated the melting of a crystal and subsequent equilibration of the energy of the melted crystal, were run at five different timesteps; 0.001, 0.0025, 0.0075, 0.01 and 0.015. They were described by the NVE or &#039;&#039;&amp;quot;microcanonical ensemble&amp;quot;&#039;&#039;. An ensemble is a collection of samples of a system which are under three thermodynamic constraints (three properties are kept constant); in the microcanonical ensemble, the number of particles, the volume and the total energy is kept constant (NVE). &lt;br /&gt;
&lt;br /&gt;
These calculations simulate a box of 1000 unit cells and use periodic boundary conditions to replicate the simulation to a larger scale. Because these simulations use the numerical methods defined in the previous section, the initial position and velocity of the atoms must be defined in the input file. The Brownian (uncorrelated, random) motion of the atoms in the simulation means that there is no long range order in the system and so the atoms in a real system would start in random positions. However, assigning random starting coordinates to the atoms in a simulated liquid is not a relative process; the coordinates are generate independently of each other. Therefore there is a probability that the coordinates simulated will cause the atoms to overlap, which would give a very large repulsion potential, as seen in the Lennard-Jones potential at very small interatomic distances. This short-range repulsion potential comes from the hard-sphere atomic repulsion model.&lt;br /&gt;
&lt;br /&gt;
The input file also defines the structure and density of the lattice. The number density of lattice points in any lattice is the number of lattice points per volume of the unit cell. In a simple cubic lattice, there is one lattice point in the unit cell. From an sc lattice with a lattice spacing (length of one side of the unit cell) of &amp;lt;math&amp;gt;1.07722&amp;lt;/math&amp;gt;, the number density of the lattice points is calculated by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{1}{1.07722^3} = 0.7999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a face-centered cubic lattice (fcc), there are four lattice points in the unit cell. Rearranging the above relationship, the lattice spacing can be calculated from the number of lattice points in a unit cell and number density, &amp;lt;math&amp;gt;1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Lattice\ spacing = \sqrt[3]{\frac{number\ of\ lattice\ points\ per\ unit\ cell}{number\ density}} = \sqrt[3]{\frac{4}{1.2}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation creates a 3D box which includes 1000 unit cells; 10 unit cells in each dimension. For a simple cubic lattice, because there is one lattice point per unit cell, there will be 1000 atoms created as seen in the input file. The &#039;&#039;create_atom&#039;&#039; command in the input file determines how many boxes are created in the simulation and therefore how determines many atoms will be created. If a face centered cubic lattice is simulated, as there are 4 lattice points per unit cell, 4000 atoms will be created by the &#039;&#039;create_atom&#039;&#039; command. &lt;br /&gt;
&lt;br /&gt;
The input script also contains the following commands which defines the potential surface which is used to model the intermolecular reactions:&lt;br /&gt;
 mass 1 1.0&lt;br /&gt;
This instruction sets the mass type for the atoms being simulated. It takes the general form of “mass I value”, where &#039;&#039;mass&#039;&#039; is the keyword which tells LAMMPS what the input is, &#039;&#039;I&#039;&#039; is the atom type and &#039;&#039;value&#039;&#039; is the mass of the atom. In this case, I is defined by a specific numerical value; 1 as there is only 1 type of atom in the simulation, but it could be defined with an asterisk (1*), which means “all atom types of 1 to n inclusive” if there are &#039;&#039;n&#039;&#039; types of atoms in the simulation. &lt;br /&gt;
 pair_style lj/cut 3.0&lt;br /&gt;
This instruction sets the type of potential which LAMMPS uses in its calculation of pairwise interactions. It takes the general form of “pair_style style args”, where &#039;&#039;pair_style&#039;&#039; is the keyword for LAMMPS, &#039;&#039;style&#039;&#039; defines the potential and any specifications it may have, and &#039;&#039;args&#039;&#039; are the arguments required for this particular potential. In this case, the Lennard-Jones potential has been used (lj) with a cutoff point (cut) of 3σ. The cutoff point is explained in the introduction section. &lt;br /&gt;
 pair_coeff * * 1.0 1.0&lt;br /&gt;
This instruction specifies the coefficients for the pairwise interactions of each pair of atoms, and it takes the general form “pair_coeff I J args”. &#039;&#039;Pair_coeff&#039;&#039; is the keyword, &#039;&#039;I&#039;&#039; and &#039;&#039;J&#039;&#039; are the atom types, and &#039;&#039;args&#039;&#039; are the coefficients which the different atoms types take. In this case, the asterisk in place of I and J refers to all atoms types from 1 to n. The coefficients are the pairwise interactions are 1 for each atom, meaning each atom has an equal contribution to the interaction.&lt;br /&gt;
&lt;br /&gt;
In these initial calculations, the initial conditions for the numerical methods, &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. For this experiment, the verit-velocity algorithm would be the most appropriate, as both the starting position and velocity is specified for this algorithm. &lt;br /&gt;
&lt;br /&gt;
To define the timestep for the algorithm the following code is used defining the timestep as a variable instead of just giving it a definite value&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;
It is much easier to use the variable version of defining the timestep because the length of time over which the simulation is run depends on the time step. By using a variable, the length of the simulation is kept the same, no matter the size of the timestep. It also makes it easier if multiple properties depend on the timestep – only the variable needs to be changed, not all the parts of the script where timestep is defined. &lt;br /&gt;
&lt;br /&gt;
The calculations produce the values for the total energy of the system, temperature and pressure in the output files, which can be plotted against time. How well these values equilibrate determines the appropriateness of the timestep to use in further calculations in the experiment.  &lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!style=&amp;quot;width: 33%;&amp;quot;|&#039;&#039;Figure 8. &#039;&#039;Plot of the equilibration of total energy for five different timesteps&lt;br /&gt;
!style=&amp;quot;width: 33%;&amp;quot;|&#039;&#039;Figure 9. &#039;&#039; Plot of the temperature vs time equilibration for timestep = 0.0025&lt;br /&gt;
!style=&amp;quot;width: 33%;&amp;quot;|&#039;&#039;Figure 9. &#039;&#039; Plot of the pressure vs time equilibration for timestep = 0.0025 &lt;br /&gt;
|- &lt;br /&gt;
|[[File:rmt_totalenergycurve.png|600x600px]]&lt;br /&gt;
|[[File:rmt_tempvstime0025.png|600x600px]]&lt;br /&gt;
|[[File:rmt_pressurevstime0025.png|600x600px]]&lt;br /&gt;
|}&lt;br /&gt;
The largest time step to give an acceptable result is 0.01. However, for any simluation we would expect energy to be independent of the timestep, something which is not true at a timestep greater than 0.0025. Therefore, the most appropriate timestep to use for a balance between accuracy and length of time which the simulation covers is 0.0025. &lt;br /&gt;
&lt;br /&gt;
0.015 is a particularly bad choice of timestep. This is because the verit-velocity algorithm gives only an approximate result to the velocity (kinetic energy term) and position (potential energy term), and so when the timestep becomes too large with respect to the time, the algorithm no longer becomes a suitable way to calculate the energy. As seen in the graph of 0.015, the energy does not equilibrate and diverges.&lt;br /&gt;
&lt;br /&gt;
The plots for temperature and pressure vs time give a good indication of an appropriate pressure and temperature to use for running the simulations under specific conditions in the next section .&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions ==&lt;br /&gt;
The calculations in this section are run in the isobaric-isothermal ensemble, where the number of particles in the system, the pressure and the temperature are kept constant (NpT). This means that the temperature and the pressure are recalculated in every step, so are no longer constant like they were in the NVE ensemble. From the &#039;&#039;equipartition theorem&#039;&#039;, each degree of freedom will contribute &amp;lt;math&amp;gt;\frac{1}{2} k_B T&amp;lt;/math&amp;gt; of energy to the system. As the system is in three dimensions, there are three degrees of translational freedom and so the total internal energy is equal to &amp;lt;math&amp;gt;\frac{3}{2} k_B T&amp;lt;/math&amp;gt;. Equating this to the kinetic energy, &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt;, at the end of every step and rearranging will allow calculation of the temperature after every step. &lt;br /&gt;
&lt;br /&gt;
A target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, is defined in the input script. The system will equilibrate by multiplying the velocity by a factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, in order to accommodate for fluctuations in the overall velocity. This keeps the system at approximately the target temperature and therefore a constant internal energy. If the temperature of the system is greater than the target temperature, the system&#039;s kinetic energy is too high, so &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is reduced to compensate for this. The same is true for is the temperature is lower than the target temperature; &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than one in the next step to increase the kinetic energy which is now too low. The principle is the same for controlling the pressure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; can be derived from equating the kinetic and internal energy of the system at an arbitrary time step:&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;
Expanding the brackets inside the sum and moving the term containing &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; out of the sum: &amp;lt;math&amp;gt;\frac{\gamma^2}{2}\sum_i m_i \left(v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;, we can replace &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt; on the left hand side of the equation with &amp;lt;math&amp;gt;\frac{3}{2} N k_B T&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;\frac{3\gamma^2}{2}N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Simplifying and rearranging for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, gives: &amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As temperature and pressure are no longer constant, the input files require specification of the pressure and the temperature for each of the systems which are simulated. 10 simulations were run at two different pressures with five different temperatures at each pressure. &lt;br /&gt;
* Temperatures: 1.6, 1.9, 2.2, 2.5, 2.8&lt;br /&gt;
* Pressures: 2.5, 3.0&lt;br /&gt;
These pressures were chosen because the data simulated when choosing an appropriate timestep gave a pressure between 2.5 and 3.0 (&#039;&#039;figures 8 and 9&#039;&#039;).  &lt;br /&gt;
&lt;br /&gt;
For the code which computes the thermodynamic potentials, this particular line defines how many steps contribute towards the average of the thermodynamic parameters computed in the calculation: &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;
&#039;&#039;fix&#039;&#039; is the keyword, &#039;&#039;aves&#039;&#039; is the name of the group of fixes which in this case is the average of the thermodynamic values, &#039;&#039;all&#039;&#039; specifies the atoms which the fix is applied to which in this case is all the atoms in the simulated system and &#039;&#039;ave/time&#039;&#039; means that compute global time averages are calculated. The following three numbers have the following meaning:&lt;br /&gt;
&lt;br /&gt;
*100 = use the input values every 100 timesteps&lt;br /&gt;
*1000 = use input values 1000 times for calculating the average&lt;br /&gt;
*100000 = calculate the average every 100000 timesteps&lt;br /&gt;
&lt;br /&gt;
Therefore for the total calculation, which lasts for 100,000 steps, the average will only be calculated once. Assuming 1 value is calculated every timestep, there will be 100,000/100 = 1000 values. &lt;br /&gt;
&lt;br /&gt;
The density data from all ten calculation was plotted on the same graph, along with the density for an &amp;quot;ideal&amp;quot; gas. This density can be derived from the ideal gas law:&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;
Rearranging in terms of density: &amp;lt;math&amp;gt;\frac{N}{V} = \frac{P}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As these simulations are being run under reduced units, we can take &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt;, and so the density of the ideal gas becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the density of the ideal gas is plotted as the pressure divided by the temperature in pressure-temperature phase space.&lt;br /&gt;
[[File:Rmt dvt plot.png|none|thumb|800x800px|&#039;&#039;Figure 11. &#039;&#039;Plot of the variation in density with temperature at a defined pressure for the numerically simulated and ideal systems]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that calculated in the ideal gas law. This is because for an ideal gas, an assumption is made that there are no intermolecular interactions, and therefore forces such as electron repulsion forces are ignored; repulsion forces dominate over attractive ones, as all the atoms in this simulation are the same and so partial charges or dipoles are created. This will mean that the particles move closer together than a real gas and so the density will be larger. This discrepancy between the ideal and non-ideal systems becomes larger at a higher pressure because with a higher pressure, the atoms in the system are closer together and therefore the intermolecular repulsion will become larger. This greater repulsion will in turn have a larger effect on decreasing the density.&lt;br /&gt;
&lt;br /&gt;
== Statistical Physics Calculations of the Heat Capacity ==&lt;br /&gt;
The heat capacity of a system at constant volume can be calculated from the variance in the total energy of the system. The relationship used to calculate the heat capacity is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = 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;\left\langle E^2\right\rangle&amp;lt;/math&amp;gt; is the continuous average of the total square energy at each temperature as a function of temperature. &amp;lt;math&amp;gt;\left\langle E\right\rangle^2&amp;lt;/math&amp;gt; is the continuous average of the total energy at each temperature as a function of temperature squared. The heat capacity is multiplied by &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; in this case because the version of LAMMPS calculates every energy divided by the number of molecules in the system simulated.&lt;br /&gt;
&lt;br /&gt;
The calculations in this sections are run in density-temperature phase space and the ensemble has changed to the canonical ensemble (NVT). A set of input files were written for ten calculations for, like the previous section, two pressures and five different temperatures at each pressure:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 0.2, 0.8&lt;br /&gt;
*Temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{C_V}{V}&amp;lt;/math&amp;gt; was plotted against temperature to determine the relationship in density-temperature phase space. An example of an input file can be found [[Media:nvt_-_0220.in|here]]. The lines which have been changed from the previous input files are at the end of the script:&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 &lt;br /&gt;
 thermo_style custom step etotal temp&lt;br /&gt;
 variable energy equal etotal&lt;br /&gt;
 variable energy2 equal etotal*etotal&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_energy v_energy2 v_temp&lt;br /&gt;
 run 100000&lt;br /&gt;
 &lt;br /&gt;
 variable aveenergy equal f_aves[1]&lt;br /&gt;
 variable aveenergy2 equal f_aves[2]&lt;br /&gt;
 variable avetemp equal f_aves[3]&lt;br /&gt;
 variable heatcapacitydv equal atoms*atoms*(v_aveenergy2-v_aveenergy*v_aveenergy)/(v_avetemp*v_avetemp*vol)&lt;br /&gt;
 &lt;br /&gt;
 print &amp;quot;Averages&amp;quot;&lt;br /&gt;
 print &amp;quot;--------&amp;quot;&lt;br /&gt;
 print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Heat Capacity per Volume: ${heatcapacitydv}&amp;quot;&lt;br /&gt;
The line with the keyword &#039;fix&#039; determines which thermodynamic values are averaged and over how many steps they are averaged. The next section takes these averages as variables and uses them to define the heat capacity which is calculated from the equation at the beginning of this section. Only the energy and temperature are needed to define the heat capacity and so only these values are calculated by the simulation. [[File:Rmt heatcapacitybyv.png|none|thumb|800x800px|&#039;&#039;Figure 12. &#039;&#039;C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V against temperature for the two different pressures 0.2 and 0.8]]As seen in &#039;&#039;figure 11.&#039;&#039;, the heat capacity decreases with temperature for both pressures. It would be expected for an ideal system that as the temperature increases, the heat capacity at constant volume increases and tends to a constant value at very high T of &amp;lt;nowiki&amp;gt;&amp;lt;math&amp;gt;3R&amp;lt;/math&amp;gt;&amp;lt;/nowiki&amp;gt;; &amp;lt;math&amp;gt;R&amp;lt;/math&amp;gt; = the universal gas constant. This means increasing the temperature increases the amount of energy being stored in the system and this energy is stored as vibrational energy. However, for a Lennard-Jones liquid, the system being simulated here, the heat capacity decreases with temperature. This is because there are two components to the simulation; the atoms are vibrating in a quasi-harmonic fashion around the equilibrium position and also, they diffuse between neighbouring equilibrium positions in a gas like fashion. As the temperature increases, the amount of diffusion increases and the amount of vibrations decrease, therefore decreasing the ability of the system to take in heat as vibrational energy, resulting in the decrease in heat capacity. &amp;lt;ref&amp;gt;Dima Bolmatov, V. V. Brazhkin, and K. Trachenko &amp;quot;Thermodynamic behaviour of supercritical matter&amp;quot;, Scientific Reports &#039;&#039;&#039;4&#039;&#039;&#039; 2331 (2013)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural Properties and the Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a single atom in a system is a plot of the probability that an atom can be found at a certain distance from the central atom. The peaks in this plot gives the distance of an atom from its nearest neighbours in the Lennard-Jones simulated system. &lt;br /&gt;
&lt;br /&gt;
The calculations in this section simulate a Lennard-Jones solid, liquid and gas and, using the output of the LAMMPS trajectory file, plots both the radial distribution function and its integral using DLV. The temperature and pressure parameters for these calculations were taken from the phase diagram or coexistence curve for a Lennard-Jones system. The parameters used are displayed in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! Temperature, &amp;lt;math&amp;gt;T^*&amp;lt;/math&amp;gt;&lt;br /&gt;
! Pressure, &amp;lt;math&amp;gt;p^*&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| LJ Solid&lt;br /&gt;
| 1.5&lt;br /&gt;
| 1.2&lt;br /&gt;
|-&lt;br /&gt;
| LJ Liquid&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.8&lt;br /&gt;
|-&lt;br /&gt;
| LJ Gas&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.01&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The data obtained from the plots and the radial distribution functions and their integrals were plotted and shown in the table below.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure 13. &#039;&#039;The radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
!&#039;&#039;Figure 14. &#039;&#039;The integrals of the radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt fullrdfs.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt allintegralsrdf.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
[[File:Rmt Nearest neighbours.png|left|thumb|300x300px|&#039;&#039;Figure 15. &#039;&#039;Representation of a cross section of the first three shells of nearest neighbours in an fcc solid. The black atom is the central atom being considered, the blue atoms are the first shell, the orange atoms the second shell and the purple atoms are the third.]]&lt;br /&gt;
The RDF of the solid gives a very irregular curve because of the irregular structure of the lattice. For a simple cubic lattice, a regular structure of the RDF would be expected because of the equal number of atoms in each of the nearest neighbour shells. However, for face-centered cubic lattice, the solid in this simulation, the structure is much more irregular and as the atoms move from their equilibrium position in the lattice due to vibrations, the peaks in the radial distribution will broaden. The irregular heights of the peaks are due to the varying numbers of atoms in each of the nearest neighbour shells for the central atom. The first shell gives the highest peak as it contains the most atoms multiplied by the strongest interaction potential; in total, considering all four surrounding unit cells, this shell contains 12 atoms and ideally takes the geometry of an icosahedron. The second shell is smaller and contains only 6 atoms in an octahedral coordination shape. The following shell again contributes 12 atoms, 3 from each unit cell. This therefore explains why the heights of the peaks in the solid plot in &#039;&#039;figure 12.&#039;&#039; vary. These values can be confirmed by the plot in &#039;&#039;figure 15.&#039;&#039; which is the integral; it cumulatively adds the numbers in each shell. The size of the first &amp;quot;step&amp;quot; is 12; there are 12 atoms in the first shell. The size of the second step is approximately 18; there are 18-12=6 steps in the second shell. The same theory applies for the third shell which gives a value of 13. This is slightly different to the predicted value possibly due to error in the calculation of the radial distribution function and therefore its integral. &lt;br /&gt;
&lt;br /&gt;
The RDF of the liquid has a representation of far fewer shells, which means that there are less atoms in the space close to a &amp;quot;central&amp;quot; atom in the bulk solution. The particles have more energy and therefore do not keep to a regular lattice structure. As they move about, some regularity is maintained around each atom, but only to the extend of two or three shells, meaning there is no long range order in a Lennard-Jones liquid. &lt;br /&gt;
&lt;br /&gt;
The RDF of the gas again omits more shells as there is almost no order in a Lennard-Jones gas. The single peak on this plot considers only the set of atoms closest to the central atom and all others are disregarded as they are too far apart. &lt;br /&gt;
&lt;br /&gt;
Considering &#039;&#039;figure 13.&#039;&#039;, the size of the integral of the radial distribution function decreases from solid to liquid to gas. This makes sense as the number of atoms in the surrounding shells decreases with density of the system; the atoms become further apart. &lt;br /&gt;
&lt;br /&gt;
From the plot of the radial distribution function of the solid, the lattice spacing can be determined. For this, we can consider just the first three peaks of the RDF plot. The lattice spacing refers to the length of one unit cell, and so, using &#039;&#039;figure m&#039;&#039;, we can calculate this using two different methods; a) we can use the distance between the central atom and the first shell of nearest neighbours, and use trigonometry to calculate the lattice spacing. Or alternatively b) we can use the distance between the central atom and the second nearest neighbour shell to get the lattice spacing.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure 16. &#039;&#039;The radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
!&#039;&#039;Figure 17. &#039;&#039;The integral of the radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt solidgr3.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt solidint3.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
Using method a) (with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; as the distance between the central atom and the nearest neighbour: Lattice spacing = &amp;lt;math&amp;gt;\frac{r}{cos({\frac{\pi}{4}})} = \frac{1.02}{cos({\frac{\pi}{4}})} \approx 1.44&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using method b): Lattice spacing &amp;lt;math&amp;gt;\approx 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can take an average between the two get an approximate value for the lattice spacing &amp;lt;math&amp;gt;\approx\ 1.46&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These values for distance are all in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
The ability of atoms to move around in a solid liquid or gas can be characterised by the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. In this section, we will explore two different ways to calculate the diffusion coefficient and compare the results. &lt;br /&gt;
&lt;br /&gt;
=== The Mean Squared Displacement ===&lt;br /&gt;
The diffusion coefficient can be measured easily be calculating the mean squared displacement of atoms in the solution; the diffusion coefficient is proportional to the first derivative of the mean squared displacement. By plotting the mean squared displacement as a function of time, the gradient can be taken to calculate the diffusion coefficient when its has equilibrated and become linear.&lt;br /&gt;
&lt;br /&gt;
The temperature and density parameters used were the same as in the previous section:&lt;br /&gt;
* Solid: T=1.5, D=1.2&lt;br /&gt;
* Liquid: T=1.1, D=0.8&lt;br /&gt;
* Gas: T=1.1, D=0.01&lt;br /&gt;
&lt;br /&gt;
Mean density squared calculations for 8,000 atoms were run for all three Lennard-Jones phases and the data plotted as function of timestep below. The data from a simulation containing 1,000,000 atoms was plotted for comparision.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!Plots for the 8,000 atom data (&#039;&#039;figures 18-20)&#039;&#039;&lt;br /&gt;
!Plots for the 1,000,000 atom data (&#039;&#039;figures 21-23)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|[[File:Rmt_MSDsolid.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt_MAsolid.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|[[File:Rmt MSDliquid.png|700x700px]]&lt;br /&gt;
|[[File:Rmt MAliquid.png|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|[[File:Rmt MSDgas.png|700x700px]]&lt;br /&gt;
|[[File:Rmt dataplots 25894 image001.png|700x700px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The exact relationship between the mean squared displacement and the diffusion coefficient is:&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;
Taking the gradients of each of the curves at the point at which they become linear and dividing by six will give the diffusion coefficient for each set of data. The gradient also needs to be converted to a function of time; this is done by dividing by the timestep, which in this case is 0.002:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom data diffusion coefficients, &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
!1,000,000 atom data diffusion coefficients &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 0.9999&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|Gradient = 0.0972&lt;br /&gt;
Amount of data used to calculate gradient: timestep 4300-5000, &amp;lt;math&amp;gt;R^2 = 0.9998&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{48.6}{6} = \mathbf{8.1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient = 0.0386&lt;br /&gt;
Amount of data used to calculate gradient: timestep 4000-5000, &amp;lt;math&amp;gt;R^2 = 0.1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{19.6}{6} = \mathbf{3.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For both of the solid approximations, the diffusion coefficient can be approximated as zero. This is because, when equilibrated, the function has a constant value of around 0.2 for the mean squared displacement. A gradient with a value of zero means that the atoms take an infinite amount of time to change their mean squared displacement or move away from their equilibrium position, and so this means that we can approximate in this system, there will be no diffusion. In real system, however, this is not the case; diffusion occurs but it is very slow. A plot for a real system will give a very shallow positive gradient.&lt;br /&gt;
&lt;br /&gt;
The liquid approximations are very well correlated. This is because in both cases, the mean squared displacement of particles in a liquid increases linearly with time and the gradient of both plots are almost identical. We can assume from this that identical starting conditions for temperature and pressure were used to calculate this data. Also, we can estimate that 8,000 atoms is a large enough simulation to give an accurate result for the diffusion coefficient for the Lennard-Jones liquid.&lt;br /&gt;
&lt;br /&gt;
The gas approximations are very different. This is most probably due to the fact that the density specified in each of the calculations is different. The 8,000 data can be estimated to be a much lower density because the diffusion coefficient is faster and this means diffusion will happen faster; at a higher density a particle will take longer to diffuse over a given distance. Because of the difference in density, the two values of the diffusion coefficient cannot be qualitatively compared. The reason for the initial deviation for linearity in the gas plots is due to the momentum of the particles initially dominating over the diffusion and the diffusion coefficient is dependent on time. As the system equilibrates, the diffusion coefficient becomes constant and the plots become linear.&lt;br /&gt;
&lt;br /&gt;
=== The Velocity Autocorrelation Function ===&lt;br /&gt;
&lt;br /&gt;
Another way to calculate the diffusion coefficient is by using the velocity correlation function, which determines how the velocity of an atom changes with time. The function determines the time when the velocity becomes uncorrelated (&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;), i.e. the difference between the velocity at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; and at time &amp;lt;math&amp;gt;t+\tau&amp;lt;/math&amp;gt;. By integrating over this function, we can find the diffusion coefficient. &lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function: &amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can also be written as the integral: &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;
Using the function which defines the position of a classical harmonic oscillator, we can differentiate this to give the equation for the velocity which we can plug into the integral:&lt;br /&gt;
&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;
&amp;lt;math&amp;gt;dv{x(t)}{t} = v(t) = -A\omega sin(\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also needed for the integral:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t+\tau) = -A\omega sin(\omega(t+\tau)+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v^2(t) = A^2\omega^2 sin^2(\omega t +\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Putting all this into the integral to find the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega sin(\omega t + \phi) \times A\omega sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} A^2\omega^2 sin^2(\omega t +\tau)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A^2\omega^2&amp;lt;/math&amp;gt; can be take out of each of the integrals and cancelled. A substituion can then be made to make solving the integral much simpler:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = \omega t + \phi&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \omega\tau&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the integral becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a) \times sin(a+b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the compound angle rule &amp;lt;math&amp;gt;sin(a+b)=sin(a)cos(b)+cos(a)sin(b)&amp;lt;/math&amp;gt;, the integral can be simplified to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a)sin(a)cos(b) + sin(a)cos(a)sin(b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Separating out into two integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)\frac{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the rule &amp;lt;math&amp;gt;sin(a)cos(a) = \frac{1}{2}sin(2a)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} \frac{1}{2}(sin(2a))\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because the function &amp;lt;math&amp;gt;\frac{1}{2}sin(2a)&amp;lt;/math&amp;gt; is symmetric over all space, the second term in this equation becomes zero. Therefore, the integral simplifies to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b) = cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same calculations from the mean squared displacement section gave an output of the velocity autocorrelation function. The function for the Lennard-Jones solid, liquid and gas were plotted against the timestep along with the approximate function for the velocity autocorrelation function, &amp;lt;math&amp;gt;cos(\omega\tau)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\omega = \frac{1}{2\pi}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure 24. &#039;&#039;Plots for the velocity autocorrelation function of a Lennard-Jones solid, liquid and gas; 8,000 atoms&lt;br /&gt;
!&#039;&#039;Figure 25. &#039;&#039;Plots for the velocity autocorrelation function of a Lennard-Jones solid, liquid and gas, 1,000,000 atoms&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt VACF 5721 image001.png|800x800px|]]&lt;br /&gt;
|[[File:Rmt MAVACF.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plots for the velocity autocorrelation function show how the time correlation of velocity decreases with time due to collisions with other atoms in the system. The Lennard-Jones solid oscillates around the VACF=0 axis with the oscillations becoming progressively more damped with time. The long range of the oscillations is due to the order in the system. Every time the plot crosses the VACF=0 axis, the velocity of the atom changes direction which is due to a collision with another atom. Every collision for every atom is completely uncorrelated so the change in velocity of one atom as it collides is independent of another change in velocity of another colliding atom. Overall, momentum must be conserved and so overall change of velocity in the system must be conserved. &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones liquid oscillations are damped much quicker; an atom in the liquid only collides with one atom before the velocity becomes uncorrelated with respect to time. The Lennard-Jones gas never reaches the VACF=0 axis as the atoms are too far apart to collide. Because the velocity autocorrelation function never equilibrates, using this method to calculate the diffusion coefficient is inaccurate because the particles in the gas never come into contact with each other.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillating system is so different to the Lennard-Jones systems because the atoms remain in their equilibrium position and vibrate around the same position, never coming into contact with another atom. Because of this, the correlation with time never decreases so the function infinitely oscillates as a sine function.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated from: &amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty C\left(\tau\right)\mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the approximate value for the diffusion coefficient using the velocity autocorrelation function is &amp;lt;math&amp;gt;D = \frac{1}{3}cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The running integral of the velocity autocorrelation functions was plotted using the &#039;&#039;trapesium rule&#039;&#039;, and so the final value on the integral plot is proportional to the diffusion coefficient.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom VACF integral &#039;&#039;(figures 26-28)&#039;&#039;&lt;br /&gt;
!1,000,000 VACF integral (&#039;&#039;figures 29-31)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|[[File:Rmt mysi.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt masi.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|[[File:Rmt myli.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt mali.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|[[File:Rmt mygi.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt ligi.png|frameless|700x700px]]&lt;br /&gt;
|}&lt;br /&gt;
The diffusion coefficients for each of the plots above are tabulated below using the final data point from the integral plot. This is the integral over the whole graph using the trapesium rule. This must be corrected for the timestep; the value is multiplied by 0.002. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom data diffusion coefficients, &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
!1,000,000 atom data diffusion coefficients &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;-0.00055&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{-0.00055}{6} = -0.00018 \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.00014&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.00014}{6} = 0.000046 \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.242&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.242}{6} = \mathbf{0.0807}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.270&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.270}{6} = \mathbf{0.0901}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;25.6&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{25.6}{6} = \mathbf{8.55}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;9.81&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{9.81}{6} = \mathbf{3.27}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
The biggest source of error in these plots is that we assume both the 8,000 atom data and the 1,000,000 atom data take the same amount of time to converge. &#039;&#039;Figure z. &#039;&#039;shows that 5000 timesteps is not long enough for the velocity autocorrelation coefficient for 8,000 atoms to converge as far as 1,000,000 atom data does in this length of time. As the molecular dynamics simulations simulate random motion, this could induce fluctuations in the velocity autocorrelation plot which could increase or decrease the integral introduction another source of error.&lt;br /&gt;
&lt;br /&gt;
Again, the diffusion coefficient of the Lennard-Jones solid can be assumed to be zero for the same reason as the mean squared displacement data. The diffusion coefficient of the liquid is lower for both sets of data when calculated using the velocity autocorrelation function, and the diffusion coefficient is higher for both sets of data.&lt;br /&gt;
&lt;br /&gt;
== Summary ==&lt;br /&gt;
A simple Lennard-Jones liquid was simulated for different temperatures, pressures and densities at an optimised timestep of 0.0025. It was found that density of a system decreases with temperature due to particles increasing their kinetic energy and therefore the particles move further apart. The density of an ideal gas is much higher than that of the simulated Lennard-Jones potentials because of lack of repulsive interatomic forces.&lt;br /&gt;
&lt;br /&gt;
It was also found that heat capacity of a Lennard-Jones liquid decreases with increasing temperature, and heat capacity is lower at a lower density. This is due to diffusion dominating atomic vibrations as temperature increases and so ability of a system to absorb heat as vibrational energy decreases with temperature.&lt;br /&gt;
&lt;br /&gt;
It was also found that the radial distribution function and its integral can be plotted to calculate the lattice spacing of a Lennard-Jones solid and the amount of atoms in each nearest neighbour shell respectively. The lattice spacing was calculated as &amp;lt;math&amp;gt;\approx\ 1.46&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient for a Lennard-Jones solid, liquid and gas can be calculate using the mean squared displacement or the velocity autocorrelation function. The velocity autocorrelation function was found to be a less reliable method for the gas because the function does not converge in the amount of timesteps that were calculated. &lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=543030</id>
		<title>Rep:Mod:hakunamatata</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=543030"/>
		<updated>2016-02-25T19:06:19Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: /* Calculating the Interatomic Distance and Force at Zero Potential */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Introduction to Molecular Dynamics Simulations ==&lt;br /&gt;
===The Classical Particle Approximation and Numerical Integration===&lt;br /&gt;
The verit and verit-velocity algorithms are numerical methods to approximate the average position and velocity respectively of randomly moving particles in a particular medium (solid, liquid, fliud etc.). This position and velocity can be applied to Newtonian mechanics to calculate such properties as the force and potential energy of the system. The algorithms work by splitting the function into discrete time steps, calculating the values of position and velocity at this particular time step, and then effectively &amp;quot;joining the dots&amp;quot; to create an approximate function. These simulations always use the answer from the previous timestep to compute the new timestep, so initial conditions must be given for the first step. Both of the algorithms are shown below and are derived from the Taylor expansion of the position or velocity of the atoms at the timestep &amp;quot;n+1&amp;quot; or &amp;lt;math&amp;gt;t+\delta t&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit Algorithum:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{x}_i\left(t + \delta t\right) \approx 2\mathbf{x}_i\left(t\right) - \mathbf{x}_i\left(t - \delta t\right) + \frac{\mathbf{F}_i\left(t\right)}{m_i}\delta t^2  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit-Velocity Algorithum:&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i\left(t\right)&amp;lt;/math&amp;gt; is the force acting on a particular atom as a function of time&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i\left(t\right)&amp;lt;/math&amp;gt; is the acceleration of the atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The smaller the timestep, the closer the numerical approximation is to the true function, which can be modeled as a classical harmonic oscillator. &#039;&#039;Figure 1.&#039;&#039; in the table below shows the comparison between the two methods at plotting position of an atom as a function of time in &#039;&#039;time&#039;&#039; space. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure 1. &#039;&#039;Plots of position vs time comparing the verit algorithm and harmonic spring results&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure 2. &#039;&#039;Plot of the total classical energy of the system (potential + kinetic)&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory xanalytical.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory energy.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The harmonic spring position values are modeled from the harmonic oscillator or particle on a spring. The equation of &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; is used to calculate these values, where &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; are equal to 1 and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; is equal to zero. As seen on the plot, the curves produced from the two different methods of calculating the position are in good agreement.&lt;br /&gt;
|The potential energy is calculated using the equation &amp;lt;math&amp;gt;U = \frac{1}{2}kx^2&amp;lt;/math&amp;gt;, with a value of k (force constant) given as 1. The kinetic energy is calculated using the velcity from the verit-velocity algorithm using the equation &amp;lt;math&amp;gt;T = \frac{1}{2} mv^2&amp;lt;/math&amp;gt;, where m (mass) is equal to 1. The total energy of the system, &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, is equal to &amp;lt;math&amp;gt;T + U&amp;lt;/math&amp;gt;. The values for &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; (from the potential energy term) and &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; (from the kinetic energy term) are taken from the verit algorithm and verit-velocity algorthim respectively. &lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;Figure 3. &#039;&#039;Plot of the difference (error) between the harmonic spring and verit algorithm data&lt;br /&gt;
!&#039;&#039;Figure 4. &#039;&#039;Plot of the peaks in the error plot in &#039;&#039;figure 3.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory error.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory errorpeaks.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The peaks in the error between the harmonic spring and verit algorithm results are at the point where the position curve crosses the time axis. This is because the harmonic spring data (&amp;lt;math&amp;gt;x(t)&amp;lt;/math&amp;gt;) has a slightly shorter wavelength than that of the verit velocity algorithm, and therefore the difference will get larger with each period of the wave. This is shown by the error getting larger in &#039;&#039;figure 3. &#039;&#039;The period of the plot of the two methods are different because the verit algorithm is much more approximate so does not give the correct solution.&lt;br /&gt;
|The change in the error/difference between the harmonic spring data and verit algorthm data increases linearly and so therefore period of each of the plots in &#039;&#039;figure 1&#039;&#039;. must be constant. &lt;br /&gt;
|}&lt;br /&gt;
The error can also be quantified on a &#039;&#039;phase space&#039;&#039; plot; phase space is momentum or velocity plotted as a function of position. The true solution for motion of an atom is a perfect ellipse, and the more elliptic the shape (less circular) the more momentum or velocity is in the system. A numerical solution, like the verit algorithms, will produce a set of points very close to this ellipse but not perfectly following the curve. A good numerical solution will remain in an elliptical shape, whereas a bad numerical solution, for example one with a large timestep, will spiral away from the true solution. Two examples of such systems using the data from &#039;&#039;figures a-d&#039;&#039; are shown below.  &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure 5. &#039;&#039;Phase plot of the harmonic spring data with a good numerical solution (timestep = 0.1) &lt;br /&gt;
!&#039;&#039;Figure 6. &#039;&#039;Phase plot of the harmonic spring data with a bad numerical solution (timestep = 0.3) &lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory phasegood.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory badphase.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The timestep at which this data is plotted is 0.1, which results in a very small change in the energy, as seen in &#039;&#039;figure b. &#039;&#039;Increasing the time step will increase the variation in the energy. To keep the variation in the total energy of the system under 1%, the time step must be no larger than approximately 0.28. The energy varies more with increasing time step because the jumps in the algorithm  are getting larger due to less data points. The algorithm assumes these points are joined by a straight line and that the halfway point in the jump is the average between the starting and finishing point of the jump. The phase space plot will become less elliptic and the jumps eventually become so large that the plot is no longer a continuous shape.  &lt;br /&gt;
&lt;br /&gt;
It is essential to monitor the energy of a numerically modeled system because a good solution for the motion of an atom has a constant energy and a plot in phase space of a perfect ellipse.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance and Force at Zero Potential===&lt;br /&gt;
From classical mechanics, the force calculated from the Newtonian mechanics above can be used to calculate the potential experienced by an atom in the system. They are related by the equation: &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;
[[File:Rmt 12-6-Lennard-Jones-Potential.png|left|thumb|&#039;&#039;Figure 7. &#039;&#039;The Lennard-Jones Potential]]&lt;br /&gt;
This potential gives the shape and dimension of the potential surface on which the system can be modeled. In this experiment, a simple 1D potential is used to describe the inter atomic forces of a liquid; the Lennard-Jones potential. It has the characteristic features of a short range repulsion potential and harmonic character around the equilibrium bond distance or interatomic separation. The value of &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the inter atomic separation when the potential, &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;, is equal to zero, can be calculated by equating the equation for the Lennard-Jones potential to zero and solving for &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The equation for the Lennard-Jones potential: &amp;lt;math&amp;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;
Equating this to zero: &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;
And rearranging in order to separate the variables: &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;
Rearranging this gives &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in terms of &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt; r^6 = \sigma^6&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r = r_0&amp;lt;/math&amp;gt; in this case.&lt;br /&gt;
&lt;br /&gt;
This, therefore, gives the result that interatomic distance at zero potential, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, is equal to &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; in the Lennard-Jones potential is effectively the diameter of one of the particles in the system being measured; in this case, the solid, liquid or gas we are simulating. This is the point where the potential curve crosses the x-axis on an Energy vs interatomic distance plot. The force, &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt;, at this point on the curve corresponds to the gradient; it is found by calculating the derivative of the curve at this point. &lt;br /&gt;
&lt;br /&gt;
To calculate the force, we must differentiate the equation for the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;U\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As force is equal to the negative differential of the potential energy, the value of the force is: &amp;lt;math&amp;gt;\mathbf{F}_i = 48\epsilon \sigma^{12} r^{-13} - 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting in the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at zero potential from the calculation before: &amp;lt;math&amp;gt;\mathbf{F}_i = \frac{48\epsilon}{\sigma} - \frac{24\epsilon}{\sigma} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The gradient where the Lennard-Jones plot crosses the axis is negative; &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; in the term obtained for &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is negative and therefore the overall value of the force will be negative.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance, Force and Well Depth of the Potential at Equilibrium===&lt;br /&gt;
To calculate the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at the equilibrium position, we need to use the derivative of the potential energy curve. The equilibrium value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is the value at the minimum of the Lennard-Jones curve; when &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Therefore, equating the derivative to zero gives: &amp;lt;math&amp;gt;0 = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rearranging this: &amp;lt;math&amp;gt;48\epsilon \sigma^{12} r^{-13} = 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And simplifying and cancelling gives: &amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6&amp;lt;/math&amp;gt;. Therefore the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at equilibrium is: &amp;lt;math&amp;gt;r_{eq} = \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Physically, this result means that the equilibrium distance is 1.12 times the diameter of one of the particles; the particles have a small gap between them so do not touch. A short range repulsion potential, as seen in the Lennard-Jones curve, is a result of the particles coming into contact. &lt;br /&gt;
&lt;br /&gt;
Again, the force can be calculated from the derivative of the potential curve at the equilibrium point. As the derivative at this point is zero (a minimum on the curve), the force will therefore also be zero.&lt;br /&gt;
&lt;br /&gt;
The well-depth of the potential curve is the difference between zero potential and the potential at the equilibrium bond length. This can be calculated by substituting the value for the equilibrium bond length into the equation for the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;U\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;U\left(r_{eq}\right) = 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;
Cancelling and simplifying this equation gives: &amp;lt;math&amp;gt;U\left(r_{eq}\right) = 4\epsilon \times \frac{1}{4}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the absolute value for the well depth is &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;. The actual value of this potential is &amp;lt;math&amp;gt;-\epsilon&amp;lt;/math&amp;gt;, as the equilibrium bond length gives the most stable configuration of the molecules and therefore suggests attractive interactions are involved in the arrangement of the molecules; this attractive potential is negative. &lt;br /&gt;
&lt;br /&gt;
===Boundary Conditions and the Lennard-Jones Cutoff===&lt;br /&gt;
When simulating a liquid, it is computationally impractical to simulate a realistic liquid. Therefore a smaller &#039;box&#039; containing &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; particles is simulated and the computer program will use &#039;&#039;periodic boundary conditions&#039;&#039; to simulate infinite repetitions of this box. For example, when the atom reaches one edge of the box, applying periodic boundary conditions, it will reappear again at the opposite edge of the box as if they were connected. Applying this logic: an atom at the position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a box of size &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;. Without periodic boundary conditions, we would assume that the atom would end up at the position &amp;lt;math&amp;gt;(1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;. However, in this box, there is no such position and so the particle must reappear at the opposite edge to where it effectively &#039;left&#039; the box. Therefore, it&#039;s ending position will be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The number of particles, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; simulated by the computer is usually between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt;. Physically, this is a very small volume. Considering water, we can calculate the number of molecules in 1 mL or 1 cm^3, a volume which would be considered small in the lab. Taking the concentration of water at standard conditions, &amp;lt;math&amp;gt;55\ mol\ dm^{-3}&amp;lt;/math&amp;gt;, we can convert it to the number of moles per mL: &amp;lt;math&amp;gt;0.055\ mol\ mL^{-1}&amp;lt;/math&amp;gt;. Multiplying this value by Avagadro&#039;s constant (&amp;lt;math&amp;gt;N_A&amp;lt;/math&amp;gt;) gives the number of molcules of water per mL: &amp;lt;math&amp;gt;3.02 \times 10^{22} mL^{-1}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The reverse procedure can be used to compare this to the volume of 10,000 molecules: 10,000 divided by Avagadro&#039;s constant gives the number of moles of water which 10,000 molecules makes up: &amp;lt;math&amp;gt;1.66 \times 10^{-20}\ mol&amp;lt;/math&amp;gt;. Dividing this value by the concentration (from &amp;lt;math&amp;gt;n=cV&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is the number of moles, &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; is the concentration and &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume), gives the volume: &amp;lt;math&amp;gt;3.02 \times 10^{-22}\ dm&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;3.02 \times 10^{-19}\ mL&amp;lt;/math&amp;gt;. Physically, of course, this is far too small a volume to be recorded in the lab.&lt;br /&gt;
 &lt;br /&gt;
Periodic boundary conditions simulate an infinite lattice and therefore, when computing the potential, will calculate an infinite amount of pair interactions. Therefore, it is only practical to calculate the energies up to a certain interatomic distance; the Lennard-Jones cutoff distance. Beyond this point, the potential energy and the integral of the curve beyond this point become insignificant and do not impact on the overall energy; removing interactions beyond this point from the calculations will not effect the accuracy. Multiplying the Lennard-Jones potential with the radial distribution function gives a plot of the probability of finding an atom at a particular interatomic distance. The larger the interatomic distance, the lower the probability and so the energy after the cutoff can be disregarded. The radial distirbution function is dicussed in a later section.&lt;br /&gt;
&lt;br /&gt;
Integrating over the Lennard-Jones curve and applying this cutoff as the lower limit can show how small the integral is:&lt;br /&gt;
&lt;br /&gt;
For a general cutoff of with value &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;I = \int_{x}^\infty U\left(r\right)\mathrm{d}r = \int_{x}^\infty \frac{4\epsilon\sigma^{12}}{r^{12}}\mathrm{d}r - \int_{x}^\infty \frac{4\epsilon\sigma^6}{r^6}\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving this: &amp;lt;math&amp;gt;I = 4\epsilon\sigma^{12} {\frac{-1}{11r^{11}}\,\Bigg\vert\,}_x^\infty - 4\epsilon\sigma^{6} {\frac{-1}{5r^{5}}\,\Bigg\vert\,}_x^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This gives the general solution: &amp;lt;math&amp;gt;I = \frac{4\epsilon\sigma^{12}}{11x^{11}} - \frac{4\epsilon\sigma^{6}}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating this for &amp;lt;math&amp;gt;\epsilon = \sigma = 1&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;I = \frac{4}{11x^{11}} - \frac{4}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt; (or 2 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.025&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt; (or 2.5 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0082&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt; (or 3 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0033&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All values are taken to 2 significant figures. As the cutoff value for the interatomic distance gets larger, the integral gets smaller, and therefore the energy excluded from the calculation becomes smaller, and the second term in the solved integral, &amp;lt;math&amp;gt;I&amp;lt;/math&amp;gt;, dominates the energy value.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
When using the Lennard-Jones potential, it is appropriate to use reduced units for intermolecular distance, energy and temperature, which makes the maths and axes of plots much easier to understand. Reduced units can be calculated by the following relationships:&lt;br /&gt;
&lt;br /&gt;
Intermolecular 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;
&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; are scaling factors. For example, if the parameters for Argon are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\sigma = 0.34 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt; \epsilon\ /\ k_B = 120 K&amp;lt;/math&amp;gt;&lt;br /&gt;
* Lennard-Jones cutoff &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;. The well-depth, &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;, is &amp;lt;math&amp;gt;0.999 kJ mol^{-1} \approx 1 kJ mol^{-1}&amp;lt;/math&amp;gt;. The value of &amp;lt;math&amp;gt;T* = 1.5&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;180 K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The reduced units in this experiment has &amp;lt;math&amp;gt;k_B=1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All simulation computations are run using the computer program LAMMPS.&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
The first aim of the experiment is to determine the most appropriate timestep, &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;, to use in the verit algorithm simulations. This timestep is a balance between the accuracy of the results (the smaller the timestep, the closer to the true function the result will be) and the length of real time over which the simulation is run (the smaller the timestep, the less real time over which the simulation will give a result). The appropriateness of the timestep will be determined by plotting the total free energy of the simulated lattice as a function of time, and seeing how it equilibrates.  &lt;br /&gt;
&lt;br /&gt;
Five different calculations, which simulated the melting of a crystal and subsequent equilibration of the energy of the melted crystal, were run at five different timesteps; 0.001, 0.0025, 0.0075, 0.01 and 0.015. They were described by the NVE or &#039;&#039;&amp;quot;microcanonical ensemble&amp;quot;&#039;&#039;. An ensemble is a collection of samples of a system which are under three thermodynamic constraints (three properties are kept constant); in the microcanonical ensemble, the number of particles, the volume and the total energy is kept constant (NVE). &lt;br /&gt;
&lt;br /&gt;
These calculations simulate a box of 1000 unit cells and use periodic boundary conditions to replicate the simulation to a larger scale. Because these simulations use the numerical methods defined in the previous section, the initial position and velocity of the atoms must be defined in the input file. The Brownian (uncorrelated, random) motion of the atoms in the simulation means that there is no long range order in the system and so the atoms in a real system would start in random positions. However, assigning random starting coordinates to the atoms in a simulated liquid is not a relative process; the coordinates are generate independently of each other. Therefore there is a probability that the coordinates simulated will cause the atoms to overlap, which would give a very large repulsion potential, as seen in the Lennard-Jones potential at very small interatomic distances. This short-range repulsion potential comes from the hard-sphere atomic repulsion model.&lt;br /&gt;
&lt;br /&gt;
The input file also defines the structure and density of the lattice. The number density of lattice points in any lattice is the number of lattice points per volume of the unit cell. In a simple cubic lattice, there is one lattice point in the unit cell. From an sc lattice with a lattice spacing (length of one side of the unit cell) of &amp;lt;math&amp;gt;1.07722&amp;lt;/math&amp;gt;, the number density of the lattice points is calculated by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{1}{1.07722^3} = 0.7999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a face-centered cubic lattice (fcc), there are four lattice points in the unit cell. Rearranging the above relationship, the lattice spacing can be calculated from the number of lattice points in a unit cell and number density, &amp;lt;math&amp;gt;1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Lattice\ spacing = \sqrt[3]{\frac{number\ of\ lattice\ points\ per\ unit\ cell}{number\ density}} = \sqrt[3]{\frac{4}{1.2}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation creates a 3D box which includes 1000 unit cells; 10 unit cells in each dimension. For a simple cubic lattice, because there is one lattice point per unit cell, there will be 1000 atoms created as seen in the input file. The &#039;&#039;create_atom&#039;&#039; command in the input file determines how many boxes are created in the simulation and therefore how determines many atoms will be created. If a face centered cubic lattice is simulated, as there are 4 lattice points per unit cell, 4000 atoms will be created by the &#039;&#039;create_atom&#039;&#039; command. &lt;br /&gt;
&lt;br /&gt;
The input script also contains the following commands which defines the potential surface which is used to model the intermolecular reactions:&lt;br /&gt;
 mass 1 1.0&lt;br /&gt;
This instruction sets the mass type for the atoms being simulated. It takes the general form of “mass I value”, where &#039;&#039;mass&#039;&#039; is the keyword which tells LAMMPS what the input is, &#039;&#039;I&#039;&#039; is the atom type and &#039;&#039;value&#039;&#039; is the mass of the atom. In this case, I is defined by a specific numerical value; 1 as there is only 1 type of atom in the simulation, but it could be defined with an asterisk (1*), which means “all atom types of 1 to n inclusive” if there are &#039;&#039;n&#039;&#039; types of atoms in the simulation. &lt;br /&gt;
 pair_style lj/cut 3.0&lt;br /&gt;
This instruction sets the type of potential which LAMMPS uses in its calculation of pairwise interactions. It takes the general form of “pair_style style args”, where &#039;&#039;pair_style&#039;&#039; is the keyword for LAMMPS, &#039;&#039;style&#039;&#039; defines the potential and any specifications it may have, and &#039;&#039;args&#039;&#039; are the arguments required for this particular potential. In this case, the Lennard-Jones potential has been used (lj) with a cutoff point (cut) of 3σ. The cutoff point is explained in the introduction section. &lt;br /&gt;
 pair_coeff * * 1.0 1.0&lt;br /&gt;
This instruction specifies the coefficients for the pairwise interactions of each pair of atoms, and it takes the general form “pair_coeff I J args”. &#039;&#039;Pair_coeff&#039;&#039; is the keyword, &#039;&#039;I&#039;&#039; and &#039;&#039;J&#039;&#039; are the atom types, and &#039;&#039;args&#039;&#039; are the coefficients which the different atoms types take. In this case, the asterisk in place of I and J refers to all atoms types from 1 to n. The coefficients are the pairwise interactions are 1 for each atom, meaning each atom has an equal contribution to the interaction.&lt;br /&gt;
&lt;br /&gt;
In these initial calculations, the initial conditions for the numerical methods, &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. For this experiment, the verit-velocity algorithm would be the most appropriate, as both the starting position and velocity is specified for this algorithm. &lt;br /&gt;
&lt;br /&gt;
To define the timestep for the algorithm the following code is used defining the timestep as a variable instead of just giving it a definite value&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;
It is much easier to use the variable version of defining the timestep because the length of time over which the simulation is run depends on the time step. By using a variable, the length of the simulation is kept the same, no matter the size of the timestep. It also makes it easier if multiple properties depend on the timestep – only the variable needs to be changed, not all the parts of the script where timestep is defined. &lt;br /&gt;
&lt;br /&gt;
The calculations produce the values for the total energy of the system, temperature and pressure in the output files, which can be plotted against time. How well these values equilibrate determines the appropriateness of the timestep to use in further calculations in the experiment.  &lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!style=&amp;quot;width: 33%;&amp;quot;|&#039;&#039;Figure 8. &#039;&#039;Plot of the equilibration of total energy for five different timesteps&lt;br /&gt;
!style=&amp;quot;width: 33%;&amp;quot;|&#039;&#039;Figure 9. &#039;&#039; Plot of the temperature vs time equilibration for timestep = 0.0025&lt;br /&gt;
!style=&amp;quot;width: 33%;&amp;quot;|&#039;&#039;Figure 9. &#039;&#039; Plot of the pressure vs time equilibration for timestep = 0.0025 &lt;br /&gt;
|- &lt;br /&gt;
|[[File:rmt_totalenergycurve.png|600x600px]]&lt;br /&gt;
|[[File:rmt_tempvstime0025.png|600x600px]]&lt;br /&gt;
|[[File:rmt_pressurevstime0025.png|600x600px]]&lt;br /&gt;
|}&lt;br /&gt;
The largest time step to give an acceptable result is 0.01. However, for any simluation we would expect energy to be independent of the timestep, something which is not true at a timestep greater than 0.0025. Therefore, the most appropriate timestep to use for a balance between accuracy and length of time which the simulation covers is 0.0025. &lt;br /&gt;
&lt;br /&gt;
0.015 is a particularly bad choice of timestep. This is because the verit-velocity algorithm gives only an approximate result to the velocity (kinetic energy term) and position (potential energy term), and so when the timestep becomes too large with respect to the time, the algorithm no longer becomes a suitable way to calculate the energy. As seen in the graph of 0.015, the energy does not equilibrate and diverges.&lt;br /&gt;
&lt;br /&gt;
The plots for temperature and pressure vs time give a good indication of an appropriate pressure and temperature to use for running the simulations under specific conditions in the next section .&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions ==&lt;br /&gt;
The calculations in this section are run in the isobaric-isothermal ensemble, where the number of particles in the system, the pressure and the temperature are kept constant (NpT). This means that the temperature and the pressure are recalculated in every step, so are no longer constant like they were in the NVE ensemble. From the &#039;&#039;equipartition theorem&#039;&#039;, each degree of freedom will contribute &amp;lt;math&amp;gt;\frac{1}{2} k_B T&amp;lt;/math&amp;gt; of energy to the system. As the system is in three dimensions, there are three degrees of translational freedom and so the total internal energy is equal to &amp;lt;math&amp;gt;\frac{3}{2} k_B T&amp;lt;/math&amp;gt;. Equating this to the kinetic energy, &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt;, at the end of every step and rearranging will allow calculation of the temperature after every step. &lt;br /&gt;
&lt;br /&gt;
A target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, is defined in the input script. The system will equilibrate by multiplying the velocity by a factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, in order to accommodate for fluctuations in the overall velocity. This keeps the system at approximately the target temperature and therefore a constant internal energy. If the temperature of the system is greater than the target temperature, the system&#039;s kinetic energy is too high, so &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is reduced to compensate for this. The same is true for is the temperature is lower than the target temperature; &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than one in the next step to increase the kinetic energy which is now too low. The principle is the same for controlling the pressure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; can be derived from equating the kinetic and internal energy of the system at an arbitrary time step:&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;
Expanding the brackets inside the sum and moving the term containing &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; out of the sum: &amp;lt;math&amp;gt;\frac{\gamma^2}{2}\sum_i m_i \left(v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;, we can replace &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt; on the left hand side of the equation with &amp;lt;math&amp;gt;\frac{3}{2} N k_B T&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;\frac{3\gamma^2}{2}N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Simplifying and rearranging for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, gives: &amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As temperature and pressure are no longer constant, the input files require specification of the pressure and the temperature for each of the systems which are simulated. 10 simulations were run at two different pressures with five different temperatures at each pressure. &lt;br /&gt;
* Temperatures: 1.6, 1.9, 2.2, 2.5, 2.8&lt;br /&gt;
* Pressures: 2.5, 3.0&lt;br /&gt;
These pressures were chosen because the data simulated when choosing an appropriate timestep gave a pressure between 2.5 and 3.0 (&#039;&#039;figures 8 and 9&#039;&#039;).  &lt;br /&gt;
&lt;br /&gt;
For the code which computes the thermodynamic potentials, this particular line defines how many steps contribute towards the average of the thermodynamic parameters computed in the calculation: &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;
&#039;&#039;fix&#039;&#039; is the keyword, &#039;&#039;aves&#039;&#039; is the name of the group of fixes which in this case is the average of the thermodynamic values, &#039;&#039;all&#039;&#039; specifies the atoms which the fix is applied to which in this case is all the atoms in the simulated system and &#039;&#039;ave/time&#039;&#039; means that compute global time averages are calculated. The following three numbers have the following meaning:&lt;br /&gt;
&lt;br /&gt;
*100 = use the input values every 100 timesteps&lt;br /&gt;
*1000 = use input values 1000 times for calculating the average&lt;br /&gt;
*100000 = calculate the average every 100000 timesteps&lt;br /&gt;
&lt;br /&gt;
Therefore for the total calculation, which lasts for 100,000 steps, the average will only be calculated once. Assuming 1 value is calculated every timestep, there will be 100,000/100 = 1000 values. &lt;br /&gt;
&lt;br /&gt;
The density data from all ten calculation was plotted on the same graph, along with the density for an &amp;quot;ideal&amp;quot; gas. This density can be derived from the ideal gas law:&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;
Rearranging in terms of density: &amp;lt;math&amp;gt;\frac{N}{V} = \frac{P}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As these simulations are being run under reduced units, we can take &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt;, and so the density of the ideal gas becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the density of the ideal gas is plotted as the pressure divided by the temperature in pressure-temperature phase space.&lt;br /&gt;
[[File:Rmt dvt plot.png|none|thumb|800x800px|&#039;&#039;Figure 11. &#039;&#039;Plot of the variation in density with temperature at a defined pressure for the numerically simulated and ideal systems]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that calculated in the ideal gas law. This is because for an ideal gas, an assumption is made that there are no intermolecular interactions, and therefore forces such as electron repulsion forces are ignored; repulsion forces dominate over attractive ones, as all the atoms in this simulation are the same and so partial charges or dipoles are created. This will mean that the particles move closer together than a real gas and so the density will be larger. This discrepancy between the ideal and non-ideal systems becomes larger at a higher pressure because with a higher pressure, the atoms in the system are closer together and therefore the intermolecular repulsion will become larger. This greater repulsion will in turn have a larger effect on decreasing the density.&lt;br /&gt;
&lt;br /&gt;
== Statistical Physics Calculations of the Heat Capacity ==&lt;br /&gt;
The heat capacity of a system at constant volume can be calculated from the variance in the total energy of the system. The relationship used to calculate the heat capacity is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = 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;\left\langle E^2\right\rangle&amp;lt;/math&amp;gt; is the continuous average of the total square energy at each temperature as a function of temperature. &amp;lt;math&amp;gt;\left\langle E\right\rangle^2&amp;lt;/math&amp;gt; is the continuous average of the total energy at each temperature as a function of temperature squared. The heat capacity is multiplied by &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; in this case because the version of LAMMPS calculates every energy divided by the number of molecules in the system simulated.&lt;br /&gt;
&lt;br /&gt;
The calculations in this sections are run in density-temperature phase space and the ensemble has changed to the canonical ensemble (NVT). A set of input files were written for ten calculations for, like the previous section, two pressures and five different temperatures at each pressure:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 0.2, 0.8&lt;br /&gt;
*Temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{C_V}{V}&amp;lt;/math&amp;gt; was plotted against temperature to determine the relationship in density-temperature phase space. An example of an input file can be found [[Media:nvt_-_0220.in|here]]. The lines which have been changed from the previous input files are at the end of the script:&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 &lt;br /&gt;
 thermo_style custom step etotal temp&lt;br /&gt;
 variable energy equal etotal&lt;br /&gt;
 variable energy2 equal etotal*etotal&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_energy v_energy2 v_temp&lt;br /&gt;
 run 100000&lt;br /&gt;
 &lt;br /&gt;
 variable aveenergy equal f_aves[1]&lt;br /&gt;
 variable aveenergy2 equal f_aves[2]&lt;br /&gt;
 variable avetemp equal f_aves[3]&lt;br /&gt;
 variable heatcapacitydv equal atoms*atoms*(v_aveenergy2-v_aveenergy*v_aveenergy)/(v_avetemp*v_avetemp*vol)&lt;br /&gt;
 &lt;br /&gt;
 print &amp;quot;Averages&amp;quot;&lt;br /&gt;
 print &amp;quot;--------&amp;quot;&lt;br /&gt;
 print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Heat Capacity per Volume: ${heatcapacitydv}&amp;quot;&lt;br /&gt;
The line with the keyword &#039;fix&#039; determines which thermodynamic values are averaged and over how many steps they are averaged. The next section takes these averages as variables and uses them to define the heat capacity which is calculated from the equation at the beginning of this section. Only the energy and temperature are needed to define the heat capacity and so only these values are calculated by the simulation. [[File:Rmt heatcapacitybyv.png|none|thumb|800x800px|&#039;&#039;Figure 12. &#039;&#039;C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V against temperature for the two different pressures 0.2 and 0.8]]As seen in &#039;&#039;figure 11.&#039;&#039;, the heat capacity decreases with temperature for both pressures. It would be expected for an ideal system that as the temperature increases, the heat capacity at constant volume increases and tends to a constant value at very high T of &amp;lt;amth&amp;gt;3R&amp;lt;/math&amp;gt;; &amp;lt;math&amp;gt;R&amp;lt;/math&amp;gt; = the universal gas constant. This means increasing the temperature increases the amount of energy being stored in the system and this energy is stored as vibrational energy. However, for a Lennard-Jones liquid, the system being simulated here, the heat capacity decreases with temperature. This is because there are two components to the simulation; the atoms are vibrating in a quasi-harmonic fashion around the equilibrium position and also, they diffuse between neighbouring equilibrium positions in a gas like fashion. As the temperature increases, the amount of diffusion increases and the amount of vibrations decrease, therefore decreasing the ability of the system to take in heat as vibrational energy, resulting in the decrease in heat capacity. &amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www.nature.com/ncomms/2013/130816/ncomms3331/full/ncomms3331.html?message-global=remove&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural Properties and the Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a single atom in a system is a plot of the probability that an atom can be found at a certain distance from the central atom. The peaks in this plot gives the distance of an atom from its nearest neighbours in the Lennard-Jones simulated system. &lt;br /&gt;
&lt;br /&gt;
The calculations in this section simulate a Lennard-Jones solid, liquid and gas and, using the output of the LAMMPS trajectory file, plots both the radial distribution function and its integral using DLV. The temperature and pressure parameters for these calculations were taken from the phase diagram or coexistence curve for a Lennard-Jones system.&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt; The parameters used are displayed in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! Temperature, &amp;lt;math&amp;gt;T^*&amp;lt;/math&amp;gt;&lt;br /&gt;
! Pressure, &amp;lt;math&amp;gt;p^*&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| LJ Solid&lt;br /&gt;
| 1.5&lt;br /&gt;
| 1.2&lt;br /&gt;
|-&lt;br /&gt;
| LJ Liquid&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.8&lt;br /&gt;
|-&lt;br /&gt;
| LJ Gas&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.01&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The data obtained from the plots and the radial distribution functions and their integrals were plotted and shown in the table below.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure 13. &#039;&#039;The radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
!&#039;&#039;Figure 14. &#039;&#039;The integrals of the radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt fullrdfs.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt allintegralsrdf.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
[[File:Rmt Nearest neighbours.png|left|thumb|300x300px|&#039;&#039;Figure 15. &#039;&#039;Representation of a cross section of the first three shells of nearest neighbours in an fcc solid. The black atom is the central atom being considered, the blue atoms are the first shell, the orange atoms the second shell and the purple atoms are the third.]]&lt;br /&gt;
The RDF of the solid gives a very irregular curve because of the irregular structure of the lattice. For a simple cubic lattice, a regular structure of the RDF would be expected because of the equal number of atoms in each of the nearest neighbour shells. However, for face-centered cubic lattice, the solid in this simulation, the structure is much more irregular and as the atoms move from their equilibrium position in the lattice due to vibrations, the peaks in the radial distribution will broaden. The irregular heights of the peaks are due to the varying numbers of atoms in each of the nearest neighbour shells for the central atom. The first shell gives the highest peak as it contains the most atoms multiplied by the strongest interaction potential; in total, considering all four surrounding unit cells, this shell contains 12 atoms and ideally takes the geometry of an icosahedron. The second shell is smaller and contains only 6 atoms in an octahedral coordination shape. The following shell again contributes 12 atoms, 3 from each unit cell. This therefore explains why the heights of the peaks in the solid plot in &#039;&#039;figure 12.&#039;&#039; vary. These values can be confirmed by the plot in &#039;&#039;figure 15.&#039;&#039; which is the integral; it cumulatively adds the numbers in each shell. The size of the first &amp;quot;step&amp;quot; is 12; there are 12 atoms in the first shell. The size of the second step is approximately 18; there are 18-12=6 steps in the second shell. The same theory applies for the third shell which gives a value of 13. This is slightly different to the predicted value possibly due to error in the calculation of the radial distribution function and therefore its integral. &lt;br /&gt;
&lt;br /&gt;
The RDF of the liquid has a representation of far fewer shells, which means that there are less atoms in the space close to a &amp;quot;central&amp;quot; atom in the bulk solution. The particles have more energy and therefore do not keep to a regular lattice structure. As they move about, some regularity is maintained around each atom, but only to the extend of two or three shells, meaning there is no long range order in a Lennard-Jones liquid. &lt;br /&gt;
&lt;br /&gt;
The RDF of the gas again omits more shells as there is almost no order in a Lennard-Jones gas. The single peak on this plot considers only the set of atoms closest to the central atom and all others are disregarded as they are too far apart. &lt;br /&gt;
&lt;br /&gt;
Considering &#039;&#039;figure 13.&#039;&#039;, the size of the integral of the radial distribution function decreases from solid to liquid to gas. This makes sense as the number of atoms in the surrounding shells decreases with density of the system; the atoms become further apart. &lt;br /&gt;
&lt;br /&gt;
From the plot of the radial distribution function of the solid, the lattice spacing can be determined. For this, we can consider just the first three peaks of the RDF plot. The lattice spacing refers to the length of one unit cell, and so, using &#039;&#039;figure m&#039;&#039;, we can calculate this using two different methods; a) we can use the distance between the central atom and the first shell of nearest neighbours, and use trigonometry to calculate the lattice spacing. Or alternatively b) we can use the distance between the central atom and the second nearest neighbour shell to get the lattice spacing.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure 16. &#039;&#039;The radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
!&#039;&#039;Figure 17. &#039;&#039;The integral of the radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt solidgr3.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt solidint3.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
Using method a) (with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; as the distance between the central atom and the nearest neighbour: Lattice spacing = &amp;lt;math&amp;gt;\frac{r}{cos({\frac{\pi}{4}})} = \frac{1.02}{cos({\frac{\pi}{4}})} \approx 1.44&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using method b): Lattice spacing &amp;lt;math&amp;gt;\approx 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can take an average between the two get an approximate value for the lattice spacing &amp;lt;math&amp;gt;\approx\ 1.46&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These values for distance are all in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
The ability of atoms to move around in a solid liquid or gas can be characterised by the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. In this section, we will explore two different ways to calculate the diffusion coefficient and compare the results. &lt;br /&gt;
&lt;br /&gt;
=== The Mean Squared Displacement ===&lt;br /&gt;
The diffusion coefficient can be measured easily be calculating the mean squared displacement of atoms in the solution; the diffusion coefficient is proportional to the first derivative of the mean squared displacement. By plotting the mean squared displacement as a function of time, the gradient can be taken to calculate the diffusion coefficient when its has equilibrated and become linear.&lt;br /&gt;
&lt;br /&gt;
The temperature and density parameters used were the same as in the previous section:&lt;br /&gt;
* Solid: T=1.5, D=1.2&lt;br /&gt;
* Liquid: T=1.1, D=0.8&lt;br /&gt;
* Gas: T=1.1, D=0.01&lt;br /&gt;
&lt;br /&gt;
Mean density squared calculations for 8,000 atoms were run for all three Lennard-Jones phases and the data plotted as function of timestep below. The data from a simulation containing 1,000,000 atoms was plotted for comparision.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!Plots for the 8,000 atom data (&#039;&#039;figures 18-20)&#039;&#039;&lt;br /&gt;
!Plots for the 1,000,000 atom data (&#039;&#039;figures 21-23)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|[[File:Rmt_MSDsolid.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt_MAsolid.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|[[File:Rmt MSDliquid.png|700x700px]]&lt;br /&gt;
|[[File:Rmt MAliquid.png|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|[[File:Rmt MSDgas.png|700x700px]]&lt;br /&gt;
|[[File:Rmt dataplots 25894 image001.png|700x700px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The exact relationship between the mean squared displacement and the diffusion coefficient is:&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;
Taking the gradients of each of the curves at the point at which they become linear and dividing by six will give the diffusion coefficient for each set of data. The gradient also needs to be converted to a function of time; this is done by dividing by the timestep, which in this case is 0.002:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom data diffusion coefficients, &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
!1,000,000 atom data diffusion coefficients &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 0.9999&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|Gradient = 0.0972&lt;br /&gt;
Amount of data used to calculate gradient: timestep 4300-5000, &amp;lt;math&amp;gt;R^2 = 0.9998&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{48.6}{6} = \mathbf{8.1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient = 0.0386&lt;br /&gt;
Amount of data used to calculate gradient: timestep 4000-5000, &amp;lt;math&amp;gt;R^2 = 0.1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{19.6}{6} = \mathbf{3.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For both of the solid approximations, the diffusion coefficient can be approximated as zero. This is because, when equilibrated, the function has a constant value of around 0.2 for the mean squared displacement. A gradient with a value of zero means that the atoms take an infinite amount of time to change their mean squared displacement or move away from their equilibrium position, and so this means that we can approximate in this system, there will be no diffusion. In real system, however, this is not the case; diffusion occurs but it is very slow. A plot for a real system will give a very shallow positive gradient.&lt;br /&gt;
&lt;br /&gt;
The liquid approximations are very well correlated. This is because in both cases, the mean squared displacement of particles in a liquid increases linearly with time and the gradient of both plots are almost identical. We can assume from this that identical starting conditions for temperature and pressure were used to calculate this data. Also, we can estimate that 8,000 atoms is a large enough simulation to give an accurate result for the diffusion coefficient for the Lennard-Jones liquid.&lt;br /&gt;
&lt;br /&gt;
The gas approximations are very different. This is most probably due to the fact that the density specified in each of the calculations is different. The 8,000 data can be estimated to be a much lower density because the diffusion coefficient is faster and this means diffusion will happen faster; at a higher density a particle will take longer to diffuse over a given distance. Because of the difference in density, the two values of the diffusion coefficient cannot be qualitatively compared. The reason for the initial deviation for linearity in the gas plots is due to the momentum of the particles initially dominating over the diffusion and the diffusion coefficient is dependent on time. As the system equilibrates, the diffusion coefficient becomes constant and the plots become linear.&lt;br /&gt;
&lt;br /&gt;
=== The Velocity Autocorrelation Function ===&lt;br /&gt;
&lt;br /&gt;
Another way to calculate the diffusion coefficient is by using the velocity correlation function, which determines how the velocity of an atom changes with time. The function determines the time when the velocity becomes uncorrelated (&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;), i.e. the difference between the velocity at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; and at time &amp;lt;math&amp;gt;t+\tau&amp;lt;/math&amp;gt;. By integrating over this function, we can find the diffusion coefficient. &lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function: &amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can also be written as the integral: &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;
Using the function which defines the position of a classical harmonic oscillator, we can differentiate this to give the equation for the velocity which we can plug into the integral:&lt;br /&gt;
&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;
&amp;lt;math&amp;gt;dv{x(t)}{t} = v(t) = -A\omega sin(\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also needed for the integral:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t+\tau) = -A\omega sin(\omega(t+\tau)+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v^2(t) = A^2\omega^2 sin^2(\omega t +\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Putting all this into the integral to find the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega sin(\omega t + \phi) \times A\omega sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} A^2\omega^2 sin^2(\omega t +\tau)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A^2\omega^2&amp;lt;/math&amp;gt; can be take out of each of the integrals and cancelled. A substituion can then be made to make solving the integral much simpler:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = \omega t + \phi&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \omega\tau&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the integral becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a) \times sin(a+b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the compound angle rule &amp;lt;math&amp;gt;sin(a+b)=sin(a)cos(b)+cos(a)sin(b)&amp;lt;/math&amp;gt;, the integral can be simplified to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a)sin(a)cos(b) + sin(a)cos(a)sin(b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Separating out into two integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)\frac{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the rule &amp;lt;math&amp;gt;sin(a)cos(a) = \frac{1}{2}sin(2a)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} \frac{1}{2}(sin(2a))\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because the function &amp;lt;math&amp;gt;\frac{1}{2}sin(2a)&amp;lt;/math&amp;gt; is symmetric over all space, the second term in this equation becomes zero. Therefore, the integral simplifies to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b) = cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same calculations from the mean squared displacement section gave an output of the velocity autocorrelation function. The function for the Lennard-Jones solid, liquid and gas were plotted against the timestep along with the approximate function for the velocity autocorrelation function, &amp;lt;math&amp;gt;cos(\omega\tau)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\omega = \frac{1}{2\pi}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure 24. &#039;&#039;Plots for the velocity autocorrelation function of a Lennard-Jones solid, liquid and gas; 8,000 atoms&lt;br /&gt;
!&#039;&#039;Figure 25. &#039;&#039;Plots for the velocity autocorrelation function of a Lennard-Jones solid, liquid and gas, 1,000,000 atoms&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt VACF 5721 image001.png|800x800px|]]&lt;br /&gt;
|[[File:Rmt MAVACF.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plots for the velocity autocorrelation function show how the time correlation of velocity decreases with time due to collisions with other atoms in the system. The Lennard-Jones solid oscillates around the VACF=0 axis with the oscillations becoming progressively more damped with time. The long range of the oscillations is due to the order in the system. Every time the plot crosses the VACF=0 axis, the velocity of the atom changes direction which is due to a collision with another atom. Every collision for every atom is completely uncorrelated so the change in velocity of one atom as it collides is independent of another change in velocity of another colliding atom. Overall, momentum must be conserved and so overall change of velocity in the system must be conserved. &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones liquid oscillations are damped much quicker; an atom in the liquid only collides with one atom before the velocity becomes uncorrelated with respect to time. The Lennard-Jones gas never reaches the VACF=0 axis as the atoms are too far apart to collide. Because the velocity autocorrelation function never equilibrates, using this method to calculate the diffusion coefficient is inaccurate because the particles in the gas never come into contact with each other.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillating system is so different to the Lennard-Jones systems because the atoms remain in their equilibrium position and vibrate around the same position, never coming into contact with another atom. Because of this, the correlation with time never decreases so the function infinitely oscillates as a sine function.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated from: &amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty C\left(\tau\right)\mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the approximate value for the diffusion coefficient using the velocity autocorrelation function is &amp;lt;math&amp;gt;D = \frac{1}{3}cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The running integral of the velocity autocorrelation functions was plotted using the &#039;&#039;trapesium rule&#039;&#039;, and so the final value on the integral plot is proportional to the diffusion coefficient.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom VACF integral &#039;&#039;(figures 26-28)&#039;&#039;&lt;br /&gt;
!1,000,000 VACF integral (&#039;&#039;figures 29-31)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|[[File:Rmt mysi.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt masi.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|[[File:Rmt myli.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt mali.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|[[File:Rmt mygi.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt ligi.png|frameless|700x700px]]&lt;br /&gt;
|}&lt;br /&gt;
The diffusion coefficients for each of the plots above are tabulated below using the final data point from the integral plot. This is the integral over the whole graph using the trapesium rule. This must be corrected for the timestep; the value is multiplied by 0.002. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom data diffusion coefficients, &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
!1,000,000 atom data diffusion coefficients &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;-0.00055&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{-0.00055}{6} = -0.00018 \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.00014&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.00014}{6} = 0.000046 \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.242&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.242}{6} = \mathbf{0.0807}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.270&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.270}{6} = \mathbf{0.0901}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;25.6&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{25.6}{6} = \mathbf{8.55}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;9.81&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{9.81}{6} = \mathbf{3.27}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
The biggest source of error in these plots is that we assume both the 8,000 atom data and the 1,000,000 atom data take the same amount of time to converge. &#039;&#039;Figure z. &#039;&#039;shows that 5000 timesteps is not long enough for the velocity autocorrelation coefficient for 8,000 atoms to converge as far as 1,000,000 atom data does in this length of time. As the molecular dynamics simulations simulate random motion, this could induce fluctuations in the velocity autocorrelation plot which could increase or decrease the integral introduction another source of error.&lt;br /&gt;
&lt;br /&gt;
Again, the diffusion coefficient of the Lennard-Jones solid can be assumed to be zero for the same reason as the mean squared displacement data. The diffusion coefficient of the liquid is lower for both sets of data when calculated using the velocity autocorrelation function, and the diffusion coefficient is higher for both sets of data.&lt;br /&gt;
&lt;br /&gt;
== Summary ==&lt;br /&gt;
A simple Lennard-Jones liquid was simulated for different temperatures, pressures and densities at an optimised timestep of 0.0025. It was found that density of a system decreases with temperature due to particles increasing their kinetic energy and therefore the particles move further apart. The density of an ideal gas is much higher than that of the simulated Lennard-Jones potentials because of lack of repulsive interatomic forces.&lt;br /&gt;
&lt;br /&gt;
It was also found that heat capacity of a Lennard-Jones liquid decreases with increasing temperature, and heat capacity is lower at a lower density. This is due to diffusion dominating atomic vibrations as temperature increases and so ability of a system to absorb heat as vibrational energy decreases with temperature.&lt;br /&gt;
&lt;br /&gt;
It was also found that the radial distribution function and its integral can be plotted to calculate the lattice spacing of a Lennard-Jones solid and the amount of atoms in each nearest neighbour shell respectively. The lattice spacing was calculated as &amp;lt;math&amp;gt;\approx\ 1.46&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient for a Lennard-Jones solid, liquid and gas can be calculate using the mean squared displacement or the velocity autocorrelation function. The velocity autocorrelation function was found to be a less reliable method for the gas because the function does not converge in the amount of timesteps that were calculated. &lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Rmt_12-6-Lennard-Jones-Potential.png&amp;diff=543023</id>
		<title>File:Rmt 12-6-Lennard-Jones-Potential.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Rmt_12-6-Lennard-Jones-Potential.png&amp;diff=543023"/>
		<updated>2016-02-25T18:58:50Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=543017</id>
		<title>Rep:Mod:hakunamatata</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=543017"/>
		<updated>2016-02-25T18:55:11Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: /* Boundary Conditions and the Lennard-Jones Cutoff */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Introduction to Molecular Dynamics Simulations ==&lt;br /&gt;
===The Classical Particle Approximation and Numerical Integration===&lt;br /&gt;
The verit and verit-velocity algorithms are numerical methods to approximate the average position and velocity respectively of randomly moving particles in a particular medium (solid, liquid, fliud etc.). This position and velocity can be applied to Newtonian mechanics to calculate such properties as the force and potential energy of the system. The algorithms work by splitting the function into discrete time steps, calculating the values of position and velocity at this particular time step, and then effectively &amp;quot;joining the dots&amp;quot; to create an approximate function. These simulations always use the answer from the previous timestep to compute the new timestep, so initial conditions must be given for the first step. Both of the algorithms are shown below and are derived from the Taylor expansion of the position or velocity of the atoms at the timestep &amp;quot;n+1&amp;quot; or &amp;lt;math&amp;gt;t+\delta t&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit Algorithum:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{x}_i\left(t + \delta t\right) \approx 2\mathbf{x}_i\left(t\right) - \mathbf{x}_i\left(t - \delta t\right) + \frac{\mathbf{F}_i\left(t\right)}{m_i}\delta t^2  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit-Velocity Algorithum:&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i\left(t\right)&amp;lt;/math&amp;gt; is the force acting on a particular atom as a function of time&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i\left(t\right)&amp;lt;/math&amp;gt; is the acceleration of the atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The smaller the timestep, the closer the numerical approximation is to the true function, which can be modeled as a classical harmonic oscillator. &#039;&#039;Figure 1.&#039;&#039; in the table below shows the comparison between the two methods at plotting position of an atom as a function of time in &#039;&#039;time&#039;&#039; space. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure 1. &#039;&#039;Plots of position vs time comparing the verit algorithm and harmonic spring results&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure 2. &#039;&#039;Plot of the total classical energy of the system (potential + kinetic)&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory xanalytical.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory energy.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The harmonic spring position values are modeled from the harmonic oscillator or particle on a spring. The equation of &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; is used to calculate these values, where &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; are equal to 1 and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; is equal to zero. As seen on the plot, the curves produced from the two different methods of calculating the position are in good agreement.&lt;br /&gt;
|The potential energy is calculated using the equation &amp;lt;math&amp;gt;U = \frac{1}{2}kx^2&amp;lt;/math&amp;gt;, with a value of k given as 1. The kinetic energy is calculated using the velcity from the verit-velocity algorithm using the equation &amp;lt;math&amp;gt;T = \frac{1}{2} mv^2&amp;lt;/math&amp;gt;, where m is equal to 1. The total energy of the system, &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, is equal to &amp;lt;math&amp;gt;T + U&amp;lt;/math&amp;gt;. The values for &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; (from the potential energy term) and &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; (from the kinetic energy term) are taken from the verit algorithm and verit-velocity algorthim respectively. &lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;Figure 3. &#039;&#039;Plot of the difference (error) between the harmonic spring and verit algorithm data&lt;br /&gt;
!&#039;&#039;Figure 4. &#039;&#039;Plot of the peaks in the error plot in &#039;&#039;figure 3.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory error.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory errorpeaks.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The peaks in the error between the harmonic spring and verit algorithm results are at the point where the position curve crosses the time axis. This is because the harmonic spring data (&amp;lt;math&amp;gt;x(t)&amp;lt;/math&amp;gt;) has a slightly shorter wavelength than that of the verit velocity algorithm, and therefore the difference will get larger with each period of the wave. This is shown by the error getting larger in &#039;&#039;figure 3. &#039;&#039;The period of the plot of the two methods are different because the verit algorithm is much more approximate so does not give the correct solution.&lt;br /&gt;
|The change in the error/difference between the harmonic spring data and verit algorthm data increases linearly and so therefore period of each of the plots in &#039;&#039;figure 1&#039;&#039;. must be constant. &lt;br /&gt;
|}&lt;br /&gt;
The error can also be quantified on a &#039;&#039;phase space&#039;&#039; plot; phase space is momentum or velocity plotted as a function of position. The true solution for motion of an atom is a perfect ellipse, and the more elliptic the shape (less circular) the more momentum or velocity is in the system. A numerical solution, like the verit algorithms, will produce a set of points very close to this ellipse but not perfectly following the curve. A good numerical solution will remain in an elliptical shape, whereas a bad numerical solution, for example one with a large timestep, will spiral away from the true solution. Two examples of such systems using the data from &#039;&#039;figures a-d&#039;&#039; are shown below.  &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure 5. &#039;&#039;Phase plot of the harmonic spring data with a good numerical solution (timestep = 0.1) &lt;br /&gt;
!&#039;&#039;Figure 6. &#039;&#039;Phase plot of the harmonic spring data with a bad numerical solution (timestep = 0.3) &lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory phasegood.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory badphase.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The timestep at which this data is plotted is 0.1, which results in a very small change in the energy, as seen in &#039;&#039;figure b. &#039;&#039;Increasing the time step will increase the variation in the energy. To keep the variation in the total energy of the system under 1%, the time step must be no larger than approximately 0.28. The energy varies more with increasing time step because the jumps in the algorithm  are getting larger due to less data points. The algorithm assumes these points are joined by a straight line and that the halfway point in the jump is the average between the starting and finishing point of the jump. The phase space plot will become less elliptic and the jumps eventually become so large that the plot is no longer a continuous shape.  &lt;br /&gt;
&lt;br /&gt;
It is essential to monitor the energy of a numerically modeled system because a good solution for the motion of an atom has a constant energy and a plot in phase space of a perfect ellipse.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance and Force at Zero Potential===&lt;br /&gt;
From classical mechanics, the force calculated from the Newtonian mechanics above can be used to calculate the potential experienced by an atom in the system. They are related by the equation: &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;
This potential gives the shape and dimension of the potential surface on which the system can be modeled. In this experiment, a simple 1D potential is used to describe the inter atomic forces of a liquid; the Lennard-Jones potential. It has the characteristic features of a short range repulsion potential and harmonic character around the equilibrium bond distance or interatomic separation. The value of &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the inter atomic separation when the potential, &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;, is equal to zero, can be calculated by equating the equation for the Lennard-Jones potential to zero and solving for &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The equation for the Lennard-Jones potential: &amp;lt;math&amp;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;
Equating this to zero: &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;
And rearranging in order to separate the variables: &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;
Rearranging this gives &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in terms of &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt; r^6 = \sigma^6&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r = r_0&amp;lt;/math&amp;gt; in this case.&lt;br /&gt;
&lt;br /&gt;
This, therefore, gives the result that interatomic distance at zero potential, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, is equal to &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; in the Lennard-Jones potential is effectively the diameter of one of the particles in the system being measured; in this case, the solid, liquid or gas we are simulating. This is the point where the potential curve crosses the x-axis on an Energy vs interatomic distance plot. The force, &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt;, at this point on the curve corresponds to the gradient; it is found by calculating the derivative of the curve at this point. &lt;br /&gt;
&lt;br /&gt;
To calculate the force, we must differentiate the equation for the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;U\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As force is equal to the negative differential of the potential energy, the value of the force is: &amp;lt;math&amp;gt;\mathbf{F}_i = 48\epsilon \sigma^{12} r^{-13} - 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting in the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at zero potential from the calculation before: &amp;lt;math&amp;gt;\mathbf{F}_i = \frac{48\epsilon}{\sigma} - \frac{24\epsilon}{\sigma} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The gradient where the Lennard-Jones plot crosses the axis is negative; &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; in the term obtained for &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is negative and therefore the overall value of the force will be negative.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance, Force and Well Depth of the Potential at Equilibrium===&lt;br /&gt;
To calculate the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at the equilibrium position, we need to use the derivative of the potential energy curve. The equilibrium value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is the value at the minimum of the Lennard-Jones curve; when &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Therefore, equating the derivative to zero gives: &amp;lt;math&amp;gt;0 = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rearranging this: &amp;lt;math&amp;gt;48\epsilon \sigma^{12} r^{-13} = 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And simplifying and cancelling gives: &amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6&amp;lt;/math&amp;gt;. Therefore the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at equilibrium is: &amp;lt;math&amp;gt;r_{eq} = \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Physically, this result means that the equilibrium distance is 1.12 times the diameter of one of the particles; the particles have a small gap between them so do not touch. A short range repulsion potential, as seen in the Lennard-Jones curve, is a result of the particles coming into contact. &lt;br /&gt;
&lt;br /&gt;
Again, the force can be calculated from the derivative of the potential curve at the equilibrium point. As the derivative at this point is zero (a minimum on the curve), the force will therefore also be zero.&lt;br /&gt;
&lt;br /&gt;
The well-depth of the potential curve is the difference between zero potential and the potential at the equilibrium bond length. This can be calculated by substituting the value for the equilibrium bond length into the equation for the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;U\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;U\left(r_{eq}\right) = 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;
Cancelling and simplifying this equation gives: &amp;lt;math&amp;gt;U\left(r_{eq}\right) = 4\epsilon \times \frac{1}{4}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the absolute value for the well depth is &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;. The actual value of this potential is &amp;lt;math&amp;gt;-\epsilon&amp;lt;/math&amp;gt;, as the equilibrium bond length gives the most stable configuration of the molecules and therefore suggests attractive interactions are involved in the arrangement of the molecules; this attractive potential is negative. &lt;br /&gt;
&lt;br /&gt;
===Boundary Conditions and the Lennard-Jones Cutoff===&lt;br /&gt;
When simulating a liquid, it is computationally impractical to simulate a realistic liquid. Therefore a smaller &#039;box&#039; containing &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; particles is simulated and the computer program will use &#039;&#039;periodic boundary conditions&#039;&#039; to simulate infinite repetitions of this box. For example, when the atom reaches one edge of the box, applying periodic boundary conditions, it will reappear again at the opposite edge of the box as if they were connected. Applying this logic: an atom at the position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a box of size &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;. Without periodic boundary conditions, we would assume that the atom would end up at the position &amp;lt;math&amp;gt;(1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;. However, in this box, there is no such position and so the particle must reappear at the opposite edge to where it effectively &#039;left&#039; the box. Therefore, it&#039;s ending position will be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The number of particles, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; simulated by the computer is usually between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt;. Physically, this is a very small volume. Considering water, we can calculate the number of molecules in 1 mL or 1 cm^3, a volume which would be considered small in the lab. Taking the concentration of water at standard conditions, &amp;lt;math&amp;gt;55\ mol\ dm^{-3}&amp;lt;/math&amp;gt;, we can convert it to the number of moles per mL: &amp;lt;math&amp;gt;0.055\ mol\ mL^{-1}&amp;lt;/math&amp;gt;. Multiplying this value by Avagadro&#039;s constant (&amp;lt;math&amp;gt;N_A&amp;lt;/math&amp;gt;) gives the number of molcules of water per mL: &amp;lt;math&amp;gt;3.02 \times 10^{22} mL^{-1}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The reverse procedure can be used to compare this to the volume of 10,000 molecules: 10,000 divided by Avagadro&#039;s constant gives the number of moles of water which 10,000 molecules makes up: &amp;lt;math&amp;gt;1.66 \times 10^{-20}\ mol&amp;lt;/math&amp;gt;. Dividing this value by the concentration (from &amp;lt;math&amp;gt;n=cV&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is the number of moles, &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; is the concentration and &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume), gives the volume: &amp;lt;math&amp;gt;3.02 \times 10^{-22}\ dm&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;3.02 \times 10^{-19}\ mL&amp;lt;/math&amp;gt;. Physically, of course, this is far too small a volume to be recorded in the lab.&lt;br /&gt;
 &lt;br /&gt;
Periodic boundary conditions simulate an infinite lattice and therefore, when computing the potential, will calculate an infinite amount of pair interactions. Therefore, it is only practical to calculate the energies up to a certain interatomic distance; the Lennard-Jones cutoff distance. Beyond this point, the potential energy and the integral of the curve beyond this point become insignificant and do not impact on the overall energy; removing interactions beyond this point from the calculations will not effect the accuracy. Multiplying the Lennard-Jones potential with the radial distribution function gives a plot of the probability of finding an atom at a particular interatomic distance. The larger the interatomic distance, the lower the probability and so the energy after the cutoff can be disregarded. The radial distirbution function is dicussed in a later section.&lt;br /&gt;
&lt;br /&gt;
Integrating over the Lennard-Jones curve and applying this cutoff as the lower limit can show how small the integral is:&lt;br /&gt;
&lt;br /&gt;
For a general cutoff of with value &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;I = \int_{x}^\infty U\left(r\right)\mathrm{d}r = \int_{x}^\infty \frac{4\epsilon\sigma^{12}}{r^{12}}\mathrm{d}r - \int_{x}^\infty \frac{4\epsilon\sigma^6}{r^6}\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving this: &amp;lt;math&amp;gt;I = 4\epsilon\sigma^{12} {\frac{-1}{11r^{11}}\,\Bigg\vert\,}_x^\infty - 4\epsilon\sigma^{6} {\frac{-1}{5r^{5}}\,\Bigg\vert\,}_x^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This gives the general solution: &amp;lt;math&amp;gt;I = \frac{4\epsilon\sigma^{12}}{11x^{11}} - \frac{4\epsilon\sigma^{6}}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating this for &amp;lt;math&amp;gt;\epsilon = \sigma = 1&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;I = \frac{4}{11x^{11}} - \frac{4}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt; (or 2 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.025&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt; (or 2.5 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0082&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt; (or 3 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0033&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All values are taken to 2 significant figures. As the cutoff value for the interatomic distance gets larger, the integral gets smaller, and therefore the energy excluded from the calculation becomes smaller, and the second term in the solved integral, &amp;lt;math&amp;gt;I&amp;lt;/math&amp;gt;, dominates the energy value.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
When using the Lennard-Jones potential, it is appropriate to use reduced units for intermolecular distance, energy and temperature, which makes the maths and axes of plots much easier to understand. Reduced units can be calculated by the following relationships:&lt;br /&gt;
&lt;br /&gt;
Intermolecular 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;
&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; are scaling factors. For example, if the parameters for Argon are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\sigma = 0.34 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt; \epsilon\ /\ k_B = 120 K&amp;lt;/math&amp;gt;&lt;br /&gt;
* Lennard-Jones cutoff &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;. The well-depth, &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;, is &amp;lt;math&amp;gt;0.999 kJ mol^{-1} \approx 1 kJ mol^{-1}&amp;lt;/math&amp;gt;. The value of &amp;lt;math&amp;gt;T* = 1.5&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;180 K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The reduced units in this experiment has &amp;lt;math&amp;gt;k_B=1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All simulation computations are run using the computer program LAMMPS.&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
The first aim of the experiment is to determine the most appropriate timestep, &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;, to use in the verit algorithm simulations. This timestep is a balance between the accuracy of the results (the smaller the timestep, the closer to the true function the result will be) and the length of real time over which the simulation is run (the smaller the timestep, the less real time over which the simulation will give a result). The appropriateness of the timestep will be determined by plotting the total free energy of the simulated lattice as a function of time, and seeing how it equilibrates.  &lt;br /&gt;
&lt;br /&gt;
Five different calculations, which simulated the melting of a crystal and subsequent equilibration of the energy of the melted crystal, were run at five different timesteps; 0.001, 0.0025, 0.0075, 0.01 and 0.015. They were described by the NVE or &#039;&#039;&amp;quot;microcanonical ensemble&amp;quot;&#039;&#039;. An ensemble is a collection of samples of a system which are under three thermodynamic constraints (three properties are kept constant); in the microcanonical ensemble, the number of particles, the volume and the total energy is kept constant (NVE). &lt;br /&gt;
&lt;br /&gt;
These calculations simulate a box of 1000 unit cells and use periodic boundary conditions to replicate the simulation to a larger scale. Because these simulations use the numerical methods defined in the previous section, the initial position and velocity of the atoms must be defined in the input file. The Brownian (uncorrelated, random) motion of the atoms in the simulation means that there is no long range order in the system and so the atoms in a real system would start in random positions. However, assigning random starting coordinates to the atoms in a simulated liquid is not a relative process; the coordinates are generate independently of each other. Therefore there is a probability that the coordinates simulated will cause the atoms to overlap, which would give a very large repulsion potential, as seen in the Lennard-Jones potential at very small interatomic distances. This short-range repulsion potential comes from the hard-sphere atomic repulsion model.&lt;br /&gt;
&lt;br /&gt;
The input file also defines the structure and density of the lattice. The number density of lattice points in any lattice is the number of lattice points per volume of the unit cell. In a simple cubic lattice, there is one lattice point in the unit cell. From an sc lattice with a lattice spacing (length of one side of the unit cell) of &amp;lt;math&amp;gt;1.07722&amp;lt;/math&amp;gt;, the number density of the lattice points is calculated by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{1}{1.07722^3} = 0.7999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a face-centered cubic lattice (fcc), there are four lattice points in the unit cell. Rearranging the above relationship, the lattice spacing can be calculated from the number of lattice points in a unit cell and number density, &amp;lt;math&amp;gt;1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Lattice\ spacing = \sqrt[3]{\frac{number\ of\ lattice\ points\ per\ unit\ cell}{number\ density}} = \sqrt[3]{\frac{4}{1.2}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation creates a 3D box which includes 1000 unit cells; 10 unit cells in each dimension. For a simple cubic lattice, because there is one lattice point per unit cell, there will be 1000 atoms created as seen in the input file. The &#039;&#039;create_atom&#039;&#039; command in the input file determines how many boxes are created in the simulation and therefore how determines many atoms will be created. If a face centered cubic lattice is simulated, as there are 4 lattice points per unit cell, 4000 atoms will be created by the &#039;&#039;create_atom&#039;&#039; command. &lt;br /&gt;
&lt;br /&gt;
The input script also contains the following commands which defines the potential surface which is used to model the intermolecular reactions:&lt;br /&gt;
 mass 1 1.0&lt;br /&gt;
This instruction sets the mass type for the atoms being simulated. It takes the general form of “mass I value”, where &#039;&#039;mass&#039;&#039; is the keyword which tells LAMMPS what the input is, &#039;&#039;I&#039;&#039; is the atom type and &#039;&#039;value&#039;&#039; is the mass of the atom. In this case, I is defined by a specific numerical value; 1 as there is only 1 type of atom in the simulation, but it could be defined with an asterisk (1*), which means “all atom types of 1 to n inclusive” if there are &#039;&#039;n&#039;&#039; types of atoms in the simulation. &lt;br /&gt;
 pair_style lj/cut 3.0&lt;br /&gt;
This instruction sets the type of potential which LAMMPS uses in its calculation of pairwise interactions. It takes the general form of “pair_style style args”, where &#039;&#039;pair_style&#039;&#039; is the keyword for LAMMPS, &#039;&#039;style&#039;&#039; defines the potential and any specifications it may have, and &#039;&#039;args&#039;&#039; are the arguments required for this particular potential. In this case, the Lennard-Jones potential has been used (lj) with a cutoff point (cut) of 3σ. The cutoff point is explained in the introduction section. &lt;br /&gt;
 pair_coeff * * 1.0 1.0&lt;br /&gt;
This instruction specifies the coefficients for the pairwise interactions of each pair of atoms, and it takes the general form “pair_coeff I J args”. &#039;&#039;Pair_coeff&#039;&#039; is the keyword, &#039;&#039;I&#039;&#039; and &#039;&#039;J&#039;&#039; are the atom types, and &#039;&#039;args&#039;&#039; are the coefficients which the different atoms types take. In this case, the asterisk in place of I and J refers to all atoms types from 1 to n. The coefficients are the pairwise interactions are 1 for each atom, meaning each atom has an equal contribution to the interaction.&lt;br /&gt;
&lt;br /&gt;
In these initial calculations, the initial conditions for the numerical methods, &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. For this experiment, the verit-velocity algorithm would be the most appropriate, as both the starting position and velocity is specified for this algorithm. &lt;br /&gt;
&lt;br /&gt;
To define the timestep for the algorithm the following code is used defining the timestep as a variable instead of just giving it a definite value&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;
It is much easier to use the variable version of defining the timestep because the length of time over which the simulation is run depends on the time step. By using a variable, the length of the simulation is kept the same, no matter the size of the timestep. It also makes it easier if multiple properties depend on the timestep – only the variable needs to be changed, not all the parts of the script where timestep is defined. &lt;br /&gt;
&lt;br /&gt;
The calculations produce the values for the total energy of the system, temperature and pressure in the output files, which can be plotted against time. How well these values equilibrate determines the appropriateness of the timestep to use in further calculations in the experiment.  &lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!style=&amp;quot;width: 33%;&amp;quot;|&#039;&#039;Figure 7. &#039;&#039;Plot of the equilibration of total energy for five different timesteps&lt;br /&gt;
!style=&amp;quot;width: 33%;&amp;quot;|&#039;&#039;Figure 8. &#039;&#039; Plot of the temperature vs time equilibration for timestep = 0.0025&lt;br /&gt;
!style=&amp;quot;width: 33%;&amp;quot;|&#039;&#039;Figure 9. &#039;&#039; Plot of the pressure vs time equilibration for timestep = 0.0025 &lt;br /&gt;
|- &lt;br /&gt;
|[[File:rmt_totalenergycurve.png|600x600px]]&lt;br /&gt;
|[[File:rmt_tempvstime0025.png|600x600px]]&lt;br /&gt;
|[[File:rmt_pressurevstime0025.png|600x600px]]&lt;br /&gt;
|}&lt;br /&gt;
The largest time step to give an acceptable result is 0.01. However, for any simluation we would expect energy to be independent of the timestep, something which is not true at a timestep greater than 0.0025. Therefore, the most appropriate timestep to use for a balance between accuracy and length of time which the simulation covers is 0.0025. &lt;br /&gt;
&lt;br /&gt;
0.015 is a particularly bad choice of timestep. This is because the verit-velocity algorithm gives only an approximate result to the velocity (kinetic energy term) and position (potential energy term), and so when the timestep becomes too large with respect to the time, the algorithm no longer becomes a suitable way to calculate the energy. As seen in the graph of 0.015, the energy does not equilibrate and diverges.&lt;br /&gt;
&lt;br /&gt;
The plots for temperature and pressure vs time give a good indication of an appropriate pressure and temperature to use for running the simulations under specific conditions in the next section .&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions ==&lt;br /&gt;
The calculations in this section are run in the isobaric-isothermal ensemble, where the number of particles in the system, the pressure and the temperature are kept constant (NpT). This means that the temperature and the pressure are recalculated in every step, so are no longer constant like they were in the NVE ensemble. From the &#039;&#039;equipartition theorem&#039;&#039;, each degree of freedom will contribute &amp;lt;math&amp;gt;\frac{1}{2} k_B T&amp;lt;/math&amp;gt; of energy to the system. As the system is in three dimensions, there are three degrees of translational freedom and so the total internal energy is equal to &amp;lt;math&amp;gt;\frac{3}{2} k_B T&amp;lt;/math&amp;gt;. Equating this to the kinetic energy, &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt;, at the end of every step and rearranging will allow calculation of the temperature after every step. &lt;br /&gt;
&lt;br /&gt;
A target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, is defined in the input script. The system will equilibrate by multiplying the velocity by a factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, in order to accommodate for fluctuations in the overall velocity. This keeps the system at approximately the target temperature and therefore a constant internal energy. If the temperature of the system is greater than the target temperature, the system&#039;s kinetic energy is too high, so &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is reduced to compensate for this. The same is true for is the temperature is lower than the target temperature; &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than one in the next step to increase the kinetic energy which is now too low. The principle is the same for controlling the pressure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; can be derived from equating the kinetic and internal energy of the system at an arbitrary time step:&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;
Expanding the brackets inside the sum and moving the term containing &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; out of the sum: &amp;lt;math&amp;gt;\frac{\gamma^2}{2}\sum_i m_i \left(v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;, we can replace &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt; on the left hand side of the equation with &amp;lt;math&amp;gt;\frac{3}{2} N k_B T&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;\frac{3\gamma^2}{2}N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Simplifying and rearranging for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, gives: &amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As temperature and pressure are no longer constant, the input files require specification of the pressure and the temperature for each of the systems which are simulated. 10 simulations were run at two different pressures with five different temperatures at each pressure. &lt;br /&gt;
* Temperatures: 1.6, 1.9, 2.2, 2.5, 2.8&lt;br /&gt;
* Pressures: 2.5, 3.0&lt;br /&gt;
These pressures were chosen because the data simulated when choosing an appropriate timestep gave a pressure between 2.5 and 3.0 (&#039;&#039;figures 8 and 9&#039;&#039;).  &lt;br /&gt;
&lt;br /&gt;
For the code which computes the thermodynamic potentials, this particular line defines how many steps contribute towards the average of the thermodynamic parameters computed in the calculation: &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;
&#039;&#039;fix&#039;&#039; is the keyword, &#039;&#039;aves&#039;&#039; is the name of the group of fixes which in this case is the average of the thermodynamic values, &#039;&#039;all&#039;&#039; specifies the atoms which the fix is applied to which in this case is all the atoms in the simulated system and &#039;&#039;ave/time&#039;&#039; means that compute global time averages are calculated. The following three numbers have the following meaning:&lt;br /&gt;
&lt;br /&gt;
*100 = use the input values every 100 timesteps&lt;br /&gt;
*1000 = use input values 1000 times for calculating the average&lt;br /&gt;
*100000 = calculate the average every 100000 timesteps&lt;br /&gt;
&lt;br /&gt;
Therefore for the total calculation, which lasts for 100,000 steps, the average will only be calculated once. Assuming 1 value is calculated every timestep, there will be 100,000/100 = 1000 values. &lt;br /&gt;
&lt;br /&gt;
The density data from all ten calculation was plotted on the same graph, along with the density for an &amp;quot;ideal&amp;quot; gas. This density can be derived from the ideal gas law:&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;
Rearranging in terms of density: &amp;lt;math&amp;gt;\frac{N}{V} = \frac{P}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As these simulations are being run under reduced units, we can take &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt;, and so the density of the ideal gas becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the density of the ideal gas is plotted as the pressure divided by the temperature in pressure-temperature phase space.&lt;br /&gt;
[[File:Rmt dvt plot.png|none|thumb|800x800px|&#039;&#039;Figure 10. &#039;&#039;Plot of the variation in density with temperature at a defined pressure for the numerically simulated and ideal systems]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that calculated in the ideal gas law. This is because for an ideal gas, an assumption is made that there are no intermolecular interactions, and therefore forces such as electron repulsion forces are ignored; repulsion forces dominate over attractive ones, as all the atoms in this simulation are the same and so partial charges or dipoles are created. This will mean that the particles move closer together than a real gas and so the density will be larger. This discrepancy between the ideal and non-ideal systems becomes larger at a higher pressure because with a higher pressure, the atoms in the system are closer together and therefore the intermolecular repulsion will become larger. This greater repulsion will in turn have a larger effect on decreasing the density.&lt;br /&gt;
&lt;br /&gt;
== Statistical Physics Calculations of the Heat Capacity ==&lt;br /&gt;
The heat capacity of a system at constant volume can be calculated from the variance in the total energy of the system. The relationship used to calculate the heat capacity is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = 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;\left\langle E^2\right\rangle&amp;lt;/math&amp;gt; is the continuous average of the total square energy at each temperature as a function of temperature. &amp;lt;math&amp;gt;\left\langle E\right\rangle^2&amp;lt;/math&amp;gt; is the continuous average of the total energy at each temperature as a function of temperature squared. The heat capacity is multiplied by &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; in this case because the version of LAMMPS calculates every energy divided by the number of molecules in the system simulated.&lt;br /&gt;
&lt;br /&gt;
The calculations in this sections are run in density-temperature phase space and the ensemble has changed to the canonical ensemble (NVT). A set of input files were written for ten calculations for, like the previous section, two pressures and five different temperatures at each pressure:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 0.2, 0.8&lt;br /&gt;
*Temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{C_V}{V}&amp;lt;/math&amp;gt; was plotted against temperature to determine the relationship in density-temperature phase space. An example of an input file can be found [[Media:nvt_-_0220.in|here]]. The lines which have been changed from the previous input files are at the end of the script:&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 &lt;br /&gt;
 thermo_style custom step etotal temp&lt;br /&gt;
 variable energy equal etotal&lt;br /&gt;
 variable energy2 equal etotal*etotal&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_energy v_energy2 v_temp&lt;br /&gt;
 run 100000&lt;br /&gt;
 &lt;br /&gt;
 variable aveenergy equal f_aves[1]&lt;br /&gt;
 variable aveenergy2 equal f_aves[2]&lt;br /&gt;
 variable avetemp equal f_aves[3]&lt;br /&gt;
 variable heatcapacitydv equal atoms*atoms*(v_aveenergy2-v_aveenergy*v_aveenergy)/(v_avetemp*v_avetemp*vol)&lt;br /&gt;
 &lt;br /&gt;
 print &amp;quot;Averages&amp;quot;&lt;br /&gt;
 print &amp;quot;--------&amp;quot;&lt;br /&gt;
 print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Heat Capacity per Volume: ${heatcapacitydv}&amp;quot;&lt;br /&gt;
The line with the keyword &#039;fix&#039; determines which thermodynamic values are averaged and over how many steps they are averaged. The next section takes these averages as variables and uses them to define the heat capacity which is calculated from the equation at the beginning of this section. Only the energy and temperature are needed to define the heat capacity and so only these values are calculated by the simulation. [[File:Rmt heatcapacitybyv.png|none|thumb|800x800px|&#039;&#039;Figure 11. &#039;&#039;C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V against temperature for the two different pressures 0.2 and 0.8]]As seen in &#039;&#039;figure 11.&#039;&#039;, the heat capacity decreases with temperature for both pressures. It would be expected for an ideal system that as the temperature increases, the heat capacity at constant volume increases and tends to a constant value at very high T of &amp;lt;amth&amp;gt;3R&amp;lt;/math&amp;gt;; &amp;lt;math&amp;gt;R&amp;lt;/math&amp;gt; = the universal gas constant. This means increasing the temperature increases the amount of energy being stored in the system and this energy is stored as vibrational energy. However, for a Lennard-Jones liquid, the system being simulated here, the heat capacity decreases with temperature. This is because there are two components to the simulation; the atoms are vibrating in a quasi-harmonic fashion around the equilibrium position and also, they diffuse between neighbouring equilibrium positions in a gas like fashion. As the temperature increases, the amount of diffusion increases and the amount of vibrations decrease, therefore decreasing the ability of the system to take in heat as vibrational energy, resulting in the decrease in heat capacity. &amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www.nature.com/ncomms/2013/130816/ncomms3331/full/ncomms3331.html?message-global=remove&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural Properties and the Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a single atom in a system is a plot of the probability that an atom can be found at a certain distance from the central atom. The peaks in this plot gives the distance of an atom from its nearest neighbours in the Lennard-Jones simulated system. &lt;br /&gt;
&lt;br /&gt;
The calculations in this section simulate a Lennard-Jones solid, liquid and gas and, using the output of the LAMMPS trajectory file, plots both the radial distribution function and its integral using DLV. The temperature and pressure parameters for these calculations were taken from the phase diagram or coexistence curve for a Lennard-Jones system.&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt; The parameters used are displayed in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! Temperature, &amp;lt;math&amp;gt;T^*&amp;lt;/math&amp;gt;&lt;br /&gt;
! Pressure, &amp;lt;math&amp;gt;p^*&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| LJ Solid&lt;br /&gt;
| 1.5&lt;br /&gt;
| 1.2&lt;br /&gt;
|-&lt;br /&gt;
| LJ Liquid&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.8&lt;br /&gt;
|-&lt;br /&gt;
| LJ Gas&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.01&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The data obtained from the plots and the radial distribution functions and their integrals were plotted and shown in the table below.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure 12. &#039;&#039;The radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
!&#039;&#039;Figure 13. &#039;&#039;The integrals of the radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt fullrdfs.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt allintegralsrdf.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
[[File:Rmt Nearest neighbours.png|left|thumb|300x300px|&#039;&#039;Figure 14. &#039;&#039;Representation of a cross section of the first three shells of nearest neighbours in an fcc solid. The black atom is the central atom being considered, the blue atoms are the first shell, the orange atoms the second shell and the purple atoms are the third.]]&lt;br /&gt;
The RDF of the solid gives a very irregular curve because of the irregular structure of the lattice. For a simple cubic lattice, a regular structure of the RDF would be expected because of the equal number of atoms in each of the nearest neighbour shells. However, for face-centered cubic lattice, the solid in this simulation, the structure is much more irregular and as the atoms move from their equilibrium position in the lattice due to vibrations, the peaks in the radial distribution will broaden. The irregular heights of the peaks are due to the varying numbers of atoms in each of the nearest neighbour shells for the central atom. The first shell gives the highest peak as it contains the most atoms multiplied by the strongest interaction potential; in total, considering all four surrounding unit cells, this shell contains 12 atoms and ideally takes the geometry of an icosahedron. The second shell is smaller and contains only 6 atoms in an octahedral coordination shape. The following shell again contributes 12 atoms, 3 from each unit cell. This therefore explains why the heights of the peaks in the solid plot in &#039;&#039;figure 12.&#039;&#039; vary. These values can be confirmed by the plot in &#039;&#039;figure 15.&#039;&#039; which is the integral; it cumulatively adds the numbers in each shell. The size of the first &amp;quot;step&amp;quot; is 12; there are 12 atoms in the first shell. The size of the second step is approximately 18; there are 18-12=6 steps in the second shell. The same theory applies for the third shell which gives a value of 13. This is slightly different to the predicted value possibly due to error in the calculation of the radial distribution function and therefore its integral. &lt;br /&gt;
&lt;br /&gt;
The RDF of the liquid has a representation of far fewer shells, which means that there are less atoms in the space close to a &amp;quot;central&amp;quot; atom in the bulk solution. The particles have more energy and therefore do not keep to a regular lattice structure. As they move about, some regularity is maintained around each atom, but only to the extend of two or three shells, meaning there is no long range order in a Lennard-Jones liquid. &lt;br /&gt;
&lt;br /&gt;
The RDF of the gas again omits more shells as there is almost no order in a Lennard-Jones gas. The single peak on this plot considers only the set of atoms closest to the central atom and all others are disregarded as they are too far apart. &lt;br /&gt;
&lt;br /&gt;
Considering &#039;&#039;figure 13.&#039;&#039;, the size of the integral of the radial distribution function decreases from solid to liquid to gas. This makes sense as the number of atoms in the surrounding shells decreases with density of the system; the atoms become further apart. &lt;br /&gt;
&lt;br /&gt;
From the plot of the radial distribution function of the solid, the lattice spacing can be determined. For this, we can consider just the first three peaks of the RDF plot. The lattice spacing refers to the length of one unit cell, and so, using &#039;&#039;figure m&#039;&#039;, we can calculate this using two different methods; a) we can use the distance between the central atom and the first shell of nearest neighbours, and use trigonometry to calculate the lattice spacing. Or alternatively b) we can use the distance between the central atom and the second nearest neighbour shell to get the lattice spacing.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure 14. &#039;&#039;The radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
!&#039;&#039;Figure 15. &#039;&#039;The integral of the radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt solidgr3.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt solidint3.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
Using method a) (with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; as the distance between the central atom and the nearest neighbour: Lattice spacing = &amp;lt;math&amp;gt;\frac{r}{cos({\frac{\pi}{4}})} = \frac{1.02}{cos({\frac{\pi}{4}})} \approx 1.44&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using method b): Lattice spacing &amp;lt;math&amp;gt;\approx 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can take an average between the two get an approximate value for the lattice spacing &amp;lt;math&amp;gt;\approx\ 1.46&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These values for distance are all in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
The ability of atoms to move around in a solid liquid or gas can be characterised by the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. In this section, we will explore two different ways to calculate the diffusion coefficient and compare the results. &lt;br /&gt;
&lt;br /&gt;
=== The Mean Squared Displacement ===&lt;br /&gt;
The diffusion coefficient can be measured easily be calculating the mean squared displacement of atoms in the solution; the diffusion coefficient is proportional to the first derivative of the mean squared displacement. By plotting the mean squared displacement as a function of time, the gradient can be taken to calculate the diffusion coefficient when its has equilibrated and become linear.&lt;br /&gt;
&lt;br /&gt;
The temperature and density parameters used were the same as in the previous section:&lt;br /&gt;
* Solid: T=1.5, D=1.2&lt;br /&gt;
* Liquid: T=1.1, D=0.8&lt;br /&gt;
* Gas: T=1.1, D=0.01&lt;br /&gt;
&lt;br /&gt;
Mean density squared calculations for 8,000 atoms were run for all three Lennard-Jones phases and the data plotted as function of timestep below. The data from a simulation containing 1,000,000 atoms was plotted for comparision.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!Plots for the 8,000 atom data (&#039;&#039;figures p-r)&#039;&#039;&lt;br /&gt;
!Plots for the 1,000,000 atom data (&#039;&#039;figures s-u)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|[[File:Rmt_MSDsolid.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt_MAsolid.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|[[File:Rmt MSDliquid.png|700x700px]]&lt;br /&gt;
|[[File:Rmt MAliquid.png|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|[[File:Rmt MSDgas.png|700x700px]]&lt;br /&gt;
|[[File:Rmt dataplots 25894 image001.png|700x700px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The exact relationship between the mean squared displacement and the diffusion coefficient is:&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;
Taking the gradients of each of the curves at the point at which they become linear and dividing by six will give the diffusion coefficient for each set of data. The gradient also needs to be converted to a function of time; this is done by dividing by the timestep, which in this case is 0.002:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom data diffusion coefficients, &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
!1,000,000 atom data diffusion coefficients &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 0.9999&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|Gradient = 0.0972&lt;br /&gt;
Amount of data used to calculate gradient: timestep 4300-5000, &amp;lt;math&amp;gt;R^2 = 0.9998&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{48.6}{6} = \mathbf{8.1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient = 0.0386&lt;br /&gt;
Amount of data used to calculate gradient: timestep 4000-5000, &amp;lt;math&amp;gt;R^2 = 0.1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{19.6}{6} = \mathbf{3.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For both of the solid approximations, the diffusion coefficient can be approximated as zero. This is because, when equilibrated, the function has a constant value of around 0.2 for the mean squared displacement. A gradient with a value of zero means that the atoms take an infinite amount of time to change their mean squared displacement or move away from their equilibrium position, and so this means that we can approximate in this system, there will be no diffusion. In real system, however, this is not the case; diffusion occurs but it is very slow. A plot for a real system will give a very shallow positive gradient.&lt;br /&gt;
&lt;br /&gt;
The liquid approximations are very well correlated. This is because in both cases, the mean squared displacement of particles in a liquid increases linearly with time and the gradient of both plots are almost identical. We can assume from this that identical starting conditions for temperature and pressure were used to calculate this data. Also, we can estimate that 8,000 atoms is a large enough simulation to give an accurate result for the diffusion coefficient for the Lennard-Jones liquid.&lt;br /&gt;
&lt;br /&gt;
The gas approximations are very different. This is most probably due to the fact that the density specified in each of the calculations is different. The 8,000 data can be estimated to be a much lower density because the diffusion coefficient is faster and this means diffusion will happen faster; at a higher density a particle will take longer to diffuse over a given distance. Because of the difference in density, the two values of the diffusion coefficient cannot be qualitatively compared. The reason for the initial deviation for linearity in the gas plots is due to the momentum of the particles initially dominating over the diffusion and the diffusion coefficient is dependent on time. As the system equilibrates, the diffusion coefficient becomes constant and the plots become linear.&lt;br /&gt;
&lt;br /&gt;
=== The Velocity Autocorrelation Function ===&lt;br /&gt;
&lt;br /&gt;
Another way to calculate the diffusion coefficient is by using the velocity correlation function, which determines how the velocity of an atom changes with time. The function determines the time when the velocity becomes uncorrelated (&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;), i.e. the difference between the velocity at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; and at time &amp;lt;math&amp;gt;t+\tau&amp;lt;/math&amp;gt;. By integrating over this function, we can find the diffusion coefficient. &lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function: &amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can also be written as the integral: &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;
Using the function which defines the position of a classical harmonic oscillator, we can differentiate this to give the equation for the velocity which we can plug into the integral:&lt;br /&gt;
&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;
&amp;lt;math&amp;gt;dv{x(t)}{t} = v(t) = -A\omega sin(\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also needed for the integral:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t+\tau) = -A\omega sin(\omega(t+\tau)+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v^2(t) = A^2\omega^2 sin^2(\omega t +\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Putting all this into the integral to find the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega sin(\omega t + \phi) \times A\omega sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} A^2\omega^2 sin^2(\omega t +\tau)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A^2\omega^2&amp;lt;/math&amp;gt; can be take out of each of the integrals and cancelled. A substituion can then be made to make solving the integral much simpler:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = \omega t + \phi&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \omega\tau&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the integral becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a) \times sin(a+b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the compound angle rule &amp;lt;math&amp;gt;sin(a+b)=sin(a)cos(b)+cos(a)sin(b)&amp;lt;/math&amp;gt;, the integral can be simplified to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a)sin(a)cos(b) + sin(a)cos(a)sin(b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Separating out into two integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)\frac{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the rule &amp;lt;math&amp;gt;sin(a)cos(a) = \frac{1}{2}sin(2a)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} \frac{1}{2}(sin(2a))\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because the function &amp;lt;math&amp;gt;\frac{1}{2}sin(2a)&amp;lt;/math&amp;gt; is symmetric over all space, the second term in this equation becomes zero. Therefore, the integral simplifies to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b) = cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same calculations from the mean squared displacement section gave an output of the velocity autocorrelation function. The function for the Lennard-Jones solid, liquid and gas were plotted against the timestep along with the approximate function for the velocity autocorrelation function, &amp;lt;math&amp;gt;cos(\omega\tau)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\omega = \frac{1}{2\pi}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure v. &#039;&#039;Plots for the velocity autocorrelation function of a Lennard-Jones solid, liquid and gas; 8,000 atoms&lt;br /&gt;
!&#039;&#039;Figure w. &#039;&#039;Plots for the velocity autocorrelation function of a Lennard-Jones solid, liquid and gas, 1,000,000 atoms&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt VACF 5721 image001.png|800x800px|]]&lt;br /&gt;
|[[File:Rmt MAVACF.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plots for the velocity autocorrelation function show how the time correlation of velocity decreases with time due to collisions with other atoms in the system. The Lennard-Jones solid oscillates around the VACF=0 axis with the oscillations becoming progressively more damped with time. The long range of the oscillations is due to the order in the system. Every time the plot crosses the VACF=0 axis, the velocity of the atom changes direction which is due to a collision with another atom. Every collision for every atom is completely uncorrelated so the change in velocity of one atom as it collides is independent of another change in velocity of another colliding atom. Overall, momentum must be conserved and so overall change of velocity in the system must be conserved. &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones liquid oscillations are damped much quicker; an atom in the liquid only collides with one atom before the velocity becomes uncorrelated with respect to time. The Lennard-Jones gas never reaches the VACF=0 axis as the atoms are too far apart to collide. Because the velocity autocorrelation function never equilibrates, using this method to calculate the diffusion coefficient is inaccurate because the particles in the gas never come into contact with each other.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillating system is so different to the Lennard-Jones systems because the atoms remain in their equilibrium position and vibrate around the same position, never coming into contact with another atom. Because of this, the correlation with time never decreases so the function infinitely oscillates as a sine function.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated from: &amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty C\left(\tau\right)\mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the approximate value for the diffusion coefficient using the velocity autocorrelation function is &amp;lt;math&amp;gt;D = \frac{1}{3}cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The running integral of the velocity autocorrelation functions was plotted using the &#039;&#039;trapesium rule&#039;&#039;, and so the final value on the integral plot is proportional to the diffusion coefficient.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom VACF integral &#039;&#039;(figures w-z)&#039;&#039;&lt;br /&gt;
!1,000,000 VACF integral (&#039;&#039;figures aa-cc)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|[[File:Rmt mysi.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt masi.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|[[File:Rmt myli.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt mali.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|[[File:Rmt mygi.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt ligi.png|frameless|700x700px]]&lt;br /&gt;
|}&lt;br /&gt;
The diffusion coefficients for each of the plots above are tabulated below using the final data point from the integral plot. This is the integral over the whole graph using the trapesium rule. This must be corrected for the timestep; the value is multiplied by 0.002. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom data diffusion coefficients, &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
!1,000,000 atom data diffusion coefficients &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;-0.00055&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{-0.00055}{6} = -0.00018 \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.00014&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.00014}{6} = 0.000046 \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.242&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.242}{6} = \mathbf{0.0807}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.270&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.270}{6} = \mathbf{0.0901}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;25.6&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{25.6}{6} = \mathbf{8.55}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;9.81&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{9.81}{6} = \mathbf{3.27}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
The biggest source of error in these plots is that we assume both the 8,000 atom data and the 1,000,000 atom data take the same amount of time to converge. &#039;&#039;Figure z. &#039;&#039;shows that 5000 timesteps is not long enough for the velocity autocorrelation coefficient for 8,000 atoms to converge as far as 1,000,000 atom data does in this length of time. As the molecular dynamics simulations simulate random motion, this could induce fluctuations in the velocity autocorrelation plot which could increase or decrease the integral introduction another source of error.&lt;br /&gt;
&lt;br /&gt;
Again, the diffusion coefficient of the Lennard-Jones solid can be assumed to be zero for the same reason as the mean squared displacement data. The diffusion coefficient of the liquid is lower for both sets of data when calculated using the velocity autocorrelation function, and the diffusion coefficient is higher for both sets of data.&lt;br /&gt;
&lt;br /&gt;
== Summary ==&lt;br /&gt;
A simple Lennard-Jones liquid was simulated for different temperatures, pressures and densities at an optimised timestep of 0.0025. It was found that density of a system decreases with temperature due to particles increasing their kinetic energy and therefore the particles move further apart. The density of an ideal gas is much higher than that of the simulated Lennard-Jones potentials because of lack of repulsive interatomic forces.&lt;br /&gt;
&lt;br /&gt;
It was also found that heat capacity of a Lennard-Jones liquid decreases with increasing temperature, and heat capacity is lower at a lower density. This is due to diffusion dominating atomic vibrations as temperature increases and so ability of a system to absorb heat as vibrational energy decreases with temperature.&lt;br /&gt;
&lt;br /&gt;
It was also found that the radial distribution function and its integral can be plotted to calculate the lattice spacing of a Lennard-Jones solid and the amount of atoms in each nearest neighbour shell respectively. The lattice spacing was calculated as &amp;lt;math&amp;gt;\approx\ 1.46&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient for a Lennard-Jones solid, liquid and gas can be calculate using the mean squared displacement or the velocity autocorrelation function. The velocity autocorrelation function was found to be a less reliable method for the gas because the function does not converge in the amount of timesteps that were calculated. &lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=542987</id>
		<title>Rep:Mod:hakunamatata</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=542987"/>
		<updated>2016-02-25T18:31:10Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Introduction to Molecular Dynamics Simulations ==&lt;br /&gt;
===The Classical Particle Approximation and Numerical Integration===&lt;br /&gt;
The verit and verit-velocity algorithms are numerical methods to approximate the average position and velocity respectively of randomly moving particles in a particular medium (solid, liquid, fliud etc.). This position and velocity can be applied to Newtonian mechanics to calculate such properties as the force and potential energy of the system. The algorithms work by splitting the function into discrete time steps, calculating the values of position and velocity at this particular time step, and then effectively &amp;quot;joining the dots&amp;quot; to create an approximate function. These simulations always use the answer from the previous timestep to compute the new timestep, so initial conditions must be given for the first step. Both of the algorithms are shown below and are derived from the Taylor expansion of the position or velocity of the atoms at the timestep &amp;quot;n+1&amp;quot; or &amp;lt;math&amp;gt;t+\delta t&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit Algorithum:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{x}_i\left(t + \delta t\right) \approx 2\mathbf{x}_i\left(t\right) - \mathbf{x}_i\left(t - \delta t\right) + \frac{\mathbf{F}_i\left(t\right)}{m_i}\delta t^2  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit-Velocity Algorithum:&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i\left(t\right)&amp;lt;/math&amp;gt; is the force acting on a particular atom as a function of time&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i\left(t\right)&amp;lt;/math&amp;gt; is the acceleration of the atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The smaller the timestep, the closer the numerical approximation is to the true function, which can be modeled as a classical harmonic oscillator. &#039;&#039;Figure 1.&#039;&#039; in the table below shows the comparison between the two methods at plotting position of an atom as a function of time in &#039;&#039;time&#039;&#039; space. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure 1. &#039;&#039;Plots of position vs time comparing the verit algorithm and harmonic spring results&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure 2. &#039;&#039;Plot of the total classical energy of the system (potential + kinetic)&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory xanalytical.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory energy.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The harmonic spring position values are modeled from the harmonic oscillator or particle on a spring. The equation of &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; is used to calculate these values, where &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; are equal to 1 and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; is equal to zero. As seen on the plot, the curves produced from the two different methods of calculating the position are in good agreement.&lt;br /&gt;
|The potential energy is calculated using the equation &amp;lt;math&amp;gt;U = \frac{1}{2}kx^2&amp;lt;/math&amp;gt;, with a value of k given as 1. The kinetic energy is calculated using the velcity from the verit-velocity algorithm using the equation &amp;lt;math&amp;gt;T = \frac{1}{2} mv^2&amp;lt;/math&amp;gt;, where m is equal to 1. The total energy of the system, &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, is equal to &amp;lt;math&amp;gt;T + U&amp;lt;/math&amp;gt;. The values for &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; (from the potential energy term) and &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; (from the kinetic energy term) are taken from the verit algorithm and verit-velocity algorthim respectively. &lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;Figure 3. &#039;&#039;Plot of the difference (error) between the harmonic spring and verit algorithm data&lt;br /&gt;
!&#039;&#039;Figure 4. &#039;&#039;Plot of the peaks in the error plot in &#039;&#039;figure 3.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory error.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory errorpeaks.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The peaks in the error between the harmonic spring and verit algorithm results are at the point where the position curve crosses the time axis. This is because the harmonic spring data (&amp;lt;math&amp;gt;x(t)&amp;lt;/math&amp;gt;) has a slightly shorter wavelength than that of the verit velocity algorithm, and therefore the difference will get larger with each period of the wave. This is shown by the error getting larger in &#039;&#039;figure 3. &#039;&#039;The period of the plot of the two methods are different because the verit algorithm is much more approximate so does not give the correct solution.&lt;br /&gt;
|The change in the error/difference between the harmonic spring data and verit algorthm data increases linearly and so therefore period of each of the plots in &#039;&#039;figure 1&#039;&#039;. must be constant. &lt;br /&gt;
|}&lt;br /&gt;
The error can also be quantified on a &#039;&#039;phase space&#039;&#039; plot; phase space is momentum or velocity plotted as a function of position. The true solution for motion of an atom is a perfect ellipse, and the more elliptic the shape (less circular) the more momentum or velocity is in the system. A numerical solution, like the verit algorithms, will produce a set of points very close to this ellipse but not perfectly following the curve. A good numerical solution will remain in an elliptical shape, whereas a bad numerical solution, for example one with a large timestep, will spiral away from the true solution. Two examples of such systems using the data from &#039;&#039;figures a-d&#039;&#039; are shown below.  &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure 5. &#039;&#039;Phase plot of the harmonic spring data with a good numerical solution (timestep = 0.1) &lt;br /&gt;
!&#039;&#039;Figure 6. &#039;&#039;Phase plot of the harmonic spring data with a bad numerical solution (timestep = 0.3) &lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory phasegood.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory badphase.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The timestep at which this data is plotted is 0.1, which results in a very small change in the energy, as seen in &#039;&#039;figure b. &#039;&#039;Increasing the time step will increase the variation in the energy. To keep the variation in the total energy of the system under 1%, the time step must be no larger than approximately 0.28. The energy varies more with increasing time step because the jumps in the algorithm  are getting larger due to less data points. The algorithm assumes these points are joined by a straight line and that the halfway point in the jump is the average between the starting and finishing point of the jump. The phase space plot will become less elliptic and the jumps eventually become so large that the plot is no longer a continuous shape.  &lt;br /&gt;
&lt;br /&gt;
It is essential to monitor the energy of a numerically modeled system because a good solution for the motion of an atom has a constant energy and a plot in phase space of a perfect ellipse.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance and Force at Zero Potential===&lt;br /&gt;
From classical mechanics, the force calculated from the Newtonian mechanics above can be used to calculate the potential experienced by an atom in the system. They are related by the equation: &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;
This potential gives the shape and dimension of the potential surface on which the system can be modeled. In this experiment, a simple 1D potential is used to describe the inter atomic forces of a liquid; the Lennard-Jones potential. It has the characteristic features of a short range repulsion potential and harmonic character around the equilibrium bond distance or interatomic separation. The value of &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the inter atomic separation when the potential, &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;, is equal to zero, can be calculated by equating the equation for the Lennard-Jones potential to zero and solving for &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The equation for the Lennard-Jones potential: &amp;lt;math&amp;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;
Equating this to zero: &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;
And rearranging in order to separate the variables: &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;
Rearranging this gives &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in terms of &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt; r^6 = \sigma^6&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r = r_0&amp;lt;/math&amp;gt; in this case.&lt;br /&gt;
&lt;br /&gt;
This, therefore, gives the result that interatomic distance at zero potential, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, is equal to &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; in the Lennard-Jones potential is effectively the diameter of one of the particles in the system being measured; in this case, the solid, liquid or gas we are simulating. This is the point where the potential curve crosses the x-axis on an Energy vs interatomic distance plot. The force, &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt;, at this point on the curve corresponds to the gradient; it is found by calculating the derivative of the curve at this point. &lt;br /&gt;
&lt;br /&gt;
To calculate the force, we must differentiate the equation for the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;U\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As force is equal to the negative differential of the potential energy, the value of the force is: &amp;lt;math&amp;gt;\mathbf{F}_i = 48\epsilon \sigma^{12} r^{-13} - 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting in the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at zero potential from the calculation before: &amp;lt;math&amp;gt;\mathbf{F}_i = \frac{48\epsilon}{\sigma} - \frac{24\epsilon}{\sigma} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The gradient where the Lennard-Jones plot crosses the axis is negative; &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; in the term obtained for &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is negative and therefore the overall value of the force will be negative.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance, Force and Well Depth of the Potential at Equilibrium===&lt;br /&gt;
To calculate the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at the equilibrium position, we need to use the derivative of the potential energy curve. The equilibrium value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is the value at the minimum of the Lennard-Jones curve; when &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Therefore, equating the derivative to zero gives: &amp;lt;math&amp;gt;0 = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rearranging this: &amp;lt;math&amp;gt;48\epsilon \sigma^{12} r^{-13} = 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And simplifying and cancelling gives: &amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6&amp;lt;/math&amp;gt;. Therefore the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at equilibrium is: &amp;lt;math&amp;gt;r_{eq} = \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Physically, this result means that the equilibrium distance is 1.12 times the diameter of one of the particles; the particles have a small gap between them so do not touch. A short range repulsion potential, as seen in the Lennard-Jones curve, is a result of the particles coming into contact. &lt;br /&gt;
&lt;br /&gt;
Again, the force can be calculated from the derivative of the potential curve at the equilibrium point. As the derivative at this point is zero (a minimum on the curve), the force will therefore also be zero.&lt;br /&gt;
&lt;br /&gt;
The well-depth of the potential curve is the difference between zero potential and the potential at the equilibrium bond length. This can be calculated by substituting the value for the equilibrium bond length into the equation for the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;U\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;U\left(r_{eq}\right) = 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;
Cancelling and simplifying this equation gives: &amp;lt;math&amp;gt;U\left(r_{eq}\right) = 4\epsilon \times \frac{1}{4}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the absolute value for the well depth is &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;. The actual value of this potential is &amp;lt;math&amp;gt;-\epsilon&amp;lt;/math&amp;gt;, as the equilibrium bond length gives the most stable configuration of the molecules and therefore suggests attractive interactions are involved in the arrangement of the molecules; this attractive potential is negative. &lt;br /&gt;
&lt;br /&gt;
===Boundary Conditions and the Lennard-Jones Cutoff===&lt;br /&gt;
When simulating a liquid, it is computationally impractical to simulate a realistic liquid. Therefore a smaller &#039;box&#039; containing &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; particles is simulated and the computer program will use &#039;&#039;periodic boundary conditions&#039;&#039; to simulate infinite repetitions of this box. For example, when the atom reaches one edge of the box, applying periodic boundary conditions, it will reappear again at the opposite edge of the box as if they were connected. Applying this logic: an atom at the position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a box of size &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;. Without periodic boundary conditions, we would assume that the atom would end up at the position &amp;lt;math&amp;gt;(1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;. However, in this box, there is no such position and so the particle must reappear at the opposite edge to where it effectively &#039;left&#039; the box. Therefore, it&#039;s ending position will be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The number of particles, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; simulated by the computer is usually between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt;. Physically, this is a very small volume. Considering water, we can calculate the number of molecules in 1 mL or 1 cm^3, a volume which would be considered small in the lab. Taking the concentration of water at standard conditions, &amp;lt;math&amp;gt;55\ mol\ dm^{-3}&amp;lt;/math&amp;gt;, we can convert it to the number of moles per mL: &amp;lt;math&amp;gt;0.055\ mol\ mL^{-1}&amp;lt;/math&amp;gt;. Multiplying this value by Avagadro&#039;s constant (&amp;lt;math&amp;gt;N_A&amp;lt;/math&amp;gt;) gives the number of molcules of water per mL: &amp;lt;math&amp;gt;3.02 \times 10^{22} mL^{-1}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The reverse procedure can be used to compare this to the volume of 10,000 molecules: 10,000 divided by Avagadro&#039;s constant gives the number of moles of water which 10,000 molecules makes up: &amp;lt;math&amp;gt;1.66 \times 10^{-20}\ moles&amp;lt;/math&amp;gt;. Dividing this value by the concentration (from &amp;lt;math&amp;gt;n=cV&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is the number of moles, &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; is the concentration and &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume), gives the volume: &amp;lt;math&amp;gt;3.02 \times 10^{-22}\ dm&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;3.02 \times 10^{-19}\ mL&amp;lt;/math&amp;gt;. Physically, of course, this is far too small a volume to be recorded in the lab.&lt;br /&gt;
 &lt;br /&gt;
Periodic boundary conditions simulate an infinite lattice and therefore, when computing the potential, will calculate an infinite amount of pair interactions. Therefore, it is only practical to calculate the energies up to a certain interatomic distance; the Lennard-Jones cutoff distance. Beyond this point, the potential energy and the integral of the curve beyond this point become insignificant and do not impact on the overall energy; removing interactions beyond this point from the calculations will not effect the accuracy. Multiplying the Lennard-Jones potential with the radial distribution function gives a plot of the probability of finding an atom at a particular interatomic distance. The larger the interatomic distance, the lower the probability and so the energy after the cutoff can be disregarded. The radial distirbution function is dicussed in a later section.&lt;br /&gt;
&lt;br /&gt;
Integrating over the Lennard-Jones curve and applying this cutoff as the lower limit can show how small the integral is:&lt;br /&gt;
&lt;br /&gt;
For a general cutoff of with value &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;I = \int_{x}^\infty U\left(r\right)\mathrm{d}r = \int_{x}^\infty \frac{4\epsilon\sigma^{12}}{r^{12}}\mathrm{d}r - \int_{x}^\infty \frac{4\epsilon\sigma^6}{r^6}\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving this: &amp;lt;math&amp;gt;I = 4\epsilon\sigma^{12} {\frac{-1}{11r^{11}}\,\Bigg\vert\,}_x^\infty - 4\epsilon\sigma^{6} {\frac{-1}{5r^{5}}\,\Bigg\vert\,}_x^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This gives the general solution: &amp;lt;math&amp;gt;I = \frac{4\epsilon\sigma^{12}}{11x^{11}} - \frac{4\epsilon\sigma^{6}}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating this for &amp;lt;math&amp;gt;\epsilon = \sigma = 1&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;I = \frac{4}{11x^{11}} - \frac{4}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt; (or 2 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.025&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt; (or 2.5 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0082&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt; (or 3 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0033&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All values are taken to 2 significant figures. As the cutoff value for the interatomic distance gets larger, the integral gets smaller, and therefore the energy excluded from the calculation becomes smaller, and the second term in the solved integral, &amp;lt;math&amp;gt;I&amp;lt;/math&amp;gt;, dominates the energy value.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
When using the Lennard-Jones potential, it is appropriate to use reduced units for intermolecular distance, energy and temperature, which makes the maths and axes of plots much easier to understand. Reduced units can be calculated by the following relationships:&lt;br /&gt;
&lt;br /&gt;
Intermolecular 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;
&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; are scaling factors. For example, if the parameters for Argon are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\sigma = 0.34 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt; \epsilon\ /\ k_B = 120 K&amp;lt;/math&amp;gt;&lt;br /&gt;
* Lennard-Jones cutoff &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;. The well-depth, &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;, is &amp;lt;math&amp;gt;0.999 kJ mol^{-1} \approx 1 kJ mol^{-1}&amp;lt;/math&amp;gt;. The value of &amp;lt;math&amp;gt;T* = 1.5&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;180 K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The reduced units in this experiment has &amp;lt;math&amp;gt;k_B=1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All simulation computations are run using the computer program LAMMPS.&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
The first aim of the experiment is to determine the most appropriate timestep, &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;, to use in the verit algorithm simulations. This timestep is a balance between the accuracy of the results (the smaller the timestep, the closer to the true function the result will be) and the length of real time over which the simulation is run (the smaller the timestep, the less real time over which the simulation will give a result). The appropriateness of the timestep will be determined by plotting the total free energy of the simulated lattice as a function of time, and seeing how it equilibrates.  &lt;br /&gt;
&lt;br /&gt;
Five different calculations, which simulated the melting of a crystal and subsequent equilibration of the energy of the melted crystal, were run at five different timesteps; 0.001, 0.0025, 0.0075, 0.01 and 0.015. They were described by the NVE or &#039;&#039;&amp;quot;microcanonical ensemble&amp;quot;&#039;&#039;. An ensemble is a collection of samples of a system which are under three thermodynamic constraints (three properties are kept constant); in the microcanonical ensemble, the number of particles, the volume and the total energy is kept constant (NVE). &lt;br /&gt;
&lt;br /&gt;
These calculations simulate a box of 1000 unit cells and use periodic boundary conditions to replicate the simulation to a larger scale. Because these simulations use the numerical methods defined in the previous section, the initial position and velocity of the atoms must be defined in the input file. The Brownian (uncorrelated, random) motion of the atoms in the simulation means that there is no long range order in the system and so the atoms in a real system would start in random positions. However, assigning random starting coordinates to the atoms in a simulated liquid is not a relative process; the coordinates are generate independently of each other. Therefore there is a probability that the coordinates simulated will cause the atoms to overlap, which would give a very large repulsion potential, as seen in the Lennard-Jones potential at very small interatomic distances. This short-range repulsion potential comes from the hard-sphere atomic repulsion model.&lt;br /&gt;
&lt;br /&gt;
The input file also defines the structure and density of the lattice. The number density of lattice points in any lattice is the number of lattice points per volume of the unit cell. In a simple cubic lattice, there is one lattice point in the unit cell. From an sc lattice with a lattice spacing (length of one side of the unit cell) of &amp;lt;math&amp;gt;1.07722&amp;lt;/math&amp;gt;, the number density of the lattice points is calculated by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{1}{1.07722^3} = 0.7999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a face-centered cubic lattice (fcc), there are four lattice points in the unit cell. Rearranging the above relationship, the lattice spacing can be calculated from the number of lattice points in a unit cell and number density, &amp;lt;math&amp;gt;1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Lattice\ spacing = \sqrt[3]{\frac{number\ of\ lattice\ points\ per\ unit\ cell}{number\ density}} = \sqrt[3]{\frac{4}{1.2}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation creates a 3D box which includes 1000 unit cells; 10 unit cells in each dimension. For a simple cubic lattice, because there is one lattice point per unit cell, there will be 1000 atoms created as seen in the input file. The &#039;&#039;create_atom&#039;&#039; command in the input file determines how many boxes are created in the simulation and therefore how determines many atoms will be created. If a face centered cubic lattice is simulated, as there are 4 lattice points per unit cell, 4000 atoms will be created by the &#039;&#039;create_atom&#039;&#039; command. &lt;br /&gt;
&lt;br /&gt;
The input script also contains the following commands which defines the potential surface which is used to model the intermolecular reactions:&lt;br /&gt;
 mass 1 1.0&lt;br /&gt;
This instruction sets the mass type for the atoms being simulated. It takes the general form of “mass I value”, where &#039;&#039;mass&#039;&#039; is the keyword which tells LAMMPS what the input is, &#039;&#039;I&#039;&#039; is the atom type and &#039;&#039;value&#039;&#039; is the mass of the atom. In this case, I is defined by a specific numerical value; 1 as there is only 1 type of atom in the simulation, but it could be defined with an asterisk (1*), which means “all atom types of 1 to n inclusive” if there are &#039;&#039;n&#039;&#039; types of atoms in the simulation. &lt;br /&gt;
 pair_style lj/cut 3.0&lt;br /&gt;
This instruction sets the type of potential which LAMMPS uses in its calculation of pairwise interactions. It takes the general form of “pair_style style args”, where &#039;&#039;pair_style&#039;&#039; is the keyword for LAMMPS, &#039;&#039;style&#039;&#039; defines the potential and any specifications it may have, and &#039;&#039;args&#039;&#039; are the arguments required for this particular potential. In this case, the Lennard-Jones potential has been used (lj) with a cutoff point (cut) of 3σ. The cutoff point is explained in the introduction section. &lt;br /&gt;
 pair_coeff * * 1.0 1.0&lt;br /&gt;
This instruction specifies the coefficients for the pairwise interactions of each pair of atoms, and it takes the general form “pair_coeff I J args”. &#039;&#039;Pair_coeff&#039;&#039; is the keyword, &#039;&#039;I&#039;&#039; and &#039;&#039;J&#039;&#039; are the atom types, and &#039;&#039;args&#039;&#039; are the coefficients which the different atoms types take. In this case, the asterisk in place of I and J refers to all atoms types from 1 to n. The coefficients are the pairwise interactions are 1 for each atom, meaning each atom has an equal contribution to the interaction.&lt;br /&gt;
&lt;br /&gt;
In these initial calculations, the initial conditions for the numerical methods, &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. For this experiment, the verit-velocity algorithm would be the most appropriate, as both the starting position and velocity is specified for this algorithm. &lt;br /&gt;
&lt;br /&gt;
To define the timestep for the algorithm the following code is used defining the timestep as a variable instead of just giving it a definite value&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;
It is much easier to use the variable version of defining the timestep because the length of time over which the simulation is run depends on the time step. By using a variable, the length of the simulation is kept the same, no matter the size of the timestep. It also makes it easier if multiple properties depend on the timestep – only the variable needs to be changed, not all the parts of the script where timestep is defined. &lt;br /&gt;
&lt;br /&gt;
The calculations produce the values for the total energy of the system, temperature and pressure in the output files, which can be plotted against time. How well these values equilibrate determines the appropriateness of the timestep to use in further calculations in the experiment.  &lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!style=&amp;quot;width: 33%;&amp;quot;|&#039;&#039;Figure 7. &#039;&#039;Plot of the equilibration of total energy for five different timesteps&lt;br /&gt;
!style=&amp;quot;width: 33%;&amp;quot;|&#039;&#039;Figure 8. &#039;&#039; Plot of the temperature vs time equilibration for timestep = 0.0025&lt;br /&gt;
!style=&amp;quot;width: 33%;&amp;quot;|&#039;&#039;Figure 9. &#039;&#039; Plot of the pressure vs time equilibration for timestep = 0.0025 &lt;br /&gt;
|- &lt;br /&gt;
|[[File:rmt_totalenergycurve.png|600x600px]]&lt;br /&gt;
|[[File:rmt_tempvstime0025.png|600x600px]]&lt;br /&gt;
|[[File:rmt_pressurevstime0025.png|600x600px]]&lt;br /&gt;
|}&lt;br /&gt;
The largest time step to give an acceptable result is 0.01. However, for any simluation we would expect energy to be independent of the timestep, something which is not true at a timestep greater than 0.0025. Therefore, the most appropriate timestep to use for a balance between accuracy and length of time which the simulation covers is 0.0025. &lt;br /&gt;
&lt;br /&gt;
0.015 is a particularly bad choice of timestep. This is because the verit-velocity algorithm gives only an approximate result to the velocity (kinetic energy term) and position (potential energy term), and so when the timestep becomes too large with respect to the time, the algorithm no longer becomes a suitable way to calculate the energy. As seen in the graph of 0.015, the energy does not equilibrate and diverges.&lt;br /&gt;
&lt;br /&gt;
The plots for temperature and pressure vs time give a good indication of an appropriate pressure and temperature to use for running the simulations under specific conditions in the next section .&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions ==&lt;br /&gt;
The calculations in this section are run in the isobaric-isothermal ensemble, where the number of particles in the system, the pressure and the temperature are kept constant (NpT). This means that the temperature and the pressure are recalculated in every step, so are no longer constant like they were in the NVE ensemble. From the &#039;&#039;equipartition theorem&#039;&#039;, each degree of freedom will contribute &amp;lt;math&amp;gt;\frac{1}{2} k_B T&amp;lt;/math&amp;gt; of energy to the system. As the system is in three dimensions, there are three degrees of translational freedom and so the total internal energy is equal to &amp;lt;math&amp;gt;\frac{3}{2} k_B T&amp;lt;/math&amp;gt;. Equating this to the kinetic energy, &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt;, at the end of every step and rearranging will allow calculation of the temperature after every step. &lt;br /&gt;
&lt;br /&gt;
A target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, is defined in the input script. The system will equilibrate by multiplying the velocity by a factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, in order to accommodate for fluctuations in the overall velocity. This keeps the system at approximately the target temperature and therefore a constant internal energy. If the temperature of the system is greater than the target temperature, the system&#039;s kinetic energy is too high, so &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is reduced to compensate for this. The same is true for is the temperature is lower than the target temperature; &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than one in the next step to increase the kinetic energy which is now too low. The principle is the same for controlling the pressure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; can be derived from equating the kinetic and internal energy of the system at an arbitrary time step:&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;
Expanding the brackets inside the sum and moving the term containing &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; out of the sum: &amp;lt;math&amp;gt;\frac{\gamma^2}{2}\sum_i m_i \left(v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;, we can replace &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt; on the left hand side of the equation with &amp;lt;math&amp;gt;\frac{3}{2} N k_B T&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;\frac{3\gamma^2}{2}N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Simplifying and rearranging for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, gives: &amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As temperature and pressure are no longer constant, the input files require specification of the pressure and the temperature for each of the systems which are simulated. 10 simulations were run at two different pressures with five different temperatures at each pressure. &lt;br /&gt;
* Temperatures: 1.6, 1.9, 2.2, 2.5, 2.8&lt;br /&gt;
* Pressures: 2.5, 3.0&lt;br /&gt;
These pressures were chosen because the data simulated when choosing an appropriate timestep gave a pressure between 2.5 and 3.0 (&#039;&#039;figures 8 and 9&#039;&#039;).  &lt;br /&gt;
&lt;br /&gt;
For the code which computes the thermodynamic potentials, this particular line defines how many steps contribute towards the average of the thermodynamic parameters computed in the calculation: &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;
&#039;&#039;fix&#039;&#039; is the keyword, &#039;&#039;aves&#039;&#039; is the name of the group of fixes which in this case is the average of the thermodynamic values, &#039;&#039;all&#039;&#039; specifies the atoms which the fix is applied to which in this case is all the atoms in the simulated system and &#039;&#039;ave/time&#039;&#039; means that compute global time averages are calculated. The following three numbers have the following meaning:&lt;br /&gt;
&lt;br /&gt;
*100 = use the input values every 100 timesteps&lt;br /&gt;
*1000 = use input values 1000 times for calculating the average&lt;br /&gt;
*100000 = calculate the average every 100000 timesteps&lt;br /&gt;
&lt;br /&gt;
Therefore for the total calculation, which lasts for 100,000 steps, the average will only be calculated once. Assuming 1 value is calculated every timestep, there will be 100,000/100 = 1000 values. &lt;br /&gt;
&lt;br /&gt;
The density data from all ten calculation was plotted on the same graph, along with the density for an &amp;quot;ideal&amp;quot; gas. This density can be derived from the ideal gas law:&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;
Rearranging in terms of density: &amp;lt;math&amp;gt;\frac{N}{V} = \frac{P}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As these simulations are being run under reduced units, we can take &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt;, and so the density of the ideal gas becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the density of the ideal gas is plotted as the pressure divided by the temperature in pressure-temperature phase space.&lt;br /&gt;
[[File:Rmt dvt plot.png|none|thumb|800x800px|&#039;&#039;Figure 10. &#039;&#039;Plot of the variation in density with temperature at a defined pressure for the numerically simulated and ideal systems]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that calculated in the ideal gas law. This is because for an ideal gas, an assumption is made that there are no intermolecular interactions, and therefore forces such as electron repulsion forces are ignored; repulsion forces dominate over attractive ones, as all the atoms in this simulation are the same and so partial charges or dipoles are created. This will mean that the particles move closer together than a real gas and so the density will be larger. This discrepancy between the ideal and non-ideal systems becomes larger at a higher pressure because with a higher pressure, the atoms in the system are closer together and therefore the intermolecular repulsion will become larger. This greater repulsion will in turn have a larger effect on decreasing the density.&lt;br /&gt;
&lt;br /&gt;
== Statistical Physics Calculations of the Heat Capacity ==&lt;br /&gt;
The heat capacity of a system at constant volume can be calculated from the variance in the total energy of the system. The relationship used to calculate the heat capacity is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = 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;\left\langle E^2\right\rangle&amp;lt;/math&amp;gt; is the continuous average of the total square energy at each temperature as a function of temperature. &amp;lt;math&amp;gt;\left\langle E\right\rangle^2&amp;lt;/math&amp;gt; is the continuous average of the total energy at each temperature as a function of temperature squared. The heat capacity is multiplied by &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; in this case because the version of LAMMPS calculates every energy divided by the number of molecules in the system simulated.&lt;br /&gt;
&lt;br /&gt;
The calculations in this sections are run in density-temperature phase space and the ensemble has changed to the canonical ensemble (NVT). A set of input files were written for ten calculations for, like the previous section, two pressures and five different temperatures at each pressure:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 0.2, 0.8&lt;br /&gt;
*Temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{C_V}{V}&amp;lt;/math&amp;gt; was plotted against temperature to determine the relationship in density-temperature phase space. An example of an input file can be found [[Media:nvt_-_0220.in|here]]. The lines which have been changed from the previous input files are at the end of the script:&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 &lt;br /&gt;
 thermo_style custom step etotal temp&lt;br /&gt;
 variable energy equal etotal&lt;br /&gt;
 variable energy2 equal etotal*etotal&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_energy v_energy2 v_temp&lt;br /&gt;
 run 100000&lt;br /&gt;
 &lt;br /&gt;
 variable aveenergy equal f_aves[1]&lt;br /&gt;
 variable aveenergy2 equal f_aves[2]&lt;br /&gt;
 variable avetemp equal f_aves[3]&lt;br /&gt;
 variable heatcapacitydv equal atoms*atoms*(v_aveenergy2-v_aveenergy*v_aveenergy)/(v_avetemp*v_avetemp*vol)&lt;br /&gt;
 &lt;br /&gt;
 print &amp;quot;Averages&amp;quot;&lt;br /&gt;
 print &amp;quot;--------&amp;quot;&lt;br /&gt;
 print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Heat Capacity per Volume: ${heatcapacitydv}&amp;quot;&lt;br /&gt;
The line with the keyword &#039;fix&#039; determines which thermodynamic values are averaged and over how many steps they are averaged. The next section takes these averages as variables and uses them to define the heat capacity which is calculated from the equation at the beginning of this section. Only the energy and temperature are needed to define the heat capacity and so only these values are calculated by the simulation. [[File:Rmt heatcapacitybyv.png|none|thumb|800x800px|&#039;&#039;Figure 11. &#039;&#039;C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V against temperature for the two different pressures 0.2 and 0.8]]As seen in &#039;&#039;figure 11.&#039;&#039;, the heat capacity decreases with temperature for both pressures. It would be expected for an ideal system that as the temperature increases, the heat capacity at constant volume increases and tends to a constant value at very high T of &amp;lt;amth&amp;gt;3R&amp;lt;/math&amp;gt;; &amp;lt;math&amp;gt;R&amp;lt;/math&amp;gt; = the universal gas constant. This means increasing the temperature increases the amount of energy being stored in the system and this energy is stored as vibrational energy. However, for a Lennard-Jones liquid, the system being simulated here, the heat capacity decreases with temperature. This is because there are two components to the simulation; the atoms are vibrating in a quasi-harmonic fashion around the equilibrium position and also, they diffuse between neighbouring equilibrium positions in a gas like fashion. As the temperature increases, the amount of diffusion increases and the amount of vibrations decrease, therefore decreasing the ability of the system to take in heat as vibrational energy, resulting in the decrease in heat capacity. &amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www.nature.com/ncomms/2013/130816/ncomms3331/full/ncomms3331.html?message-global=remove&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural Properties and the Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a single atom in a system is a plot of the probability that an atom can be found at a certain distance from the central atom. The peaks in this plot gives the distance of an atom from its nearest neighbours in the Lennard-Jones simulated system. &lt;br /&gt;
&lt;br /&gt;
The calculations in this section simulate a Lennard-Jones solid, liquid and gas and, using the output of the LAMMPS trajectory file, plots both the radial distribution function and its integral using DLV. The temperature and pressure parameters for these calculations were taken from the phase diagram or coexistence curve for a Lennard-Jones system.&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt; The parameters used are displayed in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! Temperature, &amp;lt;math&amp;gt;T^*&amp;lt;/math&amp;gt;&lt;br /&gt;
! Pressure, &amp;lt;math&amp;gt;p^*&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| LJ Solid&lt;br /&gt;
| 1.5&lt;br /&gt;
| 1.2&lt;br /&gt;
|-&lt;br /&gt;
| LJ Liquid&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.8&lt;br /&gt;
|-&lt;br /&gt;
| LJ Gas&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.01&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The data obtained from the plots and the radial distribution functions and their integrals were plotted and shown in the table below.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure 12. &#039;&#039;The radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
!&#039;&#039;Figure 13. &#039;&#039;The integrals of the radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt fullrdfs.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt allintegralsrdf.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
[[File:Rmt Nearest neighbours.png|left|thumb|300x300px|&#039;&#039;Figure 14. &#039;&#039;Representation of a cross section of the first three shells of nearest neighbours in an fcc solid. The black atom is the central atom being considered, the blue atoms are the first shell, the orange atoms the second shell and the purple atoms are the third.]]&lt;br /&gt;
The RDF of the solid gives a very irregular curve because of the irregular structure of the lattice. For a simple cubic lattice, a regular structure of the RDF would be expected because of the equal number of atoms in each of the nearest neighbour shells. However, for face-centered cubic lattice, the solid in this simulation, the structure is much more irregular and as the atoms move from their equilibrium position in the lattice due to vibrations, the peaks in the radial distribution will broaden. The irregular heights of the peaks are due to the varying numbers of atoms in each of the nearest neighbour shells for the central atom. The first shell gives the highest peak as it contains the most atoms multiplied by the strongest interaction potential; in total, considering all four surrounding unit cells, this shell contains 12 atoms and ideally takes the geometry of an icosahedron. The second shell is smaller and contains only 6 atoms in an octahedral coordination shape. The following shell again contributes 12 atoms, 3 from each unit cell. This therefore explains why the heights of the peaks in the solid plot in &#039;&#039;figure 12.&#039;&#039; vary. These values can be confirmed by the plot in &#039;&#039;figure 15.&#039;&#039; which is the integral; it cumulatively adds the numbers in each shell. The size of the first &amp;quot;step&amp;quot; is 12; there are 12 atoms in the first shell. The size of the second step is approximately 18; there are 18-12=6 steps in the second shell. The same theory applies for the third shell which gives a value of 13. This is slightly different to the predicted value possibly due to error in the calculation of the radial distribution function and therefore its integral. &lt;br /&gt;
&lt;br /&gt;
The RDF of the liquid has a representation of far fewer shells, which means that there are less atoms in the space close to a &amp;quot;central&amp;quot; atom in the bulk solution. The particles have more energy and therefore do not keep to a regular lattice structure. As they move about, some regularity is maintained around each atom, but only to the extend of two or three shells, meaning there is no long range order in a Lennard-Jones liquid. &lt;br /&gt;
&lt;br /&gt;
The RDF of the gas again omits more shells as there is almost no order in a Lennard-Jones gas. The single peak on this plot considers only the set of atoms closest to the central atom and all others are disregarded as they are too far apart. &lt;br /&gt;
&lt;br /&gt;
Considering &#039;&#039;figure 13.&#039;&#039;, the size of the integral of the radial distribution function decreases from solid to liquid to gas. This makes sense as the number of atoms in the surrounding shells decreases with density of the system; the atoms become further apart. &lt;br /&gt;
&lt;br /&gt;
From the plot of the radial distribution function of the solid, the lattice spacing can be determined. For this, we can consider just the first three peaks of the RDF plot. The lattice spacing refers to the length of one unit cell, and so, using &#039;&#039;figure m&#039;&#039;, we can calculate this using two different methods; a) we can use the distance between the central atom and the first shell of nearest neighbours, and use trigonometry to calculate the lattice spacing. Or alternatively b) we can use the distance between the central atom and the second nearest neighbour shell to get the lattice spacing.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure 14. &#039;&#039;The radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
!&#039;&#039;Figure 15. &#039;&#039;The integral of the radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt solidgr3.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt solidint3.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
Using method a) (with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; as the distance between the central atom and the nearest neighbour: Lattice spacing = &amp;lt;math&amp;gt;\frac{r}{cos({\frac{\pi}{4}})} = \frac{1.02}{cos({\frac{\pi}{4}})} \approx 1.44&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using method b): Lattice spacing &amp;lt;math&amp;gt;\approx 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can take an average between the two get an approximate value for the lattice spacing &amp;lt;math&amp;gt;\approx\ 1.46&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These values for distance are all in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
The ability of atoms to move around in a solid liquid or gas can be characterised by the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. In this section, we will explore two different ways to calculate the diffusion coefficient and compare the results. &lt;br /&gt;
&lt;br /&gt;
=== The Mean Squared Displacement ===&lt;br /&gt;
The diffusion coefficient can be measured easily be calculating the mean squared displacement of atoms in the solution; the diffusion coefficient is proportional to the first derivative of the mean squared displacement. By plotting the mean squared displacement as a function of time, the gradient can be taken to calculate the diffusion coefficient when its has equilibrated and become linear.&lt;br /&gt;
&lt;br /&gt;
The temperature and density parameters used were the same as in the previous section:&lt;br /&gt;
* Solid: T=1.5, D=1.2&lt;br /&gt;
* Liquid: T=1.1, D=0.8&lt;br /&gt;
* Gas: T=1.1, D=0.01&lt;br /&gt;
&lt;br /&gt;
Mean density squared calculations for 8,000 atoms were run for all three Lennard-Jones phases and the data plotted as function of timestep below. The data from a simulation containing 1,000,000 atoms was plotted for comparision.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!Plots for the 8,000 atom data (&#039;&#039;figures p-r)&#039;&#039;&lt;br /&gt;
!Plots for the 1,000,000 atom data (&#039;&#039;figures s-u)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|[[File:Rmt_MSDsolid.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt_MAsolid.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|[[File:Rmt MSDliquid.png|700x700px]]&lt;br /&gt;
|[[File:Rmt MAliquid.png|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|[[File:Rmt MSDgas.png|700x700px]]&lt;br /&gt;
|[[File:Rmt dataplots 25894 image001.png|700x700px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The exact relationship between the mean squared displacement and the diffusion coefficient is:&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;
Taking the gradients of each of the curves at the point at which they become linear and dividing by six will give the diffusion coefficient for each set of data. The gradient also needs to be converted to a function of time; this is done by dividing by the timestep, which in this case is 0.002:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom data diffusion coefficients, &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
!1,000,000 atom data diffusion coefficients &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 0.9999&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|Gradient = 0.0972&lt;br /&gt;
Amount of data used to calculate gradient: timestep 4300-5000, &amp;lt;math&amp;gt;R^2 = 0.9998&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{48.6}{6} = \mathbf{8.1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient = 0.0386&lt;br /&gt;
Amount of data used to calculate gradient: timestep 4000-5000, &amp;lt;math&amp;gt;R^2 = 0.1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{19.6}{6} = \mathbf{3.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For both of the solid approximations, the diffusion coefficient can be approximated as zero. This is because, when equilibrated, the function has a constant value of around 0.2 for the mean squared displacement. A gradient with a value of zero means that the atoms take an infinite amount of time to change their mean squared displacement or move away from their equilibrium position, and so this means that we can approximate in this system, there will be no diffusion. In real system, however, this is not the case; diffusion occurs but it is very slow. A plot for a real system will give a very shallow positive gradient.&lt;br /&gt;
&lt;br /&gt;
The liquid approximations are very well correlated. This is because in both cases, the mean squared displacement of particles in a liquid increases linearly with time and the gradient of both plots are almost identical. We can assume from this that identical starting conditions for temperature and pressure were used to calculate this data. Also, we can estimate that 8,000 atoms is a large enough simulation to give an accurate result for the diffusion coefficient for the Lennard-Jones liquid.&lt;br /&gt;
&lt;br /&gt;
The gas approximations are very different. This is most probably due to the fact that the density specified in each of the calculations is different. The 8,000 data can be estimated to be a much lower density because the diffusion coefficient is faster and this means diffusion will happen faster; at a higher density a particle will take longer to diffuse over a given distance. Because of the difference in density, the two values of the diffusion coefficient cannot be qualitatively compared. The reason for the initial deviation for linearity in the gas plots is due to the momentum of the particles initially dominating over the diffusion and the diffusion coefficient is dependent on time. As the system equilibrates, the diffusion coefficient becomes constant and the plots become linear.&lt;br /&gt;
&lt;br /&gt;
=== The Velocity Autocorrelation Function ===&lt;br /&gt;
&lt;br /&gt;
Another way to calculate the diffusion coefficient is by using the velocity correlation function, which determines how the velocity of an atom changes with time. The function determines the time when the velocity becomes uncorrelated (&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;), i.e. the difference between the velocity at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; and at time &amp;lt;math&amp;gt;t+\tau&amp;lt;/math&amp;gt;. By integrating over this function, we can find the diffusion coefficient. &lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function: &amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can also be written as the integral: &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;
Using the function which defines the position of a classical harmonic oscillator, we can differentiate this to give the equation for the velocity which we can plug into the integral:&lt;br /&gt;
&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;
&amp;lt;math&amp;gt;dv{x(t)}{t} = v(t) = -A\omega sin(\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also needed for the integral:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t+\tau) = -A\omega sin(\omega(t+\tau)+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v^2(t) = A^2\omega^2 sin^2(\omega t +\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Putting all this into the integral to find the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega sin(\omega t + \phi) \times A\omega sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} A^2\omega^2 sin^2(\omega t +\tau)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A^2\omega^2&amp;lt;/math&amp;gt; can be take out of each of the integrals and cancelled. A substituion can then be made to make solving the integral much simpler:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = \omega t + \phi&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \omega\tau&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the integral becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a) \times sin(a+b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the compound angle rule &amp;lt;math&amp;gt;sin(a+b)=sin(a)cos(b)+cos(a)sin(b)&amp;lt;/math&amp;gt;, the integral can be simplified to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a)sin(a)cos(b) + sin(a)cos(a)sin(b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Separating out into two integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)\frac{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the rule &amp;lt;math&amp;gt;sin(a)cos(a) = \frac{1}{2}sin(2a)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} \frac{1}{2}(sin(2a))\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because the function &amp;lt;math&amp;gt;\frac{1}{2}sin(2a)&amp;lt;/math&amp;gt; is symmetric over all space, the second term in this equation becomes zero. Therefore, the integral simplifies to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b) = cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same calculations from the mean squared displacement section gave an output of the velocity autocorrelation function. The function for the Lennard-Jones solid, liquid and gas were plotted against the timestep along with the approximate function for the velocity autocorrelation function, &amp;lt;math&amp;gt;cos(\omega\tau)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\omega = \frac{1}{2\pi}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure v. &#039;&#039;Plots for the velocity autocorrelation function of a Lennard-Jones solid, liquid and gas; 8,000 atoms&lt;br /&gt;
!&#039;&#039;Figure w. &#039;&#039;Plots for the velocity autocorrelation function of a Lennard-Jones solid, liquid and gas, 1,000,000 atoms&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt VACF 5721 image001.png|800x800px|]]&lt;br /&gt;
|[[File:Rmt MAVACF.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plots for the velocity autocorrelation function show how the time correlation of velocity decreases with time due to collisions with other atoms in the system. The Lennard-Jones solid oscillates around the VACF=0 axis with the oscillations becoming progressively more damped with time. The long range of the oscillations is due to the order in the system. Every time the plot crosses the VACF=0 axis, the velocity of the atom changes direction which is due to a collision with another atom. Every collision for every atom is completely uncorrelated so the change in velocity of one atom as it collides is independent of another change in velocity of another colliding atom. Overall, momentum must be conserved and so overall change of velocity in the system must be conserved. &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones liquid oscillations are damped much quicker; an atom in the liquid only collides with one atom before the velocity becomes uncorrelated with respect to time. The Lennard-Jones gas never reaches the VACF=0 axis as the atoms are too far apart to collide. Because the velocity autocorrelation function never equilibrates, using this method to calculate the diffusion coefficient is inaccurate because the particles in the gas never come into contact with each other.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillating system is so different to the Lennard-Jones systems because the atoms remain in their equilibrium position and vibrate around the same position, never coming into contact with another atom. Because of this, the correlation with time never decreases so the function infinitely oscillates as a sine function.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated from: &amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty C\left(\tau\right)\mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the approximate value for the diffusion coefficient using the velocity autocorrelation function is &amp;lt;math&amp;gt;D = \frac{1}{3}cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The running integral of the velocity autocorrelation functions was plotted using the &#039;&#039;trapesium rule&#039;&#039;, and so the final value on the integral plot is proportional to the diffusion coefficient.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom VACF integral &#039;&#039;(figures w-z)&#039;&#039;&lt;br /&gt;
!1,000,000 VACF integral (&#039;&#039;figures aa-cc)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|[[File:Rmt mysi.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt masi.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|[[File:Rmt myli.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt mali.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|[[File:Rmt mygi.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt ligi.png|frameless|700x700px]]&lt;br /&gt;
|}&lt;br /&gt;
The diffusion coefficients for each of the plots above are tabulated below using the final data point from the integral plot. This is the integral over the whole graph using the trapesium rule. This must be corrected for the timestep; the value is multiplied by 0.002. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom data diffusion coefficients, &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
!1,000,000 atom data diffusion coefficients &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;-0.00055&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{-0.00055}{6} = -0.00018 \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.00014&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.00014}{6} = 0.000046 \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.242&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.242}{6} = \mathbf{0.0807}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.270&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.270}{6} = \mathbf{0.0901}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;25.6&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{25.6}{6} = \mathbf{8.55}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;9.81&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{9.81}{6} = \mathbf{3.27}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
The biggest source of error in these plots is that we assume both the 8,000 atom data and the 1,000,000 atom data take the same amount of time to converge. &#039;&#039;Figure z. &#039;&#039;shows that 5000 timesteps is not long enough for the velocity autocorrelation coefficient for 8,000 atoms to converge as far as 1,000,000 atom data does in this length of time. As the molecular dynamics simulations simulate random motion, this could induce fluctuations in the velocity autocorrelation plot which could increase or decrease the integral introduction another source of error.&lt;br /&gt;
&lt;br /&gt;
Again, the diffusion coefficient of the Lennard-Jones solid can be assumed to be zero for the same reason as the mean squared displacement data. The diffusion coefficient of the liquid is lower for both sets of data when calculated using the velocity autocorrelation function, and the diffusion coefficient is higher for both sets of data.&lt;br /&gt;
&lt;br /&gt;
== Summary ==&lt;br /&gt;
A simple Lennard-Jones liquid was simulated for different temperatures, pressures and densities at an optimised timestep of 0.0025. It was found that density of a system decreases with temperature due to particles increasing their kinetic energy and therefore the particles move further apart. The density of an ideal gas is much higher than that of the simulated Lennard-Jones potentials because of lack of repulsive interatomic forces.&lt;br /&gt;
&lt;br /&gt;
It was also found that heat capacity of a Lennard-Jones liquid decreases with increasing temperature, and heat capacity is lower at a lower density. This is due to diffusion dominating atomic vibrations as temperature increases and so ability of a system to absorb heat as vibrational energy decreases with temperature.&lt;br /&gt;
&lt;br /&gt;
It was also found that the radial distribution function and its integral can be plotted to calculate the lattice spacing of a Lennard-Jones solid and the amount of atoms in each nearest neighbour shell respectively. The lattice spacing was calculated as &amp;lt;math&amp;gt;\approx\ 1.46&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient for a Lennard-Jones solid, liquid and gas can be calculate using the mean squared displacement or the velocity autocorrelation function. The velocity autocorrelation function was found to be a less reliable method for the gas because the function does not converge in the amount of timesteps that were calculated. &lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=542827</id>
		<title>Rep:Mod:hakunamatata</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=542827"/>
		<updated>2016-02-25T17:04:51Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: /* Calculating the Interatomic Distance and Force at Zero Potential */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Introduction to Molecular Dynamics Simulations ==&lt;br /&gt;
===The Classical Particle Approximation and Numerical Integration===&lt;br /&gt;
The verit and verit-velocity algorithms are numerical methods to approximate the average position and velocity respectively of randomly moving particles in a particular medium (solid, liquid, fliud etc.). This position and velocity can be applied to Newtonian mechanics to calculate such properties as the force and potential energy of the system. The algorithms work by splitting the function into discrete time steps, calculating the values of position and velocity at this particular time step, and then effectively &amp;quot;joining the dots&amp;quot; to create an approximate function. These simulations always use the answer from the previous timestep to compute the new timestep, so initial conditions must be given for the first step. Both of the algorithms are shown below and are derived from the Taylor expansion of the position or velocity of the atoms at the timestep &amp;quot;n+1&amp;quot; or &amp;lt;math&amp;gt;t+\delta t&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit Algorithum:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{x}_i\left(t + \delta t\right) \approx 2\mathbf{x}_i\left(t\right) - \mathbf{x}_i\left(t - \delta t\right) + \frac{\mathbf{F}_i\left(t\right)}{m_i}\delta t^2  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit-Velocity Algorithum:&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i\left(t\right)&amp;lt;/math&amp;gt; is the force acting on a particular atom as a function of time&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i\left(t\right)&amp;lt;/math&amp;gt; is the acceleration of the atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The smaller the timestep, the closer the numerical approximation is to the true function, which can be modeled as a classical harmonic oscillator. &#039;&#039;Figure 1.&#039;&#039; in the table below shows the comparison between the two methods at plotting position of an atom as a function of time in &#039;&#039;time&#039;&#039; space. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure 1. &#039;&#039;Plots of position vs time comparing the verit algorithm and harmonic spring results&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure 2. &#039;&#039;Plot of the total classical energy of the system (potential + kinetic)&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory xanalytical.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory energy.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The harmonic spring position values are modeled from the harmonic oscillator or particle on a spring. The equation of &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; is used to calculate these values, where &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; are equal to 1 and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; is equal to zero. As seen on the plot, the curves produced from the two different methods of calculating the position are in good agreement.&lt;br /&gt;
|The potential energy is calculated using the equation &amp;lt;math&amp;gt;U = \frac{1}{2}kx^2&amp;lt;/math&amp;gt;, with a value of k given as 1. The kinetic energy is calculated using the velcity from the verit-velocity algorithm using the equation &amp;lt;math&amp;gt;T = \frac{1}{2} mv^2&amp;lt;/math&amp;gt;, where m is equal to 1. The total energy of the system, &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, is equal to &amp;lt;math&amp;gt;T + U&amp;lt;/math&amp;gt;. The values for &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; (from the potential energy term) and &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; (from the kinetic energy term) are taken from the verit algorithm and verit-velocity algorthim respectively. &lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;Figure 3. &#039;&#039;Plot of the difference (error) between the harmonic spring and verit algorithm data&lt;br /&gt;
!&#039;&#039;Figure 4. &#039;&#039;Plot of the peaks in the error plot in &#039;&#039;figure 3.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory error.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory errorpeaks.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The peaks in the error between the harmonic spring and verit algorithm results are at the point where the position curve crosses the time axis. This is because the harmonic spring data (&amp;lt;math&amp;gt;x(t)&amp;lt;/math&amp;gt;) has a slightly shorter wavelength than that of the verit velocity algorithm, and therefore the difference will get larger with each period of the wave. This is shown by the error getting larger in &#039;&#039;figure 3. &#039;&#039;The period of the plot of the two methods are different because the verit algorithm is much more approximate so does not give the correct solution.&lt;br /&gt;
|The change in the error/difference between the harmonic spring data and verit algorthm data increases linearly and so therefore period of each of the plots in &#039;&#039;figure 1&#039;&#039;. must be constant. &lt;br /&gt;
|}&lt;br /&gt;
The error can also be quantified on a &#039;&#039;phase space&#039;&#039; plot; phase space is momentum or velocity plotted as a function of position. The true solution for motion of an atom is a perfect ellipse, and the more elliptic the shape (less circular) the more momentum or velocity is in the system. A numerical solution, like the verit algorithms, will produce a set of points very close to this ellipse but not perfectly following the curve. A good numerical solution will remain in an elliptical shape, whereas a bad numerical solution, for example one with a large timestep, will spiral away from the true solution. Two examples of such systems using the data from &#039;&#039;figures a-d&#039;&#039; are shown below.  &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure 5. &#039;&#039;Phase plot of the harmonic spring data with a good numerical solution (timestep = 0.1) &lt;br /&gt;
!&#039;&#039;Figure 6. &#039;&#039;Phase plot of the harmonic spring data with a bad numerical solution (timestep = 0.3) &lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory phasegood.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory badphase.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The timestep at which this data is plotted is 0.1, which results in a very small change in the energy, as seen in &#039;&#039;figure b. &#039;&#039;Increasing the time step will increase the variation in the energy. To keep the variation in the total energy of the system under 1%, the time step must be no larger than approximately 0.28. The energy varies more with increasing time step because the jumps in the algorithm  are getting larger due to less data points. The algorithm assumes these points are joined by a straight line and that the halfway point in the jump is the average between the starting and finishing point of the jump. The phase space plot will become less elliptic and the jumps eventually become so large that the plot is no longer a continuous shape.  &lt;br /&gt;
&lt;br /&gt;
It is essential to monitor the energy of a numerically modeled system because a good solution for the motion of an atom has a constant energy and a plot in phase space of a perfect ellipse.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance and Force at Zero Potential===&lt;br /&gt;
From classical mechanics, the force calculated from the Newtonian mechanics above can be used to calculate the potential experienced by an atom in the system. They are related by the equation: &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;
This potential gives the shape and dimension of the potential surface on which the system can be modeled. In this experiment, a simple 1D potential is used to describe the inter atomic forces of a liquid; the Lennard-Jones potential. It has the characteristic features of a short range repulsion potential and harmonic character around the equilibrium bond distance or interatomic separation. The value of &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the inter atomic separation when the potential, &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;, is equal to zero, can be calculated by equating the equation for the Lennard-Jones potential to zero and solving for &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The equation for the Lennard-Jones potential: &amp;lt;math&amp;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;
Equating this to zero: &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;
And rearranging in order to separate the variables: &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;
Rearranging this gives &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in terms of &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt; r^6 = \sigma^6&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r = r_0&amp;lt;/math&amp;gt; in this case.&lt;br /&gt;
&lt;br /&gt;
This, therefore, gives the result that interatomic distance at zero potential, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, is equal to &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; in the Lennard-Jones potential is effectively the diameter of one of the particles in the system being measured; in this case, the solid, liquid or gas we are simulating. This is the point where the potential curve crosses the x-axis on an Energy vs interatomic distance plot. The force, &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt;, at this point on the curve corresponds to the gradient; it is found by calculating the derivative of the curve at this point. &lt;br /&gt;
&lt;br /&gt;
To calculate the force, we must differentiate the equation for the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;U\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As force is equal to the negative differential of the potential energy, the value of the force is: &amp;lt;math&amp;gt;\mathbf{F}_i = 48\epsilon \sigma^{12} r^{-13} - 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting in the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at zero potential from the calculation before: &amp;lt;math&amp;gt;\mathbf{F}_i = \frac{48\epsilon}{\sigma} - \frac{24\epsilon}{\sigma} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The gradient where the Lennard-Jones plot crosses the axis is negative; &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; in the term obtained for &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is negative and therefore the overall value of the force will be negative.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance, Force and Well Depth of the Potential at Equilibrium===&lt;br /&gt;
To calculate the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at the equilibrium position, we need to use the derivative of the potential energy curve. The equilibrium value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is the value at the minimum of the Lennard-Jones curve; when &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Therefore, equating the derivative to zero gives: &amp;lt;math&amp;gt;0 = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rearranging this: &amp;lt;math&amp;gt;48\epsilon \sigma^{12} r^{-13} = 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And simplifying and cancelling gives: &amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6&amp;lt;/math&amp;gt;. Therefore the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at equilibrium is: &amp;lt;math&amp;gt;r_{eq} = \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Physically, this result means that the equilibrium distance is 1.12 times the diameter of one of the particles; the particles have a small gap between them so do not touch. A short range repulsion potential, as seen in the Lennard-Jones curve, is a result of the particles coming into contact. &lt;br /&gt;
&lt;br /&gt;
Again, the force can be calculated from the derivative of the potential curve at the equilibrium point. As the derivative at this point is zero (a minimum on the curve), the force will therefore also be zero.&lt;br /&gt;
&lt;br /&gt;
The well-depth of the potential curve is the difference between zero potential and the potential at the equilibrium bond length. This can be calculated by substituting the value for the equilibrium bond length into the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 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;
Cancelling and simplifying this equation gives: &amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \times \frac{1}{4}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the absolute value for the well depth is &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;. The actual value of this potential is &amp;lt;math&amp;gt;-\epsilon&amp;lt;/math&amp;gt;, as the equilibrium bond length gives the most stable configuration of the molecules and therefore suggests attractive interactions are involved in the arrangement of the molecules; this attractive potential means its negative. &lt;br /&gt;
&lt;br /&gt;
===Boundary Conditions and the Lennard-Jones Cutoff===&lt;br /&gt;
When simulating a liquid, it is computationally impractical to simulate a realistic liquid. Therefore a smaller &#039;box&#039; containing &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; particles is simulated and the computer program will use &#039;&#039;periodic boundary conditions&#039;&#039; to simulate infinite repetitions of this box; when the atom reaches one edge of the box, in periodic boundary conditions, it will reappear again at the opposite edge of the box as if they were connected. For example, an atom at the position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a box of size &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;. Without periodic boundary conditions, we would assume that the atom would end up at the position &amp;lt;math&amp;gt;(1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;. However, in this box, there is no such position and so the particle must reappear at the opposite edge to where it effectively &#039;left&#039; the box. Therefore, it&#039;s ending position will be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The number of particles, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; simulated by the computer is usually between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt;. Physically, this is a very small volume. Considering water, we can calculate the number of molecules in 1 mL or 1 cm^3, a volume that would be considered small in the lab. Taking the concentration of water at standard conditions, &amp;lt;math&amp;gt;55\ mol\ dm^{-3}&amp;lt;/math&amp;gt;, we can convert it to the number of moles per mL: &amp;lt;math&amp;gt;0.055\ mol\ mL^{-1}&amp;lt;/math&amp;gt;. Multiplying this value by Avagadro&#039;s constant (&amp;lt;math&amp;gt;N_A&amp;lt;/math&amp;gt;) gives the number of molcules of water per mL: &amp;lt;math&amp;gt;3.02 \times 10^{22}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The reverse procedure can be used to compare this to the volume of 10,000 molecules: 10,000 divided by Avagadro&#039;s constant gives the number of moles of water which 10,000 molecules makes up: &amp;lt;math&amp;gt;1.66 \times 10^{-20}\ moles&amp;lt;/math&amp;gt;. Dividing this value by the concentration (from &amp;lt;math&amp;gt;n=cV&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is the number of moles, &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; is the concentration and &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume), gives the volume: &amp;lt;math&amp;gt;3.02 \times 10^{-22}\ dm&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;3.02 \times 10^{-19}\ mL&amp;lt;/math&amp;gt;. Physically, of course, this is far too small a volume to be recorded in the lab.&lt;br /&gt;
 &lt;br /&gt;
Periodic boundary conditions simulate an infinite lattice and therefore, when computing the potential, will calculate an infinite amount of pair interactions. Therefore, it is only practical to calculate the energies up to a certain interatomic distance; the Lennard-Jones cutoff distance. Beyond this point, the potential energy and the integral of the curve beyond this point become insignificant and do not impact on the overall energy; removing interactions beyond this point from the calculations will not effect the accuracy. Multiplying the Lennard-Jones potential with the radial distribution function gives a plot of the probability of finding an atom at a particular interatomic distance. The larger the interatomic distance, the lower the probability and so the energy after the cutoff can be disregarded. &lt;br /&gt;
&lt;br /&gt;
Integrating over the Lennard-Jones curve and applying this cutoff as the lower limit can show how small the integral is:&lt;br /&gt;
&lt;br /&gt;
For a general cutoff of with value &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;I = \int_{x}^\infty \phi\left(r\right)\mathrm{d}r = \int_{x}^\infty \frac{4\epsilon\sigma^{12}}{r^{12}}\mathrm{d}r - \int_{x}^\infty \frac{4\epsilon\sigma^6}{r^6}\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving this: &amp;lt;math&amp;gt;I = 4\epsilon\sigma^{12} {\frac{-1}{11r^{11}}\,\Bigg\vert\,}_x^\infty - 4\epsilon\sigma^{6} {\frac{-1}{5r^{5}}\,\Bigg\vert\,}_x^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This gives the general solution: &amp;lt;math&amp;gt;I = \frac{4\epsilon\sigma^{12}}{11x^{11}} - \frac{4\epsilon\sigma^{6}}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating this for &amp;lt;math&amp;gt;\epsilon = \sigma = 1&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;I = \frac{4}{11x^{11}} - \frac{4}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt; (or 2 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.025&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt; (or 2.5 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0082&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt; (or 3 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0033&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All values are taken to 2 significant figures. As the cutoff value for the interatomic distance gets larger, the integral gets smaller, and therefore the energy excluded from the calculation becomes smaller, and the second term in the solved integral, &amp;lt;math&amp;gt;I&amp;lt;/math&amp;gt;, dominates the energy value.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
When using the Lennard-Jones potential, it is appropriate to use reduced units for intermolecular distance, energy and temperature. Reduced units can be calculated by the following relationships:&lt;br /&gt;
&lt;br /&gt;
Intermolecular 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;
&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; are scaling factors. For example, if the parameters for Argon are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\sigma = 0.34 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt; \epsilon\ /\ k_B = 120 K&amp;lt;/math&amp;gt;&lt;br /&gt;
* Lennard-Jones cutoff &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;. The well-depth, &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;, is &amp;lt;math&amp;gt;0.999 kJ mol^{-1} \approx 1 kJ mol^{-1}&amp;lt;/math&amp;gt;. The value of &amp;lt;math&amp;gt;T* = 1.5&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;180 K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
The first aim of the simulations is to determine the most appropriate timestep to use in the vert algorithm simulations. This timestep is a balance between the accuracy of the results (the smaller the timestep, the closer to the true functing the result will be) and the length of real time over which the simluation is run (the smaller the timestep, the less real time over which the simulation will give a result). The appropriateness of the timestep will be determined by plotting how the total free energy of the simulated lattice equilibrates over time.  &lt;br /&gt;
&lt;br /&gt;
Five different calculations, which simulated the melting of a crystal and subsequent equilibration of the energy of the melted crystal, were run at five different timesteps; 0.001, 0.0025, 0.0075, 0.01 and 0.015, and were described by the NVE or &#039;&#039;&amp;quot;microcanonical ensemble&amp;quot;&#039;&#039;. An ensemble is a collection of samples of a system which are under three thermodynamic constraints (three properties are kept constant); in the microcanonical ensemble, the number of particles, the volume and the total energy is kept constant (NVE). &lt;br /&gt;
&lt;br /&gt;
These calculations simulate a box of 1000 unit cells and use periodic boundary conditions to replicate the simulation to a larger scale. Because these simulations use the numerical methods defined in the previous section, the initial position and velocity of the atoms must be defined in the input file. The Brownian (uncorrelated, random) motion of the atoms in the simulation means that there is no long range order in the system and so the atoms in a real system would start in random positions. However, assigning random starting coordinates to the atoms in a simulated liquid is not a relative process; the coordinates are generate independently of each other. Therefore there is a probability that the coordinates simulated will cause the atoms to overlap, which would give a very large repulsion potential, as seen in the Lennard-Jones potential at very small interatomic distances. This short-range repulsion potential comes from the hard-sphere model of atomic simulation.&lt;br /&gt;
&lt;br /&gt;
The input file also defines the structure and density of the lattice. The number density of lattice points in any lattice is the number of lattice points per volume of the unit cell. In a simple cubic lattice, there is one lattice point in the unit cell. From an sc lattice with lattice spacing (length of one side of the unit cell) being &amp;lt;math&amp;gt;1.07722&amp;lt;/math&amp;gt;, the number density of the lattice points is calculated by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{1}{1.07722^3} = 0.7999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a face-centered cubic lattice (fcc), there are four lattice points in the unit cell. Rearranging the above relationship, the lattice spacing can be calculated from the number of lattice points in a unit cell and number density, &amp;lt;math&amp;gt;1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Lattice\ spacing = \sqrt[3]{\frac{number\ of\ lattice\ points\ per\ unit\ cell}{number\ density}} = \sqrt[3]{\frac{4}{1.2}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation creates a box which includes 1000 unit cells, which is 10 unit cells in each dimension. For a simple cubic lattice, because there is one lattice point per unit cell, there will be 1000 atoms created as seen in the input file. The &#039;&#039;create_atom&#039;&#039; command in the input file determines how many boxes are created in the simulation and therefore how many atoms will be created. If a face centered cubic lattice is simulated, because there are 4 lattice points per unit cell, 4000 atoms will be created in the &#039;&#039;create_atom&#039;&#039; command. &lt;br /&gt;
&lt;br /&gt;
The input script also contains the following commands which defines the potential surface which is used to model the intermolecular reactions:&lt;br /&gt;
 mass 1 1.0&lt;br /&gt;
This instruction sets the mass type for the atoms being simulated. It takes the general form of “mass I value”, where mass is the keyword which tells LAMMPS what the input is, I is the atom type and value is the mass of the atom. In this case, I is defined by a specific numerical value; 1 as there is only 1 type of atom in the simulation, but it can be defined with an asterisk (1*), which means “all atom types of 1 to n inclusive”. &lt;br /&gt;
 pair_style lj/cut 3.0&lt;br /&gt;
This instruction sets the type of potential which LAMMPS uses in its calculation of pairwise interactions. It takes the general form of “pair_style style args”, where pair_style is the keyword for LAMMPS, style defines the potential and any specifications it may have, and args are the arguments required for this particular potential. In this case, the Lennard-Jones potential has been used (lj) with a cutoff point (cut) of 3σ. The cutoff point is explained in the introduction section. &lt;br /&gt;
 pair_coeff * * 1.0 1.0&lt;br /&gt;
This instruction specifies the coefficients for the pairwise interactions of each pair of atoms, and it takes the general form “pair_coeff I J args”. Pair_coeff is the keyword, I and J are the atom types, and args are the coefficients which the different atoms types take. In this case, the asterisk in place of I and J refers to all atoms types from 1 to n. The coefficients are the pairwise interactions are 1 for each atom, meaning each atom has an equal contribution to the interaction.&lt;br /&gt;
&lt;br /&gt;
In these initial calculations, the initial conditions for the numerical methods, &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. For this experiment, the verit-velocity algorithm would be the most appropriate, as both the starting position and velocity is specified for this algorithm. &lt;br /&gt;
&lt;br /&gt;
To define the timestep for the algorithm the following code is used defining the timestep as a variable instead of just giving it a definite value&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;
It is much easier to use the variable version of defining the timestep because the length of time over which the simulation is run depends on the time step. By using a variable, you can keep the length of the simulation the same, no matter the size of the timestep. It also makes it easier if multiple properties depend on the timestep – only the variable needs to be changed, not all the parts of the script where timestep is defined. &lt;br /&gt;
&lt;br /&gt;
The calculations produce the values for the total energy of the system, temperature and pressure in the output files, which can be plotted against time. How well these values equilibrate determines the appropriateness of the timestep to use in further calculations in the experiment.  &lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!style=&amp;quot;width: 33%;&amp;quot;|&#039;&#039;Figure h. &#039;&#039;Plot of the equilibration of total energy for five different timesteps&lt;br /&gt;
!style=&amp;quot;width: 33%;&amp;quot;|&#039;&#039;Figure ha. &#039;&#039; Plot of the temperature vs time equilibration for timestep = 0.0025&lt;br /&gt;
!style=&amp;quot;width: 33%;&amp;quot;|&#039;&#039;Figure hb. &#039;&#039; Plot of the pressure vs time equilibration for timestep = 0.0025 &lt;br /&gt;
|- &lt;br /&gt;
|[[File:rmt_totalenergycurve.png|600x600px]]&lt;br /&gt;
|[[File:rmt_tempvstime0025.png|600x600px]]&lt;br /&gt;
|[[File:rmt_pressurevstime0025.png|600x600px]]&lt;br /&gt;
|}&lt;br /&gt;
The largest time step to give an acceptable result is 0.01. However, for any simluation we would expect energy to be independent of the timestep, something which is not true at a timestep greater than 0.0025. Therefore, the most appropriate timestep to use for a balance between accuracy and length of time which the simulation covers is 0.0025. &lt;br /&gt;
&lt;br /&gt;
0.015 is a particularly bad choice of timestep. This is because the verit-velocity algorithm gives an approximate result to the velocity (kinetic energy term) and position (potential energy term), and so when the timestep becomes too large with respect to the time, the algorithm no longer becomes a suitable way to calculate the energy. As seen in the graph of 0.015, the energy does not equilibrate and diverges.&lt;br /&gt;
&lt;br /&gt;
The plots for temperature and pressure vs time give a good indication for the next section an appropriate pressure and temperature to use for running the simulations under specific conditions.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions ==&lt;br /&gt;
The calculations in this section are run in the isobaric-isothermal ensemble, where the number of particles in the system, the pressure and the temperature are kept constant (NpT). This means that the temperature and the pressure are recalculated in every step, so are no longer constant like they were in the NVE ensemble. From the &#039;&#039;equipartition theorem&#039;&#039;, each degree of freedom will contribute &amp;lt;math&amp;gt;\frac{1}{2} k_B T&amp;lt;/math&amp;gt; of energy to the system. As the system is in three dimensions, there are three degrees of translational freedom and so the total internal energy is equal to &amp;lt;math&amp;gt;\frac{3}{2} k_B T&amp;lt;/math&amp;gt;. Equating this to the kinetic energy, &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt;, at the end of every step and rearranging will allow calculation of the temperature after every step. &lt;br /&gt;
&lt;br /&gt;
A target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, is defined in the input script and the system will equilibrate by multiplying the velocity by a factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, in order to accommodate for the fluctuation and keep the system at approximately the target temperature and therefore constant internal energy. If the temperature of the system is greater than the target temperature, the system&#039;s kinetic energy is too high, so &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is reduced to compensate for this. The same is true for is the temperature is lower than the target temperature; &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than one in the next step to increase the kinetic energy which is now too low. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; can be derived from equating the kinetic and internal energy of the system at an arbitrary time step:&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;
Expanding the brackets inside the sum and moving the term containing &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; out of the sum: &amp;lt;math&amp;gt;\frac{\gamma^2}{2}\sum_i m_i \left(v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;, we can replace &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt; on the left hand side of the equation with &amp;lt;math&amp;gt;\frac{3}{2} N k_B T&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;\frac{3\gamma^2}{2}N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Simplifying and rearranging for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, gives: &amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The principle is the same for controlling the pressure.&lt;br /&gt;
&lt;br /&gt;
As temperature and pressure are no longer constant, he input files require specification of the pressure and the temperature for each of the systems run. 10 simulations were run at two different pressures with five different temperatures at each. &lt;br /&gt;
* Temperatures: 1.6, 1.9, 2.2, 2.5, 2.8&lt;br /&gt;
* Pressures: 2.5, 3.0&lt;br /&gt;
These pressures were chosen because the data simulated when choosing an appropriate timestep gave a pressure between 2.5 and 3.0.  &lt;br /&gt;
&lt;br /&gt;
For the code which computes the thermodynamic potentials, this particular line defines how many steps contribute towards the average of the thermodynamic parameters computed in the calculation. &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;
&#039;&#039;fix&#039;&#039; is the keyword, &#039;&#039;aves&#039;&#039; is the name of the group of fixes which in this case is the average of the thermodynamic values, &#039;&#039;all&#039;&#039; specifies the atoms which the fix is applied to which in this case is all the atoms in the simulated system and &#039;&#039;ave/time&#039;&#039; means that compute global time averages are calculated. The following three numbers have the following meaning:&lt;br /&gt;
&lt;br /&gt;
*100 = use the input values every 100 timesteps&lt;br /&gt;
*1000 = use input values 1000 times for calculating the average&lt;br /&gt;
*100000 = calculate the average every 100000 timesteps&lt;br /&gt;
&lt;br /&gt;
Therefore for the total calculation which lasts for 100000 will only have the average calculated once. Assuming 1 value every timestep, there will be 100000/100 values = 1000. The amount of time simulated is 100,000 steps, read from the following line.&lt;br /&gt;
&lt;br /&gt;
The density data from all ten calculation were plotted on the same graph, along with the density for an &amp;quot;ideal&amp;quot; gas. This density can be derived from the ideal gas law:&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;
Rearranging in terms of density: &amp;lt;math&amp;gt;\frac{N}{V} = \frac{P}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As these simulations are being run under reduced units, we can take &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt;, and so the density of the ideal gas becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the density of the ideal gas is plotted as the pressure divided by the temperature in pressure-temperature phase space.&lt;br /&gt;
[[File:Rmt dvt plot.png|none|thumb|800x800px|&#039;&#039;Figure i. &#039;&#039;Plot of the variation in density with temperature at a defined pressure for the numerically simulated and ideal systems]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that calculated in the ideal gas law. This is because for an ideal gas, an assumption is made that there are no intermolecular interactions, and therefore forces such as electron repulsion forces are ignored; repulsion forces dominate over attractive ones, as all the atoms in this simulation are the same and so partial charges or dipoles are created. This will mean that the particles move closer together than a real gas and so the density will be larger. This discrepancy between the ideal and non-ideal systems becomes larger at a higher pressure because with a higher pressure, the atoms in the system are closer together and therefore the intermolecular repulsion will become larger. This greater repulsion will in turn have a larger effect on decreasing the density.&lt;br /&gt;
&lt;br /&gt;
== Statistical Physics Calculations of the Heat Capacity ==&lt;br /&gt;
The heat capacity of a system at constant volume can be calculated from the variance in the total energy of the system. The relationship used to calculate the heat capacity is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = 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;\left\langle E^2\right\rangle&amp;lt;/math&amp;gt; is the continuous average of the total square energy at each temperature as a function of temperature. &amp;lt;math&amp;gt;\left\langle E\right\rangle^2&amp;lt;/math&amp;gt; is the continuous average of the total energy at each temperature as a function of temperature squared. The heat capacity is multiplied by &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; in this case because the version of LAMMPS calculates every energy divided by the number of molecules in the system simulated.&lt;br /&gt;
&lt;br /&gt;
The calculations in this sections are run in density-temperature phase space and the ensemble has changed to the canonical ensemble (NVT). A set of input files were written for ten calculations for, like the previous section, two pressures and five different temperatures at each pressure:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 0.2, 0.8&lt;br /&gt;
*Temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{C_V}{V}&amp;lt;/math&amp;gt; was plotted against temperature to determine the relationship in density-temperature phase space. An example of an input file can be found [[Media:nvt_-_0220.in|here]]. The lines which have been changed from the previous input files are at the end of the script:&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 &lt;br /&gt;
 thermo_style custom step etotal temp&lt;br /&gt;
 variable energy equal etotal&lt;br /&gt;
 variable energy2 equal etotal*etotal&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_energy v_energy2 v_temp&lt;br /&gt;
 run 100000&lt;br /&gt;
 &lt;br /&gt;
 variable aveenergy equal f_aves[1]&lt;br /&gt;
 variable aveenergy2 equal f_aves[2]&lt;br /&gt;
 variable avetemp equal f_aves[3]&lt;br /&gt;
 variable heatcapacitydv equal atoms*atoms*(v_aveenergy2-v_aveenergy*v_aveenergy)/(v_avetemp*v_avetemp*vol)&lt;br /&gt;
 &lt;br /&gt;
 print &amp;quot;Averages&amp;quot;&lt;br /&gt;
 print &amp;quot;--------&amp;quot;&lt;br /&gt;
 print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Heat Capacity per Volume: ${heatcapacitydv}&amp;quot;&lt;br /&gt;
The line with the keyword &#039;fix&#039; determines which thermodynamic values are averaged and over how many steps they are averaged. The next section takes these averages as variables and uses them to define the heat capacity which is calculated from the equation at the beginning of this section. Only the energy and temperature are needed to define the heat capacity and so only these values are calculated by the simulation. [[File:Rmt heatcapacitybyv.png|none|thumb|800x800px|&#039;&#039;Figure j. &#039;&#039;C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V against temperature for the two different pressures 0.2 and 0.8]]As seen in the above figure, the heat capacity decreases with temperature for both pressures. It would be expected for an ideal system that as the temperature increases, the heat capacity at constant volume increases and tends to a constant volume at very high T of 3R; R = the universal gas constant. This means increasing the temperature increases the amount of energy being stored in the system and this energy is stored as vibrational energy. However, for a Lennard-Jones liquid, the system being simulated here, the heat capacity decreases with temperature. This is because the simulation has two components to the simulation; the atoms are vibrating in a quasi-harmonic fashion around the equilibrium position and also diffuse between neighbouring equilibrium positions in a gas like fashion. As the temperature increases, the amount of diffusion increases and the vibrations decreases, therefore decreasing the ability of the system to absorb vibrational energy, resulting in the decrease in heat capacity. &amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www.nature.com/ncomms/2013/130816/ncomms3331/full/ncomms3331.html?message-global=remove&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural Properties and the Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a single atom in a system is a plot of the probability that an atom can be found at a certain distance from the central atom. The peaks in this plot can give the distance of an atom from its nearest neighbours in the Lennard-Jones simulated system. &lt;br /&gt;
&lt;br /&gt;
The calculations in this section simulate a Lennard-Jones solid, liquid and gas and, using the output of the LAMMPS trajectory file, plots both the radial distribution function and its integral using DLV. The temperature and pressure parameters for these calculations were taken from the phase diagram or coexistence curve for a Lennard-Jones system.&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt; The parameters used are displayed in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! Temperature, &amp;lt;math&amp;gt;T^*&amp;lt;/math&amp;gt;&lt;br /&gt;
! Pressure, &amp;lt;math&amp;gt;p^*&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| LJ Solid&lt;br /&gt;
| 1.5&lt;br /&gt;
| 1.2&lt;br /&gt;
|-&lt;br /&gt;
| LJ Liquid&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.8&lt;br /&gt;
|-&lt;br /&gt;
| LJ Gas&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.01&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The data obtained from the plots and the radial distribution functions and their integrals were plotted and shown in the table below.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure k. &#039;&#039;The radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
!&#039;&#039;Figure l. &#039;&#039;The integrals of the radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt fullrdfs.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt allintegralsrdf.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
[[File:Rmt Nearest neighbours.png|left|thumb|300x300px|&#039;&#039;Figure m. &#039;&#039;Representation of a cross section of the first three shells of nearest neighbours in an fcc solid. The black atom is the central atom being considered, the blue atoms are the first shell, the orange atoms the second shell and the purple atoms are the third.]]&lt;br /&gt;
The RDF of the solid gives a very irregular curve because of the irregular structure of the lattice. For a simple cubic lattice, a regular structure of the RDF would be expected because of the equal number of atoms in each of the nearest neighbour shells of the atoms. However, for face-centered cubic, the solid in this simulation, the structure is much more irregular and as the atoms move from their equilibrium position in the lattice due to vibrations, the peaks in the radial distribution will broaden. The irregular heights of the peaks are due to the varying numbers of atoms in each of the nearest neighbour shells for the central atom. The first shell gives the highest peak as it contains the most atoms; in total, considering all four surrounding unit cells, this shell contains 12 atoms and ideally takes the geometry of an icosahedron. The second shell is smaller and contains only 6 atoms in an octahedral coordination shape. The following shell again contributes 12 atoms, 3 from each unit cell. This therefore explains why the heights of the peaks in the solid plot in &#039;&#039;figure k.&#039;&#039; vary. These values can be confirmed by the plot in &#039;&#039;figure o.&#039;&#039; which is the integral; it cumulatively adds the numbers in each shell. The size of the first &amp;quot;step&amp;quot; is 12; there are 12 atoms in the first shell. The size of the second step is approximately 18; there are 18-12=6 steps in the second shell. The same theory applies for the third shell which gives a value of 13. This is slightly different to the predicted value possibly due to error in the calculation of the radial distribution function and therefore its integral. &lt;br /&gt;
&lt;br /&gt;
The RDF of the liquid has a representation of far fewer shells, which means that there are less atoms in the space close to a &amp;quot;central&amp;quot; atom in the bulk solution. The particles have more energy and therefore do not keep to a regular lattice structure. As they move about, some regualrity is maintained around each atom, but only to the extend of two or three shells, meaning there is no long range order in a Lennard-Jones liquid. &lt;br /&gt;
&lt;br /&gt;
The RDF of the gas again omits more shells as there is almost no order in a Lennard-Jones gas. The single peak on this plot considers only the set of atoms closest to the central atom and all others are disregarded as they are too far apart. &lt;br /&gt;
&lt;br /&gt;
Considering &#039;&#039;figure l.&#039;&#039;, the size of the integral of the radial distribution function decreases from solid to liquid to gas. This makes sense as the number of atoms in the surrounding shells decreases with density of the system; the atoms become further apart. &lt;br /&gt;
&lt;br /&gt;
From the plot of the radial distribution function of the solid, the lattice spacing can be determined. For this, we can consider just the first three peaks of the RDF plot. The lattice spacing refers to the length of one unit cell, and so, using &#039;&#039;figure m&#039;&#039;, we can calculate this using two different methods; a) we can use the distance between the central atom and the first shell of nearest neighbours, and use trigonometry to calculate the lattice spacing. Or alternatively b) we can use the distance between the central atom and the second nearest neighbour shell to get the lattice spacing.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure n. &#039;&#039;The radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
!&#039;&#039;Figure o. &#039;&#039;The integral of the radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt solidgr3.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt solidint3.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
Using method a) (with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; as the distance between the central atom and the nearest neighbour: Lattice spacing = &amp;lt;math&amp;gt;\frac{r}{cos({\frac{\pi}{4}})} = \frac{1.02}{cos({\frac{\pi}{4}})} \approx 1.44&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using method b): Lattice spacing &amp;lt;math&amp;gt;\approx 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can take an average between the two get an approximate value for the lattice spacing: &amp;lt;math&amp;gt;1.46 \plusmn 0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These values for distance are all in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
The ability of atoms to move around in a solid liquid or gas can be characterised by the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. In this section, we will explore two different ways to calculate the diffusion coefficient and compare the results. &lt;br /&gt;
&lt;br /&gt;
=== The Mean Squared Displacement ===&lt;br /&gt;
The diffusion coefficient can be measured easily be calculating the mean squared displacement of atoms in the solution; the diffusion coefficient is proportional to the first derivative of the mean squared displacement. By plotting the mean squared displacement as a function of time, the gradient can be taken to calculate the diffusion coefficient when its has equilibrated and become linear.&lt;br /&gt;
&lt;br /&gt;
The temperature and density parameters used were the same as in the previous section:&lt;br /&gt;
* Solid: T=1.5, D=1.2&lt;br /&gt;
* Liquid: T=1.1, D=0.8&lt;br /&gt;
* Gas: T=1.1, D=0.01&lt;br /&gt;
&lt;br /&gt;
Mean density squared calculations were run for all three Lennard-Jones phases and the data plotted as function of timestep below. The data from a simulation containing 1,000,000 atoms was plotted for comparision.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!Plots for the 8,000 atom data (&#039;&#039;figures p-r)&#039;&#039;&lt;br /&gt;
!Plots for the 1,000,000 atom data (&#039;&#039;figures s-u)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|[[File:Rmt_MSDsolid.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt_MAsolid.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|[[File:Rmt MSDliquid.png|700x700px]]&lt;br /&gt;
|[[File:Rmt MAliquid.png|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|[[File:Rmt MSDgas.png|700x700px]]&lt;br /&gt;
|[[File:Rmt dataplots 25894 image001.png|700x700px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The exact relationship between the mean squared displacement and the diffusion coefficient is:&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;
Taking the gradients of each of the curves at the point at which they become linear and dividing by six will give the diffusion coefficient for each set of data. The gradient also needs to be converted to a function of time; this is done by dividing by the timestep, which in this case is 0.002:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom data diffusion coefficients, &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
!1,000,000 atom data diffusion coefficients &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 0.9999&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|Gradient = 0.0972&lt;br /&gt;
Amount of data used to calculate gradient: timestep 4300-5000, &amp;lt;math&amp;gt;R^2 = 0.9998&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{48.6}{6} = \mathbf{8.1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient = 0.0386&lt;br /&gt;
Amount of data used to calculate gradient: timestep 4000-5000, &amp;lt;math&amp;gt;R^2 = 0.1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{19.6}{6} = \mathbf{3.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For both of the solid approximations, the diffusion coefficient can be approximated as zero. This is because, when equilibrated, the function has a constant value of around 0.2 for the mean squared displacement. A gradient with a value of zero means that the atoms take an infinite amount of time to change their mean squared displacement; to move away from their equilibrium position, and so this means that we can approximate in this system, there will be no diffusion. In real system, however, this is not the case; diffusion occurs but it is very slow. A plot for a real system will give a very shallow positive gradient.&lt;br /&gt;
&lt;br /&gt;
The liquid approximations are very well correlated. This is because in both cases, the mean squared displacement of particles in a liquid increases linearly with time and the gradient of both plots are almost identical. We can assume from this that identical starting conditions were used to calculate this data. Also, we can estimate that 8,000 atoms is a large enough simulation to give an accurate result for the diffusion coefficient for the Lennard-Jones liquid.&lt;br /&gt;
&lt;br /&gt;
The gas approximations are very different. This is most probably due to the fact that the density specified in calculations are different. The 8,000 data can be estimated to be a much lower density because the diffusion coefficient is faster and this means diffusion will happen faster; at a higher density a particle will take longer to diffuse over a given distance. Because of the difference in density, the two values of the diffusion coefficient cannot be qualitatively compared. The reason for the initial deviation for linearity in the gas plots is due to the momentum of the particles initially dominating over the diffusion and the diffusion coefficient is dependent on time. As the system equilibrates, the diffusion coefficient becomes constant and the plots become linear.&lt;br /&gt;
&lt;br /&gt;
=== The Velocity Autocorrelation Function ===&lt;br /&gt;
&lt;br /&gt;
Another way to calculate the diffusion coefficient is by using the velocity correlation function, which determines how the velocity of an atom changes with time. The function determines the difference in time (&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;) when the velocity becomes uncorrelated, i.e. the difference between the velocity at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; and at time &amp;lt;math&amp;gt;t+\tau&amp;lt;/math&amp;gt;. By integrating over this function, we can find the diffusion coefficient. &lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function: &amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can also be written as the integral: &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;
Using the function which defines the position of a classical harmonic oscillator, we can differentiate this to give the equation for the velocity which we can plug into the integral:&lt;br /&gt;
&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;
&amp;lt;math&amp;gt;dv{x(t)}{t} = v(t) = -A\omega sin(\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also needed for the integral:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t+\tau) = -A\omega sin(\omega(t+\tau)+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v^2(t) = A^2\omega^2 sin^2(\omega t +\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Putting all this into the integral to find the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega sin(\omega t + \phi) \times A\omega sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} A^2\omega^2 sin^2(\omega t +\tau)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A^2\omega^2&amp;lt;/math&amp;gt; can be take out of each of the integrals and cancelled. A substituion can then be made to make solving the integral much simpler:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = \omega t + \phi&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \omega\tau&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the integral becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a) \times sin(a+b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the compound angle rule &amp;lt;math&amp;gt;sin(a+b)=sin(a)cos(b)+cos(a)sin(b)&amp;lt;/math&amp;gt;, the integral can be simplified to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a)sin(a)cos(b) + sin(a)cos(a)sin(b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Separating out into two integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)\frac{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the rule &amp;lt;math&amp;gt;sin(a)cos(a) = \frac{1}{2}sin(2a)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} \frac{1}{2}(sin(2a))\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because the function &amp;lt;math&amp;gt;\frac{1}{2}sin(2a)&amp;lt;/math&amp;gt; is symmetric over all space, the second term in this equation becomes zero. Therefore, the integral simplifies to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b) = cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same calculations from the mean squared displacement section gave an output of the velocity autocorrelation function. The function for the Lennard-Jones solid, liquid and gas were plotted against the timestep along with the approximate function for the velocity autocorrelation function, &amp;lt;math&amp;gt;cos(\omega\tau)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\omega = \frac{1}{2\pi}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure v. &#039;&#039;Plots for the velocity autocorrelation function of a Lennard-Jones solid, liquid and gas; 8,000 atoms&lt;br /&gt;
!&#039;&#039;Figure w. &#039;&#039;Plots for the velocity autocorrelation function of a Lennard-Jones solid, liquid and gas, 1,000,000 atoms&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt VACF 5721 image001.png|800x800px|]]&lt;br /&gt;
|[[File:Rmt MAVACF.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plots for the velocity autocorrelation function show how the time correlation of velocity decreases with time due to collisions with other atoms in the system. The Lennard-Jones solid oscillates around the VACF=0 axis with the oscillations becoming progressively more damped with time. The long range of the oscillations is due to the order in the system. Every time the plot crosses the VACF=0 axis, the velocity of the atom changes direction which is due to a collision with another atom. Every collision for every atom is completely uncorrelated so the change in velocity of one atom as it collides is independent of another change in velocity of another colliding atom. Overall, momentum must be conserved and so overall change of velocity in the system must be conserved. &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones liquid oscillations are damped much quicker; an atom in the liquid only collides with one atom before the velocity becomes uncorrelated with respect to time. The Lennard-Jones gas never reaches the VACF=0 axis as the atoms are too far apart to collide. Because the velocity autocorrelation function never equilibrates, using this method to calculate the diffusion coefficient is inaccurate because the particles in the gas never come into contact with each other.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillating system is so different to the Lennard-Jones systems because the atoms remain in their equilibrium position and vibrate around the same position, never coming into contact with another atom. Because of this, the correlation with time never decreases so the function infinitely oscillates as a sine function.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated from: &amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty C\left(\tau\right)\mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the approximate value for the diffusion coefficient using the velocity autocorrelation function is &amp;lt;math&amp;gt;D = \frac{1}{3}cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The running integral of the velocity autocorrelation functions was plotted using the &#039;&#039;trapesium rule&#039;&#039;, and so the final value on the integral plot is proportional to the diffusion coefficient.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom VACF integral &#039;&#039;(figures w-z)&#039;&#039;&lt;br /&gt;
!1,000,000 VACF integral (&#039;&#039;figures aa-cc)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|[[File:Rmt mysi.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt masi.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|[[File:Rmt myli.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt mali.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|[[File:Rmt mygi.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt ligi.png|frameless|700x700px]]&lt;br /&gt;
|}&lt;br /&gt;
The diffusion coefficients for each of the plots above are tabulated below using the final data point from the integral plot. This is the integral over the whole graph using the trapesium rule. This must be corrected for the timestep; the value is multiplied by 0.002. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom data diffusion coefficients, &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
!1,000,000 atom data diffusion coefficients &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;-0.00055&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{-0.00055}{6} = -0.00018 \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.00014&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.00014}{6} = 0.000046 \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.242&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.242}{6} = \mathbf{0.0807}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.270&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.270}{6} = \mathbf{0.0901}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;25.6&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{25.6}{6} = \mathbf{8.55}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;9.81&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{9.81}{6} = \mathbf{3.27}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
The biggest source of error in these plots is that we assume both the 8,000 atom data and the 1,000,000 atom data take the same amount of time to converge. &#039;&#039;Figure z. &#039;&#039;shows that 5000 timesteps is not long enough for the velocity autocorrelation coefficient for 8,000 atoms to converge as far as 1,000,000 atom data does in this length of time. As the molecular dynamics simulations simulate random motion, this could induce fluctuations in the velocity autocorrelation plot which could increase or decrease the integral introduction another source of error.&lt;br /&gt;
&lt;br /&gt;
Again, the diffusion coefficient of the Lennard-Jones solid can be assumed to be zero for the same reason as the mean squared displacement data. The diffusion coefficient of the liquid is lower for both sets of data when calculated using the velocity autocorrelation function, and the diffusion coefficient is higher for both sets of data.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=542773</id>
		<title>Rep:Mod:hakunamatata</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=542773"/>
		<updated>2016-02-25T16:57:03Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Introduction to Molecular Dynamics Simulations ==&lt;br /&gt;
===The Classical Particle Approximation and Numerical Integration===&lt;br /&gt;
The verit and verit-velocity algorithms are numerical methods to approximate the average position and velocity respectively of randomly moving particles in a particular medium (solid, liquid, fliud etc.). This position and velocity can be applied to Newtonian mechanics to calculate such properties as the force and potential energy of the system. The algorithms work by splitting the function into discrete time steps, calculating the values of position and velocity at this particular time step, and then effectively &amp;quot;joining the dots&amp;quot; to create an approximate function. These simulations always use the answer from the previous timestep to compute the new timestep, so initial conditions must be given for the first step. Both of the algorithms are shown below and are derived from the Taylor expansion of the position or velocity of the atoms at the timestep &amp;quot;n+1&amp;quot; or &amp;lt;math&amp;gt;t+\delta t&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit Algorithum:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{x}_i\left(t + \delta t\right) \approx 2\mathbf{x}_i\left(t\right) - \mathbf{x}_i\left(t - \delta t\right) + \frac{\mathbf{F}_i\left(t\right)}{m_i}\delta t^2  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit-Velocity Algorithum:&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i\left(t\right)&amp;lt;/math&amp;gt; is the force acting on a particular atom as a function of time&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i\left(t\right)&amp;lt;/math&amp;gt; is the acceleration of the atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The smaller the timestep, the closer the numerical approximation is to the true function, which can be modeled as a classical harmonic oscillator. &#039;&#039;Figure 1.&#039;&#039; in the table below shows the comparison between the two methods at plotting position of an atom as a function of time in &#039;&#039;time&#039;&#039; space. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure 1. &#039;&#039;Plots of position vs time comparing the verit algorithm and harmonic spring results&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure 2. &#039;&#039;Plot of the total classical energy of the system (potential + kinetic)&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory xanalytical.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory energy.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The harmonic spring position values are modeled from the harmonic oscillator or particle on a spring. The equation of &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; is used to calculate these values, where &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; are equal to 1 and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; is equal to zero. As seen on the plot, the curves produced from the two different methods of calculating the position are in good agreement.&lt;br /&gt;
|The potential energy is calculated using the equation &amp;lt;math&amp;gt;U = \frac{1}{2}kx^2&amp;lt;/math&amp;gt;, with a value of k given as 1. The kinetic energy is calculated using the velcity from the verit-velocity algorithm using the equation &amp;lt;math&amp;gt;T = \frac{1}{2} mv^2&amp;lt;/math&amp;gt;, where m is equal to 1. The total energy of the system, &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, is equal to &amp;lt;math&amp;gt;T + U&amp;lt;/math&amp;gt;. The values for &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; (from the potential energy term) and &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; (from the kinetic energy term) are taken from the verit algorithm and verit-velocity algorthim respectively. &lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;Figure 3. &#039;&#039;Plot of the difference (error) between the harmonic spring and verit algorithm data&lt;br /&gt;
!&#039;&#039;Figure 4. &#039;&#039;Plot of the peaks in the error plot in &#039;&#039;figure 3.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory error.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory errorpeaks.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The peaks in the error between the harmonic spring and verit algorithm results are at the point where the position curve crosses the time axis. This is because the harmonic spring data (&amp;lt;math&amp;gt;x(t)&amp;lt;/math&amp;gt;) has a slightly shorter wavelength than that of the verit velocity algorithm, and therefore the difference will get larger with each period of the wave. This is shown by the error getting larger in &#039;&#039;figure 3. &#039;&#039;The period of the plot of the two methods are different because the verit algorithm is much more approximate so does not give the correct solution.&lt;br /&gt;
|The change in the error/difference between the harmonic spring data and verit algorthm data increases linearly and so therefore period of each of the plots in &#039;&#039;figure 1&#039;&#039;. must be constant. &lt;br /&gt;
|}&lt;br /&gt;
The error can also be quantified on a &#039;&#039;phase space&#039;&#039; plot; phase space is momentum or velocity plotted as a function of position. The true solution for motion of an atom is a perfect ellipse, and the more elliptic the shape (less circular) the more momentum or velocity is in the system. A numerical solution, like the verit algorithms, will produce a set of points very close to this ellipse but not perfectly following the curve. A good numerical solution will remain in an elliptical shape, whereas a bad numerical solution, for example one with a large timestep, will spiral away from the true solution. Two examples of such systems using the data from &#039;&#039;figures a-d&#039;&#039; are shown below.  &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure 5. &#039;&#039;Phase plot of the harmonic spring data with a good numerical solution (timestep = 0.1) &lt;br /&gt;
!&#039;&#039;Figure 6. &#039;&#039;Phase plot of the harmonic spring data with a bad numerical solution (timestep = 0.3) &lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory phasegood.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory badphase.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The timestep at which this data is plotted is 0.1, which results in a very small change in the energy, as seen in &#039;&#039;figure b. &#039;&#039;Increasing the time step will increase the variation in the energy. To keep the variation in the total energy of the system under 1%, the time step must be no larger than approximately 0.28. The energy varies more with increasing time step because the jumps in the algorithm  are getting larger due to less data points. The algorithm assumes these points are joined by a straight line and that the halfway point in the jump is the average between the starting and finishing point of the jump. The phase space plot will become less elliptic and the jumps eventually become so large that the plot is no longer a continuous shape.  &lt;br /&gt;
&lt;br /&gt;
It is essential to monitor the energy of a numerically modeled system because a good solution for the motion of an atom has a constant energy and a plot in phase space of a perfect ellipse.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance and Force at Zero Potential===&lt;br /&gt;
From classical mechanics, the force calculated from the Newtonian mechanics above can be used to calculate the potential experienced by an atom in the system. They are related by the equation: &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;
This potential gives the shape and dimension of the potential surface on which the system can be modeled. A simple 1D potential that is used to describe the inter atomic forces of a liquid is the Lennard-Jones potential. It has the characteristic features of a short range repulsion potential and harmonic character around the equilibrium bond distance. The value of &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the inter atomic separation when the potential, &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;, is equal to zero, can be calculated by equating the equation for the Lennard-Jones potential to zero and solving for &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The equation for the Lennard-Jones potential: &amp;lt;math&amp;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;
Equating this to zero: &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;
And rearranging in order to separate the variables: &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;
Rearranging this gives &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in terms of &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt; r^6 = \sigma^6&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r = r_0&amp;lt;/math&amp;gt; in this case.&lt;br /&gt;
&lt;br /&gt;
This, therefore, gives the result that interatomic distance at zero potential, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, is equal to &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; in the Lennard-Jones potential is effectively the diameter of one of the particles in the system being measured; in this case, the liquid we are simulating. This is the point where the potential curve crosses the x-axis on an Energy vs interatomic distance plot. The force, &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt;, at this point on the curve corresponds to the gradient; it is found by calculating the derivative of the curve at this point. &lt;br /&gt;
&lt;br /&gt;
To calculate the force, we must differentiate the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As force is equal to the negative differential of the potential energy, the value of the force is: &amp;lt;math&amp;gt;\mathbf{F}_i = 48\epsilon \sigma^{12} r^{-13} - 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting in the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at zero potential from the calculation before: &amp;lt;math&amp;gt;\mathbf{F}_i = \frac{48\epsilon}{\sigma} - \frac{24\epsilon}{\sigma} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The gradient where the Lennard-Jones plot crosses the axis is negative; &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; in the term obtained for &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is negative and therefore the overall value of the force will be negative.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance, Force and Well Depth of the Potential at Equilibrium===&lt;br /&gt;
To calculate the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at the equilibrium position, we need to use the derivative of the potential energy curve. The equilibrium value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is the value at the minimum of the Lennard-Jones curve; when &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Therefore, equating the derivative to zero gives: &amp;lt;math&amp;gt;0 = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rearranging this: &amp;lt;math&amp;gt;48\epsilon \sigma^{12} r^{-13} = 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And simplifying and cancelling gives: &amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6&amp;lt;/math&amp;gt;. Therefore the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at equilibrium is: &amp;lt;math&amp;gt;r_{eq} = \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Physically, this result means that the equilibrium distance is 1.12 times the diameter of one of the particles; the particles have a small gap between them so do not touch. A short range repulsion potential, as seen in the Lennard-Jones curve, is a result of the particles coming into contact. &lt;br /&gt;
&lt;br /&gt;
Again, the force can be calculated from the derivative of the potential curve at the equilibrium point. As the derivative at this point is zero (a minimum on the curve), the force will therefore also be zero.&lt;br /&gt;
&lt;br /&gt;
The well-depth of the potential curve is the difference between zero potential and the potential at the equilibrium bond length. This can be calculated by substituting the value for the equilibrium bond length into the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 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;
Cancelling and simplifying this equation gives: &amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \times \frac{1}{4}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the absolute value for the well depth is &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;. The actual value of this potential is &amp;lt;math&amp;gt;-\epsilon&amp;lt;/math&amp;gt;, as the equilibrium bond length gives the most stable configuration of the molecules and therefore suggests attractive interactions are involved in the arrangement of the molecules; this attractive potential means its negative. &lt;br /&gt;
&lt;br /&gt;
===Boundary Conditions and the Lennard-Jones Cutoff===&lt;br /&gt;
When simulating a liquid, it is computationally impractical to simulate a realistic liquid. Therefore a smaller &#039;box&#039; containing &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; particles is simulated and the computer program will use &#039;&#039;periodic boundary conditions&#039;&#039; to simulate infinite repetitions of this box; when the atom reaches one edge of the box, in periodic boundary conditions, it will reappear again at the opposite edge of the box as if they were connected. For example, an atom at the position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a box of size &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;. Without periodic boundary conditions, we would assume that the atom would end up at the position &amp;lt;math&amp;gt;(1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;. However, in this box, there is no such position and so the particle must reappear at the opposite edge to where it effectively &#039;left&#039; the box. Therefore, it&#039;s ending position will be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The number of particles, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; simulated by the computer is usually between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt;. Physically, this is a very small volume. Considering water, we can calculate the number of molecules in 1 mL or 1 cm^3, a volume that would be considered small in the lab. Taking the concentration of water at standard conditions, &amp;lt;math&amp;gt;55\ mol\ dm^{-3}&amp;lt;/math&amp;gt;, we can convert it to the number of moles per mL: &amp;lt;math&amp;gt;0.055\ mol\ mL^{-1}&amp;lt;/math&amp;gt;. Multiplying this value by Avagadro&#039;s constant (&amp;lt;math&amp;gt;N_A&amp;lt;/math&amp;gt;) gives the number of molcules of water per mL: &amp;lt;math&amp;gt;3.02 \times 10^{22}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The reverse procedure can be used to compare this to the volume of 10,000 molecules: 10,000 divided by Avagadro&#039;s constant gives the number of moles of water which 10,000 molecules makes up: &amp;lt;math&amp;gt;1.66 \times 10^{-20}\ moles&amp;lt;/math&amp;gt;. Dividing this value by the concentration (from &amp;lt;math&amp;gt;n=cV&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is the number of moles, &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; is the concentration and &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume), gives the volume: &amp;lt;math&amp;gt;3.02 \times 10^{-22}\ dm&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;3.02 \times 10^{-19}\ mL&amp;lt;/math&amp;gt;. Physically, of course, this is far too small a volume to be recorded in the lab.&lt;br /&gt;
 &lt;br /&gt;
Periodic boundary conditions simulate an infinite lattice and therefore, when computing the potential, will calculate an infinite amount of pair interactions. Therefore, it is only practical to calculate the energies up to a certain interatomic distance; the Lennard-Jones cutoff distance. Beyond this point, the potential energy and the integral of the curve beyond this point become insignificant and do not impact on the overall energy; removing interactions beyond this point from the calculations will not effect the accuracy. Multiplying the Lennard-Jones potential with the radial distribution function gives a plot of the probability of finding an atom at a particular interatomic distance. The larger the interatomic distance, the lower the probability and so the energy after the cutoff can be disregarded. &lt;br /&gt;
&lt;br /&gt;
Integrating over the Lennard-Jones curve and applying this cutoff as the lower limit can show how small the integral is:&lt;br /&gt;
&lt;br /&gt;
For a general cutoff of with value &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;I = \int_{x}^\infty \phi\left(r\right)\mathrm{d}r = \int_{x}^\infty \frac{4\epsilon\sigma^{12}}{r^{12}}\mathrm{d}r - \int_{x}^\infty \frac{4\epsilon\sigma^6}{r^6}\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving this: &amp;lt;math&amp;gt;I = 4\epsilon\sigma^{12} {\frac{-1}{11r^{11}}\,\Bigg\vert\,}_x^\infty - 4\epsilon\sigma^{6} {\frac{-1}{5r^{5}}\,\Bigg\vert\,}_x^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This gives the general solution: &amp;lt;math&amp;gt;I = \frac{4\epsilon\sigma^{12}}{11x^{11}} - \frac{4\epsilon\sigma^{6}}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating this for &amp;lt;math&amp;gt;\epsilon = \sigma = 1&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;I = \frac{4}{11x^{11}} - \frac{4}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt; (or 2 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.025&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt; (or 2.5 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0082&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt; (or 3 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0033&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All values are taken to 2 significant figures. As the cutoff value for the interatomic distance gets larger, the integral gets smaller, and therefore the energy excluded from the calculation becomes smaller, and the second term in the solved integral, &amp;lt;math&amp;gt;I&amp;lt;/math&amp;gt;, dominates the energy value.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
When using the Lennard-Jones potential, it is appropriate to use reduced units for intermolecular distance, energy and temperature. Reduced units can be calculated by the following relationships:&lt;br /&gt;
&lt;br /&gt;
Intermolecular 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;
&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; are scaling factors. For example, if the parameters for Argon are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\sigma = 0.34 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt; \epsilon\ /\ k_B = 120 K&amp;lt;/math&amp;gt;&lt;br /&gt;
* Lennard-Jones cutoff &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;. The well-depth, &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;, is &amp;lt;math&amp;gt;0.999 kJ mol^{-1} \approx 1 kJ mol^{-1}&amp;lt;/math&amp;gt;. The value of &amp;lt;math&amp;gt;T* = 1.5&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;180 K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
The first aim of the simulations is to determine the most appropriate timestep to use in the vert algorithm simulations. This timestep is a balance between the accuracy of the results (the smaller the timestep, the closer to the true functing the result will be) and the length of real time over which the simluation is run (the smaller the timestep, the less real time over which the simulation will give a result). The appropriateness of the timestep will be determined by plotting how the total free energy of the simulated lattice equilibrates over time.  &lt;br /&gt;
&lt;br /&gt;
Five different calculations, which simulated the melting of a crystal and subsequent equilibration of the energy of the melted crystal, were run at five different timesteps; 0.001, 0.0025, 0.0075, 0.01 and 0.015, and were described by the NVE or &#039;&#039;&amp;quot;microcanonical ensemble&amp;quot;&#039;&#039;. An ensemble is a collection of samples of a system which are under three thermodynamic constraints (three properties are kept constant); in the microcanonical ensemble, the number of particles, the volume and the total energy is kept constant (NVE). &lt;br /&gt;
&lt;br /&gt;
These calculations simulate a box of 1000 unit cells and use periodic boundary conditions to replicate the simulation to a larger scale. Because these simulations use the numerical methods defined in the previous section, the initial position and velocity of the atoms must be defined in the input file. The Brownian (uncorrelated, random) motion of the atoms in the simulation means that there is no long range order in the system and so the atoms in a real system would start in random positions. However, assigning random starting coordinates to the atoms in a simulated liquid is not a relative process; the coordinates are generate independently of each other. Therefore there is a probability that the coordinates simulated will cause the atoms to overlap, which would give a very large repulsion potential, as seen in the Lennard-Jones potential at very small interatomic distances. This short-range repulsion potential comes from the hard-sphere model of atomic simulation.&lt;br /&gt;
&lt;br /&gt;
The input file also defines the structure and density of the lattice. The number density of lattice points in any lattice is the number of lattice points per volume of the unit cell. In a simple cubic lattice, there is one lattice point in the unit cell. From an sc lattice with lattice spacing (length of one side of the unit cell) being &amp;lt;math&amp;gt;1.07722&amp;lt;/math&amp;gt;, the number density of the lattice points is calculated by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{1}{1.07722^3} = 0.7999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a face-centered cubic lattice (fcc), there are four lattice points in the unit cell. Rearranging the above relationship, the lattice spacing can be calculated from the number of lattice points in a unit cell and number density, &amp;lt;math&amp;gt;1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Lattice\ spacing = \sqrt[3]{\frac{number\ of\ lattice\ points\ per\ unit\ cell}{number\ density}} = \sqrt[3]{\frac{4}{1.2}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation creates a box which includes 1000 unit cells, which is 10 unit cells in each dimension. For a simple cubic lattice, because there is one lattice point per unit cell, there will be 1000 atoms created as seen in the input file. The &#039;&#039;create_atom&#039;&#039; command in the input file determines how many boxes are created in the simulation and therefore how many atoms will be created. If a face centered cubic lattice is simulated, because there are 4 lattice points per unit cell, 4000 atoms will be created in the &#039;&#039;create_atom&#039;&#039; command. &lt;br /&gt;
&lt;br /&gt;
The input script also contains the following commands which defines the potential surface which is used to model the intermolecular reactions:&lt;br /&gt;
 mass 1 1.0&lt;br /&gt;
This instruction sets the mass type for the atoms being simulated. It takes the general form of “mass I value”, where mass is the keyword which tells LAMMPS what the input is, I is the atom type and value is the mass of the atom. In this case, I is defined by a specific numerical value; 1 as there is only 1 type of atom in the simulation, but it can be defined with an asterisk (1*), which means “all atom types of 1 to n inclusive”. &lt;br /&gt;
 pair_style lj/cut 3.0&lt;br /&gt;
This instruction sets the type of potential which LAMMPS uses in its calculation of pairwise interactions. It takes the general form of “pair_style style args”, where pair_style is the keyword for LAMMPS, style defines the potential and any specifications it may have, and args are the arguments required for this particular potential. In this case, the Lennard-Jones potential has been used (lj) with a cutoff point (cut) of 3σ. The cutoff point is explained in the introduction section. &lt;br /&gt;
 pair_coeff * * 1.0 1.0&lt;br /&gt;
This instruction specifies the coefficients for the pairwise interactions of each pair of atoms, and it takes the general form “pair_coeff I J args”. Pair_coeff is the keyword, I and J are the atom types, and args are the coefficients which the different atoms types take. In this case, the asterisk in place of I and J refers to all atoms types from 1 to n. The coefficients are the pairwise interactions are 1 for each atom, meaning each atom has an equal contribution to the interaction.&lt;br /&gt;
&lt;br /&gt;
In these initial calculations, the initial conditions for the numerical methods, &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. For this experiment, the verit-velocity algorithm would be the most appropriate, as both the starting position and velocity is specified for this algorithm. &lt;br /&gt;
&lt;br /&gt;
To define the timestep for the algorithm the following code is used defining the timestep as a variable instead of just giving it a definite value&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;
It is much easier to use the variable version of defining the timestep because the length of time over which the simulation is run depends on the time step. By using a variable, you can keep the length of the simulation the same, no matter the size of the timestep. It also makes it easier if multiple properties depend on the timestep – only the variable needs to be changed, not all the parts of the script where timestep is defined. &lt;br /&gt;
&lt;br /&gt;
The calculations produce the values for the total energy of the system, temperature and pressure in the output files, which can be plotted against time. How well these values equilibrate determines the appropriateness of the timestep to use in further calculations in the experiment.  &lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!style=&amp;quot;width: 33%;&amp;quot;|&#039;&#039;Figure h. &#039;&#039;Plot of the equilibration of total energy for five different timesteps&lt;br /&gt;
!style=&amp;quot;width: 33%;&amp;quot;|&#039;&#039;Figure ha. &#039;&#039; Plot of the temperature vs time equilibration for timestep = 0.0025&lt;br /&gt;
!style=&amp;quot;width: 33%;&amp;quot;|&#039;&#039;Figure hb. &#039;&#039; Plot of the pressure vs time equilibration for timestep = 0.0025 &lt;br /&gt;
|- &lt;br /&gt;
|[[File:rmt_totalenergycurve.png|600x600px]]&lt;br /&gt;
|[[File:rmt_tempvstime0025.png|600x600px]]&lt;br /&gt;
|[[File:rmt_pressurevstime0025.png|600x600px]]&lt;br /&gt;
|}&lt;br /&gt;
The largest time step to give an acceptable result is 0.01. However, for any simluation we would expect energy to be independent of the timestep, something which is not true at a timestep greater than 0.0025. Therefore, the most appropriate timestep to use for a balance between accuracy and length of time which the simulation covers is 0.0025. &lt;br /&gt;
&lt;br /&gt;
0.015 is a particularly bad choice of timestep. This is because the verit-velocity algorithm gives an approximate result to the velocity (kinetic energy term) and position (potential energy term), and so when the timestep becomes too large with respect to the time, the algorithm no longer becomes a suitable way to calculate the energy. As seen in the graph of 0.015, the energy does not equilibrate and diverges.&lt;br /&gt;
&lt;br /&gt;
The plots for temperature and pressure vs time give a good indication for the next section an appropriate pressure and temperature to use for running the simulations under specific conditions.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions ==&lt;br /&gt;
The calculations in this section are run in the isobaric-isothermal ensemble, where the number of particles in the system, the pressure and the temperature are kept constant (NpT). This means that the temperature and the pressure are recalculated in every step, so are no longer constant like they were in the NVE ensemble. From the &#039;&#039;equipartition theorem&#039;&#039;, each degree of freedom will contribute &amp;lt;math&amp;gt;\frac{1}{2} k_B T&amp;lt;/math&amp;gt; of energy to the system. As the system is in three dimensions, there are three degrees of translational freedom and so the total internal energy is equal to &amp;lt;math&amp;gt;\frac{3}{2} k_B T&amp;lt;/math&amp;gt;. Equating this to the kinetic energy, &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt;, at the end of every step and rearranging will allow calculation of the temperature after every step. &lt;br /&gt;
&lt;br /&gt;
A target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, is defined in the input script and the system will equilibrate by multiplying the velocity by a factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, in order to accommodate for the fluctuation and keep the system at approximately the target temperature and therefore constant internal energy. If the temperature of the system is greater than the target temperature, the system&#039;s kinetic energy is too high, so &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is reduced to compensate for this. The same is true for is the temperature is lower than the target temperature; &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than one in the next step to increase the kinetic energy which is now too low. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; can be derived from equating the kinetic and internal energy of the system at an arbitrary time step:&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;
Expanding the brackets inside the sum and moving the term containing &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; out of the sum: &amp;lt;math&amp;gt;\frac{\gamma^2}{2}\sum_i m_i \left(v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;, we can replace &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt; on the left hand side of the equation with &amp;lt;math&amp;gt;\frac{3}{2} N k_B T&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;\frac{3\gamma^2}{2}N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Simplifying and rearranging for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, gives: &amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The principle is the same for controlling the pressure.&lt;br /&gt;
&lt;br /&gt;
As temperature and pressure are no longer constant, he input files require specification of the pressure and the temperature for each of the systems run. 10 simulations were run at two different pressures with five different temperatures at each. &lt;br /&gt;
* Temperatures: 1.6, 1.9, 2.2, 2.5, 2.8&lt;br /&gt;
* Pressures: 2.5, 3.0&lt;br /&gt;
These pressures were chosen because the data simulated when choosing an appropriate timestep gave a pressure between 2.5 and 3.0.  &lt;br /&gt;
&lt;br /&gt;
For the code which computes the thermodynamic potentials, this particular line defines how many steps contribute towards the average of the thermodynamic parameters computed in the calculation. &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;
&#039;&#039;fix&#039;&#039; is the keyword, &#039;&#039;aves&#039;&#039; is the name of the group of fixes which in this case is the average of the thermodynamic values, &#039;&#039;all&#039;&#039; specifies the atoms which the fix is applied to which in this case is all the atoms in the simulated system and &#039;&#039;ave/time&#039;&#039; means that compute global time averages are calculated. The following three numbers have the following meaning:&lt;br /&gt;
&lt;br /&gt;
*100 = use the input values every 100 timesteps&lt;br /&gt;
*1000 = use input values 1000 times for calculating the average&lt;br /&gt;
*100000 = calculate the average every 100000 timesteps&lt;br /&gt;
&lt;br /&gt;
Therefore for the total calculation which lasts for 100000 will only have the average calculated once. Assuming 1 value every timestep, there will be 100000/100 values = 1000. The amount of time simulated is 100,000 steps, read from the following line.&lt;br /&gt;
&lt;br /&gt;
The density data from all ten calculation were plotted on the same graph, along with the density for an &amp;quot;ideal&amp;quot; gas. This density can be derived from the ideal gas law:&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;
Rearranging in terms of density: &amp;lt;math&amp;gt;\frac{N}{V} = \frac{P}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As these simulations are being run under reduced units, we can take &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt;, and so the density of the ideal gas becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the density of the ideal gas is plotted as the pressure divided by the temperature in pressure-temperature phase space.&lt;br /&gt;
[[File:Rmt dvt plot.png|none|thumb|800x800px|&#039;&#039;Figure i. &#039;&#039;Plot of the variation in density with temperature at a defined pressure for the numerically simulated and ideal systems]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that calculated in the ideal gas law. This is because for an ideal gas, an assumption is made that there are no intermolecular interactions, and therefore forces such as electron repulsion forces are ignored; repulsion forces dominate over attractive ones, as all the atoms in this simulation are the same and so partial charges or dipoles are created. This will mean that the particles move closer together than a real gas and so the density will be larger. This discrepancy between the ideal and non-ideal systems becomes larger at a higher pressure because with a higher pressure, the atoms in the system are closer together and therefore the intermolecular repulsion will become larger. This greater repulsion will in turn have a larger effect on decreasing the density.&lt;br /&gt;
&lt;br /&gt;
== Statistical Physics Calculations of the Heat Capacity ==&lt;br /&gt;
The heat capacity of a system at constant volume can be calculated from the variance in the total energy of the system. The relationship used to calculate the heat capacity is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = 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;\left\langle E^2\right\rangle&amp;lt;/math&amp;gt; is the continuous average of the total square energy at each temperature as a function of temperature. &amp;lt;math&amp;gt;\left\langle E\right\rangle^2&amp;lt;/math&amp;gt; is the continuous average of the total energy at each temperature as a function of temperature squared. The heat capacity is multiplied by &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; in this case because the version of LAMMPS calculates every energy divided by the number of molecules in the system simulated.&lt;br /&gt;
&lt;br /&gt;
The calculations in this sections are run in density-temperature phase space and the ensemble has changed to the canonical ensemble (NVT). A set of input files were written for ten calculations for, like the previous section, two pressures and five different temperatures at each pressure:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 0.2, 0.8&lt;br /&gt;
*Temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{C_V}{V}&amp;lt;/math&amp;gt; was plotted against temperature to determine the relationship in density-temperature phase space. An example of an input file can be found [[Media:nvt_-_0220.in|here]]. The lines which have been changed from the previous input files are at the end of the script:&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 &lt;br /&gt;
 thermo_style custom step etotal temp&lt;br /&gt;
 variable energy equal etotal&lt;br /&gt;
 variable energy2 equal etotal*etotal&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_energy v_energy2 v_temp&lt;br /&gt;
 run 100000&lt;br /&gt;
 &lt;br /&gt;
 variable aveenergy equal f_aves[1]&lt;br /&gt;
 variable aveenergy2 equal f_aves[2]&lt;br /&gt;
 variable avetemp equal f_aves[3]&lt;br /&gt;
 variable heatcapacitydv equal atoms*atoms*(v_aveenergy2-v_aveenergy*v_aveenergy)/(v_avetemp*v_avetemp*vol)&lt;br /&gt;
 &lt;br /&gt;
 print &amp;quot;Averages&amp;quot;&lt;br /&gt;
 print &amp;quot;--------&amp;quot;&lt;br /&gt;
 print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Heat Capacity per Volume: ${heatcapacitydv}&amp;quot;&lt;br /&gt;
The line with the keyword &#039;fix&#039; determines which thermodynamic values are averaged and over how many steps they are averaged. The next section takes these averages as variables and uses them to define the heat capacity which is calculated from the equation at the beginning of this section. Only the energy and temperature are needed to define the heat capacity and so only these values are calculated by the simulation. [[File:Rmt heatcapacitybyv.png|none|thumb|800x800px|&#039;&#039;Figure j. &#039;&#039;C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V against temperature for the two different pressures 0.2 and 0.8]]As seen in the above figure, the heat capacity decreases with temperature for both pressures. It would be expected for an ideal system that as the temperature increases, the heat capacity at constant volume increases and tends to a constant volume at very high T of 3R; R = the universal gas constant. This means increasing the temperature increases the amount of energy being stored in the system and this energy is stored as vibrational energy. However, for a Lennard-Jones liquid, the system being simulated here, the heat capacity decreases with temperature. This is because the simulation has two components to the simulation; the atoms are vibrating in a quasi-harmonic fashion around the equilibrium position and also diffuse between neighbouring equilibrium positions in a gas like fashion. As the temperature increases, the amount of diffusion increases and the vibrations decreases, therefore decreasing the ability of the system to absorb vibrational energy, resulting in the decrease in heat capacity. &amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www.nature.com/ncomms/2013/130816/ncomms3331/full/ncomms3331.html?message-global=remove&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural Properties and the Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a single atom in a system is a plot of the probability that an atom can be found at a certain distance from the central atom. The peaks in this plot can give the distance of an atom from its nearest neighbours in the Lennard-Jones simulated system. &lt;br /&gt;
&lt;br /&gt;
The calculations in this section simulate a Lennard-Jones solid, liquid and gas and, using the output of the LAMMPS trajectory file, plots both the radial distribution function and its integral using DLV. The temperature and pressure parameters for these calculations were taken from the phase diagram or coexistence curve for a Lennard-Jones system.&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt; The parameters used are displayed in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! Temperature, &amp;lt;math&amp;gt;T^*&amp;lt;/math&amp;gt;&lt;br /&gt;
! Pressure, &amp;lt;math&amp;gt;p^*&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| LJ Solid&lt;br /&gt;
| 1.5&lt;br /&gt;
| 1.2&lt;br /&gt;
|-&lt;br /&gt;
| LJ Liquid&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.8&lt;br /&gt;
|-&lt;br /&gt;
| LJ Gas&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.01&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The data obtained from the plots and the radial distribution functions and their integrals were plotted and shown in the table below.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure k. &#039;&#039;The radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
!&#039;&#039;Figure l. &#039;&#039;The integrals of the radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt fullrdfs.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt allintegralsrdf.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
[[File:Rmt Nearest neighbours.png|left|thumb|300x300px|&#039;&#039;Figure m. &#039;&#039;Representation of a cross section of the first three shells of nearest neighbours in an fcc solid. The black atom is the central atom being considered, the blue atoms are the first shell, the orange atoms the second shell and the purple atoms are the third.]]&lt;br /&gt;
The RDF of the solid gives a very irregular curve because of the irregular structure of the lattice. For a simple cubic lattice, a regular structure of the RDF would be expected because of the equal number of atoms in each of the nearest neighbour shells of the atoms. However, for face-centered cubic, the solid in this simulation, the structure is much more irregular and as the atoms move from their equilibrium position in the lattice due to vibrations, the peaks in the radial distribution will broaden. The irregular heights of the peaks are due to the varying numbers of atoms in each of the nearest neighbour shells for the central atom. The first shell gives the highest peak as it contains the most atoms; in total, considering all four surrounding unit cells, this shell contains 12 atoms and ideally takes the geometry of an icosahedron. The second shell is smaller and contains only 6 atoms in an octahedral coordination shape. The following shell again contributes 12 atoms, 3 from each unit cell. This therefore explains why the heights of the peaks in the solid plot in &#039;&#039;figure k.&#039;&#039; vary. These values can be confirmed by the plot in &#039;&#039;figure o.&#039;&#039; which is the integral; it cumulatively adds the numbers in each shell. The size of the first &amp;quot;step&amp;quot; is 12; there are 12 atoms in the first shell. The size of the second step is approximately 18; there are 18-12=6 steps in the second shell. The same theory applies for the third shell which gives a value of 13. This is slightly different to the predicted value possibly due to error in the calculation of the radial distribution function and therefore its integral. &lt;br /&gt;
&lt;br /&gt;
The RDF of the liquid has a representation of far fewer shells, which means that there are less atoms in the space close to a &amp;quot;central&amp;quot; atom in the bulk solution. The particles have more energy and therefore do not keep to a regular lattice structure. As they move about, some regualrity is maintained around each atom, but only to the extend of two or three shells, meaning there is no long range order in a Lennard-Jones liquid. &lt;br /&gt;
&lt;br /&gt;
The RDF of the gas again omits more shells as there is almost no order in a Lennard-Jones gas. The single peak on this plot considers only the set of atoms closest to the central atom and all others are disregarded as they are too far apart. &lt;br /&gt;
&lt;br /&gt;
Considering &#039;&#039;figure l.&#039;&#039;, the size of the integral of the radial distribution function decreases from solid to liquid to gas. This makes sense as the number of atoms in the surrounding shells decreases with density of the system; the atoms become further apart. &lt;br /&gt;
&lt;br /&gt;
From the plot of the radial distribution function of the solid, the lattice spacing can be determined. For this, we can consider just the first three peaks of the RDF plot. The lattice spacing refers to the length of one unit cell, and so, using &#039;&#039;figure m&#039;&#039;, we can calculate this using two different methods; a) we can use the distance between the central atom and the first shell of nearest neighbours, and use trigonometry to calculate the lattice spacing. Or alternatively b) we can use the distance between the central atom and the second nearest neighbour shell to get the lattice spacing.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure n. &#039;&#039;The radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
!&#039;&#039;Figure o. &#039;&#039;The integral of the radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt solidgr3.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt solidint3.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
Using method a) (with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; as the distance between the central atom and the nearest neighbour: Lattice spacing = &amp;lt;math&amp;gt;\frac{r}{cos({\frac{\pi}{4}})} = \frac{1.02}{cos({\frac{\pi}{4}})} \approx 1.44&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using method b): Lattice spacing &amp;lt;math&amp;gt;\approx 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can take an average between the two get an approximate value for the lattice spacing: &amp;lt;math&amp;gt;1.46 \plusmn 0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These values for distance are all in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
The ability of atoms to move around in a solid liquid or gas can be characterised by the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. In this section, we will explore two different ways to calculate the diffusion coefficient and compare the results. &lt;br /&gt;
&lt;br /&gt;
=== The Mean Squared Displacement ===&lt;br /&gt;
The diffusion coefficient can be measured easily be calculating the mean squared displacement of atoms in the solution; the diffusion coefficient is proportional to the first derivative of the mean squared displacement. By plotting the mean squared displacement as a function of time, the gradient can be taken to calculate the diffusion coefficient when its has equilibrated and become linear.&lt;br /&gt;
&lt;br /&gt;
The temperature and density parameters used were the same as in the previous section:&lt;br /&gt;
* Solid: T=1.5, D=1.2&lt;br /&gt;
* Liquid: T=1.1, D=0.8&lt;br /&gt;
* Gas: T=1.1, D=0.01&lt;br /&gt;
&lt;br /&gt;
Mean density squared calculations were run for all three Lennard-Jones phases and the data plotted as function of timestep below. The data from a simulation containing 1,000,000 atoms was plotted for comparision.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!Plots for the 8,000 atom data (&#039;&#039;figures p-r)&#039;&#039;&lt;br /&gt;
!Plots for the 1,000,000 atom data (&#039;&#039;figures s-u)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|[[File:Rmt_MSDsolid.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt_MAsolid.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|[[File:Rmt MSDliquid.png|700x700px]]&lt;br /&gt;
|[[File:Rmt MAliquid.png|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|[[File:Rmt MSDgas.png|700x700px]]&lt;br /&gt;
|[[File:Rmt dataplots 25894 image001.png|700x700px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The exact relationship between the mean squared displacement and the diffusion coefficient is:&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;
Taking the gradients of each of the curves at the point at which they become linear and dividing by six will give the diffusion coefficient for each set of data. The gradient also needs to be converted to a function of time; this is done by dividing by the timestep, which in this case is 0.002:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom data diffusion coefficients, &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
!1,000,000 atom data diffusion coefficients &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 0.9999&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|Gradient = 0.0972&lt;br /&gt;
Amount of data used to calculate gradient: timestep 4300-5000, &amp;lt;math&amp;gt;R^2 = 0.9998&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{48.6}{6} = \mathbf{8.1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient = 0.0386&lt;br /&gt;
Amount of data used to calculate gradient: timestep 4000-5000, &amp;lt;math&amp;gt;R^2 = 0.1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{19.6}{6} = \mathbf{3.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For both of the solid approximations, the diffusion coefficient can be approximated as zero. This is because, when equilibrated, the function has a constant value of around 0.2 for the mean squared displacement. A gradient with a value of zero means that the atoms take an infinite amount of time to change their mean squared displacement; to move away from their equilibrium position, and so this means that we can approximate in this system, there will be no diffusion. In real system, however, this is not the case; diffusion occurs but it is very slow. A plot for a real system will give a very shallow positive gradient.&lt;br /&gt;
&lt;br /&gt;
The liquid approximations are very well correlated. This is because in both cases, the mean squared displacement of particles in a liquid increases linearly with time and the gradient of both plots are almost identical. We can assume from this that identical starting conditions were used to calculate this data. Also, we can estimate that 8,000 atoms is a large enough simulation to give an accurate result for the diffusion coefficient for the Lennard-Jones liquid.&lt;br /&gt;
&lt;br /&gt;
The gas approximations are very different. This is most probably due to the fact that the density specified in calculations are different. The 8,000 data can be estimated to be a much lower density because the diffusion coefficient is faster and this means diffusion will happen faster; at a higher density a particle will take longer to diffuse over a given distance. Because of the difference in density, the two values of the diffusion coefficient cannot be qualitatively compared. The reason for the initial deviation for linearity in the gas plots is due to the momentum of the particles initially dominating over the diffusion and the diffusion coefficient is dependent on time. As the system equilibrates, the diffusion coefficient becomes constant and the plots become linear.&lt;br /&gt;
&lt;br /&gt;
=== The Velocity Autocorrelation Function ===&lt;br /&gt;
&lt;br /&gt;
Another way to calculate the diffusion coefficient is by using the velocity correlation function, which determines how the velocity of an atom changes with time. The function determines the difference in time (&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;) when the velocity becomes uncorrelated, i.e. the difference between the velocity at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; and at time &amp;lt;math&amp;gt;t+\tau&amp;lt;/math&amp;gt;. By integrating over this function, we can find the diffusion coefficient. &lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function: &amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can also be written as the integral: &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;
Using the function which defines the position of a classical harmonic oscillator, we can differentiate this to give the equation for the velocity which we can plug into the integral:&lt;br /&gt;
&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;
&amp;lt;math&amp;gt;dv{x(t)}{t} = v(t) = -A\omega sin(\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also needed for the integral:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t+\tau) = -A\omega sin(\omega(t+\tau)+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v^2(t) = A^2\omega^2 sin^2(\omega t +\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Putting all this into the integral to find the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega sin(\omega t + \phi) \times A\omega sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} A^2\omega^2 sin^2(\omega t +\tau)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A^2\omega^2&amp;lt;/math&amp;gt; can be take out of each of the integrals and cancelled. A substituion can then be made to make solving the integral much simpler:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = \omega t + \phi&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \omega\tau&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the integral becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a) \times sin(a+b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the compound angle rule &amp;lt;math&amp;gt;sin(a+b)=sin(a)cos(b)+cos(a)sin(b)&amp;lt;/math&amp;gt;, the integral can be simplified to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a)sin(a)cos(b) + sin(a)cos(a)sin(b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Separating out into two integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)\frac{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the rule &amp;lt;math&amp;gt;sin(a)cos(a) = \frac{1}{2}sin(2a)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} \frac{1}{2}(sin(2a))\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because the function &amp;lt;math&amp;gt;\frac{1}{2}sin(2a)&amp;lt;/math&amp;gt; is symmetric over all space, the second term in this equation becomes zero. Therefore, the integral simplifies to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b) = cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same calculations from the mean squared displacement section gave an output of the velocity autocorrelation function. The function for the Lennard-Jones solid, liquid and gas were plotted against the timestep along with the approximate function for the velocity autocorrelation function, &amp;lt;math&amp;gt;cos(\omega\tau)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\omega = \frac{1}{2\pi}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure v. &#039;&#039;Plots for the velocity autocorrelation function of a Lennard-Jones solid, liquid and gas; 8,000 atoms&lt;br /&gt;
!&#039;&#039;Figure w. &#039;&#039;Plots for the velocity autocorrelation function of a Lennard-Jones solid, liquid and gas, 1,000,000 atoms&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt VACF 5721 image001.png|800x800px|]]&lt;br /&gt;
|[[File:Rmt MAVACF.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plots for the velocity autocorrelation function show how the time correlation of velocity decreases with time due to collisions with other atoms in the system. The Lennard-Jones solid oscillates around the VACF=0 axis with the oscillations becoming progressively more damped with time. The long range of the oscillations is due to the order in the system. Every time the plot crosses the VACF=0 axis, the velocity of the atom changes direction which is due to a collision with another atom. Every collision for every atom is completely uncorrelated so the change in velocity of one atom as it collides is independent of another change in velocity of another colliding atom. Overall, momentum must be conserved and so overall change of velocity in the system must be conserved. &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones liquid oscillations are damped much quicker; an atom in the liquid only collides with one atom before the velocity becomes uncorrelated with respect to time. The Lennard-Jones gas never reaches the VACF=0 axis as the atoms are too far apart to collide. Because the velocity autocorrelation function never equilibrates, using this method to calculate the diffusion coefficient is inaccurate because the particles in the gas never come into contact with each other.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillating system is so different to the Lennard-Jones systems because the atoms remain in their equilibrium position and vibrate around the same position, never coming into contact with another atom. Because of this, the correlation with time never decreases so the function infinitely oscillates as a sine function.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated from: &amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty C\left(\tau\right)\mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the approximate value for the diffusion coefficient using the velocity autocorrelation function is &amp;lt;math&amp;gt;D = \frac{1}{3}cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The running integral of the velocity autocorrelation functions was plotted using the &#039;&#039;trapesium rule&#039;&#039;, and so the final value on the integral plot is proportional to the diffusion coefficient.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom VACF integral &#039;&#039;(figures w-z)&#039;&#039;&lt;br /&gt;
!1,000,000 VACF integral (&#039;&#039;figures aa-cc)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|[[File:Rmt mysi.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt masi.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|[[File:Rmt myli.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt mali.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|[[File:Rmt mygi.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt ligi.png|frameless|700x700px]]&lt;br /&gt;
|}&lt;br /&gt;
The diffusion coefficients for each of the plots above are tabulated below using the final data point from the integral plot. This is the integral over the whole graph using the trapesium rule. This must be corrected for the timestep; the value is multiplied by 0.002. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom data diffusion coefficients, &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
!1,000,000 atom data diffusion coefficients &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;-0.00055&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{-0.00055}{6} = -0.00018 \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.00014&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.00014}{6} = 0.000046 \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.242&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.242}{6} = \mathbf{0.0807}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.270&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.270}{6} = \mathbf{0.0901}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;25.6&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{25.6}{6} = \mathbf{8.55}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;9.81&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{9.81}{6} = \mathbf{3.27}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
The biggest source of error in these plots is that we assume both the 8,000 atom data and the 1,000,000 atom data take the same amount of time to converge. &#039;&#039;Figure z. &#039;&#039;shows that 5000 timesteps is not long enough for the velocity autocorrelation coefficient for 8,000 atoms to converge as far as 1,000,000 atom data does in this length of time. As the molecular dynamics simulations simulate random motion, this could induce fluctuations in the velocity autocorrelation plot which could increase or decrease the integral introduction another source of error.&lt;br /&gt;
&lt;br /&gt;
Again, the diffusion coefficient of the Lennard-Jones solid can be assumed to be zero for the same reason as the mean squared displacement data. The diffusion coefficient of the liquid is lower for both sets of data when calculated using the velocity autocorrelation function, and the diffusion coefficient is higher for both sets of data.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=541963</id>
		<title>Rep:Mod:hakunamatata</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=541963"/>
		<updated>2016-02-25T15:06:04Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Introduction to Molecular Dynamics Simulations ==&lt;br /&gt;
===The Classical Particle Approximation and Numerical Integration===&lt;br /&gt;
The verit and verit-velocity algorithms are numerical methods to approximate the average position and velocity respectively of randomly moving atoms in a particular medium (solid, liquid, fliud etc.). This position and velocity can be applied to Newtonian mechanics to calculate such properties as the force and potential energy of the system. The algorithms work by splitting the function into discrete time steps, calculating the values of position and velocity at this particular time step, and then effectively &amp;quot;joining the dots&amp;quot; to create an approximate function. These simulations always use the answer from the previous timestep to compute the new timestep, so initial conditions must be given for the first step. Both of the algorithms are shown below and are derived from the Taylor expansion of the position or velocity of the atoms at the timestep &amp;quot;n+1&amp;quot; or &amp;lt;math&amp;gt;t+\delta t&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit Algorithum:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{x}_i\left(t + \delta t\right) \approx 2\mathbf{x}_i\left(t\right) - \mathbf{x}_i\left(t - \delta t\right) + \frac{\mathbf{F}_i\left(t\right)}{m_i}\delta t^2  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit-Velocity Algorithum:&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i\left(t\right)&amp;lt;/math&amp;gt; is the force acting on a particular atom as a function of time&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i&amp;lt;/math&amp;gt; is the acceleration &lt;br /&gt;
&lt;br /&gt;
The smaller the timestep, the closer the numerical approximation is to the true solution function, which can be modeled as a classical harmonic oscillator. &#039;&#039;Figure a.&#039;&#039; in the table below shows the comparison between the two methods in &#039;&#039;time&#039;&#039; space. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure a. &#039;&#039;Plots of position vs time comparing the verit algorithm and harmonic spring results&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure b. &#039;&#039;Plot of the total classical energy of the system (potential + kinetic)&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory xanalytical.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory energy.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The harmonic spring position values are modeled from the harmonic oscillator or particle on a spring. The equation of &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; was used to calculate these values, where &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; are 1 and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; is zero. As seen on the plot, the curves produced from the two different methods of calculating the position are in good agreement.&lt;br /&gt;
|The potential energy is calculated using the equation U = 1/2 kx^2, with a value of k given as 1. The kinetic energy is calculated using the velcity from the verit-velocity algorithm using the equation T = 1/2 mv^2, with a value of m given as 1. The total energy of the system, E, is equal to T + U. The values for x (potential energy) and v (kinetic energy) are taken from the verity algorithm and verit-velocity algorthim respectively. &lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;Figure c. &#039;&#039;Plot of the difference (error) between the harmonic spring and verit algorithm data&lt;br /&gt;
!&#039;&#039;Figure d. &#039;&#039;Plot of the peaks in the error plot in &#039;&#039;figure c.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory error.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory errorpeaks.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The peaks in the error between the harmonic spring and verit algorithm results are at the place where the position curve crosses the time axis. This is because the harmonic spring data (x(t)) has a slightly shorter wave period than that of the verit velocity algorithm, and therefore the difference will get larger with each period of the wave, shown by the error getting larger in &#039;&#039;figure c. &#039;&#039;The period of the plot of the two methods are different because the verit algorithm is much more approximate so does not give the correct solution.&lt;br /&gt;
|The change in the error/difference between the harmonic spring data and verit algorthm data increases linearly and so therefore period of each of the plots in &#039;&#039;figure 1&#039;&#039;. must be constant. &lt;br /&gt;
|}&lt;br /&gt;
The error can also be quantified on a &#039;&#039;phase space&#039;&#039; plot; phase space is momentum or velocity plotted as a function of position. The true solution for motion of an atom is a perfect ellipse, and the more elliptic the shape (less circular) the more momentum or velocity is in the system. A numerical solution, like the verit algorithms, will produce a set of points very close to this ellipse but not perfectly following the curve. A good numerical solution will remain in an elliptical shape, whereas a bad numerical solution, for example one with a large timestep, will spiral away from the true solution. Two examples of such systems using the data from &#039;&#039;figures a-d&#039;&#039; are shown below.  &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure e. &#039;&#039;Phase plot of the harmonic spring data with a good numerical solution (timestep = 0.1) &lt;br /&gt;
!&#039;&#039;Figure f. &#039;&#039;Phase plot of the harmonic spring data with a bad numerical solution (timestep = 0.3) &lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory phasegood.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory badphase.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The timestep at which this data is plotted is 0.1, which results in a very small change in the energy, as seen in &#039;&#039;figure b. &#039;&#039;Increasing the time step will increase the variation in the energy. To keep the variation in the total energy of the system under 1%, the time step must be no larger than approximately 0.28. The energy varies more with increasing time step because the jumps in the algorithm  are getting larger due to less data points. The algorithm assumes these points are joined by a straight line; that the halfway point in the jump is the average between the starting and finishing point of the jump. The phase space plot will become less elliptic and the jumps eventually become so larger that the plot is no longer a continuous shape.  &lt;br /&gt;
&lt;br /&gt;
It is essential to monitor the energy of a numerically modeled system because a good solution for the motion of an atom has a constant energy and a plot in phase space of a perfect ellipse.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance and Force at Zero Potential===&lt;br /&gt;
From classical mechanics, the force calculated from the Newtonian mechanics above can be used to calculate the potential experienced by an atom in the system. They are related by the equation: &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;
This potential gives the shape and dimension of the potential surface on which the system can be modeled. A simple 1D potential that is used to describe the inter atomic forces of a liquid is the Lennard-Jones potential. It has the characteristic features of a short range repulsion potential and harmonic character around the equilibrium bond distance. The value of &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the inter atomic separation when the potential, &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;, is equal to zero, can be calculated by equating the equation for the Lennard-Jones potential to zero and solving for &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The equation for the Lennard-Jones potential: &amp;lt;math&amp;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;
Equating this to zero: &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;
And rearranging in order to separate the variables: &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;
Rearranging this gives &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in terms of &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt; r^6 = \sigma^6&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r = r_0&amp;lt;/math&amp;gt; in this case.&lt;br /&gt;
&lt;br /&gt;
This, therefore, gives the result that interatomic distance at zero potential, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, is equal to &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; in the Lennard-Jones potential is effectively the diameter of one of the particles in the system being measured; in this case, the liquid we are simulating. This is the point where the potential curve crosses the x-axis on an Energy vs interatomic distance plot. The force, &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt;, at this point on the curve corresponds to the gradient; it is found by calculating the derivative of the curve at this point. &lt;br /&gt;
&lt;br /&gt;
To calculate the force, we must differentiate the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As force is equal to the negative differential of the potential energy, the value of the force is: &amp;lt;math&amp;gt;\mathbf{F}_i = 48\epsilon \sigma^{12} r^{-13} - 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting in the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at zero potential from the calculation before: &amp;lt;math&amp;gt;\mathbf{F}_i = \frac{48\epsilon}{\sigma} - \frac{24\epsilon}{\sigma} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The gradient where the Lennard-Jones plot crosses the axis is negative; &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; in the term obtained for &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is negative and therefore the overall value of the force will be negative.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance, Force and Well Depth of the Potential at Equilibrium===&lt;br /&gt;
To calculate the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at the equilibrium position, we need to use the derivative of the potential energy curve. The equilibrium value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is the value at the minimum of the Lennard-Jones curve; when &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Therefore, equating the derivative to zero gives: &amp;lt;math&amp;gt;0 = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rearranging this: &amp;lt;math&amp;gt;48\epsilon \sigma^{12} r^{-13} = 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And simplifying and cancelling gives: &amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6&amp;lt;/math&amp;gt;. Therefore the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at equilibrium is: &amp;lt;math&amp;gt;r_{eq} = \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Physically, this result means that the equilibrium distance is 1.12 times the diameter of one of the particles; the particles have a small gap between them so do not touch. A short range repulsion potential, as seen in the Lennard-Jones curve, is a result of the particles coming into contact. &lt;br /&gt;
&lt;br /&gt;
Again, the force can be calculated from the derivative of the potential curve at the equilibrium point. As the derivative at this point is zero (a minimum on the curve), the force will therefore also be zero.&lt;br /&gt;
&lt;br /&gt;
The well-depth of the potential curve is the difference between zero potential and the potential at the equilibrium bond length. This can be calculated by substituting the value for the equilibrium bond length into the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 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;
Cancelling and simplifying this equation gives: &amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \times \frac{1}{4}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the absolute value for the well depth is &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;. The actual value of this potential is &amp;lt;math&amp;gt;-\epsilon&amp;lt;/math&amp;gt;, as the equilibrium bond length gives the most stable configuration of the molecules and therefore suggests attractive interactions are involved in the arrangement of the molecules; this attractive potential means its negative. &lt;br /&gt;
&lt;br /&gt;
===Boundary Conditions and the Lennard-Jones Cutoff===&lt;br /&gt;
When simulating a liquid, it is computationally impractical to simulate a realistic liquid. Therefore a smaller &#039;box&#039; containing &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; particles is simulated and the computer program will use &#039;&#039;periodic boundary conditions&#039;&#039; to simulate infinite repetitions of this box; when the atom reaches one edge of the box, in periodic boundary conditions, it will reappear again at the opposite edge of the box as if they were connected. For example, an atom at the position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a box of size &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;. Without periodic boundary conditions, we would assume that the atom would end up at the position &amp;lt;math&amp;gt;(1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;. However, in this box, there is no such position and so the particle must reappear at the opposite edge to where it effectively &#039;left&#039; the box. Therefore, it&#039;s ending position will be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The number of particles, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; simulated by the computer is usually between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt;. Physically, this is a very small volume. Considering water, we can calculate the number of molecules in 1 mL or 1 cm^3, a volume that would be considered small in the lab. Taking the concentration of water at standard conditions, &amp;lt;math&amp;gt;55\ mol\ dm^{-3}&amp;lt;/math&amp;gt;, we can convert it to the number of moles per mL: &amp;lt;math&amp;gt;0.055\ mol\ mL^{-1}&amp;lt;/math&amp;gt;. Multiplying this value by Avagadro&#039;s constant (&amp;lt;math&amp;gt;N_A&amp;lt;/math&amp;gt;) gives the number of molcules of water per mL: &amp;lt;math&amp;gt;3.02 \times 10^{22}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The reverse procedure can be used to compare this to the volume of 10,000 molecules: 10,000 divided by Avagadro&#039;s constant gives the number of moles of water which 10,000 molecules makes up: &amp;lt;math&amp;gt;1.66 \times 10^{-20}\ moles&amp;lt;/math&amp;gt;. Dividing this value by the concentration (from &amp;lt;math&amp;gt;n=cV&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is the number of moles, &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; is the concentration and &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume), gives the volume: &amp;lt;math&amp;gt;3.02 \times 10^{-22}\ dm&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;3.02 \times 10^{-19}\ mL&amp;lt;/math&amp;gt;. Physically, of course, this is far too small a volume to be recorded in the lab.&lt;br /&gt;
 &lt;br /&gt;
Periodic boundary conditions simulate an infinite lattice and therefore, when computing the potential, will calculate an infinite amount of pair interactions. Therefore, it is only practical to calculate the energies up to a certain interatomic distance; the Lennard-Jones cutoff distance. Beyond this point, the potential energy and the integral of the curve beyond this point become insignificant and do not impact on the overall energy; removing interactions beyond this point from the calculations will not effect the accuracy. Multiplying the Lennard-Jones potential with the radial distribution function gives a plot of the probability of finding an atom at a particular interatomic distance. The larger the interatomic distance, the lower the probability and so the energy after the cutoff can be disregarded. &lt;br /&gt;
&lt;br /&gt;
Integrating over the Lennard-Jones curve and applying this cutoff as the lower limit can show how small the integral is:&lt;br /&gt;
&lt;br /&gt;
For a general cutoff of with value &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;I = \int_{x}^\infty \phi\left(r\right)\mathrm{d}r = \int_{x}^\infty \frac{4\epsilon\sigma^{12}}{r^{12}}\mathrm{d}r - \int_{x}^\infty \frac{4\epsilon\sigma^6}{r^6}\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving this: &amp;lt;math&amp;gt;I = 4\epsilon\sigma^{12} {\frac{-1}{11r^{11}}\,\Bigg\vert\,}_x^\infty - 4\epsilon\sigma^{6} {\frac{-1}{5r^{5}}\,\Bigg\vert\,}_x^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This gives the general solution: &amp;lt;math&amp;gt;I = \frac{4\epsilon\sigma^{12}}{11x^{11}} - \frac{4\epsilon\sigma^{6}}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating this for &amp;lt;math&amp;gt;\epsilon = \sigma = 1&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;I = \frac{4}{11x^{11}} - \frac{4}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt; (or 2 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.025&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt; (or 2.5 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0082&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt; (or 3 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0033&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All values are taken to 2 significant figures. As the cutoff value for the interatomic distance gets larger, the integral gets smaller, and therefore the energy excluded from the calculation becomes smaller, and the second term in the solved integral, &amp;lt;math&amp;gt;I&amp;lt;/math&amp;gt;, dominates the energy value.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
When using the Lennard-Jones potential, it is appropriate to use reduced units for intermolecular distance, energy and temperature. Reduced units can be calculated by the following relationships:&lt;br /&gt;
&lt;br /&gt;
Intermolecular 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;
&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; are scaling factors. For example, if the parameters for Argon are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\sigma = 0.34 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt; \epsilon\ /\ k_B = 120 K&amp;lt;/math&amp;gt;&lt;br /&gt;
* Lennard-Jones cutoff &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;. The well-depth, &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;, is &amp;lt;math&amp;gt;0.999 kJ mol^{-1} \approx 1 kJ mol^{-1}&amp;lt;/math&amp;gt;. The value of &amp;lt;math&amp;gt;T* = 1.5&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;180 K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
The first aim of the simulations is to determine the most appropriate timestep to use in the vert algorithm simulations. This timestep is a balance between the accuracy of the results (the smaller the timestep, the closer to the true functing the result will be) and the length of real time over which the simluation is run (the smaller the timestep, the less real time over which the simulation will give a result). The appropriateness of the timestep will be determined by plotting how the total free energy of the simulated lattice equilibrates over time.  &lt;br /&gt;
&lt;br /&gt;
Five different calculations, which simulated the melting of a crystal and subsequent equilibration of the energy of the melted crystal, were run at five different timesteps; 0.001, 0.0025, 0.0075, 0.01 and 0.015, and were described by the NVE or &#039;&#039;&amp;quot;microcanonical ensemble&amp;quot;&#039;&#039;. An ensemble is a collection of samples of a system which are under three thermodynamic constraints (three properties are kept constant); in the microcanonical ensemble, the number of particles, the volume and the total energy is kept constant (NVE). &lt;br /&gt;
&lt;br /&gt;
These calculations simulate a box of 1000 unit cells and use periodic boundary conditions to replicate the simulation to a larger scale. Because these simulations use the numerical methods defined in the previous section, the initial position and velocity of the atoms must be defined in the input file. The Brownian (uncorrelated, random) motion of the atoms in the simulation means that there is no long range order in the system and so the atoms in a real system would start in random positions. However, assigning random starting coordinates to the atoms in a simulated liquid is not a relative process; the coordinates are generate independently of each other. Therefore there is a probability that the coordinates simulated will cause the atoms to overlap, which would give a very large repulsion potential, as seen in the Lennard-Jones potential at very small interatomic distances. This short-range repulsion potential comes from the hard-sphere model of atomic simulation.&lt;br /&gt;
&lt;br /&gt;
The input file also defines the structure and density of the lattice. The number density of lattice points in any lattice is the number of lattice points per volume of the unit cell. In a simple cubic lattice, there is one lattice point in the unit cell. From an sc lattice with lattice spacing (length of one side of the unit cell) being &amp;lt;math&amp;gt;1.07722&amp;lt;/math&amp;gt;, the number density of the lattice points is calculated by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{1}{1.07722^3} = 0.7999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a face-centered cubic lattice (fcc), there are four lattice points in the unit cell. Rearranging the above relationship, the lattice spacing can be calculated from the number of lattice points in a unit cell and number density, &amp;lt;math&amp;gt;1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Lattice\ spacing = \sqrt[3]{\frac{number\ of\ lattice\ points\ per\ unit\ cell}{number\ density}} = \sqrt[3]{\frac{4}{1.2}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation creates a box which includes 1000 unit cells, which is 10 unit cells in each dimension. For a simple cubic lattice, because there is one lattice point per unit cell, there will be 1000 atoms created as seen in the input file. The &#039;&#039;create_atom&#039;&#039; command in the input file determines how many boxes are created in the simulation and therefore how many atoms will be created. If a face centered cubic lattice is simulated, because there are 4 lattice points per unit cell, 4000 atoms will be created in the &#039;&#039;create_atom&#039;&#039; command. &lt;br /&gt;
&lt;br /&gt;
The input script also contains the following commands which defines the potential surface which is used to model the intermolecular reactions:&lt;br /&gt;
 mass 1 1.0&lt;br /&gt;
This instruction sets the mass type for the atoms being simulated. It takes the general form of “mass I value”, where mass is the keyword which tells LAMMPS what the input is, I is the atom type and value is the mass of the atom. In this case, I is defined by a specific numerical value; 1 as there is only 1 type of atom in the simulation, but it can be defined with an asterisk (1*), which means “all atom types of 1 to n inclusive”. &lt;br /&gt;
 pair_style lj/cut 3.0&lt;br /&gt;
This instruction sets the type of potential which LAMMPS uses in its calculation of pairwise interactions. It takes the general form of “pair_style style args”, where pair_style is the keyword for LAMMPS, style defines the potential and any specifications it may have, and args are the arguments required for this particular potential. In this case, the Lennard-Jones potential has been used (lj) with a cutoff point (cut) of 3σ. The cutoff point is explained in the introduction section. &lt;br /&gt;
 pair_coeff * * 1.0 1.0&lt;br /&gt;
This instruction specifies the coefficients for the pairwise interactions of each pair of atoms, and it takes the general form “pair_coeff I J args”. Pair_coeff is the keyword, I and J are the atom types, and args are the coefficients which the different atoms types take. In this case, the asterisk in place of I and J refers to all atoms types from 1 to n. The coefficients are the pairwise interactions are 1 for each atom, meaning each atom has an equal contribution to the interaction.&lt;br /&gt;
&lt;br /&gt;
In these initial calculations, the initial conditions for the numerical methods, &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. For this experiment, the verit-velocity algorithm would be the most appropriate, as both the starting position and velocity is specified for this algorithm. &lt;br /&gt;
&lt;br /&gt;
To define the timestep for the algorithm the following code is used defining the timestep as a variable instead of just giving it a definite value&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;
It is much easier to use the variable version of defining the timestep because the length of time over which the simulation is run depends on the time step. By using a variable, you can keep the length of the simulation the same, no matter the size of the timestep. It also makes it easier if multiple properties depend on the timestep – only the variable needs to be changed, not all the parts of the script where timestep is defined. &lt;br /&gt;
&lt;br /&gt;
The calculations produce the values for the total energy of the system, temperature and pressure in the output files, which can be plotted against time. How well these values equilibrate determines the appropriateness of the timestep to use in further calculations in the experiment.  &lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!style=&amp;quot;width: 33%;&amp;quot;|&#039;&#039;Figure h. &#039;&#039;Plot of the equilibration of total energy for five different timesteps&lt;br /&gt;
!style=&amp;quot;width: 33%;&amp;quot;|&#039;&#039;Figure ha. &#039;&#039; Plot of the temperature vs time equilibration for timestep = 0.0025&lt;br /&gt;
!style=&amp;quot;width: 33%;&amp;quot;|&#039;&#039;Figure hb. &#039;&#039; Plot of the pressure vs time equilibration for timestep = 0.0025 &lt;br /&gt;
|- &lt;br /&gt;
|[[File:rmt_totalenergycurve.png|600x600px]]&lt;br /&gt;
|[[File:rmt_tempvstime0025.png|600x600px]]&lt;br /&gt;
|[[File:rmt_pressurevstime0025.png|600x600px]]&lt;br /&gt;
|}&lt;br /&gt;
The largest time step to give an acceptable result is 0.01. However, for any simluation we would expect energy to be independent of the timestep, something which is not true at a timestep greater than 0.0025. Therefore, the most appropriate timestep to use for a balance between accuracy and length of time which the simulation covers is 0.0025. &lt;br /&gt;
&lt;br /&gt;
0.015 is a particularly bad choice of timestep. This is because the verit-velocity algorithm gives an approximate result to the velocity (kinetic energy term) and position (potential energy term), and so when the timestep becomes too large with respect to the time, the algorithm no longer becomes a suitable way to calculate the energy. As seen in the graph of 0.015, the energy does not equilibrate and diverges.&lt;br /&gt;
&lt;br /&gt;
The plots for temperature and pressure vs time give a good indication for the next section an appropriate pressure and temperature to use for running the simulations under specific conditions.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions ==&lt;br /&gt;
The calculations in this section are run in the isobaric-isothermal ensemble, where the number of particles in the system, the pressure and the temperature are kept constant (NpT). This means that the temperature and the pressure are recalculated in every step, so are no longer constant like they were in the NVE ensemble. From the &#039;&#039;equipartition theorem&#039;&#039;, each degree of freedom will contribute &amp;lt;math&amp;gt;\frac{1}{2} k_B T&amp;lt;/math&amp;gt; of energy to the system. As the system is in three dimensions, there are three degrees of translational freedom and so the total internal energy is equal to &amp;lt;math&amp;gt;\frac{3}{2} k_B T&amp;lt;/math&amp;gt;. Equating this to the kinetic energy, &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt;, at the end of every step and rearranging will allow calculation of the temperature after every step. &lt;br /&gt;
&lt;br /&gt;
A target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, is defined in the input script and the system will equilibrate by multiplying the velocity by a factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, in order to accommodate for the fluctuation and keep the system at approximately the target temperature and therefore constant internal energy. If the temperature of the system is greater than the target temperature, the system&#039;s kinetic energy is too high, so &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is reduced to compensate for this. The same is true for is the temperature is lower than the target temperature; &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than one in the next step to increase the kinetic energy which is now too low. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; can be derived from equating the kinetic and internal energy of the system at an arbitrary time step:&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;
Expanding the brackets inside the sum and moving the term containing &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; out of the sum: &amp;lt;math&amp;gt;\frac{\gamma^2}{2}\sum_i m_i \left(v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;, we can replace &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt; on the left hand side of the equation with &amp;lt;math&amp;gt;\frac{3}{2} N k_B T&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;\frac{3\gamma^2}{2}N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Simplifying and rearranging for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, gives: &amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The principle is the same for controlling the pressure.&lt;br /&gt;
&lt;br /&gt;
As temperature and pressure are no longer constant, he input files require specification of the pressure and the temperature for each of the systems run. 10 simulations were run at two different pressures with five different temperatures at each. &lt;br /&gt;
* Temperatures: 1.6, 1.9, 2.2, 2.5, 2.8&lt;br /&gt;
* Pressures: 2.5, 3.0&lt;br /&gt;
These pressures were chosen because the data simulated when choosing an appropriate timestep gave a pressure between 2.5 and 3.0.  &lt;br /&gt;
&lt;br /&gt;
For the code which computes the thermodynamic potentials, this particular line defines how many steps contribute towards the average of the thermodynamic parameters computed in the calculation. &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;
&#039;&#039;fix&#039;&#039; is the keyword, &#039;&#039;aves&#039;&#039; is the name of the group of fixes which in this case is the average of the thermodynamic values, &#039;&#039;all&#039;&#039; specifies the atoms which the fix is applied to which in this case is all the atoms in the simulated system and &#039;&#039;ave/time&#039;&#039; means that compute global time averages are calculated. The following three numbers have the following meaning:&lt;br /&gt;
&lt;br /&gt;
*100 = use the input values every 100 timesteps&lt;br /&gt;
*1000 = use input values 1000 times for calculating the average&lt;br /&gt;
*100000 = calculate the average every 100000 timesteps&lt;br /&gt;
&lt;br /&gt;
Therefore for the total calculation which lasts for 100000 will only have the average calculated once. Assuming 1 value every timestep, there will be 100000/100 values = 1000. The amount of time simulated is 100,000 steps, read from the following line.&lt;br /&gt;
&lt;br /&gt;
The density data from all ten calculation were plotted on the same graph, along with the density for an &amp;quot;ideal&amp;quot; gas. This density can be derived from the ideal gas law:&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;
Rearranging in terms of density: &amp;lt;math&amp;gt;\frac{N}{V} = \frac{P}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As these simulations are being run under reduced units, we can take &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt;, and so the density of the ideal gas becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the density of the ideal gas is plotted as the pressure divided by the temperature in pressure-temperature phase space.&lt;br /&gt;
[[File:Rmt dvt plot.png|none|thumb|800x800px|&#039;&#039;Figure i. &#039;&#039;Plot of the variation in density with temperature at a defined pressure for the numerically simulated and ideal systems]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that calculated in the ideal gas law. This is because for an ideal gas, an assumption is made that there are no intermolecular interactions, and therefore forces such as electron repulsion forces are ignored; repulsion forces dominate over attractive ones, as all the atoms in this simulation are the same and so partial charges or dipoles are created. This will mean that the particles move closer together than a real gas and so the density will be larger. This discrepancy between the ideal and non-ideal systems becomes larger at a higher pressure because with a higher pressure, the atoms in the system are closer together and therefore the intermolecular repulsion will become larger. This greater repulsion will in turn have a larger effect on decreasing the density.&lt;br /&gt;
&lt;br /&gt;
== Statistical Physics Calculations of the Heat Capacity ==&lt;br /&gt;
The heat capacity of a system at constant volume can be calculated from the variance in the total energy of the system. The relationship used to calculate the heat capacity is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = 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;\left\langle E^2\right\rangle&amp;lt;/math&amp;gt; is the continuous average of the total square energy at each temperature as a function of temperature. &amp;lt;math&amp;gt;\left\langle E\right\rangle^2&amp;lt;/math&amp;gt; is the continuous average of the total energy at each temperature as a function of temperature squared. The heat capacity is multiplied by &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; in this case because the version of LAMMPS calculates every energy divided by the number of molecules in the system simulated.&lt;br /&gt;
&lt;br /&gt;
The calculations in this sections are run in density-temperature phase space and the ensemble has changed to the canonical ensemble (NVT). A set of input files were written for ten calculations for, like the previous section, two pressures and five different temperatures at each pressure:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 0.2, 0.8&lt;br /&gt;
*Temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{C_V}{V}&amp;lt;/math&amp;gt; was plotted against temperature to determine the relationship in density-temperature phase space. An example of an input file can be found [[Media:nvt_-_0220.in|here]]. The lines which have been changed from the previous input files are at the end of the script:&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 &lt;br /&gt;
 thermo_style custom step etotal temp&lt;br /&gt;
 variable energy equal etotal&lt;br /&gt;
 variable energy2 equal etotal*etotal&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_energy v_energy2 v_temp&lt;br /&gt;
 run 100000&lt;br /&gt;
 &lt;br /&gt;
 variable aveenergy equal f_aves[1]&lt;br /&gt;
 variable aveenergy2 equal f_aves[2]&lt;br /&gt;
 variable avetemp equal f_aves[3]&lt;br /&gt;
 variable heatcapacitydv equal atoms*atoms*(v_aveenergy2-v_aveenergy*v_aveenergy)/(v_avetemp*v_avetemp*vol)&lt;br /&gt;
 &lt;br /&gt;
 print &amp;quot;Averages&amp;quot;&lt;br /&gt;
 print &amp;quot;--------&amp;quot;&lt;br /&gt;
 print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Heat Capacity per Volume: ${heatcapacitydv}&amp;quot;&lt;br /&gt;
The line with the keyword &#039;fix&#039; determines which thermodynamic values are averaged and over how many steps they are averaged. The next section takes these averages as variables and uses them to define the heat capacity which is calculated from the equation at the beginning of this section. Only the energy and temperature are needed to define the heat capacity and so only these values are calculated by the simulation. [[File:Rmt heatcapacitybyv.png|none|thumb|800x800px|&#039;&#039;Figure j. &#039;&#039;C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V against temperature for the two different pressures 0.2 and 0.8]]As seen in the above figure, the heat capacity decreases with temperature for both pressures. It would be expected for an ideal system that as the temperature increases, the heat capacity at constant volume increases and tends to a constant volume at very high T of 3R; R = the universal gas constant. This means increasing the temperature increases the amount of energy being stored in the system and this energy is stored as vibrational energy. However, for a Lennard-Jones liquid, the system being simulated here, the heat capacity decreases with temperature. This is because the simulation has two components to the simulation; the atoms are vibrating in a quasi-harmonic fashion around the equilibrium position and also diffuse between neighbouring equilibrium positions in a gas like fashion. As the temperature increases, the amount of diffusion increases and the vibrations decreases, therefore decreasing the ability of the system to absorb vibrational energy, resulting in the decrease in heat capacity. &amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www.nature.com/ncomms/2013/130816/ncomms3331/full/ncomms3331.html?message-global=remove&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural Properties and the Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a single atom in a system is a plot of the probability that an atom can be found at a certain distance from the central atom. The peaks in this plot can give the distance of an atom from its nearest neighbours in the Lennard-Jones simulated system. &lt;br /&gt;
&lt;br /&gt;
The calculations in this section simulate a Lennard-Jones solid, liquid and gas and, using the output of the LAMMPS trajectory file, plots both the radial distribution function and its integral using DLV. The temperature and pressure parameters for these calculations were taken from the phase diagram or coexistence curve for a Lennard-Jones system.&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt; The parameters used are displayed in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! Temperature, &amp;lt;math&amp;gt;T^*&amp;lt;/math&amp;gt;&lt;br /&gt;
! Pressure, &amp;lt;math&amp;gt;p^*&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| LJ Solid&lt;br /&gt;
| 1.5&lt;br /&gt;
| 1.2&lt;br /&gt;
|-&lt;br /&gt;
| LJ Liquid&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.8&lt;br /&gt;
|-&lt;br /&gt;
| LJ Gas&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.01&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The data obtained from the plots and the radial distribution functions and their integrals were plotted and shown in the table below.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure k. &#039;&#039;The radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
!&#039;&#039;Figure l. &#039;&#039;The integrals of the radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt fullrdfs.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt allintegralsrdf.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
[[File:Rmt Nearest neighbours.png|left|thumb|300x300px|&#039;&#039;Figure m. &#039;&#039;Representation of a cross section of the first three shells of nearest neighbours in an fcc solid. The black atom is the central atom being considered, the blue atoms are the first shell, the orange atoms the second shell and the purple atoms are the third.]]&lt;br /&gt;
The RDF of the solid gives a very irregular curve because of the irregular structure of the lattice. For a simple cubic lattice, a regular structure of the RDF would be expected because of the equal number of atoms in each of the nearest neighbour shells of the atoms. However, for face-centered cubic, the solid in this simulation, the structure is much more irregular and as the atoms move from their equilibrium position in the lattice due to vibrations, the peaks in the radial distribution will broaden. The irregular heights of the peaks are due to the varying numbers of atoms in each of the nearest neighbour shells for the central atom. The first shell gives the highest peak as it contains the most atoms; in total, considering all four surrounding unit cells, this shell contains 12 atoms and ideally takes the geometry of an icosahedron. The second shell is smaller and contains only 6 atoms in an octahedral coordination shape. The following shell again contributes 12 atoms, 3 from each unit cell. This therefore explains why the heights of the peaks in the solid plot in &#039;&#039;figure k.&#039;&#039; vary. These values can be confirmed by the plot in &#039;&#039;figure o.&#039;&#039; which is the integral; it cumulatively adds the numbers in each shell. The size of the first &amp;quot;step&amp;quot; is 12; there are 12 atoms in the first shell. The size of the second step is approximately 18; there are 18-12=6 steps in the second shell. The same theory applies for the third shell which gives a value of 13. This is slightly different to the predicted value possibly due to error in the calculation of the radial distribution function and therefore its integral. &lt;br /&gt;
&lt;br /&gt;
The RDF of the liquid has a representation of far fewer shells, which means that there are less atoms in the space close to a &amp;quot;central&amp;quot; atom in the bulk solution. The particles have more energy and therefore do not keep to a regular lattice structure. As they move about, some regualrity is maintained around each atom, but only to the extend of two or three shells, meaning there is no long range order in a Lennard-Jones liquid. &lt;br /&gt;
&lt;br /&gt;
The RDF of the gas again omits more shells as there is almost no order in a Lennard-Jones gas. The single peak on this plot considers only the set of atoms closest to the central atom and all others are disregarded as they are too far apart. &lt;br /&gt;
&lt;br /&gt;
Considering &#039;&#039;figure l.&#039;&#039;, the size of the integral of the radial distribution function decreases from solid to liquid to gas. This makes sense as the number of atoms in the surrounding shells decreases with density of the system; the atoms become further apart. &lt;br /&gt;
&lt;br /&gt;
From the plot of the radial distribution function of the solid, the lattice spacing can be determined. For this, we can consider just the first three peaks of the RDF plot. The lattice spacing refers to the length of one unit cell, and so, using &#039;&#039;figure m&#039;&#039;, we can calculate this using two different methods; a) we can use the distance between the central atom and the first shell of nearest neighbours, and use trigonometry to calculate the lattice spacing. Or alternatively b) we can use the distance between the central atom and the second nearest neighbour shell to get the lattice spacing.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure n. &#039;&#039;The radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
!&#039;&#039;Figure o. &#039;&#039;The integral of the radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt solidgr3.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt solidint3.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
Using method a) (with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; as the distance between the central atom and the nearest neighbour: Lattice spacing = &amp;lt;math&amp;gt;\frac{r}{cos({\frac{\pi}{4}})} = \frac{1.02}{cos({\frac{\pi}{4}})} \approx 1.44&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using method b): Lattice spacing &amp;lt;math&amp;gt;\approx 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can take an average between the two get an approximate value for the lattice spacing: &amp;lt;math&amp;gt;1.46 \plusmn 0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These values for distance are all in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
The ability of atoms to move around in a solid liquid or gas can be characterised by the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. In this section, we will explore two different ways to calculate the diffusion coefficient and compare the results. &lt;br /&gt;
&lt;br /&gt;
=== The Mean Squared Displacement ===&lt;br /&gt;
The diffusion coefficient can be measured easily be calculating the mean squared displacement of atoms in the solution; the diffusion coefficient is proportional to the first derivative of the mean squared displacement. By plotting the mean squared displacement as a function of time, the gradient can be taken to calculate the diffusion coefficient when its has equilibrated and become linear.&lt;br /&gt;
&lt;br /&gt;
The temperature and density parameters used were the same as in the previous section:&lt;br /&gt;
* Solid: T=1.5, D=1.2&lt;br /&gt;
* Liquid: T=1.1, D=0.8&lt;br /&gt;
* Gas: T=1.1, D=0.01&lt;br /&gt;
&lt;br /&gt;
Mean density squared calculations were run for all three Lennard-Jones phases and the data plotted as function of timestep below. The data from a simulation containing 1,000,000 atoms was plotted for comparision.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!Plots for the 8,000 atom data (&#039;&#039;figures p-r)&#039;&#039;&lt;br /&gt;
!Plots for the 1,000,000 atom data (&#039;&#039;figures s-u)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|[[File:Rmt_MSDsolid.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt_MAsolid.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|[[File:Rmt MSDliquid.png|700x700px]]&lt;br /&gt;
|[[File:Rmt MAliquid.png|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|[[File:Rmt MSDgas.png|700x700px]]&lt;br /&gt;
|[[File:Rmt dataplots 25894 image001.png|700x700px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The exact relationship between the mean squared displacement and the diffusion coefficient is:&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;
Taking the gradients of each of the curves at the point at which they become linear and dividing by six will give the diffusion coefficient for each set of data. The gradient also needs to be converted to a function of time; this is done by dividing by the timestep, which in this case is 0.002:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom data diffusion coefficients, &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
!1,000,000 atom data diffusion coefficients &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 0.9999&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|Gradient = 0.0972&lt;br /&gt;
Amount of data used to calculate gradient: timestep 4300-5000, &amp;lt;math&amp;gt;R^2 = 0.9998&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{48.6}{6} = \mathbf{8.1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient = 0.0386&lt;br /&gt;
Amount of data used to calculate gradient: timestep 4000-5000, &amp;lt;math&amp;gt;R^2 = 0.1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{19.6}{6} = \mathbf{3.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For both of the solid approximations, the diffusion coefficient can be approximated as zero. This is because, when equilibrated, the function has a constant value of around 0.2 for the mean squared displacement. A gradient with a value of zero means that the atoms take an infinite amount of time to change their mean squared displacement; to move away from their equilibrium position, and so this means that we can approximate in this system, there will be no diffusion. In real system, however, this is not the case; diffusion occurs but it is very slow. A plot for a real system will give a very shallow positive gradient.&lt;br /&gt;
&lt;br /&gt;
The liquid approximations are very well correlated. This is because in both cases, the mean squared displacement of particles in a liquid increases linearly with time and the gradient of both plots are almost identical. We can assume from this that identical starting conditions were used to calculate this data. Also, we can estimate that 8,000 atoms is a large enough simulation to give an accurate result for the diffusion coefficient for the Lennard-Jones liquid.&lt;br /&gt;
&lt;br /&gt;
The gas approximations are very different. This is most probably due to the fact that the density specified in calculations are different. The 8,000 data can be estimated to be a much lower density because the diffusion coefficient is faster and this means diffusion will happen faster; at a higher density a particle will take longer to diffuse over a given distance. Because of the difference in density, the two values of the diffusion coefficient cannot be qualitatively compared. The reason for the initial deviation for linearity in the gas plots is due to the momentum of the particles initially dominating over the diffusion and the diffusion coefficient is dependent on time. As the system equilibrates, the diffusion coefficient becomes constant and the plots become linear.&lt;br /&gt;
&lt;br /&gt;
=== The Velocity Autocorrelation Function ===&lt;br /&gt;
&lt;br /&gt;
Another way to calculate the diffusion coefficient is by using the velocity correlation function, which determines how the velocity of an atom changes with time. The function determines the difference in time (&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;) when the velocity becomes uncorrelated, i.e. the difference between the velocity at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; and at time &amp;lt;math&amp;gt;t+\tau&amp;lt;/math&amp;gt;. By integrating over this function, we can find the diffusion coefficient. &lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function: &amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can also be written as the integral: &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;
Using the function which defines the position of a classical harmonic oscillator, we can differentiate this to give the equation for the velocity which we can plug into the integral:&lt;br /&gt;
&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;
&amp;lt;math&amp;gt;dv{x(t)}{t} = v(t) = -A\omega sin(\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also needed for the integral:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t+\tau) = -A\omega sin(\omega(t+\tau)+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v^2(t) = A^2\omega^2 sin^2(\omega t +\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Putting all this into the integral to find the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega sin(\omega t + \phi) \times A\omega sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} A^2\omega^2 sin^2(\omega t +\tau)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A^2\omega^2&amp;lt;/math&amp;gt; can be take out of each of the integrals and cancelled. A substituion can then be made to make solving the integral much simpler:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = \omega t + \phi&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \omega\tau&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the integral becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a) \times sin(a+b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the compound angle rule &amp;lt;math&amp;gt;sin(a+b)=sin(a)cos(b)+cos(a)sin(b)&amp;lt;/math&amp;gt;, the integral can be simplified to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a)sin(a)cos(b) + sin(a)cos(a)sin(b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Separating out into two integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)\frac{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the rule &amp;lt;math&amp;gt;sin(a)cos(a) = \frac{1}{2}sin(2a)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} \frac{1}{2}(sin(2a))\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because the function &amp;lt;math&amp;gt;\frac{1}{2}sin(2a)&amp;lt;/math&amp;gt; is symmetric over all space, the second term in this equation becomes zero. Therefore, the integral simplifies to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b) = cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same calculations from the mean squared displacement section gave an output of the velocity autocorrelation function. The function for the Lennard-Jones solid, liquid and gas were plotted against the timestep along with the approximate function for the velocity autocorrelation function, &amp;lt;math&amp;gt;cos(\omega\tau)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\omega = \frac{1}{2\pi}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure v. &#039;&#039;Plots for the velocity autocorrelation function of a Lennard-Jones solid, liquid and gas; 8,000 atoms&lt;br /&gt;
!&#039;&#039;Figure w. &#039;&#039;Plots for the velocity autocorrelation function of a Lennard-Jones solid, liquid and gas, 1,000,000 atoms&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt VACF 5721 image001.png|800x800px|]]&lt;br /&gt;
|[[File:Rmt MAVACF.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plots for the velocity autocorrelation function show how the time correlation of velocity decreases with time due to collisions with other atoms in the system. The Lennard-Jones solid oscillates around the VACF=0 axis with the oscillations becoming progressively more damped with time. The long range of the oscillations is due to the order in the system. Every time the plot crosses the VACF=0 axis, the velocity of the atom changes direction which is due to a collision with another atom. Every collision for every atom is completely uncorrelated so the change in velocity of one atom as it collides is independent of another change in velocity of another colliding atom. Overall, momentum must be conserved and so overall change of velocity in the system must be conserved. &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones liquid oscillations are damped much quicker; an atom in the liquid only collides with one atom before the velocity becomes uncorrelated with respect to time. The Lennard-Jones gas never reaches the VACF=0 axis as the atoms are too far apart to collide. Because the velocity autocorrelation function never equilibrates, using this method to calculate the diffusion coefficient is inaccurate because the particles in the gas never come into contact with each other.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillating system is so different to the Lennard-Jones systems because the atoms remain in their equilibrium position and vibrate around the same position, never coming into contact with another atom. Because of this, the correlation with time never decreases so the function infinitely oscillates as a sine function.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated from: &amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty C\left(\tau\right)\mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the approximate value for the diffusion coefficient using the velocity autocorrelation function is &amp;lt;math&amp;gt;D = \frac{1}{3}cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The running integral of the velocity autocorrelation functions was plotted using the &#039;&#039;trapesium rule&#039;&#039;, and so the final value on the integral plot is proportional to the diffusion coefficient.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom VACF integral &#039;&#039;(figures w-z)&#039;&#039;&lt;br /&gt;
!1,000,000 VACF integral (&#039;&#039;figures aa-cc)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|[[File:Rmt mysi.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt masi.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|[[File:Rmt myli.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt mali.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|[[File:Rmt mygi.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt ligi.png|frameless|700x700px]]&lt;br /&gt;
|}&lt;br /&gt;
The diffusion coefficients for each of the plots above are tabulated below using the final data point from the integral plot. This is the integral over the whole graph using the trapesium rule. This must be corrected for the timestep; the value is multiplied by 0.002. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom data diffusion coefficients, &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
!1,000,000 atom data diffusion coefficients &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;-0.00055&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{-0.00055}{6} = -0.00018 \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.00014&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.00014}{6} = 0.000046 \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.242&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.242}{6} = \mathbf{0.0807}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.270&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.270}{6} = \mathbf{0.0901}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;25.6&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{25.6}{6} = \mathbf{8.55}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;9.81&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{9.81}{6} = \mathbf{3.27}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
The biggest source of error in these plots is that we assume both the 8,000 atom data and the 1,000,000 atom data take the same amount of time to converge. &#039;&#039;Figure z. &#039;&#039;shows that 5000 timesteps is not long enough for the velocity autocorrelation coefficient for 8,000 atoms to converge as far as 1,000,000 atom data does in this length of time. As the molecular dynamics simulations simulate random motion, this could induce fluctuations in the velocity autocorrelation plot which could increase or decrease the integral introduction another source of error.&lt;br /&gt;
&lt;br /&gt;
Again, the diffusion coefficient of the Lennard-Jones solid can be assumed to be zero for the same reason as the mean squared displacement data. The diffusion coefficient of the liquid is lower for both sets of data when calculated using the velocity autocorrelation function, and the diffusion coefficient is higher for both sets of data.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=541949</id>
		<title>Rep:Mod:hakunamatata</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=541949"/>
		<updated>2016-02-25T15:04:01Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: /* Equilibration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Introduction to Molecular Dynamics Simulations ==&lt;br /&gt;
===The Classical Particle Approximation and Numerical Integration===&lt;br /&gt;
The verit and verit-velocity algorithms are numerical methods to approximate the average position and velocity respectively of randomly moving atoms in a particular medium (solid, liquid, fliud etc.). This position and velocity can be applied to Newtonian mechanics to calculate such properties as the force and potential energy of the system. The algorithms work by splitting the function into discrete time steps, calculating the values of position and velocity at this particular time step, and then effectively &amp;quot;joining the dots&amp;quot; to create an approximate function. These simulations always use the answer from the previous timestep to compute the new timestep, so initial conditions must be given for the first step. Both of the algorithms are shown below and are derived from the Taylor expansion of the position or velocity of the atoms at the timestep &amp;quot;n+1&amp;quot; or &amp;lt;math&amp;gt;t+\delta t&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit Algorithum:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{x}_i\left(t + \delta t\right) \approx 2\mathbf{x}_i\left(t\right) - \mathbf{x}_i\left(t - \delta t\right) + \frac{\mathbf{F}_i\left(t\right)}{m_i}\delta t^2  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit-Velocity Algorithum:&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i\left(t\right)&amp;lt;/math&amp;gt; is the force acting on a particular atom as a function of time&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i&amp;lt;/math&amp;gt; is the acceleration &lt;br /&gt;
&lt;br /&gt;
The smaller the timestep, the closer the numerical approximation is to the true solution function, which can be modeled as a classical harmonic oscillator. &#039;&#039;Figure a.&#039;&#039; in the table below shows the comparison between the two methods in &#039;&#039;time&#039;&#039; space. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure a. &#039;&#039;Plots of position vs time comparing the verit algorithm and harmonic spring results&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure b. &#039;&#039;Plot of the total classical energy of the system (potential + kinetic)&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory xanalytical.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory energy.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The harmonic spring position values are modeled from the harmonic oscillator or particle on a spring. The equation of &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; was used to calculate these values, where &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; are 1 and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; is zero. As seen on the plot, the curves produced from the two different methods of calculating the position are in good agreement.&lt;br /&gt;
|The potential energy is calculated using the equation U = 1/2 kx^2, with a value of k given as 1. The kinetic energy is calculated using the velcity from the verit-velocity algorithm using the equation T = 1/2 mv^2, with a value of m given as 1. The total energy of the system, E, is equal to T + U. The values for x (potential energy) and v (kinetic energy) are taken from the verity algorithm and verit-velocity algorthim respectively. &lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;Figure c. &#039;&#039;Plot of the difference (error) between the harmonic spring and verit algorithm data&lt;br /&gt;
!&#039;&#039;Figure d. &#039;&#039;Plot of the peaks in the error plot in &#039;&#039;figure c.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory error.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory errorpeaks.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The peaks in the error between the harmonic spring and verit algorithm results are at the place where the position curve crosses the time axis. This is because the harmonic spring data (x(t)) has a slightly shorter wave period than that of the verit velocity algorithm, and therefore the difference will get larger with each period of the wave, shown by the error getting larger in &#039;&#039;figure c. &#039;&#039;The period of the plot of the two methods are different because the verit algorithm is much more approximate so does not give the correct solution.&lt;br /&gt;
|The change in the error/difference between the harmonic spring data and verit algorthm data increases linearly and so therefore period of each of the plots in &#039;&#039;figure 1&#039;&#039;. must be constant. &lt;br /&gt;
|}&lt;br /&gt;
The error can also be quantified on a &#039;&#039;phase space&#039;&#039; plot; phase space is momentum or velocity plotted as a function of position. The true solution for motion of an atom is a perfect ellipse, and the more elliptic the shape (less circular) the more momentum or velocity is in the system. A numerical solution, like the verit algorithms, will produce a set of points very close to this ellipse but not perfectly following the curve. A good numerical solution will remain in an elliptical shape, whereas a bad numerical solution, for example one with a large timestep, will spiral away from the true solution. Two examples of such systems using the data from &#039;&#039;figures a-d&#039;&#039; are shown below.  &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure e. &#039;&#039;Phase plot of the harmonic spring data with a good numerical solution (timestep = 0.1) &lt;br /&gt;
!&#039;&#039;Figure f. &#039;&#039;Phase plot of the harmonic spring data with a bad numerical solution (timestep = 0.3) &lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory phasegood.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory badphase.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The timestep at which this data is plotted is 0.1, which results in a very small change in the energy, as seen in &#039;&#039;figure b. &#039;&#039;Increasing the time step will increase the variation in the energy. To keep the variation in the total energy of the system under 1%, the time step must be no larger than approximately 0.28. The energy varies more with increasing time step because the jumps in the algorithm  are getting larger due to less data points. The algorithm assumes these points are joined by a straight line; that the halfway point in the jump is the average between the starting and finishing point of the jump. The phase space plot will become less elliptic and the jumps eventually become so larger that the plot is no longer a continuous shape.  &lt;br /&gt;
&lt;br /&gt;
It is essential to monitor the energy of a numerically modeled system because a good solution for the motion of an atom has a constant energy and a plot in phase space of a perfect ellipse.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance and Force at Zero Potential===&lt;br /&gt;
From classical mechanics, the force calculated from the Newtonian mechanics above can be used to calculate the potential experienced by an atom in the system. They are related by the equation: &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;
This potential gives the shape and dimension of the potential surface on which the system can be modeled. A simple 1D potential that is used to describe the inter atomic forces of a liquid is the Lennard-Jones potential. It has the characteristic features of a short range repulsion potential and harmonic character around the equilibrium bond distance. The value of &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the inter atomic separation when the potential, &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;, is equal to zero, can be calculated by equating the equation for the Lennard-Jones potential to zero and solving for &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The equation for the Lennard-Jones potential: &amp;lt;math&amp;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;
Equating this to zero: &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;
And rearranging in order to separate the variables: &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;
Rearranging this gives &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in terms of &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt; r^6 = \sigma^6&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r = r_0&amp;lt;/math&amp;gt; in this case.&lt;br /&gt;
&lt;br /&gt;
This, therefore, gives the result that interatomic distance at zero potential, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, is equal to &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; in the Lennard-Jones potential is effectively the diameter of one of the particles in the system being measured; in this case, the liquid we are simulating. This is the point where the potential curve crosses the x-axis on an Energy vs interatomic distance plot. The force, &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt;, at this point on the curve corresponds to the gradient; it is found by calculating the derivative of the curve at this point. &lt;br /&gt;
&lt;br /&gt;
To calculate the force, we must differentiate the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As force is equal to the negative differential of the potential energy, the value of the force is: &amp;lt;math&amp;gt;\mathbf{F}_i = 48\epsilon \sigma^{12} r^{-13} - 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting in the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at zero potential from the calculation before: &amp;lt;math&amp;gt;\mathbf{F}_i = \frac{48\epsilon}{\sigma} - \frac{24\epsilon}{\sigma} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The gradient where the Lennard-Jones plot crosses the axis is negative; &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; in the term obtained for &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is negative and therefore the overall value of the force will be negative.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance, Force and Well Depth of the Potential at Equilibrium===&lt;br /&gt;
To calculate the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at the equilibrium position, we need to use the derivative of the potential energy curve. The equilibrium value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is the value at the minimum of the Lennard-Jones curve; when &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Therefore, equating the derivative to zero gives: &amp;lt;math&amp;gt;0 = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rearranging this: &amp;lt;math&amp;gt;48\epsilon \sigma^{12} r^{-13} = 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And simplifying and cancelling gives: &amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6&amp;lt;/math&amp;gt;. Therefore the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at equilibrium is: &amp;lt;math&amp;gt;r_{eq} = \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Physically, this result means that the equilibrium distance is 1.12 times the diameter of one of the particles; the particles have a small gap between them so do not touch. A short range repulsion potential, as seen in the Lennard-Jones curve, is a result of the particles coming into contact. &lt;br /&gt;
&lt;br /&gt;
Again, the force can be calculated from the derivative of the potential curve at the equilibrium point. As the derivative at this point is zero (a minimum on the curve), the force will therefore also be zero.&lt;br /&gt;
&lt;br /&gt;
The well-depth of the potential curve is the difference between zero potential and the potential at the equilibrium bond length. This can be calculated by substituting the value for the equilibrium bond length into the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 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;
Cancelling and simplifying this equation gives: &amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \times \frac{1}{4}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the absolute value for the well depth is &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;. The actual value of this potential is &amp;lt;math&amp;gt;-\epsilon&amp;lt;/math&amp;gt;, as the equilibrium bond length gives the most stable configuration of the molecules and therefore suggests attractive interactions are involved in the arrangement of the molecules; this attractive potential means its negative. &lt;br /&gt;
&lt;br /&gt;
===Boundary Conditions and the Lennard-Jones Cutoff===&lt;br /&gt;
When simulating a liquid, it is computationally impractical to simulate a realistic liquid. Therefore a smaller &#039;box&#039; containing &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; particles is simulated and the computer program will use &#039;&#039;periodic boundary conditions&#039;&#039; to simulate infinite repetitions of this box; when the atom reaches one edge of the box, in periodic boundary conditions, it will reappear again at the opposite edge of the box as if they were connected. For example, an atom at the position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a box of size &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;. Without periodic boundary conditions, we would assume that the atom would end up at the position &amp;lt;math&amp;gt;(1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;. However, in this box, there is no such position and so the particle must reappear at the opposite edge to where it effectively &#039;left&#039; the box. Therefore, it&#039;s ending position will be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The number of particles, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; simulated by the computer is usually between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt;. Physically, this is a very small volume. Considering water, we can calculate the number of molecules in 1 mL or 1 cm^3, a volume that would be considered small in the lab. Taking the concentration of water at standard conditions, &amp;lt;math&amp;gt;55\ mol\ dm^{-3}&amp;lt;/math&amp;gt;, we can convert it to the number of moles per mL: &amp;lt;math&amp;gt;0.055\ mol\ mL^{-1}&amp;lt;/math&amp;gt;. Multiplying this value by Avagadro&#039;s constant (&amp;lt;math&amp;gt;N_A&amp;lt;/math&amp;gt;) gives the number of molcules of water per mL: &amp;lt;math&amp;gt;3.02 \times 10^{22}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The reverse procedure can be used to compare this to the volume of 10,000 molecules: 10,000 divided by Avagadro&#039;s constant gives the number of moles of water which 10,000 molecules makes up: &amp;lt;math&amp;gt;1.66 \times 10^{-20}\ moles&amp;lt;/math&amp;gt;. Dividing this value by the concentration (from &amp;lt;math&amp;gt;n=cV&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is the number of moles, &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; is the concentration and &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume), gives the volume: &amp;lt;math&amp;gt;3.02 \times 10^{-22}\ dm&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;3.02 \times 10^{-19}\ mL&amp;lt;/math&amp;gt;. Physically, of course, this is far too small a volume to be recorded in the lab.&lt;br /&gt;
 &lt;br /&gt;
Periodic boundary conditions simulate an infinite lattice and therefore, when computing the potential, will calculate an infinite amount of pair interactions. Therefore, it is only practical to calculate the energies up to a certain interatomic distance; the Lennard-Jones cutoff distance. Beyond this point, the potential energy and the integral of the curve beyond this point become insignificant and do not impact on the overall energy; removing interactions beyond this point from the calculations will not effect the accuracy. Multiplying the Lennard-Jones potential with the radial distribution function gives a plot of the probability of finding an atom at a particular interatomic distance. The larger the interatomic distance, the lower the probability and so the energy after the cutoff can be disregarded. &lt;br /&gt;
&lt;br /&gt;
Integrating over the Lennard-Jones curve and applying this cutoff as the lower limit can show how small the integral is:&lt;br /&gt;
&lt;br /&gt;
For a general cutoff of with value &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;I = \int_{x}^\infty \phi\left(r\right)\mathrm{d}r = \int_{x}^\infty \frac{4\epsilon\sigma^{12}}{r^{12}}\mathrm{d}r - \int_{x}^\infty \frac{4\epsilon\sigma^6}{r^6}\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving this: &amp;lt;math&amp;gt;I = 4\epsilon\sigma^{12} {\frac{-1}{11r^{11}}\,\Bigg\vert\,}_x^\infty - 4\epsilon\sigma^{6} {\frac{-1}{5r^{5}}\,\Bigg\vert\,}_x^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This gives the general solution: &amp;lt;math&amp;gt;I = \frac{4\epsilon\sigma^{12}}{11x^{11}} - \frac{4\epsilon\sigma^{6}}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating this for &amp;lt;math&amp;gt;\epsilon = \sigma = 1&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;I = \frac{4}{11x^{11}} - \frac{4}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt; (or 2 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.025&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt; (or 2.5 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0082&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt; (or 3 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0033&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All values are taken to 2 significant figures. As the cutoff value for the interatomic distance gets larger, the integral gets smaller, and therefore the energy excluded from the calculation becomes smaller, and the second term in the solved integral, &amp;lt;math&amp;gt;I&amp;lt;/math&amp;gt;, dominates the energy value.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
When using the Lennard-Jones potential, it is appropriate to use reduced units for intermolecular distance, energy and temperature. Reduced units can be calculated by the following relationships:&lt;br /&gt;
&lt;br /&gt;
Intermolecular 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;
&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; are scaling factors. For example, if the parameters for Argon are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\sigma = 0.34 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt; \epsilon\ /\ k_B = 120 K&amp;lt;/math&amp;gt;&lt;br /&gt;
* Lennard-Jones cutoff &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;. The well-depth, &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;, is &amp;lt;math&amp;gt;0.999 kJ mol^{-1} \approx 1 kJ mol^{-1}&amp;lt;/math&amp;gt;. The value of &amp;lt;math&amp;gt;T* = 1.5&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;180 K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
The first aim of the simulations is to determine the most appropriate timestep to use in the vert algorithm simulations. This timestep is a balance between the accuracy of the results (the smaller the timestep, the closer to the true functing the result will be) and the length of real time over which the simluation is run (the smaller the timestep, the less real time over which the simulation will give a result). The appropriateness of the timestep will be determined by plotting how the total free energy of the simulated lattice equilibrates over time.  &lt;br /&gt;
&lt;br /&gt;
Five different calculations, which simulated the melting of a crystal and subsequent equilibration of the energy of the melted crystal, were run at five different timesteps; 0.001, 0.0025, 0.0075, 0.01 and 0.015, and were described by the NVE or &#039;&#039;&amp;quot;microcanonical ensemble&amp;quot;&#039;&#039;. An ensemble is a collection of samples of a system which are under three thermodynamic constraints (three properties are kept constant); in the microcanonical ensemble, the number of particles, the volume and the total energy is kept constant (NVE). &lt;br /&gt;
&lt;br /&gt;
These calculations simulate a box of 1000 unit cells and use periodic boundary conditions to replicate the simulation to a larger scale. Because these simulations use the numerical methods defined in the previous section, the initial position and velocity of the atoms must be defined in the input file. The Brownian (uncorrelated, random) motion of the atoms in the simulation means that there is no long range order in the system and so the atoms in a real system would start in random positions. However, assigning random starting coordinates to the atoms in a simulated liquid is not a relative process; the coordinates are generate independently of each other. Therefore there is a probability that the coordinates simulated will cause the atoms to overlap, which would give a very large repulsion potential, as seen in the Lennard-Jones potential at very small interatomic distances. This short-range repulsion potential comes from the hard-sphere model of atomic simulation.&lt;br /&gt;
&lt;br /&gt;
The input file also defines the structure and density of the lattice. The number density of lattice points in any lattice is the number of lattice points per volume of the unit cell. In a simple cubic lattice, there is one lattice point in the unit cell. From an sc lattice with lattice spacing (length of one side of the unit cell) being &amp;lt;math&amp;gt;1.07722&amp;lt;/math&amp;gt;, the number density of the lattice points is calculated by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{1}{1.07722^3} = 0.7999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a face-centered cubic lattice (fcc), there are four lattice points in the unit cell. Rearranging the above relationship, the lattice spacing can be calculated from the number of lattice points in a unit cell and number density, &amp;lt;math&amp;gt;1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Lattice\ spacing = \sqrt[3]{\frac{number\ of\ lattice\ points\ per\ unit\ cell}{number\ density}} = \sqrt[3]{\frac{4}{1.2}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation creates a box which includes 1000 unit cells, which is 10 unit cells in each dimension. For a simple cubic lattice, because there is one lattice point per unit cell, there will be 1000 atoms created as seen in the input file. The &#039;&#039;create_atom&#039;&#039; command in the input file determines how many boxes are created in the simulation and therefore how many atoms will be created. If a face centered cubic lattice is simulated, because there are 4 lattice points per unit cell, 4000 atoms will be created in the &#039;&#039;create_atom&#039;&#039; command. &lt;br /&gt;
&lt;br /&gt;
The input script also contains the following commands which defines the potential surface which is used to model the intermolecular reactions:&lt;br /&gt;
 mass 1 1.0&lt;br /&gt;
This instruction sets the mass type for the atoms being simulated. It takes the general form of “mass I value”, where mass is the keyword which tells LAMMPS what the input is, I is the atom type and value is the mass of the atom. In this case, I is defined by a specific numerical value; 1 as there is only 1 type of atom in the simulation, but it can be defined with an asterisk (1*), which means “all atom types of 1 to n inclusive”. &lt;br /&gt;
 pair_style lj/cut 3.0&lt;br /&gt;
This instruction sets the type of potential which LAMMPS uses in its calculation of pairwise interactions. It takes the general form of “pair_style style args”, where pair_style is the keyword for LAMMPS, style defines the potential and any specifications it may have, and args are the arguments required for this particular potential. In this case, the Lennard-Jones potential has been used (lj) with a cutoff point (cut) of 3σ. The cutoff point is explained in the introduction section. &lt;br /&gt;
 pair_coeff * * 1.0 1.0&lt;br /&gt;
This instruction specifies the coefficients for the pairwise interactions of each pair of atoms, and it takes the general form “pair_coeff I J args”. Pair_coeff is the keyword, I and J are the atom types, and args are the coefficients which the different atoms types take. In this case, the asterisk in place of I and J refers to all atoms types from 1 to n. The coefficients are the pairwise interactions are 1 for each atom, meaning each atom has an equal contribution to the interaction.&lt;br /&gt;
&lt;br /&gt;
In these initial calculations, the initial conditions for the numerical methods, &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. For this experiment, the verit-velocity algorithm would be the most appropriate, as both the starting position and velocity is specified for this algorithm. &lt;br /&gt;
&lt;br /&gt;
To define the timestep for the algorithm the following code is used defining the timestep as a variable instead of just giving it a definite value&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;
It is much easier to use the variable version of defining the timestep because the length of time over which the simulation is run depends on the time step. By using a variable, you can keep the length of the simulation the same, no matter the size of the timestep. It also makes it easier if multiple properties depend on the timestep – only the variable needs to be changed, not all the parts of the script where timestep is defined. &lt;br /&gt;
&lt;br /&gt;
The calculations produce the values for the total energy of the system, temperature and pressure in the output files, which can be plotted against time. How well these values equilibrate determines the appropriateness of the timestep to use in further calculations in the experiment.  &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!&#039;&#039;Figure h. &#039;&#039;Plot of the equilibration of total energy for five different timesteps&lt;br /&gt;
!&#039;&#039;Figure ha. &#039;&#039; Plot of the temperature vs time equilibration for timestep = 0.0025&lt;br /&gt;
!&#039;&#039;Figure hb. &#039;&#039; Plot of the pressure vs time equilibration for timestep = 0.0025 &lt;br /&gt;
|- &lt;br /&gt;
|[[File:rmt_totalenergycurve.png|600x600px]]&lt;br /&gt;
|[[File:rmt_tempvstime0025.png|600x600px]]&lt;br /&gt;
|[[File:rmt_pressurevstime0025.png|600x600px]]&lt;br /&gt;
|}&lt;br /&gt;
The largest time step to give an acceptable result is 0.01. However, for any simluation we would expect energy to be independent of the timestep, something which is not true at a timestep greater than 0.0025. Therefore, the most appropriate timestep to use for a balance between accuracy and length of time which the simulation covers is 0.0025. &lt;br /&gt;
&lt;br /&gt;
0.015 is a particularly bad choice of timestep. This is because the verit-velocity algorithm gives an approximate result to the velocity (kinetic energy term) and position (potential energy term), and so when the timestep becomes too large with respect to the time, the algorithm no longer becomes a suitable way to calculate the energy. As seen in the graph of 0.015, the energy does not equilibrate and diverges.&lt;br /&gt;
&lt;br /&gt;
The plots for temperature and pressure vs time give a good indication for the next section an appropriate pressure and temperature to use for running the simulations under specific conditions.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions ==&lt;br /&gt;
The calculations in this section are run in the isobaric-isothermal ensemble, where the number of particles in the system, the pressure and the temperature are kept constant (NpT). This means that the temperature and the pressure are recalculated in every step, so are no longer constant like they were in the NVE ensemble. From the &#039;&#039;equipartition theorem&#039;&#039;, each degree of freedom will contribute &amp;lt;math&amp;gt;\frac{1}{2} k_B T&amp;lt;/math&amp;gt; of energy to the system. As the system is in three dimensions, there are three degrees of translational freedom and so the total internal energy is equal to &amp;lt;math&amp;gt;\frac{3}{2} k_B T&amp;lt;/math&amp;gt;. Equating this to the kinetic energy, &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt;, at the end of every step and rearranging will allow calculation of the temperature after every step. &lt;br /&gt;
&lt;br /&gt;
A target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, is defined in the input script and the system will equilibrate by multiplying the velocity by a factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, in order to accommodate for the fluctuation and keep the system at approximately the target temperature and therefore constant internal energy. If the temperature of the system is greater than the target temperature, the system&#039;s kinetic energy is too high, so &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is reduced to compensate for this. The same is true for is the temperature is lower than the target temperature; &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than one in the next step to increase the kinetic energy which is now too low. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; can be derived from equating the kinetic and internal energy of the system at an arbitrary time step:&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;
Expanding the brackets inside the sum and moving the term containing &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; out of the sum: &amp;lt;math&amp;gt;\frac{\gamma^2}{2}\sum_i m_i \left(v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;, we can replace &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt; on the left hand side of the equation with &amp;lt;math&amp;gt;\frac{3}{2} N k_B T&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;\frac{3\gamma^2}{2}N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Simplifying and rearranging for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, gives: &amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The principle is the same for controlling the pressure.&lt;br /&gt;
&lt;br /&gt;
As temperature and pressure are no longer constant, he input files require specification of the pressure and the temperature for each of the systems run. 10 simulations were run at two different pressures with five different temperatures at each. &lt;br /&gt;
* Temperatures: 1.6, 1.9, 2.2, 2.5, 2.8&lt;br /&gt;
* Pressures: 2.5, 3.0&lt;br /&gt;
These pressures were chosen because the data simulated when choosing an appropriate timestep gave a pressure between 2.5 and 3.0.  &lt;br /&gt;
&lt;br /&gt;
For the code which computes the thermodynamic potentials, this particular line defines how many steps contribute towards the average of the thermodynamic parameters computed in the calculation. &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;
&#039;&#039;fix&#039;&#039; is the keyword, &#039;&#039;aves&#039;&#039; is the name of the group of fixes which in this case is the average of the thermodynamic values, &#039;&#039;all&#039;&#039; specifies the atoms which the fix is applied to which in this case is all the atoms in the simulated system and &#039;&#039;ave/time&#039;&#039; means that compute global time averages are calculated. The following three numbers have the following meaning:&lt;br /&gt;
&lt;br /&gt;
*100 = use the input values every 100 timesteps&lt;br /&gt;
*1000 = use input values 1000 times for calculating the average&lt;br /&gt;
*100000 = calculate the average every 100000 timesteps&lt;br /&gt;
&lt;br /&gt;
Therefore for the total calculation which lasts for 100000 will only have the average calculated once. Assuming 1 value every timestep, there will be 100000/100 values = 1000. The amount of time simulated is 100,000 steps, read from the following line.&lt;br /&gt;
&lt;br /&gt;
The density data from all ten calculation were plotted on the same graph, along with the density for an &amp;quot;ideal&amp;quot; gas. This density can be derived from the ideal gas law:&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;
Rearranging in terms of density: &amp;lt;math&amp;gt;\frac{N}{V} = \frac{P}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As these simulations are being run under reduced units, we can take &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt;, and so the density of the ideal gas becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the density of the ideal gas is plotted as the pressure divided by the temperature in pressure-temperature phase space.&lt;br /&gt;
[[File:Rmt dvt plot.png|none|thumb|800x800px|&#039;&#039;Figure i. &#039;&#039;Plot of the variation in density with temperature at a defined pressure for the numerically simulated and ideal systems]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that calculated in the ideal gas law. This is because for an ideal gas, an assumption is made that there are no intermolecular interactions, and therefore forces such as electron repulsion forces are ignored; repulsion forces dominate over attractive ones, as all the atoms in this simulation are the same and so partial charges or dipoles are created. This will mean that the particles move closer together than a real gas and so the density will be larger. This discrepancy between the ideal and non-ideal systems becomes larger at a higher pressure because with a higher pressure, the atoms in the system are closer together and therefore the intermolecular repulsion will become larger. This greater repulsion will in turn have a larger effect on decreasing the density.&lt;br /&gt;
&lt;br /&gt;
== Statistical Physics Calculations of the Heat Capacity ==&lt;br /&gt;
The heat capacity of a system at constant volume can be calculated from the variance in the total energy of the system. The relationship used to calculate the heat capacity is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = 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;\left\langle E^2\right\rangle&amp;lt;/math&amp;gt; is the continuous average of the total square energy at each temperature as a function of temperature. &amp;lt;math&amp;gt;\left\langle E\right\rangle^2&amp;lt;/math&amp;gt; is the continuous average of the total energy at each temperature as a function of temperature squared. The heat capacity is multiplied by &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; in this case because the version of LAMMPS calculates every energy divided by the number of molecules in the system simulated.&lt;br /&gt;
&lt;br /&gt;
The calculations in this sections are run in density-temperature phase space and the ensemble has changed to the canonical ensemble (NVT). A set of input files were written for ten calculations for, like the previous section, two pressures and five different temperatures at each pressure:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 0.2, 0.8&lt;br /&gt;
*Temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{C_V}{V}&amp;lt;/math&amp;gt; was plotted against temperature to determine the relationship in density-temperature phase space. An example of an input file can be found [[Media:nvt_-_0220.in|here]]. The lines which have been changed from the previous input files are at the end of the script:&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 &lt;br /&gt;
 thermo_style custom step etotal temp&lt;br /&gt;
 variable energy equal etotal&lt;br /&gt;
 variable energy2 equal etotal*etotal&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_energy v_energy2 v_temp&lt;br /&gt;
 run 100000&lt;br /&gt;
 &lt;br /&gt;
 variable aveenergy equal f_aves[1]&lt;br /&gt;
 variable aveenergy2 equal f_aves[2]&lt;br /&gt;
 variable avetemp equal f_aves[3]&lt;br /&gt;
 variable heatcapacitydv equal atoms*atoms*(v_aveenergy2-v_aveenergy*v_aveenergy)/(v_avetemp*v_avetemp*vol)&lt;br /&gt;
 &lt;br /&gt;
 print &amp;quot;Averages&amp;quot;&lt;br /&gt;
 print &amp;quot;--------&amp;quot;&lt;br /&gt;
 print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Heat Capacity per Volume: ${heatcapacitydv}&amp;quot;&lt;br /&gt;
The line with the keyword &#039;fix&#039; determines which thermodynamic values are averaged and over how many steps they are averaged. The next section takes these averages as variables and uses them to define the heat capacity which is calculated from the equation at the beginning of this section. Only the energy and temperature are needed to define the heat capacity and so only these values are calculated by the simulation. [[File:Rmt heatcapacitybyv.png|none|thumb|800x800px|&#039;&#039;Figure j. &#039;&#039;C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V against temperature for the two different pressures 0.2 and 0.8]]As seen in the above figure, the heat capacity decreases with temperature for both pressures. It would be expected for an ideal system that as the temperature increases, the heat capacity at constant volume increases and tends to a constant volume at very high T of 3R; R = the universal gas constant. This means increasing the temperature increases the amount of energy being stored in the system and this energy is stored as vibrational energy. However, for a Lennard-Jones liquid, the system being simulated here, the heat capacity decreases with temperature. This is because the simulation has two components to the simulation; the atoms are vibrating in a quasi-harmonic fashion around the equilibrium position and also diffuse between neighbouring equilibrium positions in a gas like fashion. As the temperature increases, the amount of diffusion increases and the vibrations decreases, therefore decreasing the ability of the system to absorb vibrational energy, resulting in the decrease in heat capacity. &amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www.nature.com/ncomms/2013/130816/ncomms3331/full/ncomms3331.html?message-global=remove&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural Properties and the Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a single atom in a system is a plot of the probability that an atom can be found at a certain distance from the central atom. The peaks in this plot can give the distance of an atom from its nearest neighbours in the Lennard-Jones simulated system. &lt;br /&gt;
&lt;br /&gt;
The calculations in this section simulate a Lennard-Jones solid, liquid and gas and, using the output of the LAMMPS trajectory file, plots both the radial distribution function and its integral using DLV. The temperature and pressure parameters for these calculations were taken from the phase diagram or coexistence curve for a Lennard-Jones system.&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt; The parameters used are displayed in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! Temperature, &amp;lt;math&amp;gt;T^*&amp;lt;/math&amp;gt;&lt;br /&gt;
! Pressure, &amp;lt;math&amp;gt;p^*&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| LJ Solid&lt;br /&gt;
| 1.5&lt;br /&gt;
| 1.2&lt;br /&gt;
|-&lt;br /&gt;
| LJ Liquid&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.8&lt;br /&gt;
|-&lt;br /&gt;
| LJ Gas&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.01&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The data obtained from the plots and the radial distribution functions and their integrals were plotted and shown in the table below.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure k. &#039;&#039;The radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
!&#039;&#039;Figure l. &#039;&#039;The integrals of the radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt fullrdfs.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt allintegralsrdf.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
[[File:Rmt Nearest neighbours.png|left|thumb|300x300px|&#039;&#039;Figure m. &#039;&#039;Representation of a cross section of the first three shells of nearest neighbours in an fcc solid. The black atom is the central atom being considered, the blue atoms are the first shell, the orange atoms the second shell and the purple atoms are the third.]]&lt;br /&gt;
The RDF of the solid gives a very irregular curve because of the irregular structure of the lattice. For a simple cubic lattice, a regular structure of the RDF would be expected because of the equal number of atoms in each of the nearest neighbour shells of the atoms. However, for face-centered cubic, the solid in this simulation, the structure is much more irregular and as the atoms move from their equilibrium position in the lattice due to vibrations, the peaks in the radial distribution will broaden. The irregular heights of the peaks are due to the varying numbers of atoms in each of the nearest neighbour shells for the central atom. The first shell gives the highest peak as it contains the most atoms; in total, considering all four surrounding unit cells, this shell contains 12 atoms and ideally takes the geometry of an icosahedron. The second shell is smaller and contains only 6 atoms in an octahedral coordination shape. The following shell again contributes 12 atoms, 3 from each unit cell. This therefore explains why the heights of the peaks in the solid plot in &#039;&#039;figure k.&#039;&#039; vary. These values can be confirmed by the plot in &#039;&#039;figure o.&#039;&#039; which is the integral; it cumulatively adds the numbers in each shell. The size of the first &amp;quot;step&amp;quot; is 12; there are 12 atoms in the first shell. The size of the second step is approximately 18; there are 18-12=6 steps in the second shell. The same theory applies for the third shell which gives a value of 13. This is slightly different to the predicted value possibly due to error in the calculation of the radial distribution function and therefore its integral. &lt;br /&gt;
&lt;br /&gt;
The RDF of the liquid has a representation of far fewer shells, which means that there are less atoms in the space close to a &amp;quot;central&amp;quot; atom in the bulk solution. The particles have more energy and therefore do not keep to a regular lattice structure. As they move about, some regualrity is maintained around each atom, but only to the extend of two or three shells, meaning there is no long range order in a Lennard-Jones liquid. &lt;br /&gt;
&lt;br /&gt;
The RDF of the gas again omits more shells as there is almost no order in a Lennard-Jones gas. The single peak on this plot considers only the set of atoms closest to the central atom and all others are disregarded as they are too far apart. &lt;br /&gt;
&lt;br /&gt;
Considering &#039;&#039;figure l.&#039;&#039;, the size of the integral of the radial distribution function decreases from solid to liquid to gas. This makes sense as the number of atoms in the surrounding shells decreases with density of the system; the atoms become further apart. &lt;br /&gt;
&lt;br /&gt;
From the plot of the radial distribution function of the solid, the lattice spacing can be determined. For this, we can consider just the first three peaks of the RDF plot. The lattice spacing refers to the length of one unit cell, and so, using &#039;&#039;figure m&#039;&#039;, we can calculate this using two different methods; a) we can use the distance between the central atom and the first shell of nearest neighbours, and use trigonometry to calculate the lattice spacing. Or alternatively b) we can use the distance between the central atom and the second nearest neighbour shell to get the lattice spacing.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure n. &#039;&#039;The radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
!&#039;&#039;Figure o. &#039;&#039;The integral of the radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt solidgr3.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt solidint3.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
Using method a) (with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; as the distance between the central atom and the nearest neighbour: Lattice spacing = &amp;lt;math&amp;gt;\frac{r}{cos({\frac{\pi}{4}})} = \frac{1.02}{cos({\frac{\pi}{4}})} \approx 1.44&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using method b): Lattice spacing &amp;lt;math&amp;gt;\approx 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can take an average between the two get an approximate value for the lattice spacing: &amp;lt;math&amp;gt;1.46 \plusmn 0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These values for distance are all in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
The ability of atoms to move around in a solid liquid or gas can be characterised by the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. In this section, we will explore two different ways to calculate the diffusion coefficient and compare the results. &lt;br /&gt;
&lt;br /&gt;
=== The Mean Squared Displacement ===&lt;br /&gt;
The diffusion coefficient can be measured easily be calculating the mean squared displacement of atoms in the solution; the diffusion coefficient is proportional to the first derivative of the mean squared displacement. By plotting the mean squared displacement as a function of time, the gradient can be taken to calculate the diffusion coefficient when its has equilibrated and become linear.&lt;br /&gt;
&lt;br /&gt;
The temperature and density parameters used were the same as in the previous section:&lt;br /&gt;
* Solid: T=1.5, D=1.2&lt;br /&gt;
* Liquid: T=1.1, D=0.8&lt;br /&gt;
* Gas: T=1.1, D=0.01&lt;br /&gt;
&lt;br /&gt;
Mean density squared calculations were run for all three Lennard-Jones phases and the data plotted as function of timestep below. The data from a simulation containing 1,000,000 atoms was plotted for comparision.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!Plots for the 8,000 atom data (&#039;&#039;figures p-r)&#039;&#039;&lt;br /&gt;
!Plots for the 1,000,000 atom data (&#039;&#039;figures s-u)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|[[File:Rmt_MSDsolid.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt_MAsolid.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|[[File:Rmt MSDliquid.png|700x700px]]&lt;br /&gt;
|[[File:Rmt MAliquid.png|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|[[File:Rmt MSDgas.png|700x700px]]&lt;br /&gt;
|[[File:Rmt dataplots 25894 image001.png|700x700px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The exact relationship between the mean squared displacement and the diffusion coefficient is:&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;
Taking the gradients of each of the curves at the point at which they become linear and dividing by six will give the diffusion coefficient for each set of data. The gradient also needs to be converted to a function of time; this is done by dividing by the timestep, which in this case is 0.002:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom data diffusion coefficients, &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
!1,000,000 atom data diffusion coefficients &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 0.9999&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|Gradient = 0.0972&lt;br /&gt;
Amount of data used to calculate gradient: timestep 4300-5000, &amp;lt;math&amp;gt;R^2 = 0.9998&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{48.6}{6} = \mathbf{8.1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient = 0.0386&lt;br /&gt;
Amount of data used to calculate gradient: timestep 4000-5000, &amp;lt;math&amp;gt;R^2 = 0.1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{19.6}{6} = \mathbf{3.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For both of the solid approximations, the diffusion coefficient can be approximated as zero. This is because, when equilibrated, the function has a constant value of around 0.2 for the mean squared displacement. A gradient with a value of zero means that the atoms take an infinite amount of time to change their mean squared displacement; to move away from their equilibrium position, and so this means that we can approximate in this system, there will be no diffusion. In real system, however, this is not the case; diffusion occurs but it is very slow. A plot for a real system will give a very shallow positive gradient.&lt;br /&gt;
&lt;br /&gt;
The liquid approximations are very well correlated. This is because in both cases, the mean squared displacement of particles in a liquid increases linearly with time and the gradient of both plots are almost identical. We can assume from this that identical starting conditions were used to calculate this data. Also, we can estimate that 8,000 atoms is a large enough simulation to give an accurate result for the diffusion coefficient for the Lennard-Jones liquid.&lt;br /&gt;
&lt;br /&gt;
The gas approximations are very different. This is most probably due to the fact that the density specified in calculations are different. The 8,000 data can be estimated to be a much lower density because the diffusion coefficient is faster and this means diffusion will happen faster; at a higher density a particle will take longer to diffuse over a given distance. Because of the difference in density, the two values of the diffusion coefficient cannot be qualitatively compared. The reason for the initial deviation for linearity in the gas plots is due to the momentum of the particles initially dominating over the diffusion and the diffusion coefficient is dependent on time. As the system equilibrates, the diffusion coefficient becomes constant and the plots become linear.&lt;br /&gt;
&lt;br /&gt;
=== The Velocity Autocorrelation Function ===&lt;br /&gt;
&lt;br /&gt;
Another way to calculate the diffusion coefficient is by using the velocity correlation function, which determines how the velocity of an atom changes with time. The function determines the difference in time (&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;) when the velocity becomes uncorrelated, i.e. the difference between the velocity at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; and at time &amp;lt;math&amp;gt;t+\tau&amp;lt;/math&amp;gt;. By integrating over this function, we can find the diffusion coefficient. &lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function: &amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can also be written as the integral: &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;
Using the function which defines the position of a classical harmonic oscillator, we can differentiate this to give the equation for the velocity which we can plug into the integral:&lt;br /&gt;
&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;
&amp;lt;math&amp;gt;dv{x(t)}{t} = v(t) = -A\omega sin(\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also needed for the integral:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t+\tau) = -A\omega sin(\omega(t+\tau)+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v^2(t) = A^2\omega^2 sin^2(\omega t +\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Putting all this into the integral to find the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega sin(\omega t + \phi) \times A\omega sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} A^2\omega^2 sin^2(\omega t +\tau)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A^2\omega^2&amp;lt;/math&amp;gt; can be take out of each of the integrals and cancelled. A substituion can then be made to make solving the integral much simpler:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = \omega t + \phi&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \omega\tau&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the integral becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a) \times sin(a+b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the compound angle rule &amp;lt;math&amp;gt;sin(a+b)=sin(a)cos(b)+cos(a)sin(b)&amp;lt;/math&amp;gt;, the integral can be simplified to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a)sin(a)cos(b) + sin(a)cos(a)sin(b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Separating out into two integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)\frac{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the rule &amp;lt;math&amp;gt;sin(a)cos(a) = \frac{1}{2}sin(2a)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} \frac{1}{2}(sin(2a))\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because the function &amp;lt;math&amp;gt;\frac{1}{2}sin(2a)&amp;lt;/math&amp;gt; is symmetric over all space, the second term in this equation becomes zero. Therefore, the integral simplifies to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b) = cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same calculations from the mean squared displacement section gave an output of the velocity autocorrelation function. The function for the Lennard-Jones solid, liquid and gas were plotted against the timestep along with the approximate function for the velocity autocorrelation function, &amp;lt;math&amp;gt;cos(\omega\tau)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\omega = \frac{1}{2\pi}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure v. &#039;&#039;Plots for the velocity autocorrelation function of a Lennard-Jones solid, liquid and gas; 8,000 atoms&lt;br /&gt;
!&#039;&#039;Figure w. &#039;&#039;Plots for the velocity autocorrelation function of a Lennard-Jones solid, liquid and gas, 1,000,000 atoms&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt VACF 5721 image001.png|800x800px|]]&lt;br /&gt;
|[[File:Rmt MAVACF.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plots for the velocity autocorrelation function show how the time correlation of velocity decreases with time due to collisions with other atoms in the system. The Lennard-Jones solid oscillates around the VACF=0 axis with the oscillations becoming progressively more damped with time. The long range of the oscillations is due to the order in the system. Every time the plot crosses the VACF=0 axis, the velocity of the atom changes direction which is due to a collision with another atom. Every collision for every atom is completely uncorrelated so the change in velocity of one atom as it collides is independent of another change in velocity of another colliding atom. Overall, momentum must be conserved and so overall change of velocity in the system must be conserved. &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones liquid oscillations are damped much quicker; an atom in the liquid only collides with one atom before the velocity becomes uncorrelated with respect to time. The Lennard-Jones gas never reaches the VACF=0 axis as the atoms are too far apart to collide. Because the velocity autocorrelation function never equilibrates, using this method to calculate the diffusion coefficient is inaccurate because the particles in the gas never come into contact with each other.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillating system is so different to the Lennard-Jones systems because the atoms remain in their equilibrium position and vibrate around the same position, never coming into contact with another atom. Because of this, the correlation with time never decreases so the function infinitely oscillates as a sine function.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated from: &amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty C\left(\tau\right)\mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the approximate value for the diffusion coefficient using the velocity autocorrelation function is &amp;lt;math&amp;gt;D = \frac{1}{3}cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The running integral of the velocity autocorrelation functions was plotted using the &#039;&#039;trapesium rule&#039;&#039;, and so the final value on the integral plot is proportional to the diffusion coefficient.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom VACF integral &#039;&#039;(figures w-z)&#039;&#039;&lt;br /&gt;
!1,000,000 VACF integral (&#039;&#039;figures aa-cc)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|[[File:Rmt mysi.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt masi.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|[[File:Rmt myli.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt mali.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|[[File:Rmt mygi.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt ligi.png|frameless|700x700px]]&lt;br /&gt;
|}&lt;br /&gt;
The diffusion coefficients for each of the plots above are tabulated below using the final data point from the integral plot. This is the integral over the whole graph using the trapesium rule. This must be corrected for the timestep; the value is multiplied by 0.002. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom data diffusion coefficients, &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
!1,000,000 atom data diffusion coefficients &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;-0.00055&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{-0.00055}{6} = -0.00018 \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.00014&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.00014}{6} = 0.000046 \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.242&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.242}{6} = \mathbf{0.0807}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.270&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.270}{6} = \mathbf{0.0901}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;25.6&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{25.6}{6} = \mathbf{8.55}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;9.81&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{9.81}{6} = \mathbf{3.27}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
The biggest source of error in these plots is that we assume both the 8,000 atom data and the 1,000,000 atom data take the same amount of time to converge. &#039;&#039;Figure z. &#039;&#039;shows that 5000 timesteps is not long enough for the velocity autocorrelation coefficient for 8,000 atoms to converge as far as 1,000,000 atom data does in this length of time. As the molecular dynamics simulations simulate random motion, this could induce fluctuations in the velocity autocorrelation plot which could increase or decrease the integral introduction another source of error.&lt;br /&gt;
&lt;br /&gt;
Again, the diffusion coefficient of the Lennard-Jones solid can be assumed to be zero for the same reason as the mean squared displacement data. The diffusion coefficient of the liquid is lower for both sets of data when calculated using the velocity autocorrelation function, and the diffusion coefficient is higher for both sets of data.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=541943</id>
		<title>Rep:Mod:hakunamatata</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=541943"/>
		<updated>2016-02-25T15:03:27Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: /* Equilibration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Introduction to Molecular Dynamics Simulations ==&lt;br /&gt;
===The Classical Particle Approximation and Numerical Integration===&lt;br /&gt;
The verit and verit-velocity algorithms are numerical methods to approximate the average position and velocity respectively of randomly moving atoms in a particular medium (solid, liquid, fliud etc.). This position and velocity can be applied to Newtonian mechanics to calculate such properties as the force and potential energy of the system. The algorithms work by splitting the function into discrete time steps, calculating the values of position and velocity at this particular time step, and then effectively &amp;quot;joining the dots&amp;quot; to create an approximate function. These simulations always use the answer from the previous timestep to compute the new timestep, so initial conditions must be given for the first step. Both of the algorithms are shown below and are derived from the Taylor expansion of the position or velocity of the atoms at the timestep &amp;quot;n+1&amp;quot; or &amp;lt;math&amp;gt;t+\delta t&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit Algorithum:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{x}_i\left(t + \delta t\right) \approx 2\mathbf{x}_i\left(t\right) - \mathbf{x}_i\left(t - \delta t\right) + \frac{\mathbf{F}_i\left(t\right)}{m_i}\delta t^2  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit-Velocity Algorithum:&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i\left(t\right)&amp;lt;/math&amp;gt; is the force acting on a particular atom as a function of time&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i&amp;lt;/math&amp;gt; is the acceleration &lt;br /&gt;
&lt;br /&gt;
The smaller the timestep, the closer the numerical approximation is to the true solution function, which can be modeled as a classical harmonic oscillator. &#039;&#039;Figure a.&#039;&#039; in the table below shows the comparison between the two methods in &#039;&#039;time&#039;&#039; space. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure a. &#039;&#039;Plots of position vs time comparing the verit algorithm and harmonic spring results&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure b. &#039;&#039;Plot of the total classical energy of the system (potential + kinetic)&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory xanalytical.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory energy.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The harmonic spring position values are modeled from the harmonic oscillator or particle on a spring. The equation of &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; was used to calculate these values, where &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; are 1 and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; is zero. As seen on the plot, the curves produced from the two different methods of calculating the position are in good agreement.&lt;br /&gt;
|The potential energy is calculated using the equation U = 1/2 kx^2, with a value of k given as 1. The kinetic energy is calculated using the velcity from the verit-velocity algorithm using the equation T = 1/2 mv^2, with a value of m given as 1. The total energy of the system, E, is equal to T + U. The values for x (potential energy) and v (kinetic energy) are taken from the verity algorithm and verit-velocity algorthim respectively. &lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;Figure c. &#039;&#039;Plot of the difference (error) between the harmonic spring and verit algorithm data&lt;br /&gt;
!&#039;&#039;Figure d. &#039;&#039;Plot of the peaks in the error plot in &#039;&#039;figure c.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory error.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory errorpeaks.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The peaks in the error between the harmonic spring and verit algorithm results are at the place where the position curve crosses the time axis. This is because the harmonic spring data (x(t)) has a slightly shorter wave period than that of the verit velocity algorithm, and therefore the difference will get larger with each period of the wave, shown by the error getting larger in &#039;&#039;figure c. &#039;&#039;The period of the plot of the two methods are different because the verit algorithm is much more approximate so does not give the correct solution.&lt;br /&gt;
|The change in the error/difference between the harmonic spring data and verit algorthm data increases linearly and so therefore period of each of the plots in &#039;&#039;figure 1&#039;&#039;. must be constant. &lt;br /&gt;
|}&lt;br /&gt;
The error can also be quantified on a &#039;&#039;phase space&#039;&#039; plot; phase space is momentum or velocity plotted as a function of position. The true solution for motion of an atom is a perfect ellipse, and the more elliptic the shape (less circular) the more momentum or velocity is in the system. A numerical solution, like the verit algorithms, will produce a set of points very close to this ellipse but not perfectly following the curve. A good numerical solution will remain in an elliptical shape, whereas a bad numerical solution, for example one with a large timestep, will spiral away from the true solution. Two examples of such systems using the data from &#039;&#039;figures a-d&#039;&#039; are shown below.  &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure e. &#039;&#039;Phase plot of the harmonic spring data with a good numerical solution (timestep = 0.1) &lt;br /&gt;
!&#039;&#039;Figure f. &#039;&#039;Phase plot of the harmonic spring data with a bad numerical solution (timestep = 0.3) &lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory phasegood.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory badphase.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The timestep at which this data is plotted is 0.1, which results in a very small change in the energy, as seen in &#039;&#039;figure b. &#039;&#039;Increasing the time step will increase the variation in the energy. To keep the variation in the total energy of the system under 1%, the time step must be no larger than approximately 0.28. The energy varies more with increasing time step because the jumps in the algorithm  are getting larger due to less data points. The algorithm assumes these points are joined by a straight line; that the halfway point in the jump is the average between the starting and finishing point of the jump. The phase space plot will become less elliptic and the jumps eventually become so larger that the plot is no longer a continuous shape.  &lt;br /&gt;
&lt;br /&gt;
It is essential to monitor the energy of a numerically modeled system because a good solution for the motion of an atom has a constant energy and a plot in phase space of a perfect ellipse.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance and Force at Zero Potential===&lt;br /&gt;
From classical mechanics, the force calculated from the Newtonian mechanics above can be used to calculate the potential experienced by an atom in the system. They are related by the equation: &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;
This potential gives the shape and dimension of the potential surface on which the system can be modeled. A simple 1D potential that is used to describe the inter atomic forces of a liquid is the Lennard-Jones potential. It has the characteristic features of a short range repulsion potential and harmonic character around the equilibrium bond distance. The value of &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the inter atomic separation when the potential, &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;, is equal to zero, can be calculated by equating the equation for the Lennard-Jones potential to zero and solving for &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The equation for the Lennard-Jones potential: &amp;lt;math&amp;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;
Equating this to zero: &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;
And rearranging in order to separate the variables: &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;
Rearranging this gives &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in terms of &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt; r^6 = \sigma^6&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r = r_0&amp;lt;/math&amp;gt; in this case.&lt;br /&gt;
&lt;br /&gt;
This, therefore, gives the result that interatomic distance at zero potential, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, is equal to &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; in the Lennard-Jones potential is effectively the diameter of one of the particles in the system being measured; in this case, the liquid we are simulating. This is the point where the potential curve crosses the x-axis on an Energy vs interatomic distance plot. The force, &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt;, at this point on the curve corresponds to the gradient; it is found by calculating the derivative of the curve at this point. &lt;br /&gt;
&lt;br /&gt;
To calculate the force, we must differentiate the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As force is equal to the negative differential of the potential energy, the value of the force is: &amp;lt;math&amp;gt;\mathbf{F}_i = 48\epsilon \sigma^{12} r^{-13} - 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting in the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at zero potential from the calculation before: &amp;lt;math&amp;gt;\mathbf{F}_i = \frac{48\epsilon}{\sigma} - \frac{24\epsilon}{\sigma} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The gradient where the Lennard-Jones plot crosses the axis is negative; &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; in the term obtained for &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is negative and therefore the overall value of the force will be negative.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance, Force and Well Depth of the Potential at Equilibrium===&lt;br /&gt;
To calculate the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at the equilibrium position, we need to use the derivative of the potential energy curve. The equilibrium value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is the value at the minimum of the Lennard-Jones curve; when &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Therefore, equating the derivative to zero gives: &amp;lt;math&amp;gt;0 = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rearranging this: &amp;lt;math&amp;gt;48\epsilon \sigma^{12} r^{-13} = 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And simplifying and cancelling gives: &amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6&amp;lt;/math&amp;gt;. Therefore the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at equilibrium is: &amp;lt;math&amp;gt;r_{eq} = \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Physically, this result means that the equilibrium distance is 1.12 times the diameter of one of the particles; the particles have a small gap between them so do not touch. A short range repulsion potential, as seen in the Lennard-Jones curve, is a result of the particles coming into contact. &lt;br /&gt;
&lt;br /&gt;
Again, the force can be calculated from the derivative of the potential curve at the equilibrium point. As the derivative at this point is zero (a minimum on the curve), the force will therefore also be zero.&lt;br /&gt;
&lt;br /&gt;
The well-depth of the potential curve is the difference between zero potential and the potential at the equilibrium bond length. This can be calculated by substituting the value for the equilibrium bond length into the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 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;
Cancelling and simplifying this equation gives: &amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \times \frac{1}{4}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the absolute value for the well depth is &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;. The actual value of this potential is &amp;lt;math&amp;gt;-\epsilon&amp;lt;/math&amp;gt;, as the equilibrium bond length gives the most stable configuration of the molecules and therefore suggests attractive interactions are involved in the arrangement of the molecules; this attractive potential means its negative. &lt;br /&gt;
&lt;br /&gt;
===Boundary Conditions and the Lennard-Jones Cutoff===&lt;br /&gt;
When simulating a liquid, it is computationally impractical to simulate a realistic liquid. Therefore a smaller &#039;box&#039; containing &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; particles is simulated and the computer program will use &#039;&#039;periodic boundary conditions&#039;&#039; to simulate infinite repetitions of this box; when the atom reaches one edge of the box, in periodic boundary conditions, it will reappear again at the opposite edge of the box as if they were connected. For example, an atom at the position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a box of size &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;. Without periodic boundary conditions, we would assume that the atom would end up at the position &amp;lt;math&amp;gt;(1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;. However, in this box, there is no such position and so the particle must reappear at the opposite edge to where it effectively &#039;left&#039; the box. Therefore, it&#039;s ending position will be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The number of particles, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; simulated by the computer is usually between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt;. Physically, this is a very small volume. Considering water, we can calculate the number of molecules in 1 mL or 1 cm^3, a volume that would be considered small in the lab. Taking the concentration of water at standard conditions, &amp;lt;math&amp;gt;55\ mol\ dm^{-3}&amp;lt;/math&amp;gt;, we can convert it to the number of moles per mL: &amp;lt;math&amp;gt;0.055\ mol\ mL^{-1}&amp;lt;/math&amp;gt;. Multiplying this value by Avagadro&#039;s constant (&amp;lt;math&amp;gt;N_A&amp;lt;/math&amp;gt;) gives the number of molcules of water per mL: &amp;lt;math&amp;gt;3.02 \times 10^{22}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The reverse procedure can be used to compare this to the volume of 10,000 molecules: 10,000 divided by Avagadro&#039;s constant gives the number of moles of water which 10,000 molecules makes up: &amp;lt;math&amp;gt;1.66 \times 10^{-20}\ moles&amp;lt;/math&amp;gt;. Dividing this value by the concentration (from &amp;lt;math&amp;gt;n=cV&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is the number of moles, &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; is the concentration and &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume), gives the volume: &amp;lt;math&amp;gt;3.02 \times 10^{-22}\ dm&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;3.02 \times 10^{-19}\ mL&amp;lt;/math&amp;gt;. Physically, of course, this is far too small a volume to be recorded in the lab.&lt;br /&gt;
 &lt;br /&gt;
Periodic boundary conditions simulate an infinite lattice and therefore, when computing the potential, will calculate an infinite amount of pair interactions. Therefore, it is only practical to calculate the energies up to a certain interatomic distance; the Lennard-Jones cutoff distance. Beyond this point, the potential energy and the integral of the curve beyond this point become insignificant and do not impact on the overall energy; removing interactions beyond this point from the calculations will not effect the accuracy. Multiplying the Lennard-Jones potential with the radial distribution function gives a plot of the probability of finding an atom at a particular interatomic distance. The larger the interatomic distance, the lower the probability and so the energy after the cutoff can be disregarded. &lt;br /&gt;
&lt;br /&gt;
Integrating over the Lennard-Jones curve and applying this cutoff as the lower limit can show how small the integral is:&lt;br /&gt;
&lt;br /&gt;
For a general cutoff of with value &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;I = \int_{x}^\infty \phi\left(r\right)\mathrm{d}r = \int_{x}^\infty \frac{4\epsilon\sigma^{12}}{r^{12}}\mathrm{d}r - \int_{x}^\infty \frac{4\epsilon\sigma^6}{r^6}\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving this: &amp;lt;math&amp;gt;I = 4\epsilon\sigma^{12} {\frac{-1}{11r^{11}}\,\Bigg\vert\,}_x^\infty - 4\epsilon\sigma^{6} {\frac{-1}{5r^{5}}\,\Bigg\vert\,}_x^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This gives the general solution: &amp;lt;math&amp;gt;I = \frac{4\epsilon\sigma^{12}}{11x^{11}} - \frac{4\epsilon\sigma^{6}}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating this for &amp;lt;math&amp;gt;\epsilon = \sigma = 1&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;I = \frac{4}{11x^{11}} - \frac{4}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt; (or 2 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.025&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt; (or 2.5 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0082&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt; (or 3 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0033&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All values are taken to 2 significant figures. As the cutoff value for the interatomic distance gets larger, the integral gets smaller, and therefore the energy excluded from the calculation becomes smaller, and the second term in the solved integral, &amp;lt;math&amp;gt;I&amp;lt;/math&amp;gt;, dominates the energy value.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
When using the Lennard-Jones potential, it is appropriate to use reduced units for intermolecular distance, energy and temperature. Reduced units can be calculated by the following relationships:&lt;br /&gt;
&lt;br /&gt;
Intermolecular 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;
&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; are scaling factors. For example, if the parameters for Argon are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\sigma = 0.34 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt; \epsilon\ /\ k_B = 120 K&amp;lt;/math&amp;gt;&lt;br /&gt;
* Lennard-Jones cutoff &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;. The well-depth, &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;, is &amp;lt;math&amp;gt;0.999 kJ mol^{-1} \approx 1 kJ mol^{-1}&amp;lt;/math&amp;gt;. The value of &amp;lt;math&amp;gt;T* = 1.5&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;180 K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
The first aim of the simulations is to determine the most appropriate timestep to use in the vert algorithm simulations. This timestep is a balance between the accuracy of the results (the smaller the timestep, the closer to the true functing the result will be) and the length of real time over which the simluation is run (the smaller the timestep, the less real time over which the simulation will give a result). The appropriateness of the timestep will be determined by plotting how the total free energy of the simulated lattice equilibrates over time.  &lt;br /&gt;
&lt;br /&gt;
Five different calculations, which simulated the melting of a crystal and subsequent equilibration of the energy of the melted crystal, were run at five different timesteps; 0.001, 0.0025, 0.0075, 0.01 and 0.015, and were described by the NVE or &#039;&#039;&amp;quot;microcanonical ensemble&amp;quot;&#039;&#039;. An ensemble is a collection of samples of a system which are under three thermodynamic constraints (three properties are kept constant); in the microcanonical ensemble, the number of particles, the volume and the total energy is kept constant (NVE). &lt;br /&gt;
&lt;br /&gt;
These calculations simulate a box of 1000 unit cells and use periodic boundary conditions to replicate the simulation to a larger scale. Because these simulations use the numerical methods defined in the previous section, the initial position and velocity of the atoms must be defined in the input file. The Brownian (uncorrelated, random) motion of the atoms in the simulation means that there is no long range order in the system and so the atoms in a real system would start in random positions. However, assigning random starting coordinates to the atoms in a simulated liquid is not a relative process; the coordinates are generate independently of each other. Therefore there is a probability that the coordinates simulated will cause the atoms to overlap, which would give a very large repulsion potential, as seen in the Lennard-Jones potential at very small interatomic distances. This short-range repulsion potential comes from the hard-sphere model of atomic simulation.&lt;br /&gt;
&lt;br /&gt;
The input file also defines the structure and density of the lattice. The number density of lattice points in any lattice is the number of lattice points per volume of the unit cell. In a simple cubic lattice, there is one lattice point in the unit cell. From an sc lattice with lattice spacing (length of one side of the unit cell) being &amp;lt;math&amp;gt;1.07722&amp;lt;/math&amp;gt;, the number density of the lattice points is calculated by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{1}{1.07722^3} = 0.7999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a face-centered cubic lattice (fcc), there are four lattice points in the unit cell. Rearranging the above relationship, the lattice spacing can be calculated from the number of lattice points in a unit cell and number density, &amp;lt;math&amp;gt;1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Lattice\ spacing = \sqrt[3]{\frac{number\ of\ lattice\ points\ per\ unit\ cell}{number\ density}} = \sqrt[3]{\frac{4}{1.2}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation creates a box which includes 1000 unit cells, which is 10 unit cells in each dimension. For a simple cubic lattice, because there is one lattice point per unit cell, there will be 1000 atoms created as seen in the input file. The &#039;&#039;create_atom&#039;&#039; command in the input file determines how many boxes are created in the simulation and therefore how many atoms will be created. If a face centered cubic lattice is simulated, because there are 4 lattice points per unit cell, 4000 atoms will be created in the &#039;&#039;create_atom&#039;&#039; command. &lt;br /&gt;
&lt;br /&gt;
The input script also contains the following commands which defines the potential surface which is used to model the intermolecular reactions:&lt;br /&gt;
 mass 1 1.0&lt;br /&gt;
This instruction sets the mass type for the atoms being simulated. It takes the general form of “mass I value”, where mass is the keyword which tells LAMMPS what the input is, I is the atom type and value is the mass of the atom. In this case, I is defined by a specific numerical value; 1 as there is only 1 type of atom in the simulation, but it can be defined with an asterisk (1*), which means “all atom types of 1 to n inclusive”. &lt;br /&gt;
 pair_style lj/cut 3.0&lt;br /&gt;
This instruction sets the type of potential which LAMMPS uses in its calculation of pairwise interactions. It takes the general form of “pair_style style args”, where pair_style is the keyword for LAMMPS, style defines the potential and any specifications it may have, and args are the arguments required for this particular potential. In this case, the Lennard-Jones potential has been used (lj) with a cutoff point (cut) of 3σ. The cutoff point is explained in the introduction section. &lt;br /&gt;
 pair_coeff * * 1.0 1.0&lt;br /&gt;
This instruction specifies the coefficients for the pairwise interactions of each pair of atoms, and it takes the general form “pair_coeff I J args”. Pair_coeff is the keyword, I and J are the atom types, and args are the coefficients which the different atoms types take. In this case, the asterisk in place of I and J refers to all atoms types from 1 to n. The coefficients are the pairwise interactions are 1 for each atom, meaning each atom has an equal contribution to the interaction.&lt;br /&gt;
&lt;br /&gt;
In these initial calculations, the initial conditions for the numerical methods, &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. For this experiment, the verit-velocity algorithm would be the most appropriate, as both the starting position and velocity is specified for this algorithm. &lt;br /&gt;
&lt;br /&gt;
To define the timestep for the algorithm the following code is used defining the timestep as a variable instead of just giving it a definite value&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;
It is much easier to use the variable version of defining the timestep because the length of time over which the simulation is run depends on the time step. By using a variable, you can keep the length of the simulation the same, no matter the size of the timestep. It also makes it easier if multiple properties depend on the timestep – only the variable needs to be changed, not all the parts of the script where timestep is defined. &lt;br /&gt;
&lt;br /&gt;
The calculations produce the values for the total energy of the system, temperature and pressure in the output files, which can be plotted against time. How well these values equilibrate determines the appropriateness of the timestep to use in further calculations in the experiment.  &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!&#039;&#039;Figure h. &#039;&#039;Plot of the equilibration of total energy for five different timesteps&lt;br /&gt;
!&#039;&#039;Figure ha. &#039;&#039; Plot of the temperature vs time equilibration for timestep = 0.0025&lt;br /&gt;
!&#039;&#039;Figure hb. &#039;&#039; Plot of the pressure vs time equilibration for timestep = 0.0025 &lt;br /&gt;
|- &lt;br /&gt;
|[[File:rmt_totalenergycurve.png|600x600px]]&lt;br /&gt;
|[[File:rmt_tempvstime0025.png|600x600px]]&lt;br /&gt;
|[[File:rmt_pressurevstime0025.png|600x600px]]&lt;br /&gt;
The largest time step to give an acceptable result is 0.01. However, for any simluation we would expect energy to be independent of the timestep, something which is not true at a timestep greater than 0.0025. Therefore, the most appropriate timestep to use for a balance between accuracy and length of time which the simulation covers is 0.0025. &lt;br /&gt;
&lt;br /&gt;
0.015 is a particularly bad choice of timestep. This is because the verit-velocity algorithm gives an approximate result to the velocity (kinetic energy term) and position (potential energy term), and so when the timestep becomes too large with respect to the time, the algorithm no longer becomes a suitable way to calculate the energy. As seen in the graph of 0.015, the energy does not equilibrate and diverges.&lt;br /&gt;
&lt;br /&gt;
The plots for temperature and pressure vs time give a good indication for the next section an appropriate pressure and temperature to use for running the simulations under specific conditions.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions ==&lt;br /&gt;
The calculations in this section are run in the isobaric-isothermal ensemble, where the number of particles in the system, the pressure and the temperature are kept constant (NpT). This means that the temperature and the pressure are recalculated in every step, so are no longer constant like they were in the NVE ensemble. From the &#039;&#039;equipartition theorem&#039;&#039;, each degree of freedom will contribute &amp;lt;math&amp;gt;\frac{1}{2} k_B T&amp;lt;/math&amp;gt; of energy to the system. As the system is in three dimensions, there are three degrees of translational freedom and so the total internal energy is equal to &amp;lt;math&amp;gt;\frac{3}{2} k_B T&amp;lt;/math&amp;gt;. Equating this to the kinetic energy, &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt;, at the end of every step and rearranging will allow calculation of the temperature after every step. &lt;br /&gt;
&lt;br /&gt;
A target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, is defined in the input script and the system will equilibrate by multiplying the velocity by a factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, in order to accommodate for the fluctuation and keep the system at approximately the target temperature and therefore constant internal energy. If the temperature of the system is greater than the target temperature, the system&#039;s kinetic energy is too high, so &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is reduced to compensate for this. The same is true for is the temperature is lower than the target temperature; &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than one in the next step to increase the kinetic energy which is now too low. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; can be derived from equating the kinetic and internal energy of the system at an arbitrary time step:&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;
Expanding the brackets inside the sum and moving the term containing &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; out of the sum: &amp;lt;math&amp;gt;\frac{\gamma^2}{2}\sum_i m_i \left(v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;, we can replace &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt; on the left hand side of the equation with &amp;lt;math&amp;gt;\frac{3}{2} N k_B T&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;\frac{3\gamma^2}{2}N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Simplifying and rearranging for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, gives: &amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The principle is the same for controlling the pressure.&lt;br /&gt;
&lt;br /&gt;
As temperature and pressure are no longer constant, he input files require specification of the pressure and the temperature for each of the systems run. 10 simulations were run at two different pressures with five different temperatures at each. &lt;br /&gt;
* Temperatures: 1.6, 1.9, 2.2, 2.5, 2.8&lt;br /&gt;
* Pressures: 2.5, 3.0&lt;br /&gt;
These pressures were chosen because the data simulated when choosing an appropriate timestep gave a pressure between 2.5 and 3.0.  &lt;br /&gt;
&lt;br /&gt;
For the code which computes the thermodynamic potentials, this particular line defines how many steps contribute towards the average of the thermodynamic parameters computed in the calculation. &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;
&#039;&#039;fix&#039;&#039; is the keyword, &#039;&#039;aves&#039;&#039; is the name of the group of fixes which in this case is the average of the thermodynamic values, &#039;&#039;all&#039;&#039; specifies the atoms which the fix is applied to which in this case is all the atoms in the simulated system and &#039;&#039;ave/time&#039;&#039; means that compute global time averages are calculated. The following three numbers have the following meaning:&lt;br /&gt;
&lt;br /&gt;
*100 = use the input values every 100 timesteps&lt;br /&gt;
*1000 = use input values 1000 times for calculating the average&lt;br /&gt;
*100000 = calculate the average every 100000 timesteps&lt;br /&gt;
&lt;br /&gt;
Therefore for the total calculation which lasts for 100000 will only have the average calculated once. Assuming 1 value every timestep, there will be 100000/100 values = 1000. The amount of time simulated is 100,000 steps, read from the following line.&lt;br /&gt;
&lt;br /&gt;
The density data from all ten calculation were plotted on the same graph, along with the density for an &amp;quot;ideal&amp;quot; gas. This density can be derived from the ideal gas law:&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;
Rearranging in terms of density: &amp;lt;math&amp;gt;\frac{N}{V} = \frac{P}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As these simulations are being run under reduced units, we can take &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt;, and so the density of the ideal gas becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the density of the ideal gas is plotted as the pressure divided by the temperature in pressure-temperature phase space.&lt;br /&gt;
[[File:Rmt dvt plot.png|none|thumb|800x800px|&#039;&#039;Figure i. &#039;&#039;Plot of the variation in density with temperature at a defined pressure for the numerically simulated and ideal systems]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that calculated in the ideal gas law. This is because for an ideal gas, an assumption is made that there are no intermolecular interactions, and therefore forces such as electron repulsion forces are ignored; repulsion forces dominate over attractive ones, as all the atoms in this simulation are the same and so partial charges or dipoles are created. This will mean that the particles move closer together than a real gas and so the density will be larger. This discrepancy between the ideal and non-ideal systems becomes larger at a higher pressure because with a higher pressure, the atoms in the system are closer together and therefore the intermolecular repulsion will become larger. This greater repulsion will in turn have a larger effect on decreasing the density.&lt;br /&gt;
&lt;br /&gt;
== Statistical Physics Calculations of the Heat Capacity ==&lt;br /&gt;
The heat capacity of a system at constant volume can be calculated from the variance in the total energy of the system. The relationship used to calculate the heat capacity is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = 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;\left\langle E^2\right\rangle&amp;lt;/math&amp;gt; is the continuous average of the total square energy at each temperature as a function of temperature. &amp;lt;math&amp;gt;\left\langle E\right\rangle^2&amp;lt;/math&amp;gt; is the continuous average of the total energy at each temperature as a function of temperature squared. The heat capacity is multiplied by &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; in this case because the version of LAMMPS calculates every energy divided by the number of molecules in the system simulated.&lt;br /&gt;
&lt;br /&gt;
The calculations in this sections are run in density-temperature phase space and the ensemble has changed to the canonical ensemble (NVT). A set of input files were written for ten calculations for, like the previous section, two pressures and five different temperatures at each pressure:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 0.2, 0.8&lt;br /&gt;
*Temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{C_V}{V}&amp;lt;/math&amp;gt; was plotted against temperature to determine the relationship in density-temperature phase space. An example of an input file can be found [[Media:nvt_-_0220.in|here]]. The lines which have been changed from the previous input files are at the end of the script:&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 &lt;br /&gt;
 thermo_style custom step etotal temp&lt;br /&gt;
 variable energy equal etotal&lt;br /&gt;
 variable energy2 equal etotal*etotal&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_energy v_energy2 v_temp&lt;br /&gt;
 run 100000&lt;br /&gt;
 &lt;br /&gt;
 variable aveenergy equal f_aves[1]&lt;br /&gt;
 variable aveenergy2 equal f_aves[2]&lt;br /&gt;
 variable avetemp equal f_aves[3]&lt;br /&gt;
 variable heatcapacitydv equal atoms*atoms*(v_aveenergy2-v_aveenergy*v_aveenergy)/(v_avetemp*v_avetemp*vol)&lt;br /&gt;
 &lt;br /&gt;
 print &amp;quot;Averages&amp;quot;&lt;br /&gt;
 print &amp;quot;--------&amp;quot;&lt;br /&gt;
 print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Heat Capacity per Volume: ${heatcapacitydv}&amp;quot;&lt;br /&gt;
The line with the keyword &#039;fix&#039; determines which thermodynamic values are averaged and over how many steps they are averaged. The next section takes these averages as variables and uses them to define the heat capacity which is calculated from the equation at the beginning of this section. Only the energy and temperature are needed to define the heat capacity and so only these values are calculated by the simulation. [[File:Rmt heatcapacitybyv.png|none|thumb|800x800px|&#039;&#039;Figure j. &#039;&#039;C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V against temperature for the two different pressures 0.2 and 0.8]]As seen in the above figure, the heat capacity decreases with temperature for both pressures. It would be expected for an ideal system that as the temperature increases, the heat capacity at constant volume increases and tends to a constant volume at very high T of 3R; R = the universal gas constant. This means increasing the temperature increases the amount of energy being stored in the system and this energy is stored as vibrational energy. However, for a Lennard-Jones liquid, the system being simulated here, the heat capacity decreases with temperature. This is because the simulation has two components to the simulation; the atoms are vibrating in a quasi-harmonic fashion around the equilibrium position and also diffuse between neighbouring equilibrium positions in a gas like fashion. As the temperature increases, the amount of diffusion increases and the vibrations decreases, therefore decreasing the ability of the system to absorb vibrational energy, resulting in the decrease in heat capacity. &amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www.nature.com/ncomms/2013/130816/ncomms3331/full/ncomms3331.html?message-global=remove&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural Properties and the Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a single atom in a system is a plot of the probability that an atom can be found at a certain distance from the central atom. The peaks in this plot can give the distance of an atom from its nearest neighbours in the Lennard-Jones simulated system. &lt;br /&gt;
&lt;br /&gt;
The calculations in this section simulate a Lennard-Jones solid, liquid and gas and, using the output of the LAMMPS trajectory file, plots both the radial distribution function and its integral using DLV. The temperature and pressure parameters for these calculations were taken from the phase diagram or coexistence curve for a Lennard-Jones system.&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt; The parameters used are displayed in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! Temperature, &amp;lt;math&amp;gt;T^*&amp;lt;/math&amp;gt;&lt;br /&gt;
! Pressure, &amp;lt;math&amp;gt;p^*&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| LJ Solid&lt;br /&gt;
| 1.5&lt;br /&gt;
| 1.2&lt;br /&gt;
|-&lt;br /&gt;
| LJ Liquid&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.8&lt;br /&gt;
|-&lt;br /&gt;
| LJ Gas&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.01&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The data obtained from the plots and the radial distribution functions and their integrals were plotted and shown in the table below.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure k. &#039;&#039;The radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
!&#039;&#039;Figure l. &#039;&#039;The integrals of the radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt fullrdfs.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt allintegralsrdf.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
[[File:Rmt Nearest neighbours.png|left|thumb|300x300px|&#039;&#039;Figure m. &#039;&#039;Representation of a cross section of the first three shells of nearest neighbours in an fcc solid. The black atom is the central atom being considered, the blue atoms are the first shell, the orange atoms the second shell and the purple atoms are the third.]]&lt;br /&gt;
The RDF of the solid gives a very irregular curve because of the irregular structure of the lattice. For a simple cubic lattice, a regular structure of the RDF would be expected because of the equal number of atoms in each of the nearest neighbour shells of the atoms. However, for face-centered cubic, the solid in this simulation, the structure is much more irregular and as the atoms move from their equilibrium position in the lattice due to vibrations, the peaks in the radial distribution will broaden. The irregular heights of the peaks are due to the varying numbers of atoms in each of the nearest neighbour shells for the central atom. The first shell gives the highest peak as it contains the most atoms; in total, considering all four surrounding unit cells, this shell contains 12 atoms and ideally takes the geometry of an icosahedron. The second shell is smaller and contains only 6 atoms in an octahedral coordination shape. The following shell again contributes 12 atoms, 3 from each unit cell. This therefore explains why the heights of the peaks in the solid plot in &#039;&#039;figure k.&#039;&#039; vary. These values can be confirmed by the plot in &#039;&#039;figure o.&#039;&#039; which is the integral; it cumulatively adds the numbers in each shell. The size of the first &amp;quot;step&amp;quot; is 12; there are 12 atoms in the first shell. The size of the second step is approximately 18; there are 18-12=6 steps in the second shell. The same theory applies for the third shell which gives a value of 13. This is slightly different to the predicted value possibly due to error in the calculation of the radial distribution function and therefore its integral. &lt;br /&gt;
&lt;br /&gt;
The RDF of the liquid has a representation of far fewer shells, which means that there are less atoms in the space close to a &amp;quot;central&amp;quot; atom in the bulk solution. The particles have more energy and therefore do not keep to a regular lattice structure. As they move about, some regualrity is maintained around each atom, but only to the extend of two or three shells, meaning there is no long range order in a Lennard-Jones liquid. &lt;br /&gt;
&lt;br /&gt;
The RDF of the gas again omits more shells as there is almost no order in a Lennard-Jones gas. The single peak on this plot considers only the set of atoms closest to the central atom and all others are disregarded as they are too far apart. &lt;br /&gt;
&lt;br /&gt;
Considering &#039;&#039;figure l.&#039;&#039;, the size of the integral of the radial distribution function decreases from solid to liquid to gas. This makes sense as the number of atoms in the surrounding shells decreases with density of the system; the atoms become further apart. &lt;br /&gt;
&lt;br /&gt;
From the plot of the radial distribution function of the solid, the lattice spacing can be determined. For this, we can consider just the first three peaks of the RDF plot. The lattice spacing refers to the length of one unit cell, and so, using &#039;&#039;figure m&#039;&#039;, we can calculate this using two different methods; a) we can use the distance between the central atom and the first shell of nearest neighbours, and use trigonometry to calculate the lattice spacing. Or alternatively b) we can use the distance between the central atom and the second nearest neighbour shell to get the lattice spacing.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure n. &#039;&#039;The radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
!&#039;&#039;Figure o. &#039;&#039;The integral of the radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt solidgr3.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt solidint3.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
Using method a) (with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; as the distance between the central atom and the nearest neighbour: Lattice spacing = &amp;lt;math&amp;gt;\frac{r}{cos({\frac{\pi}{4}})} = \frac{1.02}{cos({\frac{\pi}{4}})} \approx 1.44&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using method b): Lattice spacing &amp;lt;math&amp;gt;\approx 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can take an average between the two get an approximate value for the lattice spacing: &amp;lt;math&amp;gt;1.46 \plusmn 0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These values for distance are all in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
The ability of atoms to move around in a solid liquid or gas can be characterised by the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. In this section, we will explore two different ways to calculate the diffusion coefficient and compare the results. &lt;br /&gt;
&lt;br /&gt;
=== The Mean Squared Displacement ===&lt;br /&gt;
The diffusion coefficient can be measured easily be calculating the mean squared displacement of atoms in the solution; the diffusion coefficient is proportional to the first derivative of the mean squared displacement. By plotting the mean squared displacement as a function of time, the gradient can be taken to calculate the diffusion coefficient when its has equilibrated and become linear.&lt;br /&gt;
&lt;br /&gt;
The temperature and density parameters used were the same as in the previous section:&lt;br /&gt;
* Solid: T=1.5, D=1.2&lt;br /&gt;
* Liquid: T=1.1, D=0.8&lt;br /&gt;
* Gas: T=1.1, D=0.01&lt;br /&gt;
&lt;br /&gt;
Mean density squared calculations were run for all three Lennard-Jones phases and the data plotted as function of timestep below. The data from a simulation containing 1,000,000 atoms was plotted for comparision.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!Plots for the 8,000 atom data (&#039;&#039;figures p-r)&#039;&#039;&lt;br /&gt;
!Plots for the 1,000,000 atom data (&#039;&#039;figures s-u)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|[[File:Rmt_MSDsolid.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt_MAsolid.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|[[File:Rmt MSDliquid.png|700x700px]]&lt;br /&gt;
|[[File:Rmt MAliquid.png|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|[[File:Rmt MSDgas.png|700x700px]]&lt;br /&gt;
|[[File:Rmt dataplots 25894 image001.png|700x700px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The exact relationship between the mean squared displacement and the diffusion coefficient is:&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;
Taking the gradients of each of the curves at the point at which they become linear and dividing by six will give the diffusion coefficient for each set of data. The gradient also needs to be converted to a function of time; this is done by dividing by the timestep, which in this case is 0.002:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom data diffusion coefficients, &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
!1,000,000 atom data diffusion coefficients &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 0.9999&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|Gradient = 0.0972&lt;br /&gt;
Amount of data used to calculate gradient: timestep 4300-5000, &amp;lt;math&amp;gt;R^2 = 0.9998&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{48.6}{6} = \mathbf{8.1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient = 0.0386&lt;br /&gt;
Amount of data used to calculate gradient: timestep 4000-5000, &amp;lt;math&amp;gt;R^2 = 0.1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{19.6}{6} = \mathbf{3.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For both of the solid approximations, the diffusion coefficient can be approximated as zero. This is because, when equilibrated, the function has a constant value of around 0.2 for the mean squared displacement. A gradient with a value of zero means that the atoms take an infinite amount of time to change their mean squared displacement; to move away from their equilibrium position, and so this means that we can approximate in this system, there will be no diffusion. In real system, however, this is not the case; diffusion occurs but it is very slow. A plot for a real system will give a very shallow positive gradient.&lt;br /&gt;
&lt;br /&gt;
The liquid approximations are very well correlated. This is because in both cases, the mean squared displacement of particles in a liquid increases linearly with time and the gradient of both plots are almost identical. We can assume from this that identical starting conditions were used to calculate this data. Also, we can estimate that 8,000 atoms is a large enough simulation to give an accurate result for the diffusion coefficient for the Lennard-Jones liquid.&lt;br /&gt;
&lt;br /&gt;
The gas approximations are very different. This is most probably due to the fact that the density specified in calculations are different. The 8,000 data can be estimated to be a much lower density because the diffusion coefficient is faster and this means diffusion will happen faster; at a higher density a particle will take longer to diffuse over a given distance. Because of the difference in density, the two values of the diffusion coefficient cannot be qualitatively compared. The reason for the initial deviation for linearity in the gas plots is due to the momentum of the particles initially dominating over the diffusion and the diffusion coefficient is dependent on time. As the system equilibrates, the diffusion coefficient becomes constant and the plots become linear.&lt;br /&gt;
&lt;br /&gt;
=== The Velocity Autocorrelation Function ===&lt;br /&gt;
&lt;br /&gt;
Another way to calculate the diffusion coefficient is by using the velocity correlation function, which determines how the velocity of an atom changes with time. The function determines the difference in time (&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;) when the velocity becomes uncorrelated, i.e. the difference between the velocity at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; and at time &amp;lt;math&amp;gt;t+\tau&amp;lt;/math&amp;gt;. By integrating over this function, we can find the diffusion coefficient. &lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function: &amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can also be written as the integral: &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;
Using the function which defines the position of a classical harmonic oscillator, we can differentiate this to give the equation for the velocity which we can plug into the integral:&lt;br /&gt;
&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;
&amp;lt;math&amp;gt;dv{x(t)}{t} = v(t) = -A\omega sin(\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also needed for the integral:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t+\tau) = -A\omega sin(\omega(t+\tau)+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v^2(t) = A^2\omega^2 sin^2(\omega t +\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Putting all this into the integral to find the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega sin(\omega t + \phi) \times A\omega sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} A^2\omega^2 sin^2(\omega t +\tau)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A^2\omega^2&amp;lt;/math&amp;gt; can be take out of each of the integrals and cancelled. A substituion can then be made to make solving the integral much simpler:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = \omega t + \phi&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \omega\tau&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the integral becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a) \times sin(a+b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the compound angle rule &amp;lt;math&amp;gt;sin(a+b)=sin(a)cos(b)+cos(a)sin(b)&amp;lt;/math&amp;gt;, the integral can be simplified to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a)sin(a)cos(b) + sin(a)cos(a)sin(b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Separating out into two integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)\frac{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the rule &amp;lt;math&amp;gt;sin(a)cos(a) = \frac{1}{2}sin(2a)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} \frac{1}{2}(sin(2a))\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because the function &amp;lt;math&amp;gt;\frac{1}{2}sin(2a)&amp;lt;/math&amp;gt; is symmetric over all space, the second term in this equation becomes zero. Therefore, the integral simplifies to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b) = cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same calculations from the mean squared displacement section gave an output of the velocity autocorrelation function. The function for the Lennard-Jones solid, liquid and gas were plotted against the timestep along with the approximate function for the velocity autocorrelation function, &amp;lt;math&amp;gt;cos(\omega\tau)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\omega = \frac{1}{2\pi}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure v. &#039;&#039;Plots for the velocity autocorrelation function of a Lennard-Jones solid, liquid and gas; 8,000 atoms&lt;br /&gt;
!&#039;&#039;Figure w. &#039;&#039;Plots for the velocity autocorrelation function of a Lennard-Jones solid, liquid and gas, 1,000,000 atoms&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt VACF 5721 image001.png|800x800px|]]&lt;br /&gt;
|[[File:Rmt MAVACF.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plots for the velocity autocorrelation function show how the time correlation of velocity decreases with time due to collisions with other atoms in the system. The Lennard-Jones solid oscillates around the VACF=0 axis with the oscillations becoming progressively more damped with time. The long range of the oscillations is due to the order in the system. Every time the plot crosses the VACF=0 axis, the velocity of the atom changes direction which is due to a collision with another atom. Every collision for every atom is completely uncorrelated so the change in velocity of one atom as it collides is independent of another change in velocity of another colliding atom. Overall, momentum must be conserved and so overall change of velocity in the system must be conserved. &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones liquid oscillations are damped much quicker; an atom in the liquid only collides with one atom before the velocity becomes uncorrelated with respect to time. The Lennard-Jones gas never reaches the VACF=0 axis as the atoms are too far apart to collide. Because the velocity autocorrelation function never equilibrates, using this method to calculate the diffusion coefficient is inaccurate because the particles in the gas never come into contact with each other.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillating system is so different to the Lennard-Jones systems because the atoms remain in their equilibrium position and vibrate around the same position, never coming into contact with another atom. Because of this, the correlation with time never decreases so the function infinitely oscillates as a sine function.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated from: &amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty C\left(\tau\right)\mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the approximate value for the diffusion coefficient using the velocity autocorrelation function is &amp;lt;math&amp;gt;D = \frac{1}{3}cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The running integral of the velocity autocorrelation functions was plotted using the &#039;&#039;trapesium rule&#039;&#039;, and so the final value on the integral plot is proportional to the diffusion coefficient.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom VACF integral &#039;&#039;(figures w-z)&#039;&#039;&lt;br /&gt;
!1,000,000 VACF integral (&#039;&#039;figures aa-cc)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|[[File:Rmt mysi.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt masi.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|[[File:Rmt myli.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt mali.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|[[File:Rmt mygi.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt ligi.png|frameless|700x700px]]&lt;br /&gt;
|}&lt;br /&gt;
The diffusion coefficients for each of the plots above are tabulated below using the final data point from the integral plot. This is the integral over the whole graph using the trapesium rule. This must be corrected for the timestep; the value is multiplied by 0.002. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom data diffusion coefficients, &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
!1,000,000 atom data diffusion coefficients &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;-0.00055&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{-0.00055}{6} = -0.00018 \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.00014&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.00014}{6} = 0.000046 \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.242&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.242}{6} = \mathbf{0.0807}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.270&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.270}{6} = \mathbf{0.0901}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;25.6&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{25.6}{6} = \mathbf{8.55}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;9.81&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{9.81}{6} = \mathbf{3.27}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
The biggest source of error in these plots is that we assume both the 8,000 atom data and the 1,000,000 atom data take the same amount of time to converge. &#039;&#039;Figure z. &#039;&#039;shows that 5000 timesteps is not long enough for the velocity autocorrelation coefficient for 8,000 atoms to converge as far as 1,000,000 atom data does in this length of time. As the molecular dynamics simulations simulate random motion, this could induce fluctuations in the velocity autocorrelation plot which could increase or decrease the integral introduction another source of error.&lt;br /&gt;
&lt;br /&gt;
Again, the diffusion coefficient of the Lennard-Jones solid can be assumed to be zero for the same reason as the mean squared displacement data. The diffusion coefficient of the liquid is lower for both sets of data when calculated using the velocity autocorrelation function, and the diffusion coefficient is higher for both sets of data.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Rmt_pressurevstime0025.png&amp;diff=541942</id>
		<title>File:Rmt pressurevstime0025.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Rmt_pressurevstime0025.png&amp;diff=541942"/>
		<updated>2016-02-25T15:03:20Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Rmt_tempvstime0025.png&amp;diff=541939</id>
		<title>File:Rmt tempvstime0025.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Rmt_tempvstime0025.png&amp;diff=541939"/>
		<updated>2016-02-25T15:02:59Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Rmt_totalenergycurve.png&amp;diff=541938</id>
		<title>File:Rmt totalenergycurve.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Rmt_totalenergycurve.png&amp;diff=541938"/>
		<updated>2016-02-25T15:02:37Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=541839</id>
		<title>Rep:Mod:hakunamatata</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=541839"/>
		<updated>2016-02-25T14:48:28Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: /* The Velocity Autocorrelation Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Introduction to Molecular Dynamics Simulations ==&lt;br /&gt;
===The Classical Particle Approximation and Numerical Integration===&lt;br /&gt;
The verit and verit-velocity algorithms are numerical methods to approximate the average position and velocity respectively of randomly moving atoms in a particular medium (solid, liquid, fliud etc.). This position and velocity can be applied to Newtonian mechanics to calculate such properties as the force and potential energy of the system. The algorithms work by splitting the function into discrete time steps, calculating the values of position and velocity at this particular time step, and then effectively &amp;quot;joining the dots&amp;quot; to create an approximate function. These simulations always use the answer from the previous timestep to compute the new timestep, so initial conditions must be given for the first step. Both of the algorithms are shown below and are derived from the Taylor expansion of the position or velocity of the atoms at the timestep &amp;quot;n+1&amp;quot; or &amp;lt;math&amp;gt;t+\delta t&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit Algorithum:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{x}_i\left(t + \delta t\right) \approx 2\mathbf{x}_i\left(t\right) - \mathbf{x}_i\left(t - \delta t\right) + \frac{\mathbf{F}_i\left(t\right)}{m_i}\delta t^2  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit-Velocity Algorithum:&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i\left(t\right)&amp;lt;/math&amp;gt; is the force acting on a particular atom as a function of time&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i&amp;lt;/math&amp;gt; is the acceleration &lt;br /&gt;
&lt;br /&gt;
The smaller the timestep, the closer the numerical approximation is to the true solution function, which can be modeled as a classical harmonic oscillator. &#039;&#039;Figure a.&#039;&#039; in the table below shows the comparison between the two methods in &#039;&#039;time&#039;&#039; space. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure a. &#039;&#039;Plots of position vs time comparing the verit algorithm and harmonic spring results&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure b. &#039;&#039;Plot of the total classical energy of the system (potential + kinetic)&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory xanalytical.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory energy.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The harmonic spring position values are modeled from the harmonic oscillator or particle on a spring. The equation of &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; was used to calculate these values, where &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; are 1 and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; is zero. As seen on the plot, the curves produced from the two different methods of calculating the position are in good agreement.&lt;br /&gt;
|The potential energy is calculated using the equation U = 1/2 kx^2, with a value of k given as 1. The kinetic energy is calculated using the velcity from the verit-velocity algorithm using the equation T = 1/2 mv^2, with a value of m given as 1. The total energy of the system, E, is equal to T + U. The values for x (potential energy) and v (kinetic energy) are taken from the verity algorithm and verit-velocity algorthim respectively. &lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;Figure c. &#039;&#039;Plot of the difference (error) between the harmonic spring and verit algorithm data&lt;br /&gt;
!&#039;&#039;Figure d. &#039;&#039;Plot of the peaks in the error plot in &#039;&#039;figure c.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory error.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory errorpeaks.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The peaks in the error between the harmonic spring and verit algorithm results are at the place where the position curve crosses the time axis. This is because the harmonic spring data (x(t)) has a slightly shorter wave period than that of the verit velocity algorithm, and therefore the difference will get larger with each period of the wave, shown by the error getting larger in &#039;&#039;figure c. &#039;&#039;The period of the plot of the two methods are different because the verit algorithm is much more approximate so does not give the correct solution.&lt;br /&gt;
|The change in the error/difference between the harmonic spring data and verit algorthm data increases linearly and so therefore period of each of the plots in &#039;&#039;figure 1&#039;&#039;. must be constant. &lt;br /&gt;
|}&lt;br /&gt;
The error can also be quantified on a &#039;&#039;phase space&#039;&#039; plot; phase space is momentum or velocity plotted as a function of position. The true solution for motion of an atom is a perfect ellipse, and the more elliptic the shape (less circular) the more momentum or velocity is in the system. A numerical solution, like the verit algorithms, will produce a set of points very close to this ellipse but not perfectly following the curve. A good numerical solution will remain in an elliptical shape, whereas a bad numerical solution, for example one with a large timestep, will spiral away from the true solution. Two examples of such systems using the data from &#039;&#039;figures a-d&#039;&#039; are shown below.  &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure e. &#039;&#039;Phase plot of the harmonic spring data with a good numerical solution (timestep = 0.1) &lt;br /&gt;
!&#039;&#039;Figure f. &#039;&#039;Phase plot of the harmonic spring data with a bad numerical solution (timestep = 0.3) &lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory phasegood.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory badphase.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The timestep at which this data is plotted is 0.1, which results in a very small change in the energy, as seen in &#039;&#039;figure b. &#039;&#039;Increasing the time step will increase the variation in the energy. To keep the variation in the total energy of the system under 1%, the time step must be no larger than approximately 0.28. The energy varies more with increasing time step because the jumps in the algorithm  are getting larger due to less data points. The algorithm assumes these points are joined by a straight line; that the halfway point in the jump is the average between the starting and finishing point of the jump. The phase space plot will become less elliptic and the jumps eventually become so larger that the plot is no longer a continuous shape.  &lt;br /&gt;
&lt;br /&gt;
It is essential to monitor the energy of a numerically modeled system because a good solution for the motion of an atom has a constant energy and a plot in phase space of a perfect ellipse.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance and Force at Zero Potential===&lt;br /&gt;
From classical mechanics, the force calculated from the Newtonian mechanics above can be used to calculate the potential experienced by an atom in the system. They are related by the equation: &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;
This potential gives the shape and dimension of the potential surface on which the system can be modeled. A simple 1D potential that is used to describe the inter atomic forces of a liquid is the Lennard-Jones potential. It has the characteristic features of a short range repulsion potential and harmonic character around the equilibrium bond distance. The value of &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the inter atomic separation when the potential, &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;, is equal to zero, can be calculated by equating the equation for the Lennard-Jones potential to zero and solving for &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The equation for the Lennard-Jones potential: &amp;lt;math&amp;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;
Equating this to zero: &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;
And rearranging in order to separate the variables: &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;
Rearranging this gives &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in terms of &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt; r^6 = \sigma^6&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r = r_0&amp;lt;/math&amp;gt; in this case.&lt;br /&gt;
&lt;br /&gt;
This, therefore, gives the result that interatomic distance at zero potential, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, is equal to &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; in the Lennard-Jones potential is effectively the diameter of one of the particles in the system being measured; in this case, the liquid we are simulating. This is the point where the potential curve crosses the x-axis on an Energy vs interatomic distance plot. The force, &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt;, at this point on the curve corresponds to the gradient; it is found by calculating the derivative of the curve at this point. &lt;br /&gt;
&lt;br /&gt;
To calculate the force, we must differentiate the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As force is equal to the negative differential of the potential energy, the value of the force is: &amp;lt;math&amp;gt;\mathbf{F}_i = 48\epsilon \sigma^{12} r^{-13} - 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting in the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at zero potential from the calculation before: &amp;lt;math&amp;gt;\mathbf{F}_i = \frac{48\epsilon}{\sigma} - \frac{24\epsilon}{\sigma} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The gradient where the Lennard-Jones plot crosses the axis is negative; &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; in the term obtained for &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is negative and therefore the overall value of the force will be negative.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance, Force and Well Depth of the Potential at Equilibrium===&lt;br /&gt;
To calculate the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at the equilibrium position, we need to use the derivative of the potential energy curve. The equilibrium value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is the value at the minimum of the Lennard-Jones curve; when &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Therefore, equating the derivative to zero gives: &amp;lt;math&amp;gt;0 = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rearranging this: &amp;lt;math&amp;gt;48\epsilon \sigma^{12} r^{-13} = 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And simplifying and cancelling gives: &amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6&amp;lt;/math&amp;gt;. Therefore the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at equilibrium is: &amp;lt;math&amp;gt;r_{eq} = \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Physically, this result means that the equilibrium distance is 1.12 times the diameter of one of the particles; the particles have a small gap between them so do not touch. A short range repulsion potential, as seen in the Lennard-Jones curve, is a result of the particles coming into contact. &lt;br /&gt;
&lt;br /&gt;
Again, the force can be calculated from the derivative of the potential curve at the equilibrium point. As the derivative at this point is zero (a minimum on the curve), the force will therefore also be zero.&lt;br /&gt;
&lt;br /&gt;
The well-depth of the potential curve is the difference between zero potential and the potential at the equilibrium bond length. This can be calculated by substituting the value for the equilibrium bond length into the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 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;
Cancelling and simplifying this equation gives: &amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \times \frac{1}{4}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the absolute value for the well depth is &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;. The actual value of this potential is &amp;lt;math&amp;gt;-\epsilon&amp;lt;/math&amp;gt;, as the equilibrium bond length gives the most stable configuration of the molecules and therefore suggests attractive interactions are involved in the arrangement of the molecules; this attractive potential means its negative. &lt;br /&gt;
&lt;br /&gt;
===Boundary Conditions and the Lennard-Jones Cutoff===&lt;br /&gt;
When simulating a liquid, it is computationally impractical to simulate a realistic liquid. Therefore a smaller &#039;box&#039; containing &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; particles is simulated and the computer program will use &#039;&#039;periodic boundary conditions&#039;&#039; to simulate infinite repetitions of this box; when the atom reaches one edge of the box, in periodic boundary conditions, it will reappear again at the opposite edge of the box as if they were connected. For example, an atom at the position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a box of size &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;. Without periodic boundary conditions, we would assume that the atom would end up at the position &amp;lt;math&amp;gt;(1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;. However, in this box, there is no such position and so the particle must reappear at the opposite edge to where it effectively &#039;left&#039; the box. Therefore, it&#039;s ending position will be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The number of particles, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; simulated by the computer is usually between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt;. Physically, this is a very small volume. Considering water, we can calculate the number of molecules in 1 mL or 1 cm^3, a volume that would be considered small in the lab. Taking the concentration of water at standard conditions, &amp;lt;math&amp;gt;55\ mol\ dm^{-3}&amp;lt;/math&amp;gt;, we can convert it to the number of moles per mL: &amp;lt;math&amp;gt;0.055\ mol\ mL^{-1}&amp;lt;/math&amp;gt;. Multiplying this value by Avagadro&#039;s constant (&amp;lt;math&amp;gt;N_A&amp;lt;/math&amp;gt;) gives the number of molcules of water per mL: &amp;lt;math&amp;gt;3.02 \times 10^{22}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The reverse procedure can be used to compare this to the volume of 10,000 molecules: 10,000 divided by Avagadro&#039;s constant gives the number of moles of water which 10,000 molecules makes up: &amp;lt;math&amp;gt;1.66 \times 10^{-20}\ moles&amp;lt;/math&amp;gt;. Dividing this value by the concentration (from &amp;lt;math&amp;gt;n=cV&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is the number of moles, &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; is the concentration and &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume), gives the volume: &amp;lt;math&amp;gt;3.02 \times 10^{-22}\ dm&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;3.02 \times 10^{-19}\ mL&amp;lt;/math&amp;gt;. Physically, of course, this is far too small a volume to be recorded in the lab.&lt;br /&gt;
 &lt;br /&gt;
Periodic boundary conditions simulate an infinite lattice and therefore, when computing the potential, will calculate an infinite amount of pair interactions. Therefore, it is only practical to calculate the energies up to a certain interatomic distance; the Lennard-Jones cutoff distance. Beyond this point, the potential energy and the integral of the curve beyond this point become insignificant and do not impact on the overall energy; removing interactions beyond this point from the calculations will not effect the accuracy. Multiplying the Lennard-Jones potential with the radial distribution function gives a plot of the probability of finding an atom at a particular interatomic distance. The larger the interatomic distance, the lower the probability and so the energy after the cutoff can be disregarded. &lt;br /&gt;
&lt;br /&gt;
Integrating over the Lennard-Jones curve and applying this cutoff as the lower limit can show how small the integral is:&lt;br /&gt;
&lt;br /&gt;
For a general cutoff of with value &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;I = \int_{x}^\infty \phi\left(r\right)\mathrm{d}r = \int_{x}^\infty \frac{4\epsilon\sigma^{12}}{r^{12}}\mathrm{d}r - \int_{x}^\infty \frac{4\epsilon\sigma^6}{r^6}\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving this: &amp;lt;math&amp;gt;I = 4\epsilon\sigma^{12} {\frac{-1}{11r^{11}}\,\Bigg\vert\,}_x^\infty - 4\epsilon\sigma^{6} {\frac{-1}{5r^{5}}\,\Bigg\vert\,}_x^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This gives the general solution: &amp;lt;math&amp;gt;I = \frac{4\epsilon\sigma^{12}}{11x^{11}} - \frac{4\epsilon\sigma^{6}}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating this for &amp;lt;math&amp;gt;\epsilon = \sigma = 1&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;I = \frac{4}{11x^{11}} - \frac{4}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt; (or 2 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.025&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt; (or 2.5 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0082&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt; (or 3 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0033&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All values are taken to 2 significant figures. As the cutoff value for the interatomic distance gets larger, the integral gets smaller, and therefore the energy excluded from the calculation becomes smaller, and the second term in the solved integral, &amp;lt;math&amp;gt;I&amp;lt;/math&amp;gt;, dominates the energy value.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
When using the Lennard-Jones potential, it is appropriate to use reduced units for intermolecular distance, energy and temperature. Reduced units can be calculated by the following relationships:&lt;br /&gt;
&lt;br /&gt;
Intermolecular 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;
&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; are scaling factors. For example, if the parameters for Argon are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\sigma = 0.34 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt; \epsilon\ /\ k_B = 120 K&amp;lt;/math&amp;gt;&lt;br /&gt;
* Lennard-Jones cutoff &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;. The well-depth, &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;, is &amp;lt;math&amp;gt;0.999 kJ mol^{-1} \approx 1 kJ mol^{-1}&amp;lt;/math&amp;gt;. The value of &amp;lt;math&amp;gt;T* = 1.5&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;180 K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
The first aim of the simulations is to determine the most appropriate timestep to use in the vert algorithm simulations. This timestep is a balance between the accuracy of the results (the smaller the timestep, the closer to the true functing the result will be) and the length of real time over which the simluation is run (the smaller the timestep, the less real time over which the simulation will give a result). The appropriateness of the timestep will be determined by plotting how the total free energy of the simulated lattice equilibrates over time.  &lt;br /&gt;
&lt;br /&gt;
Five different calculations, which simulated the melting of a crystal and subsequent equilibration of the energy of the melted crystal, were run at five different timesteps; 0.001, 0.0025, 0.0075, 0.01 and 0.015, and were described by the NVE or &#039;&#039;&amp;quot;microcanonical ensemble&amp;quot;&#039;&#039;. An ensemble is a collection of samples of a system which are under three thermodynamic constraints (three properties are kept constant); in the microcanonical ensemble, the number of particles, the volume and the total energy is kept constant (NVE). &lt;br /&gt;
&lt;br /&gt;
These calculations simulate a box of 1000 unit cells and use periodic boundary conditions to replicate the simulation to a larger scale. Because these simulations use the numerical methods defined in the previous section, the initial position and velocity of the atoms must be defined in the input file. The Brownian (uncorrelated, random) motion of the atoms in the simulation means that there is no long range order in the system and so the atoms in a real system would start in random positions. However, assigning random starting coordinates to the atoms in a simulated liquid is not a relative process; the coordinates are generate independently of each other. Therefore there is a probability that the coordinates simulated will cause the atoms to overlap, which would give a very large repulsion potential, as seen in the Lennard-Jones potential at very small interatomic distances. This short-range repulsion potential comes from the hard-sphere model of atomic simulation.&lt;br /&gt;
&lt;br /&gt;
The input file also defines the structure and density of the lattice. The number density of lattice points in any lattice is the number of lattice points per volume of the unit cell. In a simple cubic lattice, there is one lattice point in the unit cell. From an sc lattice with lattice spacing (length of one side of the unit cell) being &amp;lt;math&amp;gt;1.07722&amp;lt;/math&amp;gt;, the number density of the lattice points is calculated by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{1}{1.07722^3} = 0.7999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a face-centered cubic lattice (fcc), there are four lattice points in the unit cell. Rearranging the above relationship, the lattice spacing can be calculated from the number of lattice points in a unit cell and number density, &amp;lt;math&amp;gt;1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Lattice\ spacing = \sqrt[3]{\frac{number\ of\ lattice\ points\ per\ unit\ cell}{number\ density}} = \sqrt[3]{\frac{4}{1.2}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation creates a box which includes 1000 unit cells, which is 10 unit cells in each dimension. For a simple cubic lattice, because there is one lattice point per unit cell, there will be 1000 atoms created as seen in the input file. The &#039;&#039;create_atom&#039;&#039; command in the input file determines how many boxes are created in the simulation and therefore how many atoms will be created. If a face centered cubic lattice is simulated, because there are 4 lattice points per unit cell, 4000 atoms will be created in the &#039;&#039;create_atom&#039;&#039; command. &lt;br /&gt;
&lt;br /&gt;
The input script also contains the following commands which defines the potential surface which is used to model the intermolecular reactions:&lt;br /&gt;
 mass 1 1.0&lt;br /&gt;
This instruction sets the mass type for the atoms being simulated. It takes the general form of “mass I value”, where mass is the keyword which tells LAMMPS what the input is, I is the atom type and value is the mass of the atom. In this case, I is defined by a specific numerical value; 1 as there is only 1 type of atom in the simulation, but it can be defined with an asterisk (1*), which means “all atom types of 1 to n inclusive”. &lt;br /&gt;
 pair_style lj/cut 3.0&lt;br /&gt;
This instruction sets the type of potential which LAMMPS uses in its calculation of pairwise interactions. It takes the general form of “pair_style style args”, where pair_style is the keyword for LAMMPS, style defines the potential and any specifications it may have, and args are the arguments required for this particular potential. In this case, the Lennard-Jones potential has been used (lj) with a cutoff point (cut) of 3σ. The cutoff point is explained in the introduction section. &lt;br /&gt;
 pair_coeff * * 1.0 1.0&lt;br /&gt;
This instruction specifies the coefficients for the pairwise interactions of each pair of atoms, and it takes the general form “pair_coeff I J args”. Pair_coeff is the keyword, I and J are the atom types, and args are the coefficients which the different atoms types take. In this case, the asterisk in place of I and J refers to all atoms types from 1 to n. The coefficients are the pairwise interactions are 1 for each atom, meaning each atom has an equal contribution to the interaction.&lt;br /&gt;
&lt;br /&gt;
In these initial calculations, the initial conditions for the numerical methods, &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. For this experiment, the verit-velocity algorithm would be the most appropriate, as both the starting position and velocity is specified for this algorithm. &lt;br /&gt;
&lt;br /&gt;
To define the timestep for the algorithm the following code is used defining the timestep as a variable instead of just giving it a definite value&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;
It is much easier to use the variable version of defining the timestep because the length of time over which the simulation is run depends on the time step. By using a variable, you can keep the length of the simulation the same, no matter the size of the timestep. It also makes it easier if multiple properties depend on the timestep – only the variable needs to be changed, not all the parts of the script where timestep is defined. &lt;br /&gt;
&lt;br /&gt;
The calculations produce the values for the total energy of the system, temperature and pressure in the output files, which can be plotted against time. How well these values equilibrate determines the appropriateness of the timestep to use in further calculations in the experiment.   &lt;br /&gt;
[[File:Rmt totalenergy plot.png|none|thumb|800x800px|&#039;&#039;Figure h. &#039;&#039;Plot of the equilibration of total energy for five different timesteps]]&lt;br /&gt;
The largest time step to give an acceptable result is 0.01. However, for any simluation we would expect energy to be independent of the timestep, something which is not true at a timestep greater than 0.0025. Therefore, the most appropriate timestep to use for a balance between accuracy and length of time which the simulation covers is 0.0025.  &lt;br /&gt;
&lt;br /&gt;
0.015 is a particularly bad choice of timestep. This is because the verit-velocity algorithm gives an approximate result to the velocity (kinetic energy term) and position (potential energy term), and so when the timestep becomes too large with respect to the time, the algorithm no longer becomes a suitable way to calculate the energy. As seen in the graph of 0.015, the energy does not equilibrate and diverges.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions ==&lt;br /&gt;
The calculations in this section are run in the isobaric-isothermal ensemble, where the number of particles in the system, the pressure and the temperature are kept constant (NpT). This means that the temperature and the pressure are recalculated in every step, so are no longer constant like they were in the NVE ensemble. From the &#039;&#039;equipartition theorem&#039;&#039;, each degree of freedom will contribute &amp;lt;math&amp;gt;\frac{1}{2} k_B T&amp;lt;/math&amp;gt; of energy to the system. As the system is in three dimensions, there are three degrees of translational freedom and so the total internal energy is equal to &amp;lt;math&amp;gt;\frac{3}{2} k_B T&amp;lt;/math&amp;gt;. Equating this to the kinetic energy, &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt;, at the end of every step and rearranging will allow calculation of the temperature after every step. &lt;br /&gt;
&lt;br /&gt;
A target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, is defined in the input script and the system will equilibrate by multiplying the velocity by a factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, in order to accommodate for the fluctuation and keep the system at approximately the target temperature and therefore constant internal energy. If the temperature of the system is greater than the target temperature, the system&#039;s kinetic energy is too high, so &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is reduced to compensate for this. The same is true for is the temperature is lower than the target temperature; &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than one in the next step to increase the kinetic energy which is now too low. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; can be derived from equating the kinetic and internal energy of the system at an arbitrary time step:&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;
Expanding the brackets inside the sum and moving the term containing &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; out of the sum: &amp;lt;math&amp;gt;\frac{\gamma^2}{2}\sum_i m_i \left(v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;, we can replace &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt; on the left hand side of the equation with &amp;lt;math&amp;gt;\frac{3}{2} N k_B T&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;\frac{3\gamma^2}{2}N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Simplifying and rearranging for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, gives: &amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The principle is the same for controlling the pressure.&lt;br /&gt;
&lt;br /&gt;
As temperature and pressure are no longer constant, he input files require specification of the pressure and the temperature for each of the systems run. 10 simulations were run at two different pressures with five different temperatures at each. &lt;br /&gt;
* Temperatures: 1.6, 1.9, 2.2, 2.5, 2.8&lt;br /&gt;
* Pressures: 2.5, 3.0&lt;br /&gt;
These pressures were chosen because the data simulated when choosing an appropriate timestep gave a pressure between 2.5 and 3.0.  &lt;br /&gt;
&lt;br /&gt;
For the code which computes the thermodynamic potentials, this particular line defines how many steps contribute towards the average of the thermodynamic parameters computed in the calculation. &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;
&#039;&#039;fix&#039;&#039; is the keyword, &#039;&#039;aves&#039;&#039; is the name of the group of fixes which in this case is the average of the thermodynamic values, &#039;&#039;all&#039;&#039; specifies the atoms which the fix is applied to which in this case is all the atoms in the simulated system and &#039;&#039;ave/time&#039;&#039; means that compute global time averages are calculated. The following three numbers have the following meaning:&lt;br /&gt;
&lt;br /&gt;
*100 = use the input values every 100 timesteps&lt;br /&gt;
*1000 = use input values 1000 times for calculating the average&lt;br /&gt;
*100000 = calculate the average every 100000 timesteps&lt;br /&gt;
&lt;br /&gt;
Therefore for the total calculation which lasts for 100000 will only have the average calculated once. Assuming 1 value every timestep, there will be 100000/100 values = 1000. The amount of time simulated is 100,000 steps, read from the following line.&lt;br /&gt;
&lt;br /&gt;
The density data from all ten calculation were plotted on the same graph, along with the density for an &amp;quot;ideal&amp;quot; gas. This density can be derived from the ideal gas law:&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;
Rearranging in terms of density: &amp;lt;math&amp;gt;\frac{N}{V} = \frac{P}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As these simulations are being run under reduced units, we can take &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt;, and so the density of the ideal gas becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the density of the ideal gas is plotted as the pressure divided by the temperature in pressure-temperature phase space.&lt;br /&gt;
[[File:Rmt dvt plot.png|none|thumb|800x800px|&#039;&#039;Figure i. &#039;&#039;Plot of the variation in density with temperature at a defined pressure for the numerically simulated and ideal systems]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that calculated in the ideal gas law. This is because for an ideal gas, an assumption is made that there are no intermolecular interactions, and therefore forces such as electron repulsion forces are ignored; repulsion forces dominate over attractive ones, as all the atoms in this simulation are the same and so partial charges or dipoles are created. This will mean that the particles move closer together than a real gas and so the density will be larger. This discrepancy between the ideal and non-ideal systems becomes larger at a higher pressure because with a higher pressure, the atoms in the system are closer together and therefore the intermolecular repulsion will become larger. This greater repulsion will in turn have a larger effect on decreasing the density.&lt;br /&gt;
&lt;br /&gt;
== Statistical Physics Calculations of the Heat Capacity ==&lt;br /&gt;
The heat capacity of a system at constant volume can be calculated from the variance in the total energy of the system. The relationship used to calculate the heat capacity is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = 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;\left\langle E^2\right\rangle&amp;lt;/math&amp;gt; is the continuous average of the total square energy at each temperature as a function of temperature. &amp;lt;math&amp;gt;\left\langle E\right\rangle^2&amp;lt;/math&amp;gt; is the continuous average of the total energy at each temperature as a function of temperature squared. The heat capacity is multiplied by &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; in this case because the version of LAMMPS calculates every energy divided by the number of molecules in the system simulated.&lt;br /&gt;
&lt;br /&gt;
The calculations in this sections are run in density-temperature phase space and the ensemble has changed to the canonical ensemble (NVT). A set of input files were written for ten calculations for, like the previous section, two pressures and five different temperatures at each pressure:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 0.2, 0.8&lt;br /&gt;
*Temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{C_V}{V}&amp;lt;/math&amp;gt; was plotted against temperature to determine the relationship in density-temperature phase space. An example of an input file can be found [[Media:nvt_-_0220.in|here]]. The lines which have been changed from the previous input files are at the end of the script:&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 &lt;br /&gt;
 thermo_style custom step etotal temp&lt;br /&gt;
 variable energy equal etotal&lt;br /&gt;
 variable energy2 equal etotal*etotal&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_energy v_energy2 v_temp&lt;br /&gt;
 run 100000&lt;br /&gt;
 &lt;br /&gt;
 variable aveenergy equal f_aves[1]&lt;br /&gt;
 variable aveenergy2 equal f_aves[2]&lt;br /&gt;
 variable avetemp equal f_aves[3]&lt;br /&gt;
 variable heatcapacitydv equal atoms*atoms*(v_aveenergy2-v_aveenergy*v_aveenergy)/(v_avetemp*v_avetemp*vol)&lt;br /&gt;
 &lt;br /&gt;
 print &amp;quot;Averages&amp;quot;&lt;br /&gt;
 print &amp;quot;--------&amp;quot;&lt;br /&gt;
 print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Heat Capacity per Volume: ${heatcapacitydv}&amp;quot;&lt;br /&gt;
The line with the keyword &#039;fix&#039; determines which thermodynamic values are averaged and over how many steps they are averaged. The next section takes these averages as variables and uses them to define the heat capacity which is calculated from the equation at the beginning of this section. Only the energy and temperature are needed to define the heat capacity and so only these values are calculated by the simulation. [[File:Rmt heatcapacitybyv.png|none|thumb|800x800px|&#039;&#039;Figure j. &#039;&#039;C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V against temperature for the two different pressures 0.2 and 0.8]]As seen in the above figure, the heat capacity decreases with temperature for both pressures. It would be expected for an ideal system that as the temperature increases, the heat capacity at constant volume increases and tends to a constant volume at very high T of 3R; R = the universal gas constant. This means increasing the temperature increases the amount of energy being stored in the system and this energy is stored as vibrational energy. However, for a Lennard-Jones liquid, the system being simulated here, the heat capacity decreases with temperature. This is because the simulation has two components to the simulation; the atoms are vibrating in a quasi-harmonic fashion around the equilibrium position and also diffuse between neighbouring equilibrium positions in a gas like fashion. As the temperature increases, the amount of diffusion increases and the vibrations decreases, therefore decreasing the ability of the system to absorb vibrational energy, resulting in the decrease in heat capacity. &amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www.nature.com/ncomms/2013/130816/ncomms3331/full/ncomms3331.html?message-global=remove&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural Properties and the Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a single atom in a system is a plot of the probability that an atom can be found at a certain distance from the central atom. The peaks in this plot can give the distance of an atom from its nearest neighbours in the Lennard-Jones simulated system. &lt;br /&gt;
&lt;br /&gt;
The calculations in this section simulate a Lennard-Jones solid, liquid and gas and, using the output of the LAMMPS trajectory file, plots both the radial distribution function and its integral using DLV. The temperature and pressure parameters for these calculations were taken from the phase diagram or coexistence curve for a Lennard-Jones system.&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt; The parameters used are displayed in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! Temperature, &amp;lt;math&amp;gt;T^*&amp;lt;/math&amp;gt;&lt;br /&gt;
! Pressure, &amp;lt;math&amp;gt;p^*&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| LJ Solid&lt;br /&gt;
| 1.5&lt;br /&gt;
| 1.2&lt;br /&gt;
|-&lt;br /&gt;
| LJ Liquid&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.8&lt;br /&gt;
|-&lt;br /&gt;
| LJ Gas&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.01&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The data obtained from the plots and the radial distribution functions and their integrals were plotted and shown in the table below.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure k. &#039;&#039;The radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
!&#039;&#039;Figure l. &#039;&#039;The integrals of the radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt fullrdfs.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt allintegralsrdf.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
[[File:Rmt Nearest neighbours.png|left|thumb|300x300px|&#039;&#039;Figure m. &#039;&#039;Representation of a cross section of the first three shells of nearest neighbours in an fcc solid. The black atom is the central atom being considered, the blue atoms are the first shell, the orange atoms the second shell and the purple atoms are the third.]]&lt;br /&gt;
The RDF of the solid gives a very irregular curve because of the irregular structure of the lattice. For a simple cubic lattice, a regular structure of the RDF would be expected because of the equal number of atoms in each of the nearest neighbour shells of the atoms. However, for face-centered cubic, the solid in this simulation, the structure is much more irregular and as the atoms move from their equilibrium position in the lattice due to vibrations, the peaks in the radial distribution will broaden. The irregular heights of the peaks are due to the varying numbers of atoms in each of the nearest neighbour shells for the central atom. The first shell gives the highest peak as it contains the most atoms; in total, considering all four surrounding unit cells, this shell contains 12 atoms and ideally takes the geometry of an icosahedron. The second shell is smaller and contains only 6 atoms in an octahedral coordination shape. The following shell again contributes 12 atoms, 3 from each unit cell. This therefore explains why the heights of the peaks in the solid plot in &#039;&#039;figure k.&#039;&#039; vary. These values can be confirmed by the plot in &#039;&#039;figure o.&#039;&#039; which is the integral; it cumulatively adds the numbers in each shell. The size of the first &amp;quot;step&amp;quot; is 12; there are 12 atoms in the first shell. The size of the second step is approximately 18; there are 18-12=6 steps in the second shell. The same theory applies for the third shell which gives a value of 13. This is slightly different to the predicted value possibly due to error in the calculation of the radial distribution function and therefore its integral. &lt;br /&gt;
&lt;br /&gt;
The RDF of the liquid has a representation of far fewer shells, which means that there are less atoms in the space close to a &amp;quot;central&amp;quot; atom in the bulk solution. The particles have more energy and therefore do not keep to a regular lattice structure. As they move about, some regualrity is maintained around each atom, but only to the extend of two or three shells, meaning there is no long range order in a Lennard-Jones liquid. &lt;br /&gt;
&lt;br /&gt;
The RDF of the gas again omits more shells as there is almost no order in a Lennard-Jones gas. The single peak on this plot considers only the set of atoms closest to the central atom and all others are disregarded as they are too far apart. &lt;br /&gt;
&lt;br /&gt;
Considering &#039;&#039;figure l.&#039;&#039;, the size of the integral of the radial distribution function decreases from solid to liquid to gas. This makes sense as the number of atoms in the surrounding shells decreases with density of the system; the atoms become further apart. &lt;br /&gt;
&lt;br /&gt;
From the plot of the radial distribution function of the solid, the lattice spacing can be determined. For this, we can consider just the first three peaks of the RDF plot. The lattice spacing refers to the length of one unit cell, and so, using &#039;&#039;figure m&#039;&#039;, we can calculate this using two different methods; a) we can use the distance between the central atom and the first shell of nearest neighbours, and use trigonometry to calculate the lattice spacing. Or alternatively b) we can use the distance between the central atom and the second nearest neighbour shell to get the lattice spacing.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure n. &#039;&#039;The radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
!&#039;&#039;Figure o. &#039;&#039;The integral of the radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt solidgr3.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt solidint3.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
Using method a) (with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; as the distance between the central atom and the nearest neighbour: Lattice spacing = &amp;lt;math&amp;gt;\frac{r}{cos({\frac{\pi}{4}})} = \frac{1.02}{cos({\frac{\pi}{4}})} \approx 1.44&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using method b): Lattice spacing &amp;lt;math&amp;gt;\approx 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can take an average between the two get an approximate value for the lattice spacing: &amp;lt;math&amp;gt;1.46 \plusmn 0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These values for distance are all in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
The ability of atoms to move around in a solid liquid or gas can be characterised by the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. In this section, we will explore two different ways to calculate the diffusion coefficient and compare the results. &lt;br /&gt;
&lt;br /&gt;
=== The Mean Squared Displacement ===&lt;br /&gt;
The diffusion coefficient can be measured easily be calculating the mean squared displacement of atoms in the solution; the diffusion coefficient is proportional to the first derivative of the mean squared displacement. By plotting the mean squared displacement as a function of time, the gradient can be taken to calculate the diffusion coefficient when its has equilibrated and become linear.&lt;br /&gt;
&lt;br /&gt;
The temperature and density parameters used were the same as in the previous section:&lt;br /&gt;
* Solid: T=1.5, D=1.2&lt;br /&gt;
* Liquid: T=1.1, D=0.8&lt;br /&gt;
* Gas: T=1.1, D=0.01&lt;br /&gt;
&lt;br /&gt;
Mean density squared calculations were run for all three Lennard-Jones phases and the data plotted as function of timestep below. The data from a simulation containing 1,000,000 atoms was plotted for comparision.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!Plots for the 8,000 atom data (&#039;&#039;figures p-r)&#039;&#039;&lt;br /&gt;
!Plots for the 1,000,000 atom data (&#039;&#039;figures s-u)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|[[File:Rmt_MSDsolid.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt_MAsolid.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|[[File:Rmt MSDliquid.png|700x700px]]&lt;br /&gt;
|[[File:Rmt MAliquid.png|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|[[File:Rmt MSDgas.png|700x700px]]&lt;br /&gt;
|[[File:Rmt dataplots 25894 image001.png|700x700px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The exact relationship between the mean squared displacement and the diffusion coefficient is:&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;
Taking the gradients of each of the curves at the point at which they become linear and dividing by six will give the diffusion coefficient for each set of data. The gradient also needs to be converted to a function of time; this is done by dividing by the timestep, which in this case is 0.002:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom data diffusion coefficients, &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
!1,000,000 atom data diffusion coefficients &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 0.9999&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|Gradient = 0.0972&lt;br /&gt;
Amount of data used to calculate gradient: timestep 4300-5000, &amp;lt;math&amp;gt;R^2 = 0.9998&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{48.6}{6} = \mathbf{8.1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient = 0.0386&lt;br /&gt;
Amount of data used to calculate gradient: timestep 4000-5000, &amp;lt;math&amp;gt;R^2 = 0.1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{19.6}{6} = \mathbf{3.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For both of the solid approximations, the diffusion coefficient can be approximated as zero. This is because, when equilibrated, the function has a constant value of around 0.2 for the mean squared displacement. A gradient with a value of zero means that the atoms take an infinite amount of time to change their mean squared displacement; to move away from their equilibrium position, and so this means that we can approximate in this system, there will be no diffusion. In real system, however, this is not the case; diffusion occurs but it is very slow. A plot for a real system will give a very shallow positive gradient.&lt;br /&gt;
&lt;br /&gt;
The liquid approximations are very well correlated. This is because in both cases, the mean squared displacement of particles in a liquid increases linearly with time and the gradient of both plots are almost identical. We can assume from this that identical starting conditions were used to calculate this data. Also, we can estimate that 8,000 atoms is a large enough simulation to give an accurate result for the diffusion coefficient for the Lennard-Jones liquid.&lt;br /&gt;
&lt;br /&gt;
The gas approximations are very different. This is most probably due to the fact that the density specified in calculations are different. The 8,000 data can be estimated to be a much lower density because the diffusion coefficient is faster and this means diffusion will happen faster; at a higher density a particle will take longer to diffuse over a given distance. Because of the difference in density, the two values of the diffusion coefficient cannot be qualitatively compared. The reason for the initial deviation for linearity in the gas plots is due to the momentum of the particles initially dominating over the diffusion and the diffusion coefficient is dependent on time. As the system equilibrates, the diffusion coefficient becomes constant and the plots become linear.&lt;br /&gt;
&lt;br /&gt;
=== The Velocity Autocorrelation Function ===&lt;br /&gt;
&lt;br /&gt;
Another way to calculate the diffusion coefficient is by using the velocity correlation function, which determines how the velocity of an atom changes with time. The function determines the difference in time (&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;) when the velocity becomes uncorrelated, i.e. the difference between the velocity at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; and at time &amp;lt;math&amp;gt;t+\tau&amp;lt;/math&amp;gt;. By integrating over this function, we can find the diffusion coefficient. &lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function: &amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can also be written as the integral: &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;
Using the function which defines the position of a classical harmonic oscillator, we can differentiate this to give the equation for the velocity which we can plug into the integral:&lt;br /&gt;
&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;
&amp;lt;math&amp;gt;dv{x(t)}{t} = v(t) = -A\omega sin(\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also needed for the integral:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t+\tau) = -A\omega sin(\omega(t+\tau)+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v^2(t) = A^2\omega^2 sin^2(\omega t +\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Putting all this into the integral to find the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega sin(\omega t + \phi) \times A\omega sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} A^2\omega^2 sin^2(\omega t +\tau)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A^2\omega^2&amp;lt;/math&amp;gt; can be take out of each of the integrals and cancelled. A substituion can then be made to make solving the integral much simpler:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = \omega t + \phi&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \omega\tau&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the integral becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a) \times sin(a+b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the compound angle rule &amp;lt;math&amp;gt;sin(a+b)=sin(a)cos(b)+cos(a)sin(b)&amp;lt;/math&amp;gt;, the integral can be simplified to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a)sin(a)cos(b) + sin(a)cos(a)sin(b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Separating out into two integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)\frac{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the rule &amp;lt;math&amp;gt;sin(a)cos(a) = \frac{1}{2}sin(2a)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} \frac{1}{2}(sin(2a))\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because the function &amp;lt;math&amp;gt;\frac{1}{2}sin(2a)&amp;lt;/math&amp;gt; is symmetric over all space, the second term in this equation becomes zero. Therefore, the integral simplifies to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b) = cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same calculations from the mean squared displacement section gave an output of the velocity autocorrelation function. The function for the Lennard-Jones solid, liquid and gas were plotted against the timestep along with the approximate function for the velocity autocorrelation function, &amp;lt;math&amp;gt;cos(\omega\tau)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\omega = \frac{1}{2\pi}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure v. &#039;&#039;Plots for the velocity autocorrelation function of a Lennard-Jones solid, liquid and gas; 8,000 atoms&lt;br /&gt;
!&#039;&#039;Figure w. &#039;&#039;Plots for the velocity autocorrelation function of a Lennard-Jones solid, liquid and gas, 1,000,000 atoms&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt VACF 5721 image001.png|800x800px|]]&lt;br /&gt;
|[[File:Rmt MAVACF.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plots for the velocity autocorrelation function show how the time correlation of velocity decreases with time due to collisions with other atoms in the system. The Lennard-Jones solid oscillates around the VACF=0 axis with the oscillations becoming progressively more damped with time. The long range of the oscillations is due to the order in the system. Every time the plot crosses the VACF=0 axis, the velocity of the atom changes direction which is due to a collision with another atom. Every collision for every atom is completely uncorrelated so the change in velocity of one atom as it collides is independent of another change in velocity of another colliding atom. Overall, momentum must be conserved and so overall change of velocity in the system must be conserved. &lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones liquid oscillations are damped much quicker; an atom in the liquid only collides with one atom before the velocity becomes uncorrelated with respect to time. The Lennard-Jones gas never reaches the VACF=0 axis as the atoms are too far apart to collide. Because the velocity autocorrelation function never equilibrates, using this method to calculate the diffusion coefficient is inaccurate because the particles in the gas never come into contact with each other.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillating system is so different to the Lennard-Jones systems because the atoms remain in their equilibrium position and vibrate around the same position, never coming into contact with another atom. Because of this, the correlation with time never decreases so the function infinitely oscillates as a sine function.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated from: &amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty C\left(\tau\right)\mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the approximate value for the diffusion coefficient using the velocity autocorrelation function is &amp;lt;math&amp;gt;D = \frac{1}{3}cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The running integral of the velocity autocorrelation functions was plotted using the &#039;&#039;trapesium rule&#039;&#039;, and so the final value on the integral plot is proportional to the diffusion coefficient.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom VACF integral &#039;&#039;(figures w-z)&#039;&#039;&lt;br /&gt;
!1,000,000 VACF integral (&#039;&#039;figures aa-cc)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|[[File:Rmt mysi.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt masi.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|[[File:Rmt myli.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt mali.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|[[File:Rmt mygi.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt ligi.png|frameless|700x700px]]&lt;br /&gt;
|}&lt;br /&gt;
The diffusion coefficients for each of the plots above are tabulated below using the final data point from the integral plot. This is the integral over the whole graph using the trapesium rule. This must be corrected for the timestep; the value is multiplied by 0.002. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom data diffusion coefficients, &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
!1,000,000 atom data diffusion coefficients &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;-0.00055&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{-0.00055}{6} = -0.00018 \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.00014&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.00014}{6} = 0.000046 \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.242&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.242}{6} = \mathbf{0.0807}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.270&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.270}{6} = \mathbf{0.0901}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;25.6&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{25.6}{6} = \mathbf{8.55}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;9.81&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{9.81}{6} = \mathbf{3.27}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
The biggest source of error in these plots is that we assume both the 8,000 atom data and the 1,000,000 atom data take the same amount of time to converge. &#039;&#039;Figure z. &#039;&#039;shows that 5000 timesteps is not long enough for the velocity autocorrelation coefficient for 8,000 atoms to converge as far as 1,000,000 atom data does in this length of time. As the molecular dynamics simulations simulate random motion, this could induce fluctuations in the velocity autocorrelation plot which could increase or decrease the integral introduction another source of error.&lt;br /&gt;
&lt;br /&gt;
Again, the diffusion coefficient of the Lennard-Jones solid can be assumed to be zero for the same reason as the mean squared displacement data. The diffusion coefficient of the liquid is lower for both sets of data when calculated using the velocity autocorrelation function, and the diffusion coefficient is higher for both sets of data.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=541598</id>
		<title>Rep:Mod:hakunamatata</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=541598"/>
		<updated>2016-02-25T14:14:39Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: /* Dynamical Properties and the Diffusion Coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Introduction to Molecular Dynamics Simulations ==&lt;br /&gt;
===The Classical Particle Approximation and Numerical Integration===&lt;br /&gt;
The verit and verit-velocity algorithms are numerical methods to approximate the average position and velocity respectively of randomly moving atoms in a particular medium (solid, liquid, fliud etc.). This position and velocity can be applied to Newtonian mechanics to calculate such properties as the force and potential energy of the system. The algorithms work by splitting the function into discrete time steps, calculating the values of position and velocity at this particular time step, and then effectively &amp;quot;joining the dots&amp;quot; to create an approximate function. These simulations always use the answer from the previous timestep to compute the new timestep, so initial conditions must be given for the first step. Both of the algorithms are shown below and are derived from the Taylor expansion of the position or velocity of the atoms at the timestep &amp;quot;n+1&amp;quot; or &amp;lt;math&amp;gt;t+\delta t&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit Algorithum:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{x}_i\left(t + \delta t\right) \approx 2\mathbf{x}_i\left(t\right) - \mathbf{x}_i\left(t - \delta t\right) + \frac{\mathbf{F}_i\left(t\right)}{m_i}\delta t^2  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit-Velocity Algorithum:&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i\left(t\right)&amp;lt;/math&amp;gt; is the force acting on a particular atom as a function of time&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i&amp;lt;/math&amp;gt; is the acceleration &lt;br /&gt;
&lt;br /&gt;
The smaller the timestep, the closer the numerical approximation is to the true solution function, which can be modeled as a classical harmonic oscillator. &#039;&#039;Figure a.&#039;&#039; in the table below shows the comparison between the two methods in &#039;&#039;time&#039;&#039; space. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure a. &#039;&#039;Plots of position vs time comparing the verit algorithm and harmonic spring results&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure b. &#039;&#039;Plot of the total classical energy of the system (potential + kinetic)&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory xanalytical.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory energy.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The harmonic spring position values are modeled from the harmonic oscillator or particle on a spring. The equation of &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; was used to calculate these values, where &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; are 1 and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; is zero. As seen on the plot, the curves produced from the two different methods of calculating the position are in good agreement.&lt;br /&gt;
|The potential energy is calculated using the equation U = 1/2 kx^2, with a value of k given as 1. The kinetic energy is calculated using the velcity from the verit-velocity algorithm using the equation T = 1/2 mv^2, with a value of m given as 1. The total energy of the system, E, is equal to T + U. The values for x (potential energy) and v (kinetic energy) are taken from the verity algorithm and verit-velocity algorthim respectively. &lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;Figure c. &#039;&#039;Plot of the difference (error) between the harmonic spring and verit algorithm data&lt;br /&gt;
!&#039;&#039;Figure d. &#039;&#039;Plot of the peaks in the error plot in &#039;&#039;figure c.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory error.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory errorpeaks.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The peaks in the error between the harmonic spring and verit algorithm results are at the place where the position curve crosses the time axis. This is because the harmonic spring data (x(t)) has a slightly shorter wave period than that of the verit velocity algorithm, and therefore the difference will get larger with each period of the wave, shown by the error getting larger in &#039;&#039;figure c. &#039;&#039;The period of the plot of the two methods are different because the verit algorithm is much more approximate so does not give the correct solution.&lt;br /&gt;
|The change in the error/difference between the harmonic spring data and verit algorthm data increases linearly and so therefore period of each of the plots in &#039;&#039;figure 1&#039;&#039;. must be constant. &lt;br /&gt;
|}&lt;br /&gt;
The error can also be quantified on a &#039;&#039;phase space&#039;&#039; plot; phase space is momentum or velocity plotted as a function of position. The true solution for motion of an atom is a perfect ellipse, and the more elliptic the shape (less circular) the more momentum or velocity is in the system. A numerical solution, like the verit algorithms, will produce a set of points very close to this ellipse but not perfectly following the curve. A good numerical solution will remain in an elliptical shape, whereas a bad numerical solution, for example one with a large timestep, will spiral away from the true solution. Two examples of such systems using the data from &#039;&#039;figures a-d&#039;&#039; are shown below.  &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure e. &#039;&#039;Phase plot of the harmonic spring data with a good numerical solution (timestep = 0.1) &lt;br /&gt;
!&#039;&#039;Figure f. &#039;&#039;Phase plot of the harmonic spring data with a bad numerical solution (timestep = 0.3) &lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory phasegood.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory badphase.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The timestep at which this data is plotted is 0.1, which results in a very small change in the energy, as seen in &#039;&#039;figure b. &#039;&#039;Increasing the time step will increase the variation in the energy. To keep the variation in the total energy of the system under 1%, the time step must be no larger than approximately 0.28. The energy varies more with increasing time step because the jumps in the algorithm  are getting larger due to less data points. The algorithm assumes these points are joined by a straight line; that the halfway point in the jump is the average between the starting and finishing point of the jump. The phase space plot will become less elliptic and the jumps eventually become so larger that the plot is no longer a continuous shape.  &lt;br /&gt;
&lt;br /&gt;
It is essential to monitor the energy of a numerically modeled system because a good solution for the motion of an atom has a constant energy and a plot in phase space of a perfect ellipse.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance and Force at Zero Potential===&lt;br /&gt;
From classical mechanics, the force calculated from the Newtonian mechanics above can be used to calculate the potential experienced by an atom in the system. They are related by the equation: &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;
This potential gives the shape and dimension of the potential surface on which the system can be modeled. A simple 1D potential that is used to describe the inter atomic forces of a liquid is the Lennard-Jones potential. It has the characteristic features of a short range repulsion potential and harmonic character around the equilibrium bond distance. The value of &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the inter atomic separation when the potential, &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;, is equal to zero, can be calculated by equating the equation for the Lennard-Jones potential to zero and solving for &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The equation for the Lennard-Jones potential: &amp;lt;math&amp;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;
Equating this to zero: &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;
And rearranging in order to separate the variables: &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;
Rearranging this gives &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in terms of &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt; r^6 = \sigma^6&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r = r_0&amp;lt;/math&amp;gt; in this case.&lt;br /&gt;
&lt;br /&gt;
This, therefore, gives the result that interatomic distance at zero potential, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, is equal to &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; in the Lennard-Jones potential is effectively the diameter of one of the particles in the system being measured; in this case, the liquid we are simulating. This is the point where the potential curve crosses the x-axis on an Energy vs interatomic distance plot. The force, &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt;, at this point on the curve corresponds to the gradient; it is found by calculating the derivative of the curve at this point. &lt;br /&gt;
&lt;br /&gt;
To calculate the force, we must differentiate the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As force is equal to the negative differential of the potential energy, the value of the force is: &amp;lt;math&amp;gt;\mathbf{F}_i = 48\epsilon \sigma^{12} r^{-13} - 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting in the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at zero potential from the calculation before: &amp;lt;math&amp;gt;\mathbf{F}_i = \frac{48\epsilon}{\sigma} - \frac{24\epsilon}{\sigma} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The gradient where the Lennard-Jones plot crosses the axis is negative; &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; in the term obtained for &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is negative and therefore the overall value of the force will be negative.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance, Force and Well Depth of the Potential at Equilibrium===&lt;br /&gt;
To calculate the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at the equilibrium position, we need to use the derivative of the potential energy curve. The equilibrium value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is the value at the minimum of the Lennard-Jones curve; when &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Therefore, equating the derivative to zero gives: &amp;lt;math&amp;gt;0 = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rearranging this: &amp;lt;math&amp;gt;48\epsilon \sigma^{12} r^{-13} = 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And simplifying and cancelling gives: &amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6&amp;lt;/math&amp;gt;. Therefore the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at equilibrium is: &amp;lt;math&amp;gt;r_{eq} = \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Physically, this result means that the equilibrium distance is 1.12 times the diameter of one of the particles; the particles have a small gap between them so do not touch. A short range repulsion potential, as seen in the Lennard-Jones curve, is a result of the particles coming into contact. &lt;br /&gt;
&lt;br /&gt;
Again, the force can be calculated from the derivative of the potential curve at the equilibrium point. As the derivative at this point is zero (a minimum on the curve), the force will therefore also be zero.&lt;br /&gt;
&lt;br /&gt;
The well-depth of the potential curve is the difference between zero potential and the potential at the equilibrium bond length. This can be calculated by substituting the value for the equilibrium bond length into the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 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;
Cancelling and simplifying this equation gives: &amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \times \frac{1}{4}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the absolute value for the well depth is &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;. The actual value of this potential is &amp;lt;math&amp;gt;-\epsilon&amp;lt;/math&amp;gt;, as the equilibrium bond length gives the most stable configuration of the molecules and therefore suggests attractive interactions are involved in the arrangement of the molecules; this attractive potential means its negative. &lt;br /&gt;
&lt;br /&gt;
===Boundary Conditions and the Lennard-Jones Cutoff===&lt;br /&gt;
When simulating a liquid, it is computationally impractical to simulate a realistic liquid. Therefore a smaller &#039;box&#039; containing &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; particles is simulated and the computer program will use &#039;&#039;periodic boundary conditions&#039;&#039; to simulate infinite repetitions of this box; when the atom reaches one edge of the box, in periodic boundary conditions, it will reappear again at the opposite edge of the box as if they were connected. For example, an atom at the position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a box of size &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;. Without periodic boundary conditions, we would assume that the atom would end up at the position &amp;lt;math&amp;gt;(1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;. However, in this box, there is no such position and so the particle must reappear at the opposite edge to where it effectively &#039;left&#039; the box. Therefore, it&#039;s ending position will be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The number of particles, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; simulated by the computer is usually between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt;. Physically, this is a very small volume. Considering water, we can calculate the number of molecules in 1 mL or 1 cm^3, a volume that would be considered small in the lab. Taking the concentration of water at standard conditions, &amp;lt;math&amp;gt;55\ mol\ dm^{-3}&amp;lt;/math&amp;gt;, we can convert it to the number of moles per mL: &amp;lt;math&amp;gt;0.055\ mol\ mL^{-1}&amp;lt;/math&amp;gt;. Multiplying this value by Avagadro&#039;s constant (&amp;lt;math&amp;gt;N_A&amp;lt;/math&amp;gt;) gives the number of molcules of water per mL: &amp;lt;math&amp;gt;3.02 \times 10^{22}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The reverse procedure can be used to compare this to the volume of 10,000 molecules: 10,000 divided by Avagadro&#039;s constant gives the number of moles of water which 10,000 molecules makes up: &amp;lt;math&amp;gt;1.66 \times 10^{-20}\ moles&amp;lt;/math&amp;gt;. Dividing this value by the concentration (from &amp;lt;math&amp;gt;n=cV&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is the number of moles, &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; is the concentration and &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume), gives the volume: &amp;lt;math&amp;gt;3.02 \times 10^{-22}\ dm&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;3.02 \times 10^{-19}\ mL&amp;lt;/math&amp;gt;. Physically, of course, this is far too small a volume to be recorded in the lab.&lt;br /&gt;
 &lt;br /&gt;
Periodic boundary conditions simulate an infinite lattice and therefore, when computing the potential, will calculate an infinite amount of pair interactions. Therefore, it is only practical to calculate the energies up to a certain interatomic distance; the Lennard-Jones cutoff distance. Beyond this point, the potential energy and the integral of the curve beyond this point become insignificant and do not impact on the overall energy; removing interactions beyond this point from the calculations will not effect the accuracy. Multiplying the Lennard-Jones potential with the radial distribution function gives a plot of the probability of finding an atom at a particular interatomic distance. The larger the interatomic distance, the lower the probability and so the energy after the cutoff can be disregarded. &lt;br /&gt;
&lt;br /&gt;
Integrating over the Lennard-Jones curve and applying this cutoff as the lower limit can show how small the integral is:&lt;br /&gt;
&lt;br /&gt;
For a general cutoff of with value &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;I = \int_{x}^\infty \phi\left(r\right)\mathrm{d}r = \int_{x}^\infty \frac{4\epsilon\sigma^{12}}{r^{12}}\mathrm{d}r - \int_{x}^\infty \frac{4\epsilon\sigma^6}{r^6}\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving this: &amp;lt;math&amp;gt;I = 4\epsilon\sigma^{12} {\frac{-1}{11r^{11}}\,\Bigg\vert\,}_x^\infty - 4\epsilon\sigma^{6} {\frac{-1}{5r^{5}}\,\Bigg\vert\,}_x^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This gives the general solution: &amp;lt;math&amp;gt;I = \frac{4\epsilon\sigma^{12}}{11x^{11}} - \frac{4\epsilon\sigma^{6}}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating this for &amp;lt;math&amp;gt;\epsilon = \sigma = 1&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;I = \frac{4}{11x^{11}} - \frac{4}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt; (or 2 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.025&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt; (or 2.5 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0082&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt; (or 3 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0033&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All values are taken to 2 significant figures. As the cutoff value for the interatomic distance gets larger, the integral gets smaller, and therefore the energy excluded from the calculation becomes smaller, and the second term in the solved integral, &amp;lt;math&amp;gt;I&amp;lt;/math&amp;gt;, dominates the energy value.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
When using the Lennard-Jones potential, it is appropriate to use reduced units for intermolecular distance, energy and temperature. Reduced units can be calculated by the following relationships:&lt;br /&gt;
&lt;br /&gt;
Intermolecular 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;
&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; are scaling factors. For example, if the parameters for Argon are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\sigma = 0.34 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt; \epsilon\ /\ k_B = 120 K&amp;lt;/math&amp;gt;&lt;br /&gt;
* Lennard-Jones cutoff &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;. The well-depth, &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;, is &amp;lt;math&amp;gt;0.999 kJ mol^{-1} \approx 1 kJ mol^{-1}&amp;lt;/math&amp;gt;. The value of &amp;lt;math&amp;gt;T* = 1.5&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;180 K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
The first aim of the simulations is to determine the most appropriate timestep to use in the vert algorithm simulations. This timestep is a balance between the accuracy of the results (the smaller the timestep, the closer to the true functing the result will be) and the length of real time over which the simluation is run (the smaller the timestep, the less real time over which the simulation will give a result). The appropriateness of the timestep will be determined by plotting how the total free energy of the simulated lattice equilibrates over time.  &lt;br /&gt;
&lt;br /&gt;
Five different calculations, which simulated the melting of a crystal and subsequent equilibration of the energy of the melted crystal, were run at five different timesteps; 0.001, 0.0025, 0.0075, 0.01 and 0.015, and were described by the NVE or &#039;&#039;&amp;quot;microcanonical ensemble&amp;quot;&#039;&#039;. An ensemble is a collection of samples of a system which are under three thermodynamic constraints (three properties are kept constant); in the microcanonical ensemble, the number of particles, the volume and the total energy is kept constant (NVE). &lt;br /&gt;
&lt;br /&gt;
These calculations simulate a box of 1000 unit cells and use periodic boundary conditions to replicate the simulation to a larger scale. Because these simulations use the numerical methods defined in the previous section, the initial position and velocity of the atoms must be defined in the input file. The Brownian (uncorrelated, random) motion of the atoms in the simulation means that there is no long range order in the system and so the atoms in a real system would start in random positions. However, assigning random starting coordinates to the atoms in a simulated liquid is not a relative process; the coordinates are generate independently of each other. Therefore there is a probability that the coordinates simulated will cause the atoms to overlap, which would give a very large repulsion potential, as seen in the Lennard-Jones potential at very small interatomic distances. This short-range repulsion potential comes from the hard-sphere model of atomic simulation.&lt;br /&gt;
&lt;br /&gt;
The input file also defines the structure and density of the lattice. The number density of lattice points in any lattice is the number of lattice points per volume of the unit cell. In a simple cubic lattice, there is one lattice point in the unit cell. From an sc lattice with lattice spacing (length of one side of the unit cell) being &amp;lt;math&amp;gt;1.07722&amp;lt;/math&amp;gt;, the number density of the lattice points is calculated by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{1}{1.07722^3} = 0.7999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a face-centered cubic lattice (fcc), there are four lattice points in the unit cell. Rearranging the above relationship, the lattice spacing can be calculated from the number of lattice points in a unit cell and number density, &amp;lt;math&amp;gt;1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Lattice\ spacing = \sqrt[3]{\frac{number\ of\ lattice\ points\ per\ unit\ cell}{number\ density}} = \sqrt[3]{\frac{4}{1.2}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation creates a box which includes 1000 unit cells, which is 10 unit cells in each dimension. For a simple cubic lattice, because there is one lattice point per unit cell, there will be 1000 atoms created as seen in the input file. The &#039;&#039;create_atom&#039;&#039; command in the input file determines how many boxes are created in the simulation and therefore how many atoms will be created. If a face centered cubic lattice is simulated, because there are 4 lattice points per unit cell, 4000 atoms will be created in the &#039;&#039;create_atom&#039;&#039; command. &lt;br /&gt;
&lt;br /&gt;
The input script also contains the following commands which defines the potential surface which is used to model the intermolecular reactions:&lt;br /&gt;
 mass 1 1.0&lt;br /&gt;
This instruction sets the mass type for the atoms being simulated. It takes the general form of “mass I value”, where mass is the keyword which tells LAMMPS what the input is, I is the atom type and value is the mass of the atom. In this case, I is defined by a specific numerical value; 1 as there is only 1 type of atom in the simulation, but it can be defined with an asterisk (1*), which means “all atom types of 1 to n inclusive”. &lt;br /&gt;
 pair_style lj/cut 3.0&lt;br /&gt;
This instruction sets the type of potential which LAMMPS uses in its calculation of pairwise interactions. It takes the general form of “pair_style style args”, where pair_style is the keyword for LAMMPS, style defines the potential and any specifications it may have, and args are the arguments required for this particular potential. In this case, the Lennard-Jones potential has been used (lj) with a cutoff point (cut) of 3σ. The cutoff point is explained in the introduction section. &lt;br /&gt;
 pair_coeff * * 1.0 1.0&lt;br /&gt;
This instruction specifies the coefficients for the pairwise interactions of each pair of atoms, and it takes the general form “pair_coeff I J args”. Pair_coeff is the keyword, I and J are the atom types, and args are the coefficients which the different atoms types take. In this case, the asterisk in place of I and J refers to all atoms types from 1 to n. The coefficients are the pairwise interactions are 1 for each atom, meaning each atom has an equal contribution to the interaction.&lt;br /&gt;
&lt;br /&gt;
In these initial calculations, the initial conditions for the numerical methods, &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. For this experiment, the verit-velocity algorithm would be the most appropriate, as both the starting position and velocity is specified for this algorithm. &lt;br /&gt;
&lt;br /&gt;
To define the timestep for the algorithm the following code is used defining the timestep as a variable instead of just giving it a definite value&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;
It is much easier to use the variable version of defining the timestep because the length of time over which the simulation is run depends on the time step. By using a variable, you can keep the length of the simulation the same, no matter the size of the timestep. It also makes it easier if multiple properties depend on the timestep – only the variable needs to be changed, not all the parts of the script where timestep is defined. &lt;br /&gt;
&lt;br /&gt;
The calculations produce the values for the total energy of the system, temperature and pressure in the output files, which can be plotted against time. How well these values equilibrate determines the appropriateness of the timestep to use in further calculations in the experiment.   &lt;br /&gt;
[[File:Rmt totalenergy plot.png|none|thumb|800x800px|&#039;&#039;Figure h. &#039;&#039;Plot of the equilibration of total energy for five different timesteps]]&lt;br /&gt;
The largest time step to give an acceptable result is 0.01. However, for any simluation we would expect energy to be independent of the timestep, something which is not true at a timestep greater than 0.0025. Therefore, the most appropriate timestep to use for a balance between accuracy and length of time which the simulation covers is 0.0025.  &lt;br /&gt;
&lt;br /&gt;
0.015 is a particularly bad choice of timestep. This is because the verit-velocity algorithm gives an approximate result to the velocity (kinetic energy term) and position (potential energy term), and so when the timestep becomes too large with respect to the time, the algorithm no longer becomes a suitable way to calculate the energy. As seen in the graph of 0.015, the energy does not equilibrate and diverges.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions ==&lt;br /&gt;
The calculations in this section are run in the isobaric-isothermal ensemble, where the number of particles in the system, the pressure and the temperature are kept constant (NpT). This means that the temperature and the pressure are recalculated in every step, so are no longer constant like they were in the NVE ensemble. From the &#039;&#039;equipartition theorem&#039;&#039;, each degree of freedom will contribute &amp;lt;math&amp;gt;\frac{1}{2} k_B T&amp;lt;/math&amp;gt; of energy to the system. As the system is in three dimensions, there are three degrees of translational freedom and so the total internal energy is equal to &amp;lt;math&amp;gt;\frac{3}{2} k_B T&amp;lt;/math&amp;gt;. Equating this to the kinetic energy, &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt;, at the end of every step and rearranging will allow calculation of the temperature after every step. &lt;br /&gt;
&lt;br /&gt;
A target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, is defined in the input script and the system will equilibrate by multiplying the velocity by a factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, in order to accommodate for the fluctuation and keep the system at approximately the target temperature and therefore constant internal energy. If the temperature of the system is greater than the target temperature, the system&#039;s kinetic energy is too high, so &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is reduced to compensate for this. The same is true for is the temperature is lower than the target temperature; &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than one in the next step to increase the kinetic energy which is now too low. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; can be derived from equating the kinetic and internal energy of the system at an arbitrary time step:&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;
Expanding the brackets inside the sum and moving the term containing &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; out of the sum: &amp;lt;math&amp;gt;\frac{\gamma^2}{2}\sum_i m_i \left(v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;, we can replace &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt; on the left hand side of the equation with &amp;lt;math&amp;gt;\frac{3}{2} N k_B T&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;\frac{3\gamma^2}{2}N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Simplifying and rearranging for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, gives: &amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The principle is the same for controlling the pressure.&lt;br /&gt;
&lt;br /&gt;
As temperature and pressure are no longer constant, he input files require specification of the pressure and the temperature for each of the systems run. 10 simulations were run at two different pressures with five different temperatures at each. &lt;br /&gt;
* Temperatures: 1.6, 1.9, 2.2, 2.5, 2.8&lt;br /&gt;
* Pressures: 2.5, 3.0&lt;br /&gt;
These pressures were chosen because the data simulated when choosing an appropriate timestep gave a pressure between 2.5 and 3.0.  &lt;br /&gt;
&lt;br /&gt;
For the code which computes the thermodynamic potentials, this particular line defines how many steps contribute towards the average of the thermodynamic parameters computed in the calculation. &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;
&#039;&#039;fix&#039;&#039; is the keyword, &#039;&#039;aves&#039;&#039; is the name of the group of fixes which in this case is the average of the thermodynamic values, &#039;&#039;all&#039;&#039; specifies the atoms which the fix is applied to which in this case is all the atoms in the simulated system and &#039;&#039;ave/time&#039;&#039; means that compute global time averages are calculated. The following three numbers have the following meaning:&lt;br /&gt;
&lt;br /&gt;
*100 = use the input values every 100 timesteps&lt;br /&gt;
*1000 = use input values 1000 times for calculating the average&lt;br /&gt;
*100000 = calculate the average every 100000 timesteps&lt;br /&gt;
&lt;br /&gt;
Therefore for the total calculation which lasts for 100000 will only have the average calculated once. Assuming 1 value every timestep, there will be 100000/100 values = 1000. The amount of time simulated is 100,000 steps, read from the following line.&lt;br /&gt;
&lt;br /&gt;
The density data from all ten calculation were plotted on the same graph, along with the density for an &amp;quot;ideal&amp;quot; gas. This density can be derived from the ideal gas law:&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;
Rearranging in terms of density: &amp;lt;math&amp;gt;\frac{N}{V} = \frac{P}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As these simulations are being run under reduced units, we can take &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt;, and so the density of the ideal gas becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the density of the ideal gas is plotted as the pressure divided by the temperature in pressure-temperature phase space.&lt;br /&gt;
[[File:Rmt dvt plot.png|none|thumb|800x800px|&#039;&#039;Figure i. &#039;&#039;Plot of the variation in density with temperature at a defined pressure for the numerically simulated and ideal systems]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that calculated in the ideal gas law. This is because for an ideal gas, an assumption is made that there are no intermolecular interactions, and therefore forces such as electron repulsion forces are ignored; repulsion forces dominate over attractive ones, as all the atoms in this simulation are the same and so partial charges or dipoles are created. This will mean that the particles move closer together than a real gas and so the density will be larger. This discrepancy between the ideal and non-ideal systems becomes larger at a higher pressure because with a higher pressure, the atoms in the system are closer together and therefore the intermolecular repulsion will become larger. This greater repulsion will in turn have a larger effect on decreasing the density.&lt;br /&gt;
&lt;br /&gt;
== Statistical Physics Calculations of the Heat Capacity ==&lt;br /&gt;
The heat capacity of a system at constant volume can be calculated from the variance in the total energy of the system. The relationship used to calculate the heat capacity is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = 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;\left\langle E^2\right\rangle&amp;lt;/math&amp;gt; is the continuous average of the total square energy at each temperature as a function of temperature. &amp;lt;math&amp;gt;\left\langle E\right\rangle^2&amp;lt;/math&amp;gt; is the continuous average of the total energy at each temperature as a function of temperature squared. The heat capacity is multiplied by &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; in this case because the version of LAMMPS calculates every energy divided by the number of molecules in the system simulated.&lt;br /&gt;
&lt;br /&gt;
The calculations in this sections are run in density-temperature phase space and the ensemble has changed to the canonical ensemble (NVT). A set of input files were written for ten calculations for, like the previous section, two pressures and five different temperatures at each pressure:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 0.2, 0.8&lt;br /&gt;
*Temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{C_V}{V}&amp;lt;/math&amp;gt; was plotted against temperature to determine the relationship in density-temperature phase space. An example of an input file can be found [[Media:nvt_-_0220.in|here]]. The lines which have been changed from the previous input files are at the end of the script:&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 &lt;br /&gt;
 thermo_style custom step etotal temp&lt;br /&gt;
 variable energy equal etotal&lt;br /&gt;
 variable energy2 equal etotal*etotal&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_energy v_energy2 v_temp&lt;br /&gt;
 run 100000&lt;br /&gt;
 &lt;br /&gt;
 variable aveenergy equal f_aves[1]&lt;br /&gt;
 variable aveenergy2 equal f_aves[2]&lt;br /&gt;
 variable avetemp equal f_aves[3]&lt;br /&gt;
 variable heatcapacitydv equal atoms*atoms*(v_aveenergy2-v_aveenergy*v_aveenergy)/(v_avetemp*v_avetemp*vol)&lt;br /&gt;
 &lt;br /&gt;
 print &amp;quot;Averages&amp;quot;&lt;br /&gt;
 print &amp;quot;--------&amp;quot;&lt;br /&gt;
 print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Heat Capacity per Volume: ${heatcapacitydv}&amp;quot;&lt;br /&gt;
The line with the keyword &#039;fix&#039; determines which thermodynamic values are averaged and over how many steps they are averaged. The next section takes these averages as variables and uses them to define the heat capacity which is calculated from the equation at the beginning of this section. Only the energy and temperature are needed to define the heat capacity and so only these values are calculated by the simulation. [[File:Rmt heatcapacitybyv.png|none|thumb|800x800px|&#039;&#039;Figure j. &#039;&#039;C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V against temperature for the two different pressures 0.2 and 0.8]]As seen in the above figure, the heat capacity decreases with temperature for both pressures. It would be expected for an ideal system that as the temperature increases, the heat capacity at constant volume increases and tends to a constant volume at very high T of 3R; R = the universal gas constant. This means increasing the temperature increases the amount of energy being stored in the system and this energy is stored as vibrational energy. However, for a Lennard-Jones liquid, the system being simulated here, the heat capacity decreases with temperature. This is because the simulation has two components to the simulation; the atoms are vibrating in a quasi-harmonic fashion around the equilibrium position and also diffuse between neighbouring equilibrium positions in a gas like fashion. As the temperature increases, the amount of diffusion increases and the vibrations decreases, therefore decreasing the ability of the system to absorb vibrational energy, resulting in the decrease in heat capacity. &amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www.nature.com/ncomms/2013/130816/ncomms3331/full/ncomms3331.html?message-global=remove&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural Properties and the Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a single atom in a system is a plot of the probability that an atom can be found at a certain distance from the central atom. The peaks in this plot can give the distance of an atom from its nearest neighbours in the Lennard-Jones simulated system. &lt;br /&gt;
&lt;br /&gt;
The calculations in this section simulate a Lennard-Jones solid, liquid and gas and, using the output of the LAMMPS trajectory file, plots both the radial distribution function and its integral using DLV. The temperature and pressure parameters for these calculations were taken from the phase diagram or coexistence curve for a Lennard-Jones system.&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt; The parameters used are displayed in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! Temperature, &amp;lt;math&amp;gt;T^*&amp;lt;/math&amp;gt;&lt;br /&gt;
! Pressure, &amp;lt;math&amp;gt;p^*&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| LJ Solid&lt;br /&gt;
| 1.5&lt;br /&gt;
| 1.2&lt;br /&gt;
|-&lt;br /&gt;
| LJ Liquid&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.8&lt;br /&gt;
|-&lt;br /&gt;
| LJ Gas&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.01&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The data obtained from the plots and the radial distribution functions and their integrals were plotted and shown in the table below.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure k. &#039;&#039;The radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
!&#039;&#039;Figure l. &#039;&#039;The integrals of the radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt fullrdfs.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt allintegralsrdf.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
[[File:Rmt Nearest neighbours.png|left|thumb|300x300px|&#039;&#039;Figure m. &#039;&#039;Representation of a cross section of the first three shells of nearest neighbours in an fcc solid. The black atom is the central atom being considered, the blue atoms are the first shell, the orange atoms the second shell and the purple atoms are the third.]]&lt;br /&gt;
The RDF of the solid gives a very irregular curve because of the irregular structure of the lattice. For a simple cubic lattice, a regular structure of the RDF would be expected because of the equal number of atoms in each of the nearest neighbour shells of the atoms. However, for face-centered cubic, the solid in this simulation, the structure is much more irregular and as the atoms move from their equilibrium position in the lattice due to vibrations, the peaks in the radial distribution will broaden. The irregular heights of the peaks are due to the varying numbers of atoms in each of the nearest neighbour shells for the central atom. The first shell gives the highest peak as it contains the most atoms; in total, considering all four surrounding unit cells, this shell contains 12 atoms and ideally takes the geometry of an icosahedron. The second shell is smaller and contains only 6 atoms in an octahedral coordination shape. The following shell again contributes 12 atoms, 3 from each unit cell. This therefore explains why the heights of the peaks in the solid plot in &#039;&#039;figure k.&#039;&#039; vary. These values can be confirmed by the plot in &#039;&#039;figure o.&#039;&#039; which is the integral; it cumulatively adds the numbers in each shell. The size of the first &amp;quot;step&amp;quot; is 12; there are 12 atoms in the first shell. The size of the second step is approximately 18; there are 18-12=6 steps in the second shell. The same theory applies for the third shell which gives a value of 13. This is slightly different to the predicted value possibly due to error in the calculation of the radial distribution function and therefore its integral. &lt;br /&gt;
&lt;br /&gt;
The RDF of the liquid has a representation of far fewer shells, which means that there are less atoms in the space close to a &amp;quot;central&amp;quot; atom in the bulk solution. The particles have more energy and therefore do not keep to a regular lattice structure. As they move about, some regualrity is maintained around each atom, but only to the extend of two or three shells, meaning there is no long range order in a Lennard-Jones liquid. &lt;br /&gt;
&lt;br /&gt;
The RDF of the gas again omits more shells as there is almost no order in a Lennard-Jones gas. The single peak on this plot considers only the set of atoms closest to the central atom and all others are disregarded as they are too far apart. &lt;br /&gt;
&lt;br /&gt;
Considering &#039;&#039;figure l.&#039;&#039;, the size of the integral of the radial distribution function decreases from solid to liquid to gas. This makes sense as the number of atoms in the surrounding shells decreases with density of the system; the atoms become further apart. &lt;br /&gt;
&lt;br /&gt;
From the plot of the radial distribution function of the solid, the lattice spacing can be determined. For this, we can consider just the first three peaks of the RDF plot. The lattice spacing refers to the length of one unit cell, and so, using &#039;&#039;figure m&#039;&#039;, we can calculate this using two different methods; a) we can use the distance between the central atom and the first shell of nearest neighbours, and use trigonometry to calculate the lattice spacing. Or alternatively b) we can use the distance between the central atom and the second nearest neighbour shell to get the lattice spacing.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure n. &#039;&#039;The radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
!&#039;&#039;Figure o. &#039;&#039;The integral of the radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt solidgr3.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt solidint3.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
Using method a) (with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; as the distance between the central atom and the nearest neighbour: Lattice spacing = &amp;lt;math&amp;gt;\frac{r}{cos({\frac{\pi}{4}})} = \frac{1.02}{cos({\frac{\pi}{4}})} \approx 1.44&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using method b): Lattice spacing &amp;lt;math&amp;gt;\approx 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can take an average between the two get an approximate value for the lattice spacing: &amp;lt;math&amp;gt;1.46 \plusmn 0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These values for distance are all in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
The ability of atoms to move around in a solid liquid or gas can be characterised by the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. In this section, we will explore two different ways to calculate the diffusion coefficient and compare the results. &lt;br /&gt;
&lt;br /&gt;
=== The Mean Squared Displacement ===&lt;br /&gt;
The diffusion coefficient can be measured easily be calculating the mean squared displacement of atoms in the solution; the diffusion coefficient is proportional to the first derivative of the mean squared displacement. By plotting the mean squared displacement as a function of time, the gradient can be taken to calculate the diffusion coefficient when its has equilibrated and become linear.&lt;br /&gt;
&lt;br /&gt;
The temperature and density parameters used were the same as in the previous section:&lt;br /&gt;
* Solid: T=1.5, D=1.2&lt;br /&gt;
* Liquid: T=1.1, D=0.8&lt;br /&gt;
* Gas: T=1.1, D=0.01&lt;br /&gt;
&lt;br /&gt;
Mean density squared calculations were run for all three Lennard-Jones phases and the data plotted as function of timestep below. The data from a simulation containing 1,000,000 atoms was plotted for comparision.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!Plots for the 8,000 atom data (&#039;&#039;figures p-r)&#039;&#039;&lt;br /&gt;
!Plots for the 1,000,000 atom data (&#039;&#039;figures s-u)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|[[File:Rmt_MSDsolid.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt_MAsolid.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|[[File:Rmt MSDliquid.png|700x700px]]&lt;br /&gt;
|[[File:Rmt MAliquid.png|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|[[File:Rmt MSDgas.png|700x700px]]&lt;br /&gt;
|[[File:Rmt dataplots 25894 image001.png|700x700px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The exact relationship between the mean squared displacement and the diffusion coefficient is:&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;
Taking the gradients of each of the curves at the point at which they become linear and dividing by six will give the diffusion coefficient for each set of data. The gradient also needs to be converted to a function of time; this is done by dividing by the timestep, which in this case is 0.002:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom data diffusion coefficients, &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
!1,000,000 atom data diffusion coefficients &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 0.9999&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|Gradient = 0.0972&lt;br /&gt;
Amount of data used to calculate gradient: timestep 4300-5000, &amp;lt;math&amp;gt;R^2 = 0.9998&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{48.6}{6} = \mathbf{8.1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient = 0.0386&lt;br /&gt;
Amount of data used to calculate gradient: timestep 4000-5000, &amp;lt;math&amp;gt;R^2 = 0.1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{19.6}{6} = \mathbf{3.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For both of the solid approximations, the diffusion coefficient can be approximated as zero. This is because, when equilibrated, the function has a constant value of around 0.2 for the mean squared displacement. A gradient with a value of zero means that the atoms take an infinite amount of time to change their mean squared displacement; to move away from their equilibrium position, and so this means that we can approximate in this system, there will be no diffusion. In real system, however, this is not the case; diffusion occurs but it is very slow. A plot for a real system will give a very shallow positive gradient.&lt;br /&gt;
&lt;br /&gt;
The liquid approximations are very well correlated. This is because in both cases, the mean squared displacement of particles in a liquid increases linearly with time and the gradient of both plots are almost identical. We can assume from this that identical starting conditions were used to calculate this data. Also, we can estimate that 8,000 atoms is a large enough simulation to give an accurate result for the diffusion coefficient for the Lennard-Jones liquid.&lt;br /&gt;
&lt;br /&gt;
The gas approximations are very different. This is most probably due to the fact that the density specified in calculations are different. The 8,000 data can be estimated to be a much lower density because the diffusion coefficient is faster and this means diffusion will happen faster; at a higher density a particle will take longer to diffuse over a given distance. Because of the difference in density, the two values of the diffusion coefficient cannot be qualitatively compared. The reason for the initial deviation for linearity in the gas plots is due to the momentum of the particles initially dominating over the diffusion and the diffusion coefficient is dependent on time. As the system equilibrates, the diffusion coefficient becomes constant and the plots become linear.&lt;br /&gt;
&lt;br /&gt;
=== The Velocity Autocorrelation Function ===&lt;br /&gt;
&lt;br /&gt;
Another way to calculate the diffusion coefficient is by using the velocity correlation function, which determines how the velocity of an atom changes with time. The function determines the difference in time (&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;) when the velocity becomes uncorrelated, i.e. the difference between the velocity at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; and at time &amp;lt;math&amp;gt;t+\tau&amp;lt;/math&amp;gt;. By integrating over this function, we can find the diffusion coefficient. &lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function: &amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can also be written as the integral: &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;
Using the function which defines the position of a classical harmonic oscillator, we can differentiate this to give the equation for the velocity which we can plug into the integral:&lt;br /&gt;
&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;
&amp;lt;math&amp;gt;dv{x(t)}{t} = v(t) = -A\omega sin(\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also needed for the integral:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t+\tau) = -A\omega sin(\omega(t+\tau)+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v^2(t) = A^2\omega^2 sin^2(\omega t +\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Putting all this into the integral to find the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega sin(\omega t + \phi) \times A\omega sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} A^2\omega^2 sin^2(\omega t +\tau)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A^2\omega^2&amp;lt;/math&amp;gt; can be take out of each of the integrals and cancelled. A substituion can then be made to make solving the integral much simpler:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = \omega t + \phi&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \omega\tau&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the integral becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a) \times sin(a+b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the compound angle rule &amp;lt;math&amp;gt;sin(a+b)=sin(a)cos(b)+cos(a)sin(b)&amp;lt;/math&amp;gt;, the integral can be simplified to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a)sin(a)cos(b) + sin(a)cos(a)sin(b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Separating out into two integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)\frac{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the rule &amp;lt;math&amp;gt;sin(a)cos(a) = \frac{1}{2}sin(2a)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} \frac{1}{2}(sin(2a))\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because the function &amp;lt;math&amp;gt;\frac{1}{2}sin(2a)&amp;lt;/math&amp;gt; is symmetric over all space, the second term in this equation becomes zero. Therefore, the integral simplifies to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b) = cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same calculations from the mean squared displacement section gave an output of the velocity autocorrelation function. The function for the Lennard-Jones solid, liquid and gas were plotted against the timestep along with the approximate function for the velocity autocorrelation function, &amp;lt;math&amp;gt;cos(\omega\tau)&amp;lt;/math&amp;gt;, where \omega = \frac{1}{2\pi}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure v. &#039;&#039;Plots for the velocity autocorrelation function of a Lennard-Jones solid, liquid and gas; 8,000 atoms&lt;br /&gt;
!&#039;&#039;Figure w. &#039;&#039;Plots for the velocity autocorrelation function of a Lennard-Jones solid, liquid and gas, 1,000,000 atoms&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt VACF 5721 image001.png|800x800px|]]&lt;br /&gt;
|[[File:Rmt MAVACF.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
The diffusion coefficient is calculated from: &amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty C\left(\tau\right)\mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the approximate value for the diffusion coefficient using the velocity autocorrelation function is &amp;lt;math&amp;gt;D = \frac{1}{3}cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The running integral of the velocity autocorrelation functions was plotted using the &#039;&#039;trapesium rule&#039;&#039;, and so the final value on the integral plot is proportional to the diffusion coefficient.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom VACF integral &#039;&#039;(figures w-z)&#039;&#039;&lt;br /&gt;
!1,000,000 VACF integral (&#039;&#039;figures aa-cc)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|[[File:Rmt mysi.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt masi.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|[[File:Rmt myli.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt mali.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|[[File:Rmt mygi.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt ligi.png|frameless|700x700px]]&lt;br /&gt;
|}&lt;br /&gt;
The diffusion coefficients for each of the plots above are tabulated below using the final data point from the integral plot. This is the integral over the whole graph using the trapesium rule. This must be corrected for the timestep; the value is multiplied by 0.002. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom data diffusion coefficients, &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
!1,000,000 atom data diffusion coefficients &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;-0.00055&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{-0.00055}{6} = -0.00018 \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.00014&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.00014}{6} = 0.000046 \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.242&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.242}{6} = \mathbf{0.0807}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.270&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.270}{6} = \mathbf{0.0901}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;25.6&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{25.6}{6} = \mathbf{8.55}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;9.81&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{9.81}{6} = \mathbf{3.27}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
The biggest source of error in these plots is that we assume both the 8,000 atom data and the 1,000,000 atom data take the same amount of time to converge. &#039;&#039;Figure z. &#039;&#039;shows that 5000 timesteps is not long enough for the velocity autocorrelation coefficient for 8,000 atoms to converge as far as 1,000,000 atom data does in this length of time. As the molecular dynamics simulations simulate random motion, this could induce fluctuations in the velocity autocorrelation plot which could increase or decrease the integral introduction another source of error.&lt;br /&gt;
&lt;br /&gt;
Again, the diffusion coefficient of the Lennard-Jones solid can be assumed to be zero for the same reason as the mean squared displacement data. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient of the liquid is lower for both sets of data when calculated using the velocity autocorrelation function.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=541568</id>
		<title>Rep:Mod:hakunamatata</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=541568"/>
		<updated>2016-02-25T14:07:21Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: /* The Velocity Autocorrelation Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Introduction to Molecular Dynamics Simulations ==&lt;br /&gt;
===The Classical Particle Approximation and Numerical Integration===&lt;br /&gt;
The verit and verit-velocity algorithms are numerical methods to approximate the average position and velocity respectively of randomly moving atoms in a particular medium (solid, liquid, fliud etc.). This position and velocity can be applied to Newtonian mechanics to calculate such properties as the force and potential energy of the system. The algorithms work by splitting the function into discrete time steps, calculating the values of position and velocity at this particular time step, and then effectively &amp;quot;joining the dots&amp;quot; to create an approximate function. These simulations always use the answer from the previous timestep to compute the new timestep, so initial conditions must be given for the first step. Both of the algorithms are shown below and are derived from the Taylor expansion of the position or velocity of the atoms at the timestep &amp;quot;n+1&amp;quot; or &amp;lt;math&amp;gt;t+\delta t&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit Algorithum:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{x}_i\left(t + \delta t\right) \approx 2\mathbf{x}_i\left(t\right) - \mathbf{x}_i\left(t - \delta t\right) + \frac{\mathbf{F}_i\left(t\right)}{m_i}\delta t^2  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit-Velocity Algorithum:&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i\left(t\right)&amp;lt;/math&amp;gt; is the force acting on a particular atom as a function of time&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i&amp;lt;/math&amp;gt; is the acceleration &lt;br /&gt;
&lt;br /&gt;
The smaller the timestep, the closer the numerical approximation is to the true solution function, which can be modeled as a classical harmonic oscillator. &#039;&#039;Figure a.&#039;&#039; in the table below shows the comparison between the two methods in &#039;&#039;time&#039;&#039; space. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure a. &#039;&#039;Plots of position vs time comparing the verit algorithm and harmonic spring results&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure b. &#039;&#039;Plot of the total classical energy of the system (potential + kinetic)&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory xanalytical.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory energy.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The harmonic spring position values are modeled from the harmonic oscillator or particle on a spring. The equation of &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; was used to calculate these values, where &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; are 1 and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; is zero. As seen on the plot, the curves produced from the two different methods of calculating the position are in good agreement.&lt;br /&gt;
|The potential energy is calculated using the equation U = 1/2 kx^2, with a value of k given as 1. The kinetic energy is calculated using the velcity from the verit-velocity algorithm using the equation T = 1/2 mv^2, with a value of m given as 1. The total energy of the system, E, is equal to T + U. The values for x (potential energy) and v (kinetic energy) are taken from the verity algorithm and verit-velocity algorthim respectively. &lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;Figure c. &#039;&#039;Plot of the difference (error) between the harmonic spring and verit algorithm data&lt;br /&gt;
!&#039;&#039;Figure d. &#039;&#039;Plot of the peaks in the error plot in &#039;&#039;figure c.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory error.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory errorpeaks.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The peaks in the error between the harmonic spring and verit algorithm results are at the place where the position curve crosses the time axis. This is because the harmonic spring data (x(t)) has a slightly shorter wave period than that of the verit velocity algorithm, and therefore the difference will get larger with each period of the wave, shown by the error getting larger in &#039;&#039;figure c. &#039;&#039;The period of the plot of the two methods are different because the verit algorithm is much more approximate so does not give the correct solution.&lt;br /&gt;
|The change in the error/difference between the harmonic spring data and verit algorthm data increases linearly and so therefore period of each of the plots in &#039;&#039;figure 1&#039;&#039;. must be constant. &lt;br /&gt;
|}&lt;br /&gt;
The error can also be quantified on a &#039;&#039;phase space&#039;&#039; plot; phase space is momentum or velocity plotted as a function of position. The true solution for motion of an atom is a perfect ellipse, and the more elliptic the shape (less circular) the more momentum or velocity is in the system. A numerical solution, like the verit algorithms, will produce a set of points very close to this ellipse but not perfectly following the curve. A good numerical solution will remain in an elliptical shape, whereas a bad numerical solution, for example one with a large timestep, will spiral away from the true solution. Two examples of such systems using the data from &#039;&#039;figures a-d&#039;&#039; are shown below.  &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure e. &#039;&#039;Phase plot of the harmonic spring data with a good numerical solution (timestep = 0.1) &lt;br /&gt;
!&#039;&#039;Figure f. &#039;&#039;Phase plot of the harmonic spring data with a bad numerical solution (timestep = 0.3) &lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory phasegood.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory badphase.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The timestep at which this data is plotted is 0.1, which results in a very small change in the energy, as seen in &#039;&#039;figure b. &#039;&#039;Increasing the time step will increase the variation in the energy. To keep the variation in the total energy of the system under 1%, the time step must be no larger than approximately 0.28. The energy varies more with increasing time step because the jumps in the algorithm  are getting larger due to less data points. The algorithm assumes these points are joined by a straight line; that the halfway point in the jump is the average between the starting and finishing point of the jump. The phase space plot will become less elliptic and the jumps eventually become so larger that the plot is no longer a continuous shape.  &lt;br /&gt;
&lt;br /&gt;
It is essential to monitor the energy of a numerically modeled system because a good solution for the motion of an atom has a constant energy and a plot in phase space of a perfect ellipse.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance and Force at Zero Potential===&lt;br /&gt;
From classical mechanics, the force calculated from the Newtonian mechanics above can be used to calculate the potential experienced by an atom in the system. They are related by the equation: &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;
This potential gives the shape and dimension of the potential surface on which the system can be modeled. A simple 1D potential that is used to describe the inter atomic forces of a liquid is the Lennard-Jones potential. It has the characteristic features of a short range repulsion potential and harmonic character around the equilibrium bond distance. The value of &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the inter atomic separation when the potential, &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;, is equal to zero, can be calculated by equating the equation for the Lennard-Jones potential to zero and solving for &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The equation for the Lennard-Jones potential: &amp;lt;math&amp;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;
Equating this to zero: &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;
And rearranging in order to separate the variables: &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;
Rearranging this gives &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in terms of &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt; r^6 = \sigma^6&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r = r_0&amp;lt;/math&amp;gt; in this case.&lt;br /&gt;
&lt;br /&gt;
This, therefore, gives the result that interatomic distance at zero potential, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, is equal to &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; in the Lennard-Jones potential is effectively the diameter of one of the particles in the system being measured; in this case, the liquid we are simulating. This is the point where the potential curve crosses the x-axis on an Energy vs interatomic distance plot. The force, &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt;, at this point on the curve corresponds to the gradient; it is found by calculating the derivative of the curve at this point. &lt;br /&gt;
&lt;br /&gt;
To calculate the force, we must differentiate the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As force is equal to the negative differential of the potential energy, the value of the force is: &amp;lt;math&amp;gt;\mathbf{F}_i = 48\epsilon \sigma^{12} r^{-13} - 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting in the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at zero potential from the calculation before: &amp;lt;math&amp;gt;\mathbf{F}_i = \frac{48\epsilon}{\sigma} - \frac{24\epsilon}{\sigma} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The gradient where the Lennard-Jones plot crosses the axis is negative; &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; in the term obtained for &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is negative and therefore the overall value of the force will be negative.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance, Force and Well Depth of the Potential at Equilibrium===&lt;br /&gt;
To calculate the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at the equilibrium position, we need to use the derivative of the potential energy curve. The equilibrium value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is the value at the minimum of the Lennard-Jones curve; when &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Therefore, equating the derivative to zero gives: &amp;lt;math&amp;gt;0 = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rearranging this: &amp;lt;math&amp;gt;48\epsilon \sigma^{12} r^{-13} = 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And simplifying and cancelling gives: &amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6&amp;lt;/math&amp;gt;. Therefore the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at equilibrium is: &amp;lt;math&amp;gt;r_{eq} = \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Physically, this result means that the equilibrium distance is 1.12 times the diameter of one of the particles; the particles have a small gap between them so do not touch. A short range repulsion potential, as seen in the Lennard-Jones curve, is a result of the particles coming into contact. &lt;br /&gt;
&lt;br /&gt;
Again, the force can be calculated from the derivative of the potential curve at the equilibrium point. As the derivative at this point is zero (a minimum on the curve), the force will therefore also be zero.&lt;br /&gt;
&lt;br /&gt;
The well-depth of the potential curve is the difference between zero potential and the potential at the equilibrium bond length. This can be calculated by substituting the value for the equilibrium bond length into the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 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;
Cancelling and simplifying this equation gives: &amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \times \frac{1}{4}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the absolute value for the well depth is &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;. The actual value of this potential is &amp;lt;math&amp;gt;-\epsilon&amp;lt;/math&amp;gt;, as the equilibrium bond length gives the most stable configuration of the molecules and therefore suggests attractive interactions are involved in the arrangement of the molecules; this attractive potential means its negative. &lt;br /&gt;
&lt;br /&gt;
===Boundary Conditions and the Lennard-Jones Cutoff===&lt;br /&gt;
When simulating a liquid, it is computationally impractical to simulate a realistic liquid. Therefore a smaller &#039;box&#039; containing &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; particles is simulated and the computer program will use &#039;&#039;periodic boundary conditions&#039;&#039; to simulate infinite repetitions of this box; when the atom reaches one edge of the box, in periodic boundary conditions, it will reappear again at the opposite edge of the box as if they were connected. For example, an atom at the position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a box of size &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;. Without periodic boundary conditions, we would assume that the atom would end up at the position &amp;lt;math&amp;gt;(1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;. However, in this box, there is no such position and so the particle must reappear at the opposite edge to where it effectively &#039;left&#039; the box. Therefore, it&#039;s ending position will be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The number of particles, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; simulated by the computer is usually between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt;. Physically, this is a very small volume. Considering water, we can calculate the number of molecules in 1 mL or 1 cm^3, a volume that would be considered small in the lab. Taking the concentration of water at standard conditions, &amp;lt;math&amp;gt;55\ mol\ dm^{-3}&amp;lt;/math&amp;gt;, we can convert it to the number of moles per mL: &amp;lt;math&amp;gt;0.055\ mol\ mL^{-1}&amp;lt;/math&amp;gt;. Multiplying this value by Avagadro&#039;s constant (&amp;lt;math&amp;gt;N_A&amp;lt;/math&amp;gt;) gives the number of molcules of water per mL: &amp;lt;math&amp;gt;3.02 \times 10^{22}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The reverse procedure can be used to compare this to the volume of 10,000 molecules: 10,000 divided by Avagadro&#039;s constant gives the number of moles of water which 10,000 molecules makes up: &amp;lt;math&amp;gt;1.66 \times 10^{-20}\ moles&amp;lt;/math&amp;gt;. Dividing this value by the concentration (from &amp;lt;math&amp;gt;n=cV&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is the number of moles, &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; is the concentration and &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume), gives the volume: &amp;lt;math&amp;gt;3.02 \times 10^{-22}\ dm&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;3.02 \times 10^{-19}\ mL&amp;lt;/math&amp;gt;. Physically, of course, this is far too small a volume to be recorded in the lab.&lt;br /&gt;
 &lt;br /&gt;
Periodic boundary conditions simulate an infinite lattice and therefore, when computing the potential, will calculate an infinite amount of pair interactions. Therefore, it is only practical to calculate the energies up to a certain interatomic distance; the Lennard-Jones cutoff distance. Beyond this point, the potential energy and the integral of the curve beyond this point become insignificant and do not impact on the overall energy; removing interactions beyond this point from the calculations will not effect the accuracy. Multiplying the Lennard-Jones potential with the radial distribution function gives a plot of the probability of finding an atom at a particular interatomic distance. The larger the interatomic distance, the lower the probability and so the energy after the cutoff can be disregarded. &lt;br /&gt;
&lt;br /&gt;
Integrating over the Lennard-Jones curve and applying this cutoff as the lower limit can show how small the integral is:&lt;br /&gt;
&lt;br /&gt;
For a general cutoff of with value &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;I = \int_{x}^\infty \phi\left(r\right)\mathrm{d}r = \int_{x}^\infty \frac{4\epsilon\sigma^{12}}{r^{12}}\mathrm{d}r - \int_{x}^\infty \frac{4\epsilon\sigma^6}{r^6}\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving this: &amp;lt;math&amp;gt;I = 4\epsilon\sigma^{12} {\frac{-1}{11r^{11}}\,\Bigg\vert\,}_x^\infty - 4\epsilon\sigma^{6} {\frac{-1}{5r^{5}}\,\Bigg\vert\,}_x^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This gives the general solution: &amp;lt;math&amp;gt;I = \frac{4\epsilon\sigma^{12}}{11x^{11}} - \frac{4\epsilon\sigma^{6}}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating this for &amp;lt;math&amp;gt;\epsilon = \sigma = 1&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;I = \frac{4}{11x^{11}} - \frac{4}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt; (or 2 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.025&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt; (or 2.5 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0082&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt; (or 3 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0033&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All values are taken to 2 significant figures. As the cutoff value for the interatomic distance gets larger, the integral gets smaller, and therefore the energy excluded from the calculation becomes smaller, and the second term in the solved integral, &amp;lt;math&amp;gt;I&amp;lt;/math&amp;gt;, dominates the energy value.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
When using the Lennard-Jones potential, it is appropriate to use reduced units for intermolecular distance, energy and temperature. Reduced units can be calculated by the following relationships:&lt;br /&gt;
&lt;br /&gt;
Intermolecular 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;
&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; are scaling factors. For example, if the parameters for Argon are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\sigma = 0.34 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt; \epsilon\ /\ k_B = 120 K&amp;lt;/math&amp;gt;&lt;br /&gt;
* Lennard-Jones cutoff &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;. The well-depth, &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;, is &amp;lt;math&amp;gt;0.999 kJ mol^{-1} \approx 1 kJ mol^{-1}&amp;lt;/math&amp;gt;. The value of &amp;lt;math&amp;gt;T* = 1.5&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;180 K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
The first aim of the simulations is to determine the most appropriate timestep to use in the vert algorithm simulations. This timestep is a balance between the accuracy of the results (the smaller the timestep, the closer to the true functing the result will be) and the length of real time over which the simluation is run (the smaller the timestep, the less real time over which the simulation will give a result). The appropriateness of the timestep will be determined by plotting how the total free energy of the simulated lattice equilibrates over time.  &lt;br /&gt;
&lt;br /&gt;
Five different calculations, which simulated the melting of a crystal and subsequent equilibration of the energy of the melted crystal, were run at five different timesteps; 0.001, 0.0025, 0.0075, 0.01 and 0.015, and were described by the NVE or &#039;&#039;&amp;quot;microcanonical ensemble&amp;quot;&#039;&#039;. An ensemble is a collection of samples of a system which are under three thermodynamic constraints (three properties are kept constant); in the microcanonical ensemble, the number of particles, the volume and the total energy is kept constant (NVE). &lt;br /&gt;
&lt;br /&gt;
These calculations simulate a box of 1000 unit cells and use periodic boundary conditions to replicate the simulation to a larger scale. Because these simulations use the numerical methods defined in the previous section, the initial position and velocity of the atoms must be defined in the input file. The Brownian (uncorrelated, random) motion of the atoms in the simulation means that there is no long range order in the system and so the atoms in a real system would start in random positions. However, assigning random starting coordinates to the atoms in a simulated liquid is not a relative process; the coordinates are generate independently of each other. Therefore there is a probability that the coordinates simulated will cause the atoms to overlap, which would give a very large repulsion potential, as seen in the Lennard-Jones potential at very small interatomic distances. This short-range repulsion potential comes from the hard-sphere model of atomic simulation.&lt;br /&gt;
&lt;br /&gt;
The input file also defines the structure and density of the lattice. The number density of lattice points in any lattice is the number of lattice points per volume of the unit cell. In a simple cubic lattice, there is one lattice point in the unit cell. From an sc lattice with lattice spacing (length of one side of the unit cell) being &amp;lt;math&amp;gt;1.07722&amp;lt;/math&amp;gt;, the number density of the lattice points is calculated by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{1}{1.07722^3} = 0.7999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a face-centered cubic lattice (fcc), there are four lattice points in the unit cell. Rearranging the above relationship, the lattice spacing can be calculated from the number of lattice points in a unit cell and number density, &amp;lt;math&amp;gt;1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Lattice\ spacing = \sqrt[3]{\frac{number\ of\ lattice\ points\ per\ unit\ cell}{number\ density}} = \sqrt[3]{\frac{4}{1.2}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation creates a box which includes 1000 unit cells, which is 10 unit cells in each dimension. For a simple cubic lattice, because there is one lattice point per unit cell, there will be 1000 atoms created as seen in the input file. The &#039;&#039;create_atom&#039;&#039; command in the input file determines how many boxes are created in the simulation and therefore how many atoms will be created. If a face centered cubic lattice is simulated, because there are 4 lattice points per unit cell, 4000 atoms will be created in the &#039;&#039;create_atom&#039;&#039; command. &lt;br /&gt;
&lt;br /&gt;
The input script also contains the following commands which defines the potential surface which is used to model the intermolecular reactions:&lt;br /&gt;
 mass 1 1.0&lt;br /&gt;
This instruction sets the mass type for the atoms being simulated. It takes the general form of “mass I value”, where mass is the keyword which tells LAMMPS what the input is, I is the atom type and value is the mass of the atom. In this case, I is defined by a specific numerical value; 1 as there is only 1 type of atom in the simulation, but it can be defined with an asterisk (1*), which means “all atom types of 1 to n inclusive”. &lt;br /&gt;
 pair_style lj/cut 3.0&lt;br /&gt;
This instruction sets the type of potential which LAMMPS uses in its calculation of pairwise interactions. It takes the general form of “pair_style style args”, where pair_style is the keyword for LAMMPS, style defines the potential and any specifications it may have, and args are the arguments required for this particular potential. In this case, the Lennard-Jones potential has been used (lj) with a cutoff point (cut) of 3σ. The cutoff point is explained in the introduction section. &lt;br /&gt;
 pair_coeff * * 1.0 1.0&lt;br /&gt;
This instruction specifies the coefficients for the pairwise interactions of each pair of atoms, and it takes the general form “pair_coeff I J args”. Pair_coeff is the keyword, I and J are the atom types, and args are the coefficients which the different atoms types take. In this case, the asterisk in place of I and J refers to all atoms types from 1 to n. The coefficients are the pairwise interactions are 1 for each atom, meaning each atom has an equal contribution to the interaction.&lt;br /&gt;
&lt;br /&gt;
In these initial calculations, the initial conditions for the numerical methods, &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. For this experiment, the verit-velocity algorithm would be the most appropriate, as both the starting position and velocity is specified for this algorithm. &lt;br /&gt;
&lt;br /&gt;
To define the timestep for the algorithm the following code is used defining the timestep as a variable instead of just giving it a definite value&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;
It is much easier to use the variable version of defining the timestep because the length of time over which the simulation is run depends on the time step. By using a variable, you can keep the length of the simulation the same, no matter the size of the timestep. It also makes it easier if multiple properties depend on the timestep – only the variable needs to be changed, not all the parts of the script where timestep is defined. &lt;br /&gt;
&lt;br /&gt;
The calculations produce the values for the total energy of the system, temperature and pressure in the output files, which can be plotted against time. How well these values equilibrate determines the appropriateness of the timestep to use in further calculations in the experiment.   &lt;br /&gt;
[[File:Rmt totalenergy plot.png|none|thumb|800x800px|&#039;&#039;Figure h. &#039;&#039;Plot of the equilibration of total energy for five different timesteps]]&lt;br /&gt;
The largest time step to give an acceptable result is 0.01. However, for any simluation we would expect energy to be independent of the timestep, something which is not true at a timestep greater than 0.0025. Therefore, the most appropriate timestep to use for a balance between accuracy and length of time which the simulation covers is 0.0025.  &lt;br /&gt;
&lt;br /&gt;
0.015 is a particularly bad choice of timestep. This is because the verit-velocity algorithm gives an approximate result to the velocity (kinetic energy term) and position (potential energy term), and so when the timestep becomes too large with respect to the time, the algorithm no longer becomes a suitable way to calculate the energy. As seen in the graph of 0.015, the energy does not equilibrate and diverges.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions ==&lt;br /&gt;
The calculations in this section are run in the isobaric-isothermal ensemble, where the number of particles in the system, the pressure and the temperature are kept constant (NpT). This means that the temperature and the pressure are recalculated in every step, so are no longer constant like they were in the NVE ensemble. From the &#039;&#039;equipartition theorem&#039;&#039;, each degree of freedom will contribute &amp;lt;math&amp;gt;\frac{1}{2} k_B T&amp;lt;/math&amp;gt; of energy to the system. As the system is in three dimensions, there are three degrees of translational freedom and so the total internal energy is equal to &amp;lt;math&amp;gt;\frac{3}{2} k_B T&amp;lt;/math&amp;gt;. Equating this to the kinetic energy, &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt;, at the end of every step and rearranging will allow calculation of the temperature after every step. &lt;br /&gt;
&lt;br /&gt;
A target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, is defined in the input script and the system will equilibrate by multiplying the velocity by a factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, in order to accommodate for the fluctuation and keep the system at approximately the target temperature and therefore constant internal energy. If the temperature of the system is greater than the target temperature, the system&#039;s kinetic energy is too high, so &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is reduced to compensate for this. The same is true for is the temperature is lower than the target temperature; &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than one in the next step to increase the kinetic energy which is now too low. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; can be derived from equating the kinetic and internal energy of the system at an arbitrary time step:&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;
Expanding the brackets inside the sum and moving the term containing &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; out of the sum: &amp;lt;math&amp;gt;\frac{\gamma^2}{2}\sum_i m_i \left(v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;, we can replace &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt; on the left hand side of the equation with &amp;lt;math&amp;gt;\frac{3}{2} N k_B T&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;\frac{3\gamma^2}{2}N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Simplifying and rearranging for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, gives: &amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The principle is the same for controlling the pressure.&lt;br /&gt;
&lt;br /&gt;
As temperature and pressure are no longer constant, he input files require specification of the pressure and the temperature for each of the systems run. 10 simulations were run at two different pressures with five different temperatures at each. &lt;br /&gt;
* Temperatures: 1.6, 1.9, 2.2, 2.5, 2.8&lt;br /&gt;
* Pressures: 2.5, 3.0&lt;br /&gt;
These pressures were chosen because the data simulated when choosing an appropriate timestep gave a pressure between 2.5 and 3.0.  &lt;br /&gt;
&lt;br /&gt;
For the code which computes the thermodynamic potentials, this particular line defines how many steps contribute towards the average of the thermodynamic parameters computed in the calculation. &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;
&#039;&#039;fix&#039;&#039; is the keyword, &#039;&#039;aves&#039;&#039; is the name of the group of fixes which in this case is the average of the thermodynamic values, &#039;&#039;all&#039;&#039; specifies the atoms which the fix is applied to which in this case is all the atoms in the simulated system and &#039;&#039;ave/time&#039;&#039; means that compute global time averages are calculated. The following three numbers have the following meaning:&lt;br /&gt;
&lt;br /&gt;
*100 = use the input values every 100 timesteps&lt;br /&gt;
*1000 = use input values 1000 times for calculating the average&lt;br /&gt;
*100000 = calculate the average every 100000 timesteps&lt;br /&gt;
&lt;br /&gt;
Therefore for the total calculation which lasts for 100000 will only have the average calculated once. Assuming 1 value every timestep, there will be 100000/100 values = 1000. The amount of time simulated is 100,000 steps, read from the following line.&lt;br /&gt;
&lt;br /&gt;
The density data from all ten calculation were plotted on the same graph, along with the density for an &amp;quot;ideal&amp;quot; gas. This density can be derived from the ideal gas law:&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;
Rearranging in terms of density: &amp;lt;math&amp;gt;\frac{N}{V} = \frac{P}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As these simulations are being run under reduced units, we can take &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt;, and so the density of the ideal gas becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the density of the ideal gas is plotted as the pressure divided by the temperature in pressure-temperature phase space.&lt;br /&gt;
[[File:Rmt dvt plot.png|none|thumb|800x800px|&#039;&#039;Figure i. &#039;&#039;Plot of the variation in density with temperature at a defined pressure for the numerically simulated and ideal systems]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that calculated in the ideal gas law. This is because for an ideal gas, an assumption is made that there are no intermolecular interactions, and therefore forces such as electron repulsion forces are ignored; repulsion forces dominate over attractive ones, as all the atoms in this simulation are the same and so partial charges or dipoles are created. This will mean that the particles move closer together than a real gas and so the density will be larger. This discrepancy between the ideal and non-ideal systems becomes larger at a higher pressure because with a higher pressure, the atoms in the system are closer together and therefore the intermolecular repulsion will become larger. This greater repulsion will in turn have a larger effect on decreasing the density.&lt;br /&gt;
&lt;br /&gt;
== Statistical Physics Calculations of the Heat Capacity ==&lt;br /&gt;
The heat capacity of a system at constant volume can be calculated from the variance in the total energy of the system. The relationship used to calculate the heat capacity is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = 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;\left\langle E^2\right\rangle&amp;lt;/math&amp;gt; is the continuous average of the total square energy at each temperature as a function of temperature. &amp;lt;math&amp;gt;\left\langle E\right\rangle^2&amp;lt;/math&amp;gt; is the continuous average of the total energy at each temperature as a function of temperature squared. The heat capacity is multiplied by &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; in this case because the version of LAMMPS calculates every energy divided by the number of molecules in the system simulated.&lt;br /&gt;
&lt;br /&gt;
The calculations in this sections are run in density-temperature phase space and the ensemble has changed to the canonical ensemble (NVT). A set of input files were written for ten calculations for, like the previous section, two pressures and five different temperatures at each pressure:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 0.2, 0.8&lt;br /&gt;
*Temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{C_V}{V}&amp;lt;/math&amp;gt; was plotted against temperature to determine the relationship in density-temperature phase space. An example of an input file can be found [[Media:nvt_-_0220.in|here]]. The lines which have been changed from the previous input files are at the end of the script:&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 &lt;br /&gt;
 thermo_style custom step etotal temp&lt;br /&gt;
 variable energy equal etotal&lt;br /&gt;
 variable energy2 equal etotal*etotal&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_energy v_energy2 v_temp&lt;br /&gt;
 run 100000&lt;br /&gt;
 &lt;br /&gt;
 variable aveenergy equal f_aves[1]&lt;br /&gt;
 variable aveenergy2 equal f_aves[2]&lt;br /&gt;
 variable avetemp equal f_aves[3]&lt;br /&gt;
 variable heatcapacitydv equal atoms*atoms*(v_aveenergy2-v_aveenergy*v_aveenergy)/(v_avetemp*v_avetemp*vol)&lt;br /&gt;
 &lt;br /&gt;
 print &amp;quot;Averages&amp;quot;&lt;br /&gt;
 print &amp;quot;--------&amp;quot;&lt;br /&gt;
 print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Heat Capacity per Volume: ${heatcapacitydv}&amp;quot;&lt;br /&gt;
The line with the keyword &#039;fix&#039; determines which thermodynamic values are averaged and over how many steps they are averaged. The next section takes these averages as variables and uses them to define the heat capacity which is calculated from the equation at the beginning of this section. Only the energy and temperature are needed to define the heat capacity and so only these values are calculated by the simulation. [[File:Rmt heatcapacitybyv.png|none|thumb|800x800px|&#039;&#039;Figure j. &#039;&#039;C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V against temperature for the two different pressures 0.2 and 0.8]]As seen in the above figure, the heat capacity decreases with temperature for both pressures. It would be expected for an ideal system that as the temperature increases, the heat capacity at constant volume increases and tends to a constant volume at very high T of 3R; R = the universal gas constant. This means increasing the temperature increases the amount of energy being stored in the system and this energy is stored as vibrational energy. However, for a Lennard-Jones liquid, the system being simulated here, the heat capacity decreases with temperature. This is because the simulation has two components to the simulation; the atoms are vibrating in a quasi-harmonic fashion around the equilibrium position and also diffuse between neighbouring equilibrium positions in a gas like fashion. As the temperature increases, the amount of diffusion increases and the vibrations decreases, therefore decreasing the ability of the system to absorb vibrational energy, resulting in the decrease in heat capacity. &amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www.nature.com/ncomms/2013/130816/ncomms3331/full/ncomms3331.html?message-global=remove&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural Properties and the Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a single atom in a system is a plot of the probability that an atom can be found at a certain distance from the central atom. The peaks in this plot can give the distance of an atom from its nearest neighbours in the Lennard-Jones simulated system. &lt;br /&gt;
&lt;br /&gt;
The calculations in this section simulate a Lennard-Jones solid, liquid and gas and, using the output of the LAMMPS trajectory file, plots both the radial distribution function and its integral using DLV. The temperature and pressure parameters for these calculations were taken from the phase diagram or coexistence curve for a Lennard-Jones system.&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt; The parameters used are displayed in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! Temperature, &amp;lt;math&amp;gt;T^*&amp;lt;/math&amp;gt;&lt;br /&gt;
! Pressure, &amp;lt;math&amp;gt;p^*&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| LJ Solid&lt;br /&gt;
| 1.5&lt;br /&gt;
| 1.2&lt;br /&gt;
|-&lt;br /&gt;
| LJ Liquid&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.8&lt;br /&gt;
|-&lt;br /&gt;
| LJ Gas&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.01&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The data obtained from the plots and the radial distribution functions and their integrals were plotted and shown in the table below.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure k. &#039;&#039;The radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
!&#039;&#039;Figure l. &#039;&#039;The integrals of the radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt fullrdfs.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt allintegralsrdf.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
[[File:Rmt Nearest neighbours.png|left|thumb|300x300px|&#039;&#039;Figure m. &#039;&#039;Representation of a cross section of the first three shells of nearest neighbours in an fcc solid. The black atom is the central atom being considered, the blue atoms are the first shell, the orange atoms the second shell and the purple atoms are the third.]]&lt;br /&gt;
The RDF of the solid gives a very irregular curve because of the irregular structure of the lattice. For a simple cubic lattice, a regular structure of the RDF would be expected because of the equal number of atoms in each of the nearest neighbour shells of the atoms. However, for face-centered cubic, the solid in this simulation, the structure is much more irregular and as the atoms move from their equilibrium position in the lattice due to vibrations, the peaks in the radial distribution will broaden. The irregular heights of the peaks are due to the varying numbers of atoms in each of the nearest neighbour shells for the central atom. The first shell gives the highest peak as it contains the most atoms; in total, considering all four surrounding unit cells, this shell contains 12 atoms and ideally takes the geometry of an icosahedron. The second shell is smaller and contains only 6 atoms in an octahedral coordination shape. The following shell again contributes 12 atoms, 3 from each unit cell. This therefore explains why the heights of the peaks in the solid plot in &#039;&#039;figure k.&#039;&#039; vary. These values can be confirmed by the plot in &#039;&#039;figure o.&#039;&#039; which is the integral; it cumulatively adds the numbers in each shell. The size of the first &amp;quot;step&amp;quot; is 12; there are 12 atoms in the first shell. The size of the second step is approximately 18; there are 18-12=6 steps in the second shell. The same theory applies for the third shell which gives a value of 13. This is slightly different to the predicted value possibly due to error in the calculation of the radial distribution function and therefore its integral. &lt;br /&gt;
&lt;br /&gt;
The RDF of the liquid has a representation of far fewer shells, which means that there are less atoms in the space close to a &amp;quot;central&amp;quot; atom in the bulk solution. The particles have more energy and therefore do not keep to a regular lattice structure. As they move about, some regualrity is maintained around each atom, but only to the extend of two or three shells, meaning there is no long range order in a Lennard-Jones liquid. &lt;br /&gt;
&lt;br /&gt;
The RDF of the gas again omits more shells as there is almost no order in a Lennard-Jones gas. The single peak on this plot considers only the set of atoms closest to the central atom and all others are disregarded as they are too far apart. &lt;br /&gt;
&lt;br /&gt;
Considering &#039;&#039;figure l.&#039;&#039;, the size of the integral of the radial distribution function decreases from solid to liquid to gas. This makes sense as the number of atoms in the surrounding shells decreases with density of the system; the atoms become further apart. &lt;br /&gt;
&lt;br /&gt;
From the plot of the radial distribution function of the solid, the lattice spacing can be determined. For this, we can consider just the first three peaks of the RDF plot. The lattice spacing refers to the length of one unit cell, and so, using &#039;&#039;figure m&#039;&#039;, we can calculate this using two different methods; a) we can use the distance between the central atom and the first shell of nearest neighbours, and use trigonometry to calculate the lattice spacing. Or alternatively b) we can use the distance between the central atom and the second nearest neighbour shell to get the lattice spacing.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure n. &#039;&#039;The radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
!&#039;&#039;Figure o. &#039;&#039;The integral of the radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt solidgr3.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt solidint3.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
Using method a) (with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; as the distance between the central atom and the nearest neighbour: Lattice spacing = &amp;lt;math&amp;gt;\frac{r}{cos({\frac{\pi}{4}})} = \frac{1.02}{cos({\frac{\pi}{4}})} \approx 1.44&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using method b): Lattice spacing &amp;lt;math&amp;gt;\approx 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can take an average between the two get an approximate value for the lattice spacing: &amp;lt;math&amp;gt;1.46 \plusmn 0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These values for distance are all in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
The ability of atoms to move around in a solid liquid or gas can be characterised by the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. In this section, we will explore two different ways to calculate the diffusion coefficient and compare the results. &lt;br /&gt;
&lt;br /&gt;
=== The Mean Squared Displacement ===&lt;br /&gt;
The diffusion coefficient can be measured easily be calculating the mean squared displacement of atoms in the solution; the diffusion coefficient is proportional to the first derivative of the mean squared displacement. By plotting the mean squared displacement as a function of time, the gradient can be taken to calculate the diffusion coefficient when its has equilibrated and become linear.&lt;br /&gt;
&lt;br /&gt;
The temperature and density parameters used were the same as in the previous section:&lt;br /&gt;
* Solid: T=1.5, D=1.2&lt;br /&gt;
* Liquid: T=1.1, D=0.8&lt;br /&gt;
* Gas: T=1.1, D=0.01&lt;br /&gt;
&lt;br /&gt;
Mean density squared calculations were run for all three Lennard-Jones phases and the data plotted as function of timestep below. The data from a simulation containing 1,000,000 atoms was plotted for comparision.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!Plots for the 8,000 atom data (&#039;&#039;figures p-r)&#039;&#039;&lt;br /&gt;
!Plots for the 1,000,000 atom data (&#039;&#039;figures s-u)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|[[File:Rmt_MSDsolid.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt_MAsolid.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|[[File:Rmt MSDliquid.png|700x700px]]&lt;br /&gt;
|[[File:Rmt MAliquid.png|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|[[File:Rmt MSDgas.png|700x700px]]&lt;br /&gt;
|[[File:Rmt dataplots 25894 image001.png|700x700px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The exact relationship between the mean squared displacement and the diffusion coefficient is:&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;
Taking the gradients of each of the curves at the point at which they become linear and dividing by six will give the diffusion coefficient for each set of data. The gradient also needs to be converted to a function of time; this is done by dividing by the timestep, which in this case is 0.002:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom data diffusion coefficients, &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
!1,000,000 atom data diffusion coefficients &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 0.9999&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|Gradient = 0.0972&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{48.6}{6} = \mathbf{8.1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient = 0.0386&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{19.6}{6} = \mathbf{3.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For both of the solid approximations, the diffusion coefficient can be approximated as zero. This is because, when equilibrated, the function has a constant value of around 0.2 for the mean squared displacement. A gradient with a value of zero means that the atoms take an infinite amount of time to change their mean squared displacement; to move away from their equilibrium position, and so this means that we can approximate in this system, there will be no diffusion. In real system, however, this is not the case; diffusion occurs but it is very slow. A plot for a real system will give a very shallow positive gradient.&lt;br /&gt;
&lt;br /&gt;
The liquid approximations are very well correlated. This is because in both cases, the mean squared displacement of particles in a liquid increases linearly with time and the gradient of both plots are almost identical. We can assume from this that identical starting conditions were used to calculate this data. Also, we can estimate that 8,000 atoms is a large enough simulation to give an accurate result for the diffusion coefficient for the Lennard-Jones liquid.&lt;br /&gt;
&lt;br /&gt;
The gas approximations are very different. This is most probably due to the fact that the density specified in calculations are different. The 8,000 data can be estimated to be a much lower density because the diffusion coefficient is faster and this means diffusion will happen faster; at a higher density a particle will take longer to diffuse over a given distance. Because of the difference in density, the two values of the diffusion coefficient cannot be qualitatively compared. The reason for the initial deviation for linearity in the gas plots is due to the momentum of the particles initially dominating over the diffusion and the diffusion coefficient is dependent on time. As the system equilibrates, the diffusion coefficient becomes constant and the plots become linear.&lt;br /&gt;
&lt;br /&gt;
=== The Velocity Autocorrelation Function ===&lt;br /&gt;
&lt;br /&gt;
Another way to calculate the diffusion coefficient is by using the velocity correlation function, which determines how the velocity of an atom changes with time. The function determines the difference in time (&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;) when the velocity becomes uncorrelated, i.e. the difference between the velocity at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; and at time &amp;lt;math&amp;gt;t+\tau&amp;lt;/math&amp;gt;. By integrating over this function, we can find the diffusion coefficient. &lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function: &amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can also be written as the integral: &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;
Using the function which defines the position of a classical harmonic oscillator, we can differentiate this to give the equation for the velocity which we can plug into the integral:&lt;br /&gt;
&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;
&amp;lt;math&amp;gt;dv{x(t)}{t} = v(t) = -A\omega sin(\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also needed for the integral:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t+\tau) = -A\omega sin(\omega(t+\tau)+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v^2(t) = A^2\omega^2 sin^2(\omega t +\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Putting all this into the integral to find the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega sin(\omega t + \phi) \times A\omega sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} A^2\omega^2 sin^2(\omega t +\tau)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A^2\omega^2&amp;lt;/math&amp;gt; can be take out of each of the integrals and cancelled. A substituion can then be made to make solving the integral much simpler:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = \omega t + \phi&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \omega\tau&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the integral becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a) \times sin(a+b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the compound angle rule &amp;lt;math&amp;gt;sin(a+b)=sin(a)cos(b)+cos(a)sin(b)&amp;lt;/math&amp;gt;, the integral can be simplified to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a)sin(a)cos(b) + sin(a)cos(a)sin(b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Separating out into two integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)\frac{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the rule &amp;lt;math&amp;gt;sin(a)cos(a) = \frac{1}{2}sin(2a)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} \frac{1}{2}(sin(2a))\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because the function &amp;lt;math&amp;gt;\frac{1}{2}sin(2a)&amp;lt;/math&amp;gt; is symmetric over all space, the second term in this equation becomes zero. Therefore, the integral simplifies to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b) = cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same calculations from the mean squared displacement section gave an output of the velocity autocorrelation function. The function for the Lennard-Jones solid, liquid and gas were plotted against the timestep along with the approximate function for the velocity autocorrelation function, &amp;lt;math&amp;gt;cos(\omega\tau)&amp;lt;/math&amp;gt;, where \omega = \frac{1}{2\pi}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure v. &#039;&#039;Plots for the velocity autocorrelation function of a Lennard-Jones solid, liquid and gas; 8,000 atoms&lt;br /&gt;
!&#039;&#039;Figure w. &#039;&#039;Plots for the velocity autocorrelation function of a Lennard-Jones solid, liquid and gas, 1,000,000 atoms&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt VACF 5721 image001.png|800x800px|]]&lt;br /&gt;
|[[File:Rmt MAVACF.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
The diffusion coefficient is calculated from: &amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty C\left(\tau\right)\mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the approximate value for the diffusion coefficient using the velocity autocorrelation function is &amp;lt;math&amp;gt;D = \frac{1}{3}cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The running integral of the velocity autocorrelation functions was plotted using the &#039;&#039;trapesium rule&#039;&#039;, and so the final value on the integral plot is proportional to the diffusion coefficient.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom VACF integral &#039;&#039;(figures w-z)&#039;&#039;&lt;br /&gt;
!1,000,000 VACF integral (&#039;&#039;figures aa-cc)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|[[File:Rmt mysi.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt masi.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|[[File:Rmt myli.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt mali.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|[[File:Rmt mygi.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt ligi.png|frameless|700x700px]]&lt;br /&gt;
|}&lt;br /&gt;
The diffusion coefficients for each of the plots above are tabulated below using the final data point from the integral plot. This is the integral over the whole graph using the trapesium rule. This must be corrected for the timestep; the value is multiplied by 0.002. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom data diffusion coefficients, &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
!1,000,000 atom data diffusion coefficients &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;-0.00055&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{-0.00055}{6} = -0.00018 \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.00014&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.00014}{6} = 0.000046 \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.242&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.242}{6} = \mathbf{0.0807}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.270&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.270}{6} = \mathbf{0.0901}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;25.6&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{25.6}{6} = \mathbf{8.55}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;9.81&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{9.81}{6} = \mathbf{3.27}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
The biggest source of error in these plots is that we assume both the 8,000 atom data and the 1,000,000 atom data take the same amount of time to converge. &#039;&#039;Figure z. &#039;&#039;shows that 5000 timesteps is not long enough for the velocity autocorrelation coefficient for 8,000 atoms to converge as far as 1,000,000 atom data does in this length of time. As the molecular dynamics simulations simulate random motion, this could induce fluctuations in the velocity autocorrelation plot which could increase or decrease the integral introduction another source of error.&lt;br /&gt;
&lt;br /&gt;
Again, the diffusion coefficient of the Lennard-Jones solid can be assumed to be zero for the same reason as the mean squared displacement data. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient of the liquid is lower for both sets of data when calculated using the velocity autocorrelation function. &lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=541516</id>
		<title>Rep:Mod:hakunamatata</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=541516"/>
		<updated>2016-02-25T13:54:33Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: /* The Velocity Autocorrelation Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Introduction to Molecular Dynamics Simulations ==&lt;br /&gt;
===The Classical Particle Approximation and Numerical Integration===&lt;br /&gt;
The verit and verit-velocity algorithms are numerical methods to approximate the average position and velocity respectively of randomly moving atoms in a particular medium (solid, liquid, fliud etc.). This position and velocity can be applied to Newtonian mechanics to calculate such properties as the force and potential energy of the system. The algorithms work by splitting the function into discrete time steps, calculating the values of position and velocity at this particular time step, and then effectively &amp;quot;joining the dots&amp;quot; to create an approximate function. These simulations always use the answer from the previous timestep to compute the new timestep, so initial conditions must be given for the first step. Both of the algorithms are shown below and are derived from the Taylor expansion of the position or velocity of the atoms at the timestep &amp;quot;n+1&amp;quot; or &amp;lt;math&amp;gt;t+\delta t&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit Algorithum:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{x}_i\left(t + \delta t\right) \approx 2\mathbf{x}_i\left(t\right) - \mathbf{x}_i\left(t - \delta t\right) + \frac{\mathbf{F}_i\left(t\right)}{m_i}\delta t^2  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit-Velocity Algorithum:&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i\left(t\right)&amp;lt;/math&amp;gt; is the force acting on a particular atom as a function of time&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i&amp;lt;/math&amp;gt; is the acceleration &lt;br /&gt;
&lt;br /&gt;
The smaller the timestep, the closer the numerical approximation is to the true solution function, which can be modeled as a classical harmonic oscillator. &#039;&#039;Figure a.&#039;&#039; in the table below shows the comparison between the two methods in &#039;&#039;time&#039;&#039; space. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure a. &#039;&#039;Plots of position vs time comparing the verit algorithm and harmonic spring results&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure b. &#039;&#039;Plot of the total classical energy of the system (potential + kinetic)&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory xanalytical.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory energy.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The harmonic spring position values are modeled from the harmonic oscillator or particle on a spring. The equation of &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; was used to calculate these values, where &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; are 1 and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; is zero. As seen on the plot, the curves produced from the two different methods of calculating the position are in good agreement.&lt;br /&gt;
|The potential energy is calculated using the equation U = 1/2 kx^2, with a value of k given as 1. The kinetic energy is calculated using the velcity from the verit-velocity algorithm using the equation T = 1/2 mv^2, with a value of m given as 1. The total energy of the system, E, is equal to T + U. The values for x (potential energy) and v (kinetic energy) are taken from the verity algorithm and verit-velocity algorthim respectively. &lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;Figure c. &#039;&#039;Plot of the difference (error) between the harmonic spring and verit algorithm data&lt;br /&gt;
!&#039;&#039;Figure d. &#039;&#039;Plot of the peaks in the error plot in &#039;&#039;figure c.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory error.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory errorpeaks.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The peaks in the error between the harmonic spring and verit algorithm results are at the place where the position curve crosses the time axis. This is because the harmonic spring data (x(t)) has a slightly shorter wave period than that of the verit velocity algorithm, and therefore the difference will get larger with each period of the wave, shown by the error getting larger in &#039;&#039;figure c. &#039;&#039;The period of the plot of the two methods are different because the verit algorithm is much more approximate so does not give the correct solution.&lt;br /&gt;
|The change in the error/difference between the harmonic spring data and verit algorthm data increases linearly and so therefore period of each of the plots in &#039;&#039;figure 1&#039;&#039;. must be constant. &lt;br /&gt;
|}&lt;br /&gt;
The error can also be quantified on a &#039;&#039;phase space&#039;&#039; plot; phase space is momentum or velocity plotted as a function of position. The true solution for motion of an atom is a perfect ellipse, and the more elliptic the shape (less circular) the more momentum or velocity is in the system. A numerical solution, like the verit algorithms, will produce a set of points very close to this ellipse but not perfectly following the curve. A good numerical solution will remain in an elliptical shape, whereas a bad numerical solution, for example one with a large timestep, will spiral away from the true solution. Two examples of such systems using the data from &#039;&#039;figures a-d&#039;&#039; are shown below.  &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure e. &#039;&#039;Phase plot of the harmonic spring data with a good numerical solution (timestep = 0.1) &lt;br /&gt;
!&#039;&#039;Figure f. &#039;&#039;Phase plot of the harmonic spring data with a bad numerical solution (timestep = 0.3) &lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory phasegood.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory badphase.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The timestep at which this data is plotted is 0.1, which results in a very small change in the energy, as seen in &#039;&#039;figure b. &#039;&#039;Increasing the time step will increase the variation in the energy. To keep the variation in the total energy of the system under 1%, the time step must be no larger than approximately 0.28. The energy varies more with increasing time step because the jumps in the algorithm  are getting larger due to less data points. The algorithm assumes these points are joined by a straight line; that the halfway point in the jump is the average between the starting and finishing point of the jump. The phase space plot will become less elliptic and the jumps eventually become so larger that the plot is no longer a continuous shape.  &lt;br /&gt;
&lt;br /&gt;
It is essential to monitor the energy of a numerically modeled system because a good solution for the motion of an atom has a constant energy and a plot in phase space of a perfect ellipse.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance and Force at Zero Potential===&lt;br /&gt;
From classical mechanics, the force calculated from the Newtonian mechanics above can be used to calculate the potential experienced by an atom in the system. They are related by the equation: &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;
This potential gives the shape and dimension of the potential surface on which the system can be modeled. A simple 1D potential that is used to describe the inter atomic forces of a liquid is the Lennard-Jones potential. It has the characteristic features of a short range repulsion potential and harmonic character around the equilibrium bond distance. The value of &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the inter atomic separation when the potential, &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;, is equal to zero, can be calculated by equating the equation for the Lennard-Jones potential to zero and solving for &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The equation for the Lennard-Jones potential: &amp;lt;math&amp;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;
Equating this to zero: &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;
And rearranging in order to separate the variables: &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;
Rearranging this gives &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in terms of &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt; r^6 = \sigma^6&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r = r_0&amp;lt;/math&amp;gt; in this case.&lt;br /&gt;
&lt;br /&gt;
This, therefore, gives the result that interatomic distance at zero potential, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, is equal to &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; in the Lennard-Jones potential is effectively the diameter of one of the particles in the system being measured; in this case, the liquid we are simulating. This is the point where the potential curve crosses the x-axis on an Energy vs interatomic distance plot. The force, &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt;, at this point on the curve corresponds to the gradient; it is found by calculating the derivative of the curve at this point. &lt;br /&gt;
&lt;br /&gt;
To calculate the force, we must differentiate the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As force is equal to the negative differential of the potential energy, the value of the force is: &amp;lt;math&amp;gt;\mathbf{F}_i = 48\epsilon \sigma^{12} r^{-13} - 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting in the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at zero potential from the calculation before: &amp;lt;math&amp;gt;\mathbf{F}_i = \frac{48\epsilon}{\sigma} - \frac{24\epsilon}{\sigma} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The gradient where the Lennard-Jones plot crosses the axis is negative; &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; in the term obtained for &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is negative and therefore the overall value of the force will be negative.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance, Force and Well Depth of the Potential at Equilibrium===&lt;br /&gt;
To calculate the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at the equilibrium position, we need to use the derivative of the potential energy curve. The equilibrium value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is the value at the minimum of the Lennard-Jones curve; when &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Therefore, equating the derivative to zero gives: &amp;lt;math&amp;gt;0 = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rearranging this: &amp;lt;math&amp;gt;48\epsilon \sigma^{12} r^{-13} = 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And simplifying and cancelling gives: &amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6&amp;lt;/math&amp;gt;. Therefore the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at equilibrium is: &amp;lt;math&amp;gt;r_{eq} = \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Physically, this result means that the equilibrium distance is 1.12 times the diameter of one of the particles; the particles have a small gap between them so do not touch. A short range repulsion potential, as seen in the Lennard-Jones curve, is a result of the particles coming into contact. &lt;br /&gt;
&lt;br /&gt;
Again, the force can be calculated from the derivative of the potential curve at the equilibrium point. As the derivative at this point is zero (a minimum on the curve), the force will therefore also be zero.&lt;br /&gt;
&lt;br /&gt;
The well-depth of the potential curve is the difference between zero potential and the potential at the equilibrium bond length. This can be calculated by substituting the value for the equilibrium bond length into the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 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;
Cancelling and simplifying this equation gives: &amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \times \frac{1}{4}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the absolute value for the well depth is &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;. The actual value of this potential is &amp;lt;math&amp;gt;-\epsilon&amp;lt;/math&amp;gt;, as the equilibrium bond length gives the most stable configuration of the molecules and therefore suggests attractive interactions are involved in the arrangement of the molecules; this attractive potential means its negative. &lt;br /&gt;
&lt;br /&gt;
===Boundary Conditions and the Lennard-Jones Cutoff===&lt;br /&gt;
When simulating a liquid, it is computationally impractical to simulate a realistic liquid. Therefore a smaller &#039;box&#039; containing &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; particles is simulated and the computer program will use &#039;&#039;periodic boundary conditions&#039;&#039; to simulate infinite repetitions of this box; when the atom reaches one edge of the box, in periodic boundary conditions, it will reappear again at the opposite edge of the box as if they were connected. For example, an atom at the position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a box of size &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;. Without periodic boundary conditions, we would assume that the atom would end up at the position &amp;lt;math&amp;gt;(1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;. However, in this box, there is no such position and so the particle must reappear at the opposite edge to where it effectively &#039;left&#039; the box. Therefore, it&#039;s ending position will be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The number of particles, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; simulated by the computer is usually between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt;. Physically, this is a very small volume. Considering water, we can calculate the number of molecules in 1 mL or 1 cm^3, a volume that would be considered small in the lab. Taking the concentration of water at standard conditions, &amp;lt;math&amp;gt;55\ mol\ dm^{-3}&amp;lt;/math&amp;gt;, we can convert it to the number of moles per mL: &amp;lt;math&amp;gt;0.055\ mol\ mL^{-1}&amp;lt;/math&amp;gt;. Multiplying this value by Avagadro&#039;s constant (&amp;lt;math&amp;gt;N_A&amp;lt;/math&amp;gt;) gives the number of molcules of water per mL: &amp;lt;math&amp;gt;3.02 \times 10^{22}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The reverse procedure can be used to compare this to the volume of 10,000 molecules: 10,000 divided by Avagadro&#039;s constant gives the number of moles of water which 10,000 molecules makes up: &amp;lt;math&amp;gt;1.66 \times 10^{-20}\ moles&amp;lt;/math&amp;gt;. Dividing this value by the concentration (from &amp;lt;math&amp;gt;n=cV&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is the number of moles, &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; is the concentration and &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume), gives the volume: &amp;lt;math&amp;gt;3.02 \times 10^{-22}\ dm&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;3.02 \times 10^{-19}\ mL&amp;lt;/math&amp;gt;. Physically, of course, this is far too small a volume to be recorded in the lab.&lt;br /&gt;
 &lt;br /&gt;
Periodic boundary conditions simulate an infinite lattice and therefore, when computing the potential, will calculate an infinite amount of pair interactions. Therefore, it is only practical to calculate the energies up to a certain interatomic distance; the Lennard-Jones cutoff distance. Beyond this point, the potential energy and the integral of the curve beyond this point become insignificant and do not impact on the overall energy; removing interactions beyond this point from the calculations will not effect the accuracy. Multiplying the Lennard-Jones potential with the radial distribution function gives a plot of the probability of finding an atom at a particular interatomic distance. The larger the interatomic distance, the lower the probability and so the energy after the cutoff can be disregarded. &lt;br /&gt;
&lt;br /&gt;
Integrating over the Lennard-Jones curve and applying this cutoff as the lower limit can show how small the integral is:&lt;br /&gt;
&lt;br /&gt;
For a general cutoff of with value &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;I = \int_{x}^\infty \phi\left(r\right)\mathrm{d}r = \int_{x}^\infty \frac{4\epsilon\sigma^{12}}{r^{12}}\mathrm{d}r - \int_{x}^\infty \frac{4\epsilon\sigma^6}{r^6}\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving this: &amp;lt;math&amp;gt;I = 4\epsilon\sigma^{12} {\frac{-1}{11r^{11}}\,\Bigg\vert\,}_x^\infty - 4\epsilon\sigma^{6} {\frac{-1}{5r^{5}}\,\Bigg\vert\,}_x^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This gives the general solution: &amp;lt;math&amp;gt;I = \frac{4\epsilon\sigma^{12}}{11x^{11}} - \frac{4\epsilon\sigma^{6}}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating this for &amp;lt;math&amp;gt;\epsilon = \sigma = 1&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;I = \frac{4}{11x^{11}} - \frac{4}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt; (or 2 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.025&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt; (or 2.5 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0082&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt; (or 3 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0033&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All values are taken to 2 significant figures. As the cutoff value for the interatomic distance gets larger, the integral gets smaller, and therefore the energy excluded from the calculation becomes smaller, and the second term in the solved integral, &amp;lt;math&amp;gt;I&amp;lt;/math&amp;gt;, dominates the energy value.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
When using the Lennard-Jones potential, it is appropriate to use reduced units for intermolecular distance, energy and temperature. Reduced units can be calculated by the following relationships:&lt;br /&gt;
&lt;br /&gt;
Intermolecular 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;
&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; are scaling factors. For example, if the parameters for Argon are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\sigma = 0.34 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt; \epsilon\ /\ k_B = 120 K&amp;lt;/math&amp;gt;&lt;br /&gt;
* Lennard-Jones cutoff &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;. The well-depth, &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;, is &amp;lt;math&amp;gt;0.999 kJ mol^{-1} \approx 1 kJ mol^{-1}&amp;lt;/math&amp;gt;. The value of &amp;lt;math&amp;gt;T* = 1.5&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;180 K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
The first aim of the simulations is to determine the most appropriate timestep to use in the vert algorithm simulations. This timestep is a balance between the accuracy of the results (the smaller the timestep, the closer to the true functing the result will be) and the length of real time over which the simluation is run (the smaller the timestep, the less real time over which the simulation will give a result). The appropriateness of the timestep will be determined by plotting how the total free energy of the simulated lattice equilibrates over time.  &lt;br /&gt;
&lt;br /&gt;
Five different calculations, which simulated the melting of a crystal and subsequent equilibration of the energy of the melted crystal, were run at five different timesteps; 0.001, 0.0025, 0.0075, 0.01 and 0.015, and were described by the NVE or &#039;&#039;&amp;quot;microcanonical ensemble&amp;quot;&#039;&#039;. An ensemble is a collection of samples of a system which are under three thermodynamic constraints (three properties are kept constant); in the microcanonical ensemble, the number of particles, the volume and the total energy is kept constant (NVE). &lt;br /&gt;
&lt;br /&gt;
These calculations simulate a box of 1000 unit cells and use periodic boundary conditions to replicate the simulation to a larger scale. Because these simulations use the numerical methods defined in the previous section, the initial position and velocity of the atoms must be defined in the input file. The Brownian (uncorrelated, random) motion of the atoms in the simulation means that there is no long range order in the system and so the atoms in a real system would start in random positions. However, assigning random starting coordinates to the atoms in a simulated liquid is not a relative process; the coordinates are generate independently of each other. Therefore there is a probability that the coordinates simulated will cause the atoms to overlap, which would give a very large repulsion potential, as seen in the Lennard-Jones potential at very small interatomic distances. This short-range repulsion potential comes from the hard-sphere model of atomic simulation.&lt;br /&gt;
&lt;br /&gt;
The input file also defines the structure and density of the lattice. The number density of lattice points in any lattice is the number of lattice points per volume of the unit cell. In a simple cubic lattice, there is one lattice point in the unit cell. From an sc lattice with lattice spacing (length of one side of the unit cell) being &amp;lt;math&amp;gt;1.07722&amp;lt;/math&amp;gt;, the number density of the lattice points is calculated by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{1}{1.07722^3} = 0.7999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a face-centered cubic lattice (fcc), there are four lattice points in the unit cell. Rearranging the above relationship, the lattice spacing can be calculated from the number of lattice points in a unit cell and number density, &amp;lt;math&amp;gt;1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Lattice\ spacing = \sqrt[3]{\frac{number\ of\ lattice\ points\ per\ unit\ cell}{number\ density}} = \sqrt[3]{\frac{4}{1.2}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation creates a box which includes 1000 unit cells, which is 10 unit cells in each dimension. For a simple cubic lattice, because there is one lattice point per unit cell, there will be 1000 atoms created as seen in the input file. The &#039;&#039;create_atom&#039;&#039; command in the input file determines how many boxes are created in the simulation and therefore how many atoms will be created. If a face centered cubic lattice is simulated, because there are 4 lattice points per unit cell, 4000 atoms will be created in the &#039;&#039;create_atom&#039;&#039; command. &lt;br /&gt;
&lt;br /&gt;
The input script also contains the following commands which defines the potential surface which is used to model the intermolecular reactions:&lt;br /&gt;
 mass 1 1.0&lt;br /&gt;
This instruction sets the mass type for the atoms being simulated. It takes the general form of “mass I value”, where mass is the keyword which tells LAMMPS what the input is, I is the atom type and value is the mass of the atom. In this case, I is defined by a specific numerical value; 1 as there is only 1 type of atom in the simulation, but it can be defined with an asterisk (1*), which means “all atom types of 1 to n inclusive”. &lt;br /&gt;
 pair_style lj/cut 3.0&lt;br /&gt;
This instruction sets the type of potential which LAMMPS uses in its calculation of pairwise interactions. It takes the general form of “pair_style style args”, where pair_style is the keyword for LAMMPS, style defines the potential and any specifications it may have, and args are the arguments required for this particular potential. In this case, the Lennard-Jones potential has been used (lj) with a cutoff point (cut) of 3σ. The cutoff point is explained in the introduction section. &lt;br /&gt;
 pair_coeff * * 1.0 1.0&lt;br /&gt;
This instruction specifies the coefficients for the pairwise interactions of each pair of atoms, and it takes the general form “pair_coeff I J args”. Pair_coeff is the keyword, I and J are the atom types, and args are the coefficients which the different atoms types take. In this case, the asterisk in place of I and J refers to all atoms types from 1 to n. The coefficients are the pairwise interactions are 1 for each atom, meaning each atom has an equal contribution to the interaction.&lt;br /&gt;
&lt;br /&gt;
In these initial calculations, the initial conditions for the numerical methods, &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. For this experiment, the verit-velocity algorithm would be the most appropriate, as both the starting position and velocity is specified for this algorithm. &lt;br /&gt;
&lt;br /&gt;
To define the timestep for the algorithm the following code is used defining the timestep as a variable instead of just giving it a definite value&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;
It is much easier to use the variable version of defining the timestep because the length of time over which the simulation is run depends on the time step. By using a variable, you can keep the length of the simulation the same, no matter the size of the timestep. It also makes it easier if multiple properties depend on the timestep – only the variable needs to be changed, not all the parts of the script where timestep is defined. &lt;br /&gt;
&lt;br /&gt;
The calculations produce the values for the total energy of the system, temperature and pressure in the output files, which can be plotted against time. How well these values equilibrate determines the appropriateness of the timestep to use in further calculations in the experiment.   &lt;br /&gt;
[[File:Rmt totalenergy plot.png|none|thumb|800x800px|&#039;&#039;Figure h. &#039;&#039;Plot of the equilibration of total energy for five different timesteps]]&lt;br /&gt;
The largest time step to give an acceptable result is 0.01. However, for any simluation we would expect energy to be independent of the timestep, something which is not true at a timestep greater than 0.0025. Therefore, the most appropriate timestep to use for a balance between accuracy and length of time which the simulation covers is 0.0025.  &lt;br /&gt;
&lt;br /&gt;
0.015 is a particularly bad choice of timestep. This is because the verit-velocity algorithm gives an approximate result to the velocity (kinetic energy term) and position (potential energy term), and so when the timestep becomes too large with respect to the time, the algorithm no longer becomes a suitable way to calculate the energy. As seen in the graph of 0.015, the energy does not equilibrate and diverges.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions ==&lt;br /&gt;
The calculations in this section are run in the isobaric-isothermal ensemble, where the number of particles in the system, the pressure and the temperature are kept constant (NpT). This means that the temperature and the pressure are recalculated in every step, so are no longer constant like they were in the NVE ensemble. From the &#039;&#039;equipartition theorem&#039;&#039;, each degree of freedom will contribute &amp;lt;math&amp;gt;\frac{1}{2} k_B T&amp;lt;/math&amp;gt; of energy to the system. As the system is in three dimensions, there are three degrees of translational freedom and so the total internal energy is equal to &amp;lt;math&amp;gt;\frac{3}{2} k_B T&amp;lt;/math&amp;gt;. Equating this to the kinetic energy, &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt;, at the end of every step and rearranging will allow calculation of the temperature after every step. &lt;br /&gt;
&lt;br /&gt;
A target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, is defined in the input script and the system will equilibrate by multiplying the velocity by a factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, in order to accommodate for the fluctuation and keep the system at approximately the target temperature and therefore constant internal energy. If the temperature of the system is greater than the target temperature, the system&#039;s kinetic energy is too high, so &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is reduced to compensate for this. The same is true for is the temperature is lower than the target temperature; &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than one in the next step to increase the kinetic energy which is now too low. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; can be derived from equating the kinetic and internal energy of the system at an arbitrary time step:&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;
Expanding the brackets inside the sum and moving the term containing &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; out of the sum: &amp;lt;math&amp;gt;\frac{\gamma^2}{2}\sum_i m_i \left(v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;, we can replace &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt; on the left hand side of the equation with &amp;lt;math&amp;gt;\frac{3}{2} N k_B T&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;\frac{3\gamma^2}{2}N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Simplifying and rearranging for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, gives: &amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The principle is the same for controlling the pressure.&lt;br /&gt;
&lt;br /&gt;
As temperature and pressure are no longer constant, he input files require specification of the pressure and the temperature for each of the systems run. 10 simulations were run at two different pressures with five different temperatures at each. &lt;br /&gt;
* Temperatures: 1.6, 1.9, 2.2, 2.5, 2.8&lt;br /&gt;
* Pressures: 2.5, 3.0&lt;br /&gt;
These pressures were chosen because the data simulated when choosing an appropriate timestep gave a pressure between 2.5 and 3.0.  &lt;br /&gt;
&lt;br /&gt;
For the code which computes the thermodynamic potentials, this particular line defines how many steps contribute towards the average of the thermodynamic parameters computed in the calculation. &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;
&#039;&#039;fix&#039;&#039; is the keyword, &#039;&#039;aves&#039;&#039; is the name of the group of fixes which in this case is the average of the thermodynamic values, &#039;&#039;all&#039;&#039; specifies the atoms which the fix is applied to which in this case is all the atoms in the simulated system and &#039;&#039;ave/time&#039;&#039; means that compute global time averages are calculated. The following three numbers have the following meaning:&lt;br /&gt;
&lt;br /&gt;
*100 = use the input values every 100 timesteps&lt;br /&gt;
*1000 = use input values 1000 times for calculating the average&lt;br /&gt;
*100000 = calculate the average every 100000 timesteps&lt;br /&gt;
&lt;br /&gt;
Therefore for the total calculation which lasts for 100000 will only have the average calculated once. Assuming 1 value every timestep, there will be 100000/100 values = 1000. The amount of time simulated is 100,000 steps, read from the following line.&lt;br /&gt;
&lt;br /&gt;
The density data from all ten calculation were plotted on the same graph, along with the density for an &amp;quot;ideal&amp;quot; gas. This density can be derived from the ideal gas law:&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;
Rearranging in terms of density: &amp;lt;math&amp;gt;\frac{N}{V} = \frac{P}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As these simulations are being run under reduced units, we can take &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt;, and so the density of the ideal gas becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the density of the ideal gas is plotted as the pressure divided by the temperature in pressure-temperature phase space.&lt;br /&gt;
[[File:Rmt dvt plot.png|none|thumb|800x800px|&#039;&#039;Figure i. &#039;&#039;Plot of the variation in density with temperature at a defined pressure for the numerically simulated and ideal systems]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that calculated in the ideal gas law. This is because for an ideal gas, an assumption is made that there are no intermolecular interactions, and therefore forces such as electron repulsion forces are ignored; repulsion forces dominate over attractive ones, as all the atoms in this simulation are the same and so partial charges or dipoles are created. This will mean that the particles move closer together than a real gas and so the density will be larger. This discrepancy between the ideal and non-ideal systems becomes larger at a higher pressure because with a higher pressure, the atoms in the system are closer together and therefore the intermolecular repulsion will become larger. This greater repulsion will in turn have a larger effect on decreasing the density.&lt;br /&gt;
&lt;br /&gt;
== Statistical Physics Calculations of the Heat Capacity ==&lt;br /&gt;
The heat capacity of a system at constant volume can be calculated from the variance in the total energy of the system. The relationship used to calculate the heat capacity is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = 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;\left\langle E^2\right\rangle&amp;lt;/math&amp;gt; is the continuous average of the total square energy at each temperature as a function of temperature. &amp;lt;math&amp;gt;\left\langle E\right\rangle^2&amp;lt;/math&amp;gt; is the continuous average of the total energy at each temperature as a function of temperature squared. The heat capacity is multiplied by &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; in this case because the version of LAMMPS calculates every energy divided by the number of molecules in the system simulated.&lt;br /&gt;
&lt;br /&gt;
The calculations in this sections are run in density-temperature phase space and the ensemble has changed to the canonical ensemble (NVT). A set of input files were written for ten calculations for, like the previous section, two pressures and five different temperatures at each pressure:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 0.2, 0.8&lt;br /&gt;
*Temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{C_V}{V}&amp;lt;/math&amp;gt; was plotted against temperature to determine the relationship in density-temperature phase space. An example of an input file can be found [[Media:nvt_-_0220.in|here]]. The lines which have been changed from the previous input files are at the end of the script:&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 &lt;br /&gt;
 thermo_style custom step etotal temp&lt;br /&gt;
 variable energy equal etotal&lt;br /&gt;
 variable energy2 equal etotal*etotal&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_energy v_energy2 v_temp&lt;br /&gt;
 run 100000&lt;br /&gt;
 &lt;br /&gt;
 variable aveenergy equal f_aves[1]&lt;br /&gt;
 variable aveenergy2 equal f_aves[2]&lt;br /&gt;
 variable avetemp equal f_aves[3]&lt;br /&gt;
 variable heatcapacitydv equal atoms*atoms*(v_aveenergy2-v_aveenergy*v_aveenergy)/(v_avetemp*v_avetemp*vol)&lt;br /&gt;
 &lt;br /&gt;
 print &amp;quot;Averages&amp;quot;&lt;br /&gt;
 print &amp;quot;--------&amp;quot;&lt;br /&gt;
 print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Heat Capacity per Volume: ${heatcapacitydv}&amp;quot;&lt;br /&gt;
The line with the keyword &#039;fix&#039; determines which thermodynamic values are averaged and over how many steps they are averaged. The next section takes these averages as variables and uses them to define the heat capacity which is calculated from the equation at the beginning of this section. Only the energy and temperature are needed to define the heat capacity and so only these values are calculated by the simulation. [[File:Rmt heatcapacitybyv.png|none|thumb|800x800px|&#039;&#039;Figure j. &#039;&#039;C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V against temperature for the two different pressures 0.2 and 0.8]]As seen in the above figure, the heat capacity decreases with temperature for both pressures. It would be expected for an ideal system that as the temperature increases, the heat capacity at constant volume increases and tends to a constant volume at very high T of 3R; R = the universal gas constant. This means increasing the temperature increases the amount of energy being stored in the system and this energy is stored as vibrational energy. However, for a Lennard-Jones liquid, the system being simulated here, the heat capacity decreases with temperature. This is because the simulation has two components to the simulation; the atoms are vibrating in a quasi-harmonic fashion around the equilibrium position and also diffuse between neighbouring equilibrium positions in a gas like fashion. As the temperature increases, the amount of diffusion increases and the vibrations decreases, therefore decreasing the ability of the system to absorb vibrational energy, resulting in the decrease in heat capacity. &amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www.nature.com/ncomms/2013/130816/ncomms3331/full/ncomms3331.html?message-global=remove&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural Properties and the Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a single atom in a system is a plot of the probability that an atom can be found at a certain distance from the central atom. The peaks in this plot can give the distance of an atom from its nearest neighbours in the Lennard-Jones simulated system. &lt;br /&gt;
&lt;br /&gt;
The calculations in this section simulate a Lennard-Jones solid, liquid and gas and, using the output of the LAMMPS trajectory file, plots both the radial distribution function and its integral using DLV. The temperature and pressure parameters for these calculations were taken from the phase diagram or coexistence curve for a Lennard-Jones system.&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt; The parameters used are displayed in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! Temperature, &amp;lt;math&amp;gt;T^*&amp;lt;/math&amp;gt;&lt;br /&gt;
! Pressure, &amp;lt;math&amp;gt;p^*&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| LJ Solid&lt;br /&gt;
| 1.5&lt;br /&gt;
| 1.2&lt;br /&gt;
|-&lt;br /&gt;
| LJ Liquid&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.8&lt;br /&gt;
|-&lt;br /&gt;
| LJ Gas&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.01&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The data obtained from the plots and the radial distribution functions and their integrals were plotted and shown in the table below.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure k. &#039;&#039;The radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
!&#039;&#039;Figure l. &#039;&#039;The integrals of the radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt fullrdfs.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt allintegralsrdf.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
[[File:Rmt Nearest neighbours.png|left|thumb|300x300px|&#039;&#039;Figure m. &#039;&#039;Representation of a cross section of the first three shells of nearest neighbours in an fcc solid. The black atom is the central atom being considered, the blue atoms are the first shell, the orange atoms the second shell and the purple atoms are the third.]]&lt;br /&gt;
The RDF of the solid gives a very irregular curve because of the irregular structure of the lattice. For a simple cubic lattice, a regular structure of the RDF would be expected because of the equal number of atoms in each of the nearest neighbour shells of the atoms. However, for face-centered cubic, the solid in this simulation, the structure is much more irregular and as the atoms move from their equilibrium position in the lattice due to vibrations, the peaks in the radial distribution will broaden. The irregular heights of the peaks are due to the varying numbers of atoms in each of the nearest neighbour shells for the central atom. The first shell gives the highest peak as it contains the most atoms; in total, considering all four surrounding unit cells, this shell contains 12 atoms and ideally takes the geometry of an icosahedron. The second shell is smaller and contains only 6 atoms in an octahedral coordination shape. The following shell again contributes 12 atoms, 3 from each unit cell. This therefore explains why the heights of the peaks in the solid plot in &#039;&#039;figure k.&#039;&#039; vary. These values can be confirmed by the plot in &#039;&#039;figure o.&#039;&#039; which is the integral; it cumulatively adds the numbers in each shell. The size of the first &amp;quot;step&amp;quot; is 12; there are 12 atoms in the first shell. The size of the second step is approximately 18; there are 18-12=6 steps in the second shell. The same theory applies for the third shell which gives a value of 13. This is slightly different to the predicted value possibly due to error in the calculation of the radial distribution function and therefore its integral. &lt;br /&gt;
&lt;br /&gt;
The RDF of the liquid has a representation of far fewer shells, which means that there are less atoms in the space close to a &amp;quot;central&amp;quot; atom in the bulk solution. The particles have more energy and therefore do not keep to a regular lattice structure. As they move about, some regualrity is maintained around each atom, but only to the extend of two or three shells, meaning there is no long range order in a Lennard-Jones liquid. &lt;br /&gt;
&lt;br /&gt;
The RDF of the gas again omits more shells as there is almost no order in a Lennard-Jones gas. The single peak on this plot considers only the set of atoms closest to the central atom and all others are disregarded as they are too far apart. &lt;br /&gt;
&lt;br /&gt;
Considering &#039;&#039;figure l.&#039;&#039;, the size of the integral of the radial distribution function decreases from solid to liquid to gas. This makes sense as the number of atoms in the surrounding shells decreases with density of the system; the atoms become further apart. &lt;br /&gt;
&lt;br /&gt;
From the plot of the radial distribution function of the solid, the lattice spacing can be determined. For this, we can consider just the first three peaks of the RDF plot. The lattice spacing refers to the length of one unit cell, and so, using &#039;&#039;figure m&#039;&#039;, we can calculate this using two different methods; a) we can use the distance between the central atom and the first shell of nearest neighbours, and use trigonometry to calculate the lattice spacing. Or alternatively b) we can use the distance between the central atom and the second nearest neighbour shell to get the lattice spacing.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure n. &#039;&#039;The radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
!&#039;&#039;Figure o. &#039;&#039;The integral of the radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt solidgr3.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt solidint3.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
Using method a) (with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; as the distance between the central atom and the nearest neighbour: Lattice spacing = &amp;lt;math&amp;gt;\frac{r}{cos({\frac{\pi}{4}})} = \frac{1.02}{cos({\frac{\pi}{4}})} \approx 1.44&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using method b): Lattice spacing &amp;lt;math&amp;gt;\approx 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can take an average between the two get an approximate value for the lattice spacing: &amp;lt;math&amp;gt;1.46 \plusmn 0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These values for distance are all in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
The ability of atoms to move around in a solid liquid or gas can be characterised by the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. In this section, we will explore two different ways to calculate the diffusion coefficient and compare the results. &lt;br /&gt;
&lt;br /&gt;
=== The Mean Squared Displacement ===&lt;br /&gt;
The diffusion coefficient can be measured easily be calculating the mean squared displacement of atoms in the solution; the diffusion coefficient is proportional to the first derivative of the mean squared displacement. By plotting the mean squared displacement as a function of time, the gradient can be taken to calculate the diffusion coefficient when its has equilibrated and become linear.&lt;br /&gt;
&lt;br /&gt;
The temperature and density parameters used were the same as in the previous section:&lt;br /&gt;
* Solid: T=1.5, D=1.2&lt;br /&gt;
* Liquid: T=1.1, D=0.8&lt;br /&gt;
* Gas: T=1.1, D=0.01&lt;br /&gt;
&lt;br /&gt;
Mean density squared calculations were run for all three Lennard-Jones phases and the data plotted as function of timestep below. The data from a simulation containing 1,000,000 atoms was plotted for comparision.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!Plots for the 8,000 atom data (&#039;&#039;figures p-r)&#039;&#039;&lt;br /&gt;
!Plots for the 1,000,000 atom data (&#039;&#039;figures s-u)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|[[File:Rmt_MSDsolid.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt_MAsolid.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|[[File:Rmt MSDliquid.png|700x700px]]&lt;br /&gt;
|[[File:Rmt MAliquid.png|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|[[File:Rmt MSDgas.png|700x700px]]&lt;br /&gt;
|[[File:Rmt dataplots 25894 image001.png|700x700px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The exact relationship between the mean squared displacement and the diffusion coefficient is:&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;
Taking the gradients of each of the curves at the point at which they become linear and dividing by six will give the diffusion coefficient for each set of data. The gradient also needs to be converted to a function of time; this is done by dividing by the timestep, which in this case is 0.002:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom data diffusion coefficients, &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
!1,000,000 atom data diffusion coefficients &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 0.9999&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|Gradient = 0.0972&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{48.6}{6} = \mathbf{8.1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient = 0.0386&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{19.6}{6} = \mathbf{3.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For both of the solid approximations, the diffusion coefficient can be approximated as zero. This is because, when equilibrated, the function has a constant value of around 0.2 for the mean squared displacement. A gradient with a value of zero means that the atoms take an infinite amount of time to change their mean squared displacement; to move away from their equilibrium position, and so this means that we can approximate in this system, there will be no diffusion. In real system, however, this is not the case; diffusion occurs but it is very slow. A plot for a real system will give a very shallow positive gradient.&lt;br /&gt;
&lt;br /&gt;
The liquid approximations are very well correlated. This is because in both cases, the mean squared displacement of particles in a liquid increases linearly with time and the gradient of both plots are almost identical. We can assume from this that identical starting conditions were used to calculate this data. Also, we can estimate that 8,000 atoms is a large enough simulation to give an accurate result for the diffusion coefficient for the Lennard-Jones liquid.&lt;br /&gt;
&lt;br /&gt;
The gas approximations are very different. This is most probably due to the fact that the density specified in calculations are different. The 8,000 data can be estimated to be a much lower density because the diffusion coefficient is faster and this means diffusion will happen faster; at a higher density a particle will take longer to diffuse over a given distance. Because of the difference in density, the two values of the diffusion coefficient cannot be qualitatively compared. The reason for the initial deviation for linearity in the gas plots is due to the momentum of the particles initially dominating over the diffusion and the diffusion coefficient is dependent on time. As the system equilibrates, the diffusion coefficient becomes constant and the plots become linear.&lt;br /&gt;
&lt;br /&gt;
=== The Velocity Autocorrelation Function ===&lt;br /&gt;
&lt;br /&gt;
Another way to calculate the diffusion coefficient is by using the velocity correlation function, which determines how the velocity of an atom changes with time. The function determines the difference in time (&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;) when the velocity becomes uncorrelated, i.e. the difference between the velocity at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; and at time &amp;lt;math&amp;gt;t+\tau&amp;lt;/math&amp;gt;. By integrating over this function, we can find the diffusion coefficient. &lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function: &amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can also be written as the integral: &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;
Using the function which defines the position of a classical harmonic oscillator, we can differentiate this to give the equation for the velocity which we can plug into the integral:&lt;br /&gt;
&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;
&amp;lt;math&amp;gt;dv{x(t)}{t} = v(t) = -A\omega sin(\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also needed for the integral:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t+\tau) = -A\omega sin(\omega(t+\tau)+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v^2(t) = A^2\omega^2 sin^2(\omega t +\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Putting all this into the integral to find the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega sin(\omega t + \phi) \times A\omega sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} A^2\omega^2 sin^2(\omega t +\tau)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A^2\omega^2&amp;lt;/math&amp;gt; can be take out of each of the integrals and cancelled. A substituion can then be made to make solving the integral much simpler:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = \omega t + \phi&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \omega\tau&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the integral becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a) \times sin(a+b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the compound angle rule &amp;lt;math&amp;gt;sin(a+b)=sin(a)cos(b)+cos(a)sin(b)&amp;lt;/math&amp;gt;, the integral can be simplified to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a)sin(a)cos(b) + sin(a)cos(a)sin(b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Separating out into two integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)\frac{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the rule &amp;lt;math&amp;gt;sin(a)cos(a) = \frac{1}{2}sin(2a)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} \frac{1}{2}(sin(2a))\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because the function &amp;lt;math&amp;gt;\frac{1}{2}sin(2a)&amp;lt;/math&amp;gt; is symmetric over all space, the second term in this equation becomes zero. Therefore, the integral simplifies to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b) = cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same calculations from the mean squared displacement section gave an output of the velocity autocorrelation function. The function for the Lennard-Jones solid, liquid and gas were plotted against the timestep along with the approximate function for the velocity autocorrelation function, &amp;lt;math&amp;gt;cos(\omega\tau)&amp;lt;/math&amp;gt;, where \omega = \frac{1}{2\pi}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure v. &#039;&#039;Plots for the velocity autocorrelation function of a Lennard-Jones solid, liquid and gas; 8,000 atoms&lt;br /&gt;
!&#039;&#039;Figure w. &#039;&#039;Plots for the velocity autocorrelation function of a Lennard-Jones solid, liquid and gas, 1,000,000 atoms&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt VACF 5721 image001.png|800x800px|]]&lt;br /&gt;
|[[File:Rmt MAVACF.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
The diffusion coefficient is calculated from: &amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty C\left(\tau\right)\mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the approximate value for the diffusion coefficient using the velocity autocorrelation function is &amp;lt;math&amp;gt;D = \frac{1}{3}cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The running integral of the velocity autocorrelation functions was plotted using the &#039;&#039;trapesium rule&#039;&#039;, and so the final value on the integral plot is proportional to the diffusion coefficient.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom VACF integral &#039;&#039;(figures w-z)&#039;&#039;&lt;br /&gt;
!1,000,000 VACF integral (&#039;&#039;figures aa-cc)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|[[File:Rmt mysi.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt masi.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|[[File:Rmt myli.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt mali.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|[[File:Rmt mygi.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt ligi.png|frameless|700x700px]]&lt;br /&gt;
|}&lt;br /&gt;
The diffusion coefficients for each of the plots above are tabulated below using the final data point from the integral plot. This is the integral over the whole graph using the trapesium rule. This must be corrected for the timestep; the value is multiplied by 0.002. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom data diffusion coefficients, &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
!1,000,000 atom data diffusion coefficients &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;-0.00055&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{-0.00055}{6} = -0.00018 \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.00014&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.00014}{6} = 0.000046 \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.242&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.242}{6} = \mathbf{0.0807}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.270&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.270}{6} = \mathbf{0.0901}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;25.6&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{25.6}{6} = \mathbf{8.55}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;9.81&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{9.81}{6} = \mathbf{3.27}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=541510</id>
		<title>Rep:Mod:hakunamatata</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=541510"/>
		<updated>2016-02-25T13:54:00Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: /* The Velocity Autocorrelation Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Introduction to Molecular Dynamics Simulations ==&lt;br /&gt;
===The Classical Particle Approximation and Numerical Integration===&lt;br /&gt;
The verit and verit-velocity algorithms are numerical methods to approximate the average position and velocity respectively of randomly moving atoms in a particular medium (solid, liquid, fliud etc.). This position and velocity can be applied to Newtonian mechanics to calculate such properties as the force and potential energy of the system. The algorithms work by splitting the function into discrete time steps, calculating the values of position and velocity at this particular time step, and then effectively &amp;quot;joining the dots&amp;quot; to create an approximate function. These simulations always use the answer from the previous timestep to compute the new timestep, so initial conditions must be given for the first step. Both of the algorithms are shown below and are derived from the Taylor expansion of the position or velocity of the atoms at the timestep &amp;quot;n+1&amp;quot; or &amp;lt;math&amp;gt;t+\delta t&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit Algorithum:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{x}_i\left(t + \delta t\right) \approx 2\mathbf{x}_i\left(t\right) - \mathbf{x}_i\left(t - \delta t\right) + \frac{\mathbf{F}_i\left(t\right)}{m_i}\delta t^2  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit-Velocity Algorithum:&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i\left(t\right)&amp;lt;/math&amp;gt; is the force acting on a particular atom as a function of time&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i&amp;lt;/math&amp;gt; is the acceleration &lt;br /&gt;
&lt;br /&gt;
The smaller the timestep, the closer the numerical approximation is to the true solution function, which can be modeled as a classical harmonic oscillator. &#039;&#039;Figure a.&#039;&#039; in the table below shows the comparison between the two methods in &#039;&#039;time&#039;&#039; space. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure a. &#039;&#039;Plots of position vs time comparing the verit algorithm and harmonic spring results&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure b. &#039;&#039;Plot of the total classical energy of the system (potential + kinetic)&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory xanalytical.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory energy.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The harmonic spring position values are modeled from the harmonic oscillator or particle on a spring. The equation of &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; was used to calculate these values, where &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; are 1 and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; is zero. As seen on the plot, the curves produced from the two different methods of calculating the position are in good agreement.&lt;br /&gt;
|The potential energy is calculated using the equation U = 1/2 kx^2, with a value of k given as 1. The kinetic energy is calculated using the velcity from the verit-velocity algorithm using the equation T = 1/2 mv^2, with a value of m given as 1. The total energy of the system, E, is equal to T + U. The values for x (potential energy) and v (kinetic energy) are taken from the verity algorithm and verit-velocity algorthim respectively. &lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;Figure c. &#039;&#039;Plot of the difference (error) between the harmonic spring and verit algorithm data&lt;br /&gt;
!&#039;&#039;Figure d. &#039;&#039;Plot of the peaks in the error plot in &#039;&#039;figure c.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory error.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory errorpeaks.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The peaks in the error between the harmonic spring and verit algorithm results are at the place where the position curve crosses the time axis. This is because the harmonic spring data (x(t)) has a slightly shorter wave period than that of the verit velocity algorithm, and therefore the difference will get larger with each period of the wave, shown by the error getting larger in &#039;&#039;figure c. &#039;&#039;The period of the plot of the two methods are different because the verit algorithm is much more approximate so does not give the correct solution.&lt;br /&gt;
|The change in the error/difference between the harmonic spring data and verit algorthm data increases linearly and so therefore period of each of the plots in &#039;&#039;figure 1&#039;&#039;. must be constant. &lt;br /&gt;
|}&lt;br /&gt;
The error can also be quantified on a &#039;&#039;phase space&#039;&#039; plot; phase space is momentum or velocity plotted as a function of position. The true solution for motion of an atom is a perfect ellipse, and the more elliptic the shape (less circular) the more momentum or velocity is in the system. A numerical solution, like the verit algorithms, will produce a set of points very close to this ellipse but not perfectly following the curve. A good numerical solution will remain in an elliptical shape, whereas a bad numerical solution, for example one with a large timestep, will spiral away from the true solution. Two examples of such systems using the data from &#039;&#039;figures a-d&#039;&#039; are shown below.  &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure e. &#039;&#039;Phase plot of the harmonic spring data with a good numerical solution (timestep = 0.1) &lt;br /&gt;
!&#039;&#039;Figure f. &#039;&#039;Phase plot of the harmonic spring data with a bad numerical solution (timestep = 0.3) &lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory phasegood.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory badphase.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The timestep at which this data is plotted is 0.1, which results in a very small change in the energy, as seen in &#039;&#039;figure b. &#039;&#039;Increasing the time step will increase the variation in the energy. To keep the variation in the total energy of the system under 1%, the time step must be no larger than approximately 0.28. The energy varies more with increasing time step because the jumps in the algorithm  are getting larger due to less data points. The algorithm assumes these points are joined by a straight line; that the halfway point in the jump is the average between the starting and finishing point of the jump. The phase space plot will become less elliptic and the jumps eventually become so larger that the plot is no longer a continuous shape.  &lt;br /&gt;
&lt;br /&gt;
It is essential to monitor the energy of a numerically modeled system because a good solution for the motion of an atom has a constant energy and a plot in phase space of a perfect ellipse.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance and Force at Zero Potential===&lt;br /&gt;
From classical mechanics, the force calculated from the Newtonian mechanics above can be used to calculate the potential experienced by an atom in the system. They are related by the equation: &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;
This potential gives the shape and dimension of the potential surface on which the system can be modeled. A simple 1D potential that is used to describe the inter atomic forces of a liquid is the Lennard-Jones potential. It has the characteristic features of a short range repulsion potential and harmonic character around the equilibrium bond distance. The value of &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the inter atomic separation when the potential, &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;, is equal to zero, can be calculated by equating the equation for the Lennard-Jones potential to zero and solving for &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The equation for the Lennard-Jones potential: &amp;lt;math&amp;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;
Equating this to zero: &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;
And rearranging in order to separate the variables: &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;
Rearranging this gives &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in terms of &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt; r^6 = \sigma^6&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r = r_0&amp;lt;/math&amp;gt; in this case.&lt;br /&gt;
&lt;br /&gt;
This, therefore, gives the result that interatomic distance at zero potential, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, is equal to &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; in the Lennard-Jones potential is effectively the diameter of one of the particles in the system being measured; in this case, the liquid we are simulating. This is the point where the potential curve crosses the x-axis on an Energy vs interatomic distance plot. The force, &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt;, at this point on the curve corresponds to the gradient; it is found by calculating the derivative of the curve at this point. &lt;br /&gt;
&lt;br /&gt;
To calculate the force, we must differentiate the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As force is equal to the negative differential of the potential energy, the value of the force is: &amp;lt;math&amp;gt;\mathbf{F}_i = 48\epsilon \sigma^{12} r^{-13} - 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting in the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at zero potential from the calculation before: &amp;lt;math&amp;gt;\mathbf{F}_i = \frac{48\epsilon}{\sigma} - \frac{24\epsilon}{\sigma} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The gradient where the Lennard-Jones plot crosses the axis is negative; &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; in the term obtained for &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is negative and therefore the overall value of the force will be negative.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance, Force and Well Depth of the Potential at Equilibrium===&lt;br /&gt;
To calculate the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at the equilibrium position, we need to use the derivative of the potential energy curve. The equilibrium value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is the value at the minimum of the Lennard-Jones curve; when &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Therefore, equating the derivative to zero gives: &amp;lt;math&amp;gt;0 = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rearranging this: &amp;lt;math&amp;gt;48\epsilon \sigma^{12} r^{-13} = 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And simplifying and cancelling gives: &amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6&amp;lt;/math&amp;gt;. Therefore the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at equilibrium is: &amp;lt;math&amp;gt;r_{eq} = \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Physically, this result means that the equilibrium distance is 1.12 times the diameter of one of the particles; the particles have a small gap between them so do not touch. A short range repulsion potential, as seen in the Lennard-Jones curve, is a result of the particles coming into contact. &lt;br /&gt;
&lt;br /&gt;
Again, the force can be calculated from the derivative of the potential curve at the equilibrium point. As the derivative at this point is zero (a minimum on the curve), the force will therefore also be zero.&lt;br /&gt;
&lt;br /&gt;
The well-depth of the potential curve is the difference between zero potential and the potential at the equilibrium bond length. This can be calculated by substituting the value for the equilibrium bond length into the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 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;
Cancelling and simplifying this equation gives: &amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \times \frac{1}{4}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the absolute value for the well depth is &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;. The actual value of this potential is &amp;lt;math&amp;gt;-\epsilon&amp;lt;/math&amp;gt;, as the equilibrium bond length gives the most stable configuration of the molecules and therefore suggests attractive interactions are involved in the arrangement of the molecules; this attractive potential means its negative. &lt;br /&gt;
&lt;br /&gt;
===Boundary Conditions and the Lennard-Jones Cutoff===&lt;br /&gt;
When simulating a liquid, it is computationally impractical to simulate a realistic liquid. Therefore a smaller &#039;box&#039; containing &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; particles is simulated and the computer program will use &#039;&#039;periodic boundary conditions&#039;&#039; to simulate infinite repetitions of this box; when the atom reaches one edge of the box, in periodic boundary conditions, it will reappear again at the opposite edge of the box as if they were connected. For example, an atom at the position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a box of size &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;. Without periodic boundary conditions, we would assume that the atom would end up at the position &amp;lt;math&amp;gt;(1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;. However, in this box, there is no such position and so the particle must reappear at the opposite edge to where it effectively &#039;left&#039; the box. Therefore, it&#039;s ending position will be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The number of particles, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; simulated by the computer is usually between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt;. Physically, this is a very small volume. Considering water, we can calculate the number of molecules in 1 mL or 1 cm^3, a volume that would be considered small in the lab. Taking the concentration of water at standard conditions, &amp;lt;math&amp;gt;55\ mol\ dm^{-3}&amp;lt;/math&amp;gt;, we can convert it to the number of moles per mL: &amp;lt;math&amp;gt;0.055\ mol\ mL^{-1}&amp;lt;/math&amp;gt;. Multiplying this value by Avagadro&#039;s constant (&amp;lt;math&amp;gt;N_A&amp;lt;/math&amp;gt;) gives the number of molcules of water per mL: &amp;lt;math&amp;gt;3.02 \times 10^{22}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The reverse procedure can be used to compare this to the volume of 10,000 molecules: 10,000 divided by Avagadro&#039;s constant gives the number of moles of water which 10,000 molecules makes up: &amp;lt;math&amp;gt;1.66 \times 10^{-20}\ moles&amp;lt;/math&amp;gt;. Dividing this value by the concentration (from &amp;lt;math&amp;gt;n=cV&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is the number of moles, &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; is the concentration and &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume), gives the volume: &amp;lt;math&amp;gt;3.02 \times 10^{-22}\ dm&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;3.02 \times 10^{-19}\ mL&amp;lt;/math&amp;gt;. Physically, of course, this is far too small a volume to be recorded in the lab.&lt;br /&gt;
 &lt;br /&gt;
Periodic boundary conditions simulate an infinite lattice and therefore, when computing the potential, will calculate an infinite amount of pair interactions. Therefore, it is only practical to calculate the energies up to a certain interatomic distance; the Lennard-Jones cutoff distance. Beyond this point, the potential energy and the integral of the curve beyond this point become insignificant and do not impact on the overall energy; removing interactions beyond this point from the calculations will not effect the accuracy. Multiplying the Lennard-Jones potential with the radial distribution function gives a plot of the probability of finding an atom at a particular interatomic distance. The larger the interatomic distance, the lower the probability and so the energy after the cutoff can be disregarded. &lt;br /&gt;
&lt;br /&gt;
Integrating over the Lennard-Jones curve and applying this cutoff as the lower limit can show how small the integral is:&lt;br /&gt;
&lt;br /&gt;
For a general cutoff of with value &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;I = \int_{x}^\infty \phi\left(r\right)\mathrm{d}r = \int_{x}^\infty \frac{4\epsilon\sigma^{12}}{r^{12}}\mathrm{d}r - \int_{x}^\infty \frac{4\epsilon\sigma^6}{r^6}\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving this: &amp;lt;math&amp;gt;I = 4\epsilon\sigma^{12} {\frac{-1}{11r^{11}}\,\Bigg\vert\,}_x^\infty - 4\epsilon\sigma^{6} {\frac{-1}{5r^{5}}\,\Bigg\vert\,}_x^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This gives the general solution: &amp;lt;math&amp;gt;I = \frac{4\epsilon\sigma^{12}}{11x^{11}} - \frac{4\epsilon\sigma^{6}}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating this for &amp;lt;math&amp;gt;\epsilon = \sigma = 1&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;I = \frac{4}{11x^{11}} - \frac{4}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt; (or 2 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.025&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt; (or 2.5 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0082&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt; (or 3 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0033&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All values are taken to 2 significant figures. As the cutoff value for the interatomic distance gets larger, the integral gets smaller, and therefore the energy excluded from the calculation becomes smaller, and the second term in the solved integral, &amp;lt;math&amp;gt;I&amp;lt;/math&amp;gt;, dominates the energy value.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
When using the Lennard-Jones potential, it is appropriate to use reduced units for intermolecular distance, energy and temperature. Reduced units can be calculated by the following relationships:&lt;br /&gt;
&lt;br /&gt;
Intermolecular 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;
&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; are scaling factors. For example, if the parameters for Argon are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\sigma = 0.34 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt; \epsilon\ /\ k_B = 120 K&amp;lt;/math&amp;gt;&lt;br /&gt;
* Lennard-Jones cutoff &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;. The well-depth, &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;, is &amp;lt;math&amp;gt;0.999 kJ mol^{-1} \approx 1 kJ mol^{-1}&amp;lt;/math&amp;gt;. The value of &amp;lt;math&amp;gt;T* = 1.5&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;180 K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
The first aim of the simulations is to determine the most appropriate timestep to use in the vert algorithm simulations. This timestep is a balance between the accuracy of the results (the smaller the timestep, the closer to the true functing the result will be) and the length of real time over which the simluation is run (the smaller the timestep, the less real time over which the simulation will give a result). The appropriateness of the timestep will be determined by plotting how the total free energy of the simulated lattice equilibrates over time.  &lt;br /&gt;
&lt;br /&gt;
Five different calculations, which simulated the melting of a crystal and subsequent equilibration of the energy of the melted crystal, were run at five different timesteps; 0.001, 0.0025, 0.0075, 0.01 and 0.015, and were described by the NVE or &#039;&#039;&amp;quot;microcanonical ensemble&amp;quot;&#039;&#039;. An ensemble is a collection of samples of a system which are under three thermodynamic constraints (three properties are kept constant); in the microcanonical ensemble, the number of particles, the volume and the total energy is kept constant (NVE). &lt;br /&gt;
&lt;br /&gt;
These calculations simulate a box of 1000 unit cells and use periodic boundary conditions to replicate the simulation to a larger scale. Because these simulations use the numerical methods defined in the previous section, the initial position and velocity of the atoms must be defined in the input file. The Brownian (uncorrelated, random) motion of the atoms in the simulation means that there is no long range order in the system and so the atoms in a real system would start in random positions. However, assigning random starting coordinates to the atoms in a simulated liquid is not a relative process; the coordinates are generate independently of each other. Therefore there is a probability that the coordinates simulated will cause the atoms to overlap, which would give a very large repulsion potential, as seen in the Lennard-Jones potential at very small interatomic distances. This short-range repulsion potential comes from the hard-sphere model of atomic simulation.&lt;br /&gt;
&lt;br /&gt;
The input file also defines the structure and density of the lattice. The number density of lattice points in any lattice is the number of lattice points per volume of the unit cell. In a simple cubic lattice, there is one lattice point in the unit cell. From an sc lattice with lattice spacing (length of one side of the unit cell) being &amp;lt;math&amp;gt;1.07722&amp;lt;/math&amp;gt;, the number density of the lattice points is calculated by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{1}{1.07722^3} = 0.7999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a face-centered cubic lattice (fcc), there are four lattice points in the unit cell. Rearranging the above relationship, the lattice spacing can be calculated from the number of lattice points in a unit cell and number density, &amp;lt;math&amp;gt;1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Lattice\ spacing = \sqrt[3]{\frac{number\ of\ lattice\ points\ per\ unit\ cell}{number\ density}} = \sqrt[3]{\frac{4}{1.2}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation creates a box which includes 1000 unit cells, which is 10 unit cells in each dimension. For a simple cubic lattice, because there is one lattice point per unit cell, there will be 1000 atoms created as seen in the input file. The &#039;&#039;create_atom&#039;&#039; command in the input file determines how many boxes are created in the simulation and therefore how many atoms will be created. If a face centered cubic lattice is simulated, because there are 4 lattice points per unit cell, 4000 atoms will be created in the &#039;&#039;create_atom&#039;&#039; command. &lt;br /&gt;
&lt;br /&gt;
The input script also contains the following commands which defines the potential surface which is used to model the intermolecular reactions:&lt;br /&gt;
 mass 1 1.0&lt;br /&gt;
This instruction sets the mass type for the atoms being simulated. It takes the general form of “mass I value”, where mass is the keyword which tells LAMMPS what the input is, I is the atom type and value is the mass of the atom. In this case, I is defined by a specific numerical value; 1 as there is only 1 type of atom in the simulation, but it can be defined with an asterisk (1*), which means “all atom types of 1 to n inclusive”. &lt;br /&gt;
 pair_style lj/cut 3.0&lt;br /&gt;
This instruction sets the type of potential which LAMMPS uses in its calculation of pairwise interactions. It takes the general form of “pair_style style args”, where pair_style is the keyword for LAMMPS, style defines the potential and any specifications it may have, and args are the arguments required for this particular potential. In this case, the Lennard-Jones potential has been used (lj) with a cutoff point (cut) of 3σ. The cutoff point is explained in the introduction section. &lt;br /&gt;
 pair_coeff * * 1.0 1.0&lt;br /&gt;
This instruction specifies the coefficients for the pairwise interactions of each pair of atoms, and it takes the general form “pair_coeff I J args”. Pair_coeff is the keyword, I and J are the atom types, and args are the coefficients which the different atoms types take. In this case, the asterisk in place of I and J refers to all atoms types from 1 to n. The coefficients are the pairwise interactions are 1 for each atom, meaning each atom has an equal contribution to the interaction.&lt;br /&gt;
&lt;br /&gt;
In these initial calculations, the initial conditions for the numerical methods, &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. For this experiment, the verit-velocity algorithm would be the most appropriate, as both the starting position and velocity is specified for this algorithm. &lt;br /&gt;
&lt;br /&gt;
To define the timestep for the algorithm the following code is used defining the timestep as a variable instead of just giving it a definite value&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;
It is much easier to use the variable version of defining the timestep because the length of time over which the simulation is run depends on the time step. By using a variable, you can keep the length of the simulation the same, no matter the size of the timestep. It also makes it easier if multiple properties depend on the timestep – only the variable needs to be changed, not all the parts of the script where timestep is defined. &lt;br /&gt;
&lt;br /&gt;
The calculations produce the values for the total energy of the system, temperature and pressure in the output files, which can be plotted against time. How well these values equilibrate determines the appropriateness of the timestep to use in further calculations in the experiment.   &lt;br /&gt;
[[File:Rmt totalenergy plot.png|none|thumb|800x800px|&#039;&#039;Figure h. &#039;&#039;Plot of the equilibration of total energy for five different timesteps]]&lt;br /&gt;
The largest time step to give an acceptable result is 0.01. However, for any simluation we would expect energy to be independent of the timestep, something which is not true at a timestep greater than 0.0025. Therefore, the most appropriate timestep to use for a balance between accuracy and length of time which the simulation covers is 0.0025.  &lt;br /&gt;
&lt;br /&gt;
0.015 is a particularly bad choice of timestep. This is because the verit-velocity algorithm gives an approximate result to the velocity (kinetic energy term) and position (potential energy term), and so when the timestep becomes too large with respect to the time, the algorithm no longer becomes a suitable way to calculate the energy. As seen in the graph of 0.015, the energy does not equilibrate and diverges.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions ==&lt;br /&gt;
The calculations in this section are run in the isobaric-isothermal ensemble, where the number of particles in the system, the pressure and the temperature are kept constant (NpT). This means that the temperature and the pressure are recalculated in every step, so are no longer constant like they were in the NVE ensemble. From the &#039;&#039;equipartition theorem&#039;&#039;, each degree of freedom will contribute &amp;lt;math&amp;gt;\frac{1}{2} k_B T&amp;lt;/math&amp;gt; of energy to the system. As the system is in three dimensions, there are three degrees of translational freedom and so the total internal energy is equal to &amp;lt;math&amp;gt;\frac{3}{2} k_B T&amp;lt;/math&amp;gt;. Equating this to the kinetic energy, &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt;, at the end of every step and rearranging will allow calculation of the temperature after every step. &lt;br /&gt;
&lt;br /&gt;
A target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, is defined in the input script and the system will equilibrate by multiplying the velocity by a factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, in order to accommodate for the fluctuation and keep the system at approximately the target temperature and therefore constant internal energy. If the temperature of the system is greater than the target temperature, the system&#039;s kinetic energy is too high, so &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is reduced to compensate for this. The same is true for is the temperature is lower than the target temperature; &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than one in the next step to increase the kinetic energy which is now too low. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; can be derived from equating the kinetic and internal energy of the system at an arbitrary time step:&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;
Expanding the brackets inside the sum and moving the term containing &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; out of the sum: &amp;lt;math&amp;gt;\frac{\gamma^2}{2}\sum_i m_i \left(v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;, we can replace &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt; on the left hand side of the equation with &amp;lt;math&amp;gt;\frac{3}{2} N k_B T&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;\frac{3\gamma^2}{2}N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Simplifying and rearranging for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, gives: &amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The principle is the same for controlling the pressure.&lt;br /&gt;
&lt;br /&gt;
As temperature and pressure are no longer constant, he input files require specification of the pressure and the temperature for each of the systems run. 10 simulations were run at two different pressures with five different temperatures at each. &lt;br /&gt;
* Temperatures: 1.6, 1.9, 2.2, 2.5, 2.8&lt;br /&gt;
* Pressures: 2.5, 3.0&lt;br /&gt;
These pressures were chosen because the data simulated when choosing an appropriate timestep gave a pressure between 2.5 and 3.0.  &lt;br /&gt;
&lt;br /&gt;
For the code which computes the thermodynamic potentials, this particular line defines how many steps contribute towards the average of the thermodynamic parameters computed in the calculation. &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;
&#039;&#039;fix&#039;&#039; is the keyword, &#039;&#039;aves&#039;&#039; is the name of the group of fixes which in this case is the average of the thermodynamic values, &#039;&#039;all&#039;&#039; specifies the atoms which the fix is applied to which in this case is all the atoms in the simulated system and &#039;&#039;ave/time&#039;&#039; means that compute global time averages are calculated. The following three numbers have the following meaning:&lt;br /&gt;
&lt;br /&gt;
*100 = use the input values every 100 timesteps&lt;br /&gt;
*1000 = use input values 1000 times for calculating the average&lt;br /&gt;
*100000 = calculate the average every 100000 timesteps&lt;br /&gt;
&lt;br /&gt;
Therefore for the total calculation which lasts for 100000 will only have the average calculated once. Assuming 1 value every timestep, there will be 100000/100 values = 1000. The amount of time simulated is 100,000 steps, read from the following line.&lt;br /&gt;
&lt;br /&gt;
The density data from all ten calculation were plotted on the same graph, along with the density for an &amp;quot;ideal&amp;quot; gas. This density can be derived from the ideal gas law:&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;
Rearranging in terms of density: &amp;lt;math&amp;gt;\frac{N}{V} = \frac{P}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As these simulations are being run under reduced units, we can take &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt;, and so the density of the ideal gas becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the density of the ideal gas is plotted as the pressure divided by the temperature in pressure-temperature phase space.&lt;br /&gt;
[[File:Rmt dvt plot.png|none|thumb|800x800px|&#039;&#039;Figure i. &#039;&#039;Plot of the variation in density with temperature at a defined pressure for the numerically simulated and ideal systems]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that calculated in the ideal gas law. This is because for an ideal gas, an assumption is made that there are no intermolecular interactions, and therefore forces such as electron repulsion forces are ignored; repulsion forces dominate over attractive ones, as all the atoms in this simulation are the same and so partial charges or dipoles are created. This will mean that the particles move closer together than a real gas and so the density will be larger. This discrepancy between the ideal and non-ideal systems becomes larger at a higher pressure because with a higher pressure, the atoms in the system are closer together and therefore the intermolecular repulsion will become larger. This greater repulsion will in turn have a larger effect on decreasing the density.&lt;br /&gt;
&lt;br /&gt;
== Statistical Physics Calculations of the Heat Capacity ==&lt;br /&gt;
The heat capacity of a system at constant volume can be calculated from the variance in the total energy of the system. The relationship used to calculate the heat capacity is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = 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;\left\langle E^2\right\rangle&amp;lt;/math&amp;gt; is the continuous average of the total square energy at each temperature as a function of temperature. &amp;lt;math&amp;gt;\left\langle E\right\rangle^2&amp;lt;/math&amp;gt; is the continuous average of the total energy at each temperature as a function of temperature squared. The heat capacity is multiplied by &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; in this case because the version of LAMMPS calculates every energy divided by the number of molecules in the system simulated.&lt;br /&gt;
&lt;br /&gt;
The calculations in this sections are run in density-temperature phase space and the ensemble has changed to the canonical ensemble (NVT). A set of input files were written for ten calculations for, like the previous section, two pressures and five different temperatures at each pressure:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 0.2, 0.8&lt;br /&gt;
*Temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{C_V}{V}&amp;lt;/math&amp;gt; was plotted against temperature to determine the relationship in density-temperature phase space. An example of an input file can be found [[Media:nvt_-_0220.in|here]]. The lines which have been changed from the previous input files are at the end of the script:&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 &lt;br /&gt;
 thermo_style custom step etotal temp&lt;br /&gt;
 variable energy equal etotal&lt;br /&gt;
 variable energy2 equal etotal*etotal&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_energy v_energy2 v_temp&lt;br /&gt;
 run 100000&lt;br /&gt;
 &lt;br /&gt;
 variable aveenergy equal f_aves[1]&lt;br /&gt;
 variable aveenergy2 equal f_aves[2]&lt;br /&gt;
 variable avetemp equal f_aves[3]&lt;br /&gt;
 variable heatcapacitydv equal atoms*atoms*(v_aveenergy2-v_aveenergy*v_aveenergy)/(v_avetemp*v_avetemp*vol)&lt;br /&gt;
 &lt;br /&gt;
 print &amp;quot;Averages&amp;quot;&lt;br /&gt;
 print &amp;quot;--------&amp;quot;&lt;br /&gt;
 print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Heat Capacity per Volume: ${heatcapacitydv}&amp;quot;&lt;br /&gt;
The line with the keyword &#039;fix&#039; determines which thermodynamic values are averaged and over how many steps they are averaged. The next section takes these averages as variables and uses them to define the heat capacity which is calculated from the equation at the beginning of this section. Only the energy and temperature are needed to define the heat capacity and so only these values are calculated by the simulation. [[File:Rmt heatcapacitybyv.png|none|thumb|800x800px|&#039;&#039;Figure j. &#039;&#039;C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V against temperature for the two different pressures 0.2 and 0.8]]As seen in the above figure, the heat capacity decreases with temperature for both pressures. It would be expected for an ideal system that as the temperature increases, the heat capacity at constant volume increases and tends to a constant volume at very high T of 3R; R = the universal gas constant. This means increasing the temperature increases the amount of energy being stored in the system and this energy is stored as vibrational energy. However, for a Lennard-Jones liquid, the system being simulated here, the heat capacity decreases with temperature. This is because the simulation has two components to the simulation; the atoms are vibrating in a quasi-harmonic fashion around the equilibrium position and also diffuse between neighbouring equilibrium positions in a gas like fashion. As the temperature increases, the amount of diffusion increases and the vibrations decreases, therefore decreasing the ability of the system to absorb vibrational energy, resulting in the decrease in heat capacity. &amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www.nature.com/ncomms/2013/130816/ncomms3331/full/ncomms3331.html?message-global=remove&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural Properties and the Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a single atom in a system is a plot of the probability that an atom can be found at a certain distance from the central atom. The peaks in this plot can give the distance of an atom from its nearest neighbours in the Lennard-Jones simulated system. &lt;br /&gt;
&lt;br /&gt;
The calculations in this section simulate a Lennard-Jones solid, liquid and gas and, using the output of the LAMMPS trajectory file, plots both the radial distribution function and its integral using DLV. The temperature and pressure parameters for these calculations were taken from the phase diagram or coexistence curve for a Lennard-Jones system.&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt; The parameters used are displayed in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! Temperature, &amp;lt;math&amp;gt;T^*&amp;lt;/math&amp;gt;&lt;br /&gt;
! Pressure, &amp;lt;math&amp;gt;p^*&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| LJ Solid&lt;br /&gt;
| 1.5&lt;br /&gt;
| 1.2&lt;br /&gt;
|-&lt;br /&gt;
| LJ Liquid&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.8&lt;br /&gt;
|-&lt;br /&gt;
| LJ Gas&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.01&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The data obtained from the plots and the radial distribution functions and their integrals were plotted and shown in the table below.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure k. &#039;&#039;The radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
!&#039;&#039;Figure l. &#039;&#039;The integrals of the radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt fullrdfs.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt allintegralsrdf.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
[[File:Rmt Nearest neighbours.png|left|thumb|300x300px|&#039;&#039;Figure m. &#039;&#039;Representation of a cross section of the first three shells of nearest neighbours in an fcc solid. The black atom is the central atom being considered, the blue atoms are the first shell, the orange atoms the second shell and the purple atoms are the third.]]&lt;br /&gt;
The RDF of the solid gives a very irregular curve because of the irregular structure of the lattice. For a simple cubic lattice, a regular structure of the RDF would be expected because of the equal number of atoms in each of the nearest neighbour shells of the atoms. However, for face-centered cubic, the solid in this simulation, the structure is much more irregular and as the atoms move from their equilibrium position in the lattice due to vibrations, the peaks in the radial distribution will broaden. The irregular heights of the peaks are due to the varying numbers of atoms in each of the nearest neighbour shells for the central atom. The first shell gives the highest peak as it contains the most atoms; in total, considering all four surrounding unit cells, this shell contains 12 atoms and ideally takes the geometry of an icosahedron. The second shell is smaller and contains only 6 atoms in an octahedral coordination shape. The following shell again contributes 12 atoms, 3 from each unit cell. This therefore explains why the heights of the peaks in the solid plot in &#039;&#039;figure k.&#039;&#039; vary. These values can be confirmed by the plot in &#039;&#039;figure o.&#039;&#039; which is the integral; it cumulatively adds the numbers in each shell. The size of the first &amp;quot;step&amp;quot; is 12; there are 12 atoms in the first shell. The size of the second step is approximately 18; there are 18-12=6 steps in the second shell. The same theory applies for the third shell which gives a value of 13. This is slightly different to the predicted value possibly due to error in the calculation of the radial distribution function and therefore its integral. &lt;br /&gt;
&lt;br /&gt;
The RDF of the liquid has a representation of far fewer shells, which means that there are less atoms in the space close to a &amp;quot;central&amp;quot; atom in the bulk solution. The particles have more energy and therefore do not keep to a regular lattice structure. As they move about, some regualrity is maintained around each atom, but only to the extend of two or three shells, meaning there is no long range order in a Lennard-Jones liquid. &lt;br /&gt;
&lt;br /&gt;
The RDF of the gas again omits more shells as there is almost no order in a Lennard-Jones gas. The single peak on this plot considers only the set of atoms closest to the central atom and all others are disregarded as they are too far apart. &lt;br /&gt;
&lt;br /&gt;
Considering &#039;&#039;figure l.&#039;&#039;, the size of the integral of the radial distribution function decreases from solid to liquid to gas. This makes sense as the number of atoms in the surrounding shells decreases with density of the system; the atoms become further apart. &lt;br /&gt;
&lt;br /&gt;
From the plot of the radial distribution function of the solid, the lattice spacing can be determined. For this, we can consider just the first three peaks of the RDF plot. The lattice spacing refers to the length of one unit cell, and so, using &#039;&#039;figure m&#039;&#039;, we can calculate this using two different methods; a) we can use the distance between the central atom and the first shell of nearest neighbours, and use trigonometry to calculate the lattice spacing. Or alternatively b) we can use the distance between the central atom and the second nearest neighbour shell to get the lattice spacing.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure n. &#039;&#039;The radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
!&#039;&#039;Figure o. &#039;&#039;The integral of the radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt solidgr3.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt solidint3.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
Using method a) (with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; as the distance between the central atom and the nearest neighbour: Lattice spacing = &amp;lt;math&amp;gt;\frac{r}{cos({\frac{\pi}{4}})} = \frac{1.02}{cos({\frac{\pi}{4}})} \approx 1.44&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using method b): Lattice spacing &amp;lt;math&amp;gt;\approx 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can take an average between the two get an approximate value for the lattice spacing: &amp;lt;math&amp;gt;1.46 \plusmn 0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These values for distance are all in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
The ability of atoms to move around in a solid liquid or gas can be characterised by the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. In this section, we will explore two different ways to calculate the diffusion coefficient and compare the results. &lt;br /&gt;
&lt;br /&gt;
=== The Mean Squared Displacement ===&lt;br /&gt;
The diffusion coefficient can be measured easily be calculating the mean squared displacement of atoms in the solution; the diffusion coefficient is proportional to the first derivative of the mean squared displacement. By plotting the mean squared displacement as a function of time, the gradient can be taken to calculate the diffusion coefficient when its has equilibrated and become linear.&lt;br /&gt;
&lt;br /&gt;
The temperature and density parameters used were the same as in the previous section:&lt;br /&gt;
* Solid: T=1.5, D=1.2&lt;br /&gt;
* Liquid: T=1.1, D=0.8&lt;br /&gt;
* Gas: T=1.1, D=0.01&lt;br /&gt;
&lt;br /&gt;
Mean density squared calculations were run for all three Lennard-Jones phases and the data plotted as function of timestep below. The data from a simulation containing 1,000,000 atoms was plotted for comparision.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!Plots for the 8,000 atom data (&#039;&#039;figures p-r)&#039;&#039;&lt;br /&gt;
!Plots for the 1,000,000 atom data (&#039;&#039;figures s-u)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|[[File:Rmt_MSDsolid.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt_MAsolid.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|[[File:Rmt MSDliquid.png|700x700px]]&lt;br /&gt;
|[[File:Rmt MAliquid.png|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|[[File:Rmt MSDgas.png|700x700px]]&lt;br /&gt;
|[[File:Rmt dataplots 25894 image001.png|700x700px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The exact relationship between the mean squared displacement and the diffusion coefficient is:&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;
Taking the gradients of each of the curves at the point at which they become linear and dividing by six will give the diffusion coefficient for each set of data. The gradient also needs to be converted to a function of time; this is done by dividing by the timestep, which in this case is 0.002:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom data diffusion coefficients, &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
!1,000,000 atom data diffusion coefficients &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 0.9999&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|Gradient = 0.0972&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{48.6}{6} = \mathbf{8.1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient = 0.0386&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{19.6}{6} = \mathbf{3.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For both of the solid approximations, the diffusion coefficient can be approximated as zero. This is because, when equilibrated, the function has a constant value of around 0.2 for the mean squared displacement. A gradient with a value of zero means that the atoms take an infinite amount of time to change their mean squared displacement; to move away from their equilibrium position, and so this means that we can approximate in this system, there will be no diffusion. In real system, however, this is not the case; diffusion occurs but it is very slow. A plot for a real system will give a very shallow positive gradient.&lt;br /&gt;
&lt;br /&gt;
The liquid approximations are very well correlated. This is because in both cases, the mean squared displacement of particles in a liquid increases linearly with time and the gradient of both plots are almost identical. We can assume from this that identical starting conditions were used to calculate this data. Also, we can estimate that 8,000 atoms is a large enough simulation to give an accurate result for the diffusion coefficient for the Lennard-Jones liquid.&lt;br /&gt;
&lt;br /&gt;
The gas approximations are very different. This is most probably due to the fact that the density specified in calculations are different. The 8,000 data can be estimated to be a much lower density because the diffusion coefficient is faster and this means diffusion will happen faster; at a higher density a particle will take longer to diffuse over a given distance. Because of the difference in density, the two values of the diffusion coefficient cannot be qualitatively compared. The reason for the initial deviation for linearity in the gas plots is due to the momentum of the particles initially dominating over the diffusion and the diffusion coefficient is dependent on time. As the system equilibrates, the diffusion coefficient becomes constant and the plots become linear.&lt;br /&gt;
&lt;br /&gt;
=== The Velocity Autocorrelation Function ===&lt;br /&gt;
&lt;br /&gt;
Another way to calculate the diffusion coefficient is by using the velocity correlation function, which determines how the velocity of an atom changes with time. The function determines the difference in time (&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;) when the velocity becomes uncorrelated, i.e. the difference between the velocity at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; and at time &amp;lt;math&amp;gt;t+\tau&amp;lt;/math&amp;gt;. By integrating over this function, we can find the diffusion coefficient. &lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function: &amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can also be written as the integral: &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;
Using the function which defines the position of a classical harmonic oscillator, we can differentiate this to give the equation for the velocity which we can plug into the integral:&lt;br /&gt;
&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;
&amp;lt;math&amp;gt;dv{x(t)}{t} = v(t) = -A\omega sin(\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also needed for the integral:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t+\tau) = -A\omega sin(\omega(t+\tau)+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v^2(t) = A^2\omega^2 sin^2(\omega t +\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Putting all this into the integral to find the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega sin(\omega t + \phi) \times A\omega sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} A^2\omega^2 sin^2(\omega t +\tau)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A^2\omega^2&amp;lt;/math&amp;gt; can be take out of each of the integrals and cancelled. A substituion can then be made to make solving the integral much simpler:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = \omega t + \phi&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \omega\tau&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the integral becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a) \times sin(a+b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the compound angle rule &amp;lt;math&amp;gt;sin(a+b)=sin(a)cos(b)+cos(a)sin(b)&amp;lt;/math&amp;gt;, the integral can be simplified to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a)sin(a)cos(b) + sin(a)cos(a)sin(b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Separating out into two integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)\frac{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the rule &amp;lt;math&amp;gt;sin(a)cos(a) = \frac{1}{2}sin(2a)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} \frac{1}{2}(sin(2a))\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because the function &amp;lt;math&amp;gt;\frac{1}{2}sin(2a)&amp;lt;/math&amp;gt; is symmetric over all space, the second term in this equation becomes zero. Therefore, the integral simplifies to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b) = cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same calculations from the mean squared displacement section gave an output of the velocity autocorrelation function. The function for the Lennard-Jones solid, liquid and gas were plotted against the timestep along with the approximate function for the velocity autocorrelation function, &amp;lt;math&amp;gt;cos(\omega\tau)&amp;lt;/math&amp;gt;, where \omega = \frac{1}{2\pi}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure v. &#039;&#039;Plots for the velocity autocorrelation function of a Lennard-Jones solid, liquid and gas; 8,000 atoms&lt;br /&gt;
!&#039;&#039;Figure w. &#039;&#039;Plots for the velocity autocorrelation function of a Lennard-Jones solid, liquid and gas, 1,000,000 atoms&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt VACF 5721 image001.png|800x800px|]]&lt;br /&gt;
|[[File:Rmt MAVACF.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
The diffusion coefficient is calculated from: &amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty C\left(\tau\right)\mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the approximate value for the diffusion coefficient using the velocity autocorrelation function is &amp;lt;math&amp;gt;D = \frac{1}{3}cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The running integral of the velocity autocorrelation functions was plotted using the &#039;&#039;trapesium rule&#039;&#039;, and so the final value on the integral plot is proportional to the diffusion coefficient.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom VACF integral &#039;&#039;(figures w-z)&#039;&#039;&lt;br /&gt;
!1,000,000 VACF integral (&#039;&#039;figures aa-cc)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|[[File:Rmt mysi.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt masi.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|[[File:Rmt myli.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt mali.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|[[File:Rmt mygi.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt ligi.png|frameless|700x700px]]&lt;br /&gt;
|}&lt;br /&gt;
The diffusion coefficients for each of the plots above are tabulated below using the final data point from the integral plot. This is the integral over the whole graph using the trapesium rule. This must be corrected for the timestep; the value is multiplied by 0.002. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom data diffusion coefficients, &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
!1,000,000 atom data diffusion coefficients &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;-0.00055&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{-0.00055}{6} = -0.00018 \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.00014&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.00014}{6} = 0.000046 \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.242&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.242}{6} = \mathbf{0.0807}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.270&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.270}{6} = \mathbf{0.901}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;25.6&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{25.6}{6} = \mathbf{8.55}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;9.81&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{9.81}{6} = \mathbf{3.27}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=541497</id>
		<title>Rep:Mod:hakunamatata</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=541497"/>
		<updated>2016-02-25T13:51:16Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: /* The Velocity Autocorrelation Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Introduction to Molecular Dynamics Simulations ==&lt;br /&gt;
===The Classical Particle Approximation and Numerical Integration===&lt;br /&gt;
The verit and verit-velocity algorithms are numerical methods to approximate the average position and velocity respectively of randomly moving atoms in a particular medium (solid, liquid, fliud etc.). This position and velocity can be applied to Newtonian mechanics to calculate such properties as the force and potential energy of the system. The algorithms work by splitting the function into discrete time steps, calculating the values of position and velocity at this particular time step, and then effectively &amp;quot;joining the dots&amp;quot; to create an approximate function. These simulations always use the answer from the previous timestep to compute the new timestep, so initial conditions must be given for the first step. Both of the algorithms are shown below and are derived from the Taylor expansion of the position or velocity of the atoms at the timestep &amp;quot;n+1&amp;quot; or &amp;lt;math&amp;gt;t+\delta t&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit Algorithum:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{x}_i\left(t + \delta t\right) \approx 2\mathbf{x}_i\left(t\right) - \mathbf{x}_i\left(t - \delta t\right) + \frac{\mathbf{F}_i\left(t\right)}{m_i}\delta t^2  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit-Velocity Algorithum:&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i\left(t\right)&amp;lt;/math&amp;gt; is the force acting on a particular atom as a function of time&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i&amp;lt;/math&amp;gt; is the acceleration &lt;br /&gt;
&lt;br /&gt;
The smaller the timestep, the closer the numerical approximation is to the true solution function, which can be modeled as a classical harmonic oscillator. &#039;&#039;Figure a.&#039;&#039; in the table below shows the comparison between the two methods in &#039;&#039;time&#039;&#039; space. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure a. &#039;&#039;Plots of position vs time comparing the verit algorithm and harmonic spring results&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure b. &#039;&#039;Plot of the total classical energy of the system (potential + kinetic)&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory xanalytical.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory energy.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The harmonic spring position values are modeled from the harmonic oscillator or particle on a spring. The equation of &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; was used to calculate these values, where &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; are 1 and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; is zero. As seen on the plot, the curves produced from the two different methods of calculating the position are in good agreement.&lt;br /&gt;
|The potential energy is calculated using the equation U = 1/2 kx^2, with a value of k given as 1. The kinetic energy is calculated using the velcity from the verit-velocity algorithm using the equation T = 1/2 mv^2, with a value of m given as 1. The total energy of the system, E, is equal to T + U. The values for x (potential energy) and v (kinetic energy) are taken from the verity algorithm and verit-velocity algorthim respectively. &lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;Figure c. &#039;&#039;Plot of the difference (error) between the harmonic spring and verit algorithm data&lt;br /&gt;
!&#039;&#039;Figure d. &#039;&#039;Plot of the peaks in the error plot in &#039;&#039;figure c.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory error.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory errorpeaks.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The peaks in the error between the harmonic spring and verit algorithm results are at the place where the position curve crosses the time axis. This is because the harmonic spring data (x(t)) has a slightly shorter wave period than that of the verit velocity algorithm, and therefore the difference will get larger with each period of the wave, shown by the error getting larger in &#039;&#039;figure c. &#039;&#039;The period of the plot of the two methods are different because the verit algorithm is much more approximate so does not give the correct solution.&lt;br /&gt;
|The change in the error/difference between the harmonic spring data and verit algorthm data increases linearly and so therefore period of each of the plots in &#039;&#039;figure 1&#039;&#039;. must be constant. &lt;br /&gt;
|}&lt;br /&gt;
The error can also be quantified on a &#039;&#039;phase space&#039;&#039; plot; phase space is momentum or velocity plotted as a function of position. The true solution for motion of an atom is a perfect ellipse, and the more elliptic the shape (less circular) the more momentum or velocity is in the system. A numerical solution, like the verit algorithms, will produce a set of points very close to this ellipse but not perfectly following the curve. A good numerical solution will remain in an elliptical shape, whereas a bad numerical solution, for example one with a large timestep, will spiral away from the true solution. Two examples of such systems using the data from &#039;&#039;figures a-d&#039;&#039; are shown below.  &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure e. &#039;&#039;Phase plot of the harmonic spring data with a good numerical solution (timestep = 0.1) &lt;br /&gt;
!&#039;&#039;Figure f. &#039;&#039;Phase plot of the harmonic spring data with a bad numerical solution (timestep = 0.3) &lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory phasegood.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory badphase.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The timestep at which this data is plotted is 0.1, which results in a very small change in the energy, as seen in &#039;&#039;figure b. &#039;&#039;Increasing the time step will increase the variation in the energy. To keep the variation in the total energy of the system under 1%, the time step must be no larger than approximately 0.28. The energy varies more with increasing time step because the jumps in the algorithm  are getting larger due to less data points. The algorithm assumes these points are joined by a straight line; that the halfway point in the jump is the average between the starting and finishing point of the jump. The phase space plot will become less elliptic and the jumps eventually become so larger that the plot is no longer a continuous shape.  &lt;br /&gt;
&lt;br /&gt;
It is essential to monitor the energy of a numerically modeled system because a good solution for the motion of an atom has a constant energy and a plot in phase space of a perfect ellipse.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance and Force at Zero Potential===&lt;br /&gt;
From classical mechanics, the force calculated from the Newtonian mechanics above can be used to calculate the potential experienced by an atom in the system. They are related by the equation: &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;
This potential gives the shape and dimension of the potential surface on which the system can be modeled. A simple 1D potential that is used to describe the inter atomic forces of a liquid is the Lennard-Jones potential. It has the characteristic features of a short range repulsion potential and harmonic character around the equilibrium bond distance. The value of &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the inter atomic separation when the potential, &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;, is equal to zero, can be calculated by equating the equation for the Lennard-Jones potential to zero and solving for &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The equation for the Lennard-Jones potential: &amp;lt;math&amp;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;
Equating this to zero: &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;
And rearranging in order to separate the variables: &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;
Rearranging this gives &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in terms of &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt; r^6 = \sigma^6&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r = r_0&amp;lt;/math&amp;gt; in this case.&lt;br /&gt;
&lt;br /&gt;
This, therefore, gives the result that interatomic distance at zero potential, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, is equal to &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; in the Lennard-Jones potential is effectively the diameter of one of the particles in the system being measured; in this case, the liquid we are simulating. This is the point where the potential curve crosses the x-axis on an Energy vs interatomic distance plot. The force, &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt;, at this point on the curve corresponds to the gradient; it is found by calculating the derivative of the curve at this point. &lt;br /&gt;
&lt;br /&gt;
To calculate the force, we must differentiate the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As force is equal to the negative differential of the potential energy, the value of the force is: &amp;lt;math&amp;gt;\mathbf{F}_i = 48\epsilon \sigma^{12} r^{-13} - 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting in the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at zero potential from the calculation before: &amp;lt;math&amp;gt;\mathbf{F}_i = \frac{48\epsilon}{\sigma} - \frac{24\epsilon}{\sigma} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The gradient where the Lennard-Jones plot crosses the axis is negative; &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; in the term obtained for &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is negative and therefore the overall value of the force will be negative.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance, Force and Well Depth of the Potential at Equilibrium===&lt;br /&gt;
To calculate the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at the equilibrium position, we need to use the derivative of the potential energy curve. The equilibrium value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is the value at the minimum of the Lennard-Jones curve; when &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Therefore, equating the derivative to zero gives: &amp;lt;math&amp;gt;0 = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rearranging this: &amp;lt;math&amp;gt;48\epsilon \sigma^{12} r^{-13} = 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And simplifying and cancelling gives: &amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6&amp;lt;/math&amp;gt;. Therefore the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at equilibrium is: &amp;lt;math&amp;gt;r_{eq} = \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Physically, this result means that the equilibrium distance is 1.12 times the diameter of one of the particles; the particles have a small gap between them so do not touch. A short range repulsion potential, as seen in the Lennard-Jones curve, is a result of the particles coming into contact. &lt;br /&gt;
&lt;br /&gt;
Again, the force can be calculated from the derivative of the potential curve at the equilibrium point. As the derivative at this point is zero (a minimum on the curve), the force will therefore also be zero.&lt;br /&gt;
&lt;br /&gt;
The well-depth of the potential curve is the difference between zero potential and the potential at the equilibrium bond length. This can be calculated by substituting the value for the equilibrium bond length into the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 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;
Cancelling and simplifying this equation gives: &amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \times \frac{1}{4}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the absolute value for the well depth is &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;. The actual value of this potential is &amp;lt;math&amp;gt;-\epsilon&amp;lt;/math&amp;gt;, as the equilibrium bond length gives the most stable configuration of the molecules and therefore suggests attractive interactions are involved in the arrangement of the molecules; this attractive potential means its negative. &lt;br /&gt;
&lt;br /&gt;
===Boundary Conditions and the Lennard-Jones Cutoff===&lt;br /&gt;
When simulating a liquid, it is computationally impractical to simulate a realistic liquid. Therefore a smaller &#039;box&#039; containing &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; particles is simulated and the computer program will use &#039;&#039;periodic boundary conditions&#039;&#039; to simulate infinite repetitions of this box; when the atom reaches one edge of the box, in periodic boundary conditions, it will reappear again at the opposite edge of the box as if they were connected. For example, an atom at the position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a box of size &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;. Without periodic boundary conditions, we would assume that the atom would end up at the position &amp;lt;math&amp;gt;(1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;. However, in this box, there is no such position and so the particle must reappear at the opposite edge to where it effectively &#039;left&#039; the box. Therefore, it&#039;s ending position will be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The number of particles, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; simulated by the computer is usually between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt;. Physically, this is a very small volume. Considering water, we can calculate the number of molecules in 1 mL or 1 cm^3, a volume that would be considered small in the lab. Taking the concentration of water at standard conditions, &amp;lt;math&amp;gt;55\ mol\ dm^{-3}&amp;lt;/math&amp;gt;, we can convert it to the number of moles per mL: &amp;lt;math&amp;gt;0.055\ mol\ mL^{-1}&amp;lt;/math&amp;gt;. Multiplying this value by Avagadro&#039;s constant (&amp;lt;math&amp;gt;N_A&amp;lt;/math&amp;gt;) gives the number of molcules of water per mL: &amp;lt;math&amp;gt;3.02 \times 10^{22}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The reverse procedure can be used to compare this to the volume of 10,000 molecules: 10,000 divided by Avagadro&#039;s constant gives the number of moles of water which 10,000 molecules makes up: &amp;lt;math&amp;gt;1.66 \times 10^{-20}\ moles&amp;lt;/math&amp;gt;. Dividing this value by the concentration (from &amp;lt;math&amp;gt;n=cV&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is the number of moles, &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; is the concentration and &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume), gives the volume: &amp;lt;math&amp;gt;3.02 \times 10^{-22}\ dm&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;3.02 \times 10^{-19}\ mL&amp;lt;/math&amp;gt;. Physically, of course, this is far too small a volume to be recorded in the lab.&lt;br /&gt;
 &lt;br /&gt;
Periodic boundary conditions simulate an infinite lattice and therefore, when computing the potential, will calculate an infinite amount of pair interactions. Therefore, it is only practical to calculate the energies up to a certain interatomic distance; the Lennard-Jones cutoff distance. Beyond this point, the potential energy and the integral of the curve beyond this point become insignificant and do not impact on the overall energy; removing interactions beyond this point from the calculations will not effect the accuracy. Multiplying the Lennard-Jones potential with the radial distribution function gives a plot of the probability of finding an atom at a particular interatomic distance. The larger the interatomic distance, the lower the probability and so the energy after the cutoff can be disregarded. &lt;br /&gt;
&lt;br /&gt;
Integrating over the Lennard-Jones curve and applying this cutoff as the lower limit can show how small the integral is:&lt;br /&gt;
&lt;br /&gt;
For a general cutoff of with value &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;I = \int_{x}^\infty \phi\left(r\right)\mathrm{d}r = \int_{x}^\infty \frac{4\epsilon\sigma^{12}}{r^{12}}\mathrm{d}r - \int_{x}^\infty \frac{4\epsilon\sigma^6}{r^6}\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving this: &amp;lt;math&amp;gt;I = 4\epsilon\sigma^{12} {\frac{-1}{11r^{11}}\,\Bigg\vert\,}_x^\infty - 4\epsilon\sigma^{6} {\frac{-1}{5r^{5}}\,\Bigg\vert\,}_x^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This gives the general solution: &amp;lt;math&amp;gt;I = \frac{4\epsilon\sigma^{12}}{11x^{11}} - \frac{4\epsilon\sigma^{6}}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating this for &amp;lt;math&amp;gt;\epsilon = \sigma = 1&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;I = \frac{4}{11x^{11}} - \frac{4}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt; (or 2 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.025&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt; (or 2.5 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0082&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt; (or 3 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0033&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All values are taken to 2 significant figures. As the cutoff value for the interatomic distance gets larger, the integral gets smaller, and therefore the energy excluded from the calculation becomes smaller, and the second term in the solved integral, &amp;lt;math&amp;gt;I&amp;lt;/math&amp;gt;, dominates the energy value.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
When using the Lennard-Jones potential, it is appropriate to use reduced units for intermolecular distance, energy and temperature. Reduced units can be calculated by the following relationships:&lt;br /&gt;
&lt;br /&gt;
Intermolecular 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;
&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; are scaling factors. For example, if the parameters for Argon are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\sigma = 0.34 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt; \epsilon\ /\ k_B = 120 K&amp;lt;/math&amp;gt;&lt;br /&gt;
* Lennard-Jones cutoff &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;. The well-depth, &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;, is &amp;lt;math&amp;gt;0.999 kJ mol^{-1} \approx 1 kJ mol^{-1}&amp;lt;/math&amp;gt;. The value of &amp;lt;math&amp;gt;T* = 1.5&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;180 K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
The first aim of the simulations is to determine the most appropriate timestep to use in the vert algorithm simulations. This timestep is a balance between the accuracy of the results (the smaller the timestep, the closer to the true functing the result will be) and the length of real time over which the simluation is run (the smaller the timestep, the less real time over which the simulation will give a result). The appropriateness of the timestep will be determined by plotting how the total free energy of the simulated lattice equilibrates over time.  &lt;br /&gt;
&lt;br /&gt;
Five different calculations, which simulated the melting of a crystal and subsequent equilibration of the energy of the melted crystal, were run at five different timesteps; 0.001, 0.0025, 0.0075, 0.01 and 0.015, and were described by the NVE or &#039;&#039;&amp;quot;microcanonical ensemble&amp;quot;&#039;&#039;. An ensemble is a collection of samples of a system which are under three thermodynamic constraints (three properties are kept constant); in the microcanonical ensemble, the number of particles, the volume and the total energy is kept constant (NVE). &lt;br /&gt;
&lt;br /&gt;
These calculations simulate a box of 1000 unit cells and use periodic boundary conditions to replicate the simulation to a larger scale. Because these simulations use the numerical methods defined in the previous section, the initial position and velocity of the atoms must be defined in the input file. The Brownian (uncorrelated, random) motion of the atoms in the simulation means that there is no long range order in the system and so the atoms in a real system would start in random positions. However, assigning random starting coordinates to the atoms in a simulated liquid is not a relative process; the coordinates are generate independently of each other. Therefore there is a probability that the coordinates simulated will cause the atoms to overlap, which would give a very large repulsion potential, as seen in the Lennard-Jones potential at very small interatomic distances. This short-range repulsion potential comes from the hard-sphere model of atomic simulation.&lt;br /&gt;
&lt;br /&gt;
The input file also defines the structure and density of the lattice. The number density of lattice points in any lattice is the number of lattice points per volume of the unit cell. In a simple cubic lattice, there is one lattice point in the unit cell. From an sc lattice with lattice spacing (length of one side of the unit cell) being &amp;lt;math&amp;gt;1.07722&amp;lt;/math&amp;gt;, the number density of the lattice points is calculated by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{1}{1.07722^3} = 0.7999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a face-centered cubic lattice (fcc), there are four lattice points in the unit cell. Rearranging the above relationship, the lattice spacing can be calculated from the number of lattice points in a unit cell and number density, &amp;lt;math&amp;gt;1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Lattice\ spacing = \sqrt[3]{\frac{number\ of\ lattice\ points\ per\ unit\ cell}{number\ density}} = \sqrt[3]{\frac{4}{1.2}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation creates a box which includes 1000 unit cells, which is 10 unit cells in each dimension. For a simple cubic lattice, because there is one lattice point per unit cell, there will be 1000 atoms created as seen in the input file. The &#039;&#039;create_atom&#039;&#039; command in the input file determines how many boxes are created in the simulation and therefore how many atoms will be created. If a face centered cubic lattice is simulated, because there are 4 lattice points per unit cell, 4000 atoms will be created in the &#039;&#039;create_atom&#039;&#039; command. &lt;br /&gt;
&lt;br /&gt;
The input script also contains the following commands which defines the potential surface which is used to model the intermolecular reactions:&lt;br /&gt;
 mass 1 1.0&lt;br /&gt;
This instruction sets the mass type for the atoms being simulated. It takes the general form of “mass I value”, where mass is the keyword which tells LAMMPS what the input is, I is the atom type and value is the mass of the atom. In this case, I is defined by a specific numerical value; 1 as there is only 1 type of atom in the simulation, but it can be defined with an asterisk (1*), which means “all atom types of 1 to n inclusive”. &lt;br /&gt;
 pair_style lj/cut 3.0&lt;br /&gt;
This instruction sets the type of potential which LAMMPS uses in its calculation of pairwise interactions. It takes the general form of “pair_style style args”, where pair_style is the keyword for LAMMPS, style defines the potential and any specifications it may have, and args are the arguments required for this particular potential. In this case, the Lennard-Jones potential has been used (lj) with a cutoff point (cut) of 3σ. The cutoff point is explained in the introduction section. &lt;br /&gt;
 pair_coeff * * 1.0 1.0&lt;br /&gt;
This instruction specifies the coefficients for the pairwise interactions of each pair of atoms, and it takes the general form “pair_coeff I J args”. Pair_coeff is the keyword, I and J are the atom types, and args are the coefficients which the different atoms types take. In this case, the asterisk in place of I and J refers to all atoms types from 1 to n. The coefficients are the pairwise interactions are 1 for each atom, meaning each atom has an equal contribution to the interaction.&lt;br /&gt;
&lt;br /&gt;
In these initial calculations, the initial conditions for the numerical methods, &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. For this experiment, the verit-velocity algorithm would be the most appropriate, as both the starting position and velocity is specified for this algorithm. &lt;br /&gt;
&lt;br /&gt;
To define the timestep for the algorithm the following code is used defining the timestep as a variable instead of just giving it a definite value&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;
It is much easier to use the variable version of defining the timestep because the length of time over which the simulation is run depends on the time step. By using a variable, you can keep the length of the simulation the same, no matter the size of the timestep. It also makes it easier if multiple properties depend on the timestep – only the variable needs to be changed, not all the parts of the script where timestep is defined. &lt;br /&gt;
&lt;br /&gt;
The calculations produce the values for the total energy of the system, temperature and pressure in the output files, which can be plotted against time. How well these values equilibrate determines the appropriateness of the timestep to use in further calculations in the experiment.   &lt;br /&gt;
[[File:Rmt totalenergy plot.png|none|thumb|800x800px|&#039;&#039;Figure h. &#039;&#039;Plot of the equilibration of total energy for five different timesteps]]&lt;br /&gt;
The largest time step to give an acceptable result is 0.01. However, for any simluation we would expect energy to be independent of the timestep, something which is not true at a timestep greater than 0.0025. Therefore, the most appropriate timestep to use for a balance between accuracy and length of time which the simulation covers is 0.0025.  &lt;br /&gt;
&lt;br /&gt;
0.015 is a particularly bad choice of timestep. This is because the verit-velocity algorithm gives an approximate result to the velocity (kinetic energy term) and position (potential energy term), and so when the timestep becomes too large with respect to the time, the algorithm no longer becomes a suitable way to calculate the energy. As seen in the graph of 0.015, the energy does not equilibrate and diverges.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions ==&lt;br /&gt;
The calculations in this section are run in the isobaric-isothermal ensemble, where the number of particles in the system, the pressure and the temperature are kept constant (NpT). This means that the temperature and the pressure are recalculated in every step, so are no longer constant like they were in the NVE ensemble. From the &#039;&#039;equipartition theorem&#039;&#039;, each degree of freedom will contribute &amp;lt;math&amp;gt;\frac{1}{2} k_B T&amp;lt;/math&amp;gt; of energy to the system. As the system is in three dimensions, there are three degrees of translational freedom and so the total internal energy is equal to &amp;lt;math&amp;gt;\frac{3}{2} k_B T&amp;lt;/math&amp;gt;. Equating this to the kinetic energy, &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt;, at the end of every step and rearranging will allow calculation of the temperature after every step. &lt;br /&gt;
&lt;br /&gt;
A target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, is defined in the input script and the system will equilibrate by multiplying the velocity by a factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, in order to accommodate for the fluctuation and keep the system at approximately the target temperature and therefore constant internal energy. If the temperature of the system is greater than the target temperature, the system&#039;s kinetic energy is too high, so &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is reduced to compensate for this. The same is true for is the temperature is lower than the target temperature; &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than one in the next step to increase the kinetic energy which is now too low. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; can be derived from equating the kinetic and internal energy of the system at an arbitrary time step:&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;
Expanding the brackets inside the sum and moving the term containing &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; out of the sum: &amp;lt;math&amp;gt;\frac{\gamma^2}{2}\sum_i m_i \left(v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;, we can replace &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt; on the left hand side of the equation with &amp;lt;math&amp;gt;\frac{3}{2} N k_B T&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;\frac{3\gamma^2}{2}N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Simplifying and rearranging for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, gives: &amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The principle is the same for controlling the pressure.&lt;br /&gt;
&lt;br /&gt;
As temperature and pressure are no longer constant, he input files require specification of the pressure and the temperature for each of the systems run. 10 simulations were run at two different pressures with five different temperatures at each. &lt;br /&gt;
* Temperatures: 1.6, 1.9, 2.2, 2.5, 2.8&lt;br /&gt;
* Pressures: 2.5, 3.0&lt;br /&gt;
These pressures were chosen because the data simulated when choosing an appropriate timestep gave a pressure between 2.5 and 3.0.  &lt;br /&gt;
&lt;br /&gt;
For the code which computes the thermodynamic potentials, this particular line defines how many steps contribute towards the average of the thermodynamic parameters computed in the calculation. &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;
&#039;&#039;fix&#039;&#039; is the keyword, &#039;&#039;aves&#039;&#039; is the name of the group of fixes which in this case is the average of the thermodynamic values, &#039;&#039;all&#039;&#039; specifies the atoms which the fix is applied to which in this case is all the atoms in the simulated system and &#039;&#039;ave/time&#039;&#039; means that compute global time averages are calculated. The following three numbers have the following meaning:&lt;br /&gt;
&lt;br /&gt;
*100 = use the input values every 100 timesteps&lt;br /&gt;
*1000 = use input values 1000 times for calculating the average&lt;br /&gt;
*100000 = calculate the average every 100000 timesteps&lt;br /&gt;
&lt;br /&gt;
Therefore for the total calculation which lasts for 100000 will only have the average calculated once. Assuming 1 value every timestep, there will be 100000/100 values = 1000. The amount of time simulated is 100,000 steps, read from the following line.&lt;br /&gt;
&lt;br /&gt;
The density data from all ten calculation were plotted on the same graph, along with the density for an &amp;quot;ideal&amp;quot; gas. This density can be derived from the ideal gas law:&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;
Rearranging in terms of density: &amp;lt;math&amp;gt;\frac{N}{V} = \frac{P}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As these simulations are being run under reduced units, we can take &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt;, and so the density of the ideal gas becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the density of the ideal gas is plotted as the pressure divided by the temperature in pressure-temperature phase space.&lt;br /&gt;
[[File:Rmt dvt plot.png|none|thumb|800x800px|&#039;&#039;Figure i. &#039;&#039;Plot of the variation in density with temperature at a defined pressure for the numerically simulated and ideal systems]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that calculated in the ideal gas law. This is because for an ideal gas, an assumption is made that there are no intermolecular interactions, and therefore forces such as electron repulsion forces are ignored; repulsion forces dominate over attractive ones, as all the atoms in this simulation are the same and so partial charges or dipoles are created. This will mean that the particles move closer together than a real gas and so the density will be larger. This discrepancy between the ideal and non-ideal systems becomes larger at a higher pressure because with a higher pressure, the atoms in the system are closer together and therefore the intermolecular repulsion will become larger. This greater repulsion will in turn have a larger effect on decreasing the density.&lt;br /&gt;
&lt;br /&gt;
== Statistical Physics Calculations of the Heat Capacity ==&lt;br /&gt;
The heat capacity of a system at constant volume can be calculated from the variance in the total energy of the system. The relationship used to calculate the heat capacity is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = 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;\left\langle E^2\right\rangle&amp;lt;/math&amp;gt; is the continuous average of the total square energy at each temperature as a function of temperature. &amp;lt;math&amp;gt;\left\langle E\right\rangle^2&amp;lt;/math&amp;gt; is the continuous average of the total energy at each temperature as a function of temperature squared. The heat capacity is multiplied by &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; in this case because the version of LAMMPS calculates every energy divided by the number of molecules in the system simulated.&lt;br /&gt;
&lt;br /&gt;
The calculations in this sections are run in density-temperature phase space and the ensemble has changed to the canonical ensemble (NVT). A set of input files were written for ten calculations for, like the previous section, two pressures and five different temperatures at each pressure:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 0.2, 0.8&lt;br /&gt;
*Temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{C_V}{V}&amp;lt;/math&amp;gt; was plotted against temperature to determine the relationship in density-temperature phase space. An example of an input file can be found [[Media:nvt_-_0220.in|here]]. The lines which have been changed from the previous input files are at the end of the script:&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 &lt;br /&gt;
 thermo_style custom step etotal temp&lt;br /&gt;
 variable energy equal etotal&lt;br /&gt;
 variable energy2 equal etotal*etotal&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_energy v_energy2 v_temp&lt;br /&gt;
 run 100000&lt;br /&gt;
 &lt;br /&gt;
 variable aveenergy equal f_aves[1]&lt;br /&gt;
 variable aveenergy2 equal f_aves[2]&lt;br /&gt;
 variable avetemp equal f_aves[3]&lt;br /&gt;
 variable heatcapacitydv equal atoms*atoms*(v_aveenergy2-v_aveenergy*v_aveenergy)/(v_avetemp*v_avetemp*vol)&lt;br /&gt;
 &lt;br /&gt;
 print &amp;quot;Averages&amp;quot;&lt;br /&gt;
 print &amp;quot;--------&amp;quot;&lt;br /&gt;
 print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Heat Capacity per Volume: ${heatcapacitydv}&amp;quot;&lt;br /&gt;
The line with the keyword &#039;fix&#039; determines which thermodynamic values are averaged and over how many steps they are averaged. The next section takes these averages as variables and uses them to define the heat capacity which is calculated from the equation at the beginning of this section. Only the energy and temperature are needed to define the heat capacity and so only these values are calculated by the simulation. [[File:Rmt heatcapacitybyv.png|none|thumb|800x800px|&#039;&#039;Figure j. &#039;&#039;C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V against temperature for the two different pressures 0.2 and 0.8]]As seen in the above figure, the heat capacity decreases with temperature for both pressures. It would be expected for an ideal system that as the temperature increases, the heat capacity at constant volume increases and tends to a constant volume at very high T of 3R; R = the universal gas constant. This means increasing the temperature increases the amount of energy being stored in the system and this energy is stored as vibrational energy. However, for a Lennard-Jones liquid, the system being simulated here, the heat capacity decreases with temperature. This is because the simulation has two components to the simulation; the atoms are vibrating in a quasi-harmonic fashion around the equilibrium position and also diffuse between neighbouring equilibrium positions in a gas like fashion. As the temperature increases, the amount of diffusion increases and the vibrations decreases, therefore decreasing the ability of the system to absorb vibrational energy, resulting in the decrease in heat capacity. &amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www.nature.com/ncomms/2013/130816/ncomms3331/full/ncomms3331.html?message-global=remove&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural Properties and the Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a single atom in a system is a plot of the probability that an atom can be found at a certain distance from the central atom. The peaks in this plot can give the distance of an atom from its nearest neighbours in the Lennard-Jones simulated system. &lt;br /&gt;
&lt;br /&gt;
The calculations in this section simulate a Lennard-Jones solid, liquid and gas and, using the output of the LAMMPS trajectory file, plots both the radial distribution function and its integral using DLV. The temperature and pressure parameters for these calculations were taken from the phase diagram or coexistence curve for a Lennard-Jones system.&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt; The parameters used are displayed in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! Temperature, &amp;lt;math&amp;gt;T^*&amp;lt;/math&amp;gt;&lt;br /&gt;
! Pressure, &amp;lt;math&amp;gt;p^*&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| LJ Solid&lt;br /&gt;
| 1.5&lt;br /&gt;
| 1.2&lt;br /&gt;
|-&lt;br /&gt;
| LJ Liquid&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.8&lt;br /&gt;
|-&lt;br /&gt;
| LJ Gas&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.01&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The data obtained from the plots and the radial distribution functions and their integrals were plotted and shown in the table below.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure k. &#039;&#039;The radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
!&#039;&#039;Figure l. &#039;&#039;The integrals of the radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt fullrdfs.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt allintegralsrdf.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
[[File:Rmt Nearest neighbours.png|left|thumb|300x300px|&#039;&#039;Figure m. &#039;&#039;Representation of a cross section of the first three shells of nearest neighbours in an fcc solid. The black atom is the central atom being considered, the blue atoms are the first shell, the orange atoms the second shell and the purple atoms are the third.]]&lt;br /&gt;
The RDF of the solid gives a very irregular curve because of the irregular structure of the lattice. For a simple cubic lattice, a regular structure of the RDF would be expected because of the equal number of atoms in each of the nearest neighbour shells of the atoms. However, for face-centered cubic, the solid in this simulation, the structure is much more irregular and as the atoms move from their equilibrium position in the lattice due to vibrations, the peaks in the radial distribution will broaden. The irregular heights of the peaks are due to the varying numbers of atoms in each of the nearest neighbour shells for the central atom. The first shell gives the highest peak as it contains the most atoms; in total, considering all four surrounding unit cells, this shell contains 12 atoms and ideally takes the geometry of an icosahedron. The second shell is smaller and contains only 6 atoms in an octahedral coordination shape. The following shell again contributes 12 atoms, 3 from each unit cell. This therefore explains why the heights of the peaks in the solid plot in &#039;&#039;figure k.&#039;&#039; vary. These values can be confirmed by the plot in &#039;&#039;figure o.&#039;&#039; which is the integral; it cumulatively adds the numbers in each shell. The size of the first &amp;quot;step&amp;quot; is 12; there are 12 atoms in the first shell. The size of the second step is approximately 18; there are 18-12=6 steps in the second shell. The same theory applies for the third shell which gives a value of 13. This is slightly different to the predicted value possibly due to error in the calculation of the radial distribution function and therefore its integral. &lt;br /&gt;
&lt;br /&gt;
The RDF of the liquid has a representation of far fewer shells, which means that there are less atoms in the space close to a &amp;quot;central&amp;quot; atom in the bulk solution. The particles have more energy and therefore do not keep to a regular lattice structure. As they move about, some regualrity is maintained around each atom, but only to the extend of two or three shells, meaning there is no long range order in a Lennard-Jones liquid. &lt;br /&gt;
&lt;br /&gt;
The RDF of the gas again omits more shells as there is almost no order in a Lennard-Jones gas. The single peak on this plot considers only the set of atoms closest to the central atom and all others are disregarded as they are too far apart. &lt;br /&gt;
&lt;br /&gt;
Considering &#039;&#039;figure l.&#039;&#039;, the size of the integral of the radial distribution function decreases from solid to liquid to gas. This makes sense as the number of atoms in the surrounding shells decreases with density of the system; the atoms become further apart. &lt;br /&gt;
&lt;br /&gt;
From the plot of the radial distribution function of the solid, the lattice spacing can be determined. For this, we can consider just the first three peaks of the RDF plot. The lattice spacing refers to the length of one unit cell, and so, using &#039;&#039;figure m&#039;&#039;, we can calculate this using two different methods; a) we can use the distance between the central atom and the first shell of nearest neighbours, and use trigonometry to calculate the lattice spacing. Or alternatively b) we can use the distance between the central atom and the second nearest neighbour shell to get the lattice spacing.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure n. &#039;&#039;The radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
!&#039;&#039;Figure o. &#039;&#039;The integral of the radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt solidgr3.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt solidint3.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
Using method a) (with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; as the distance between the central atom and the nearest neighbour: Lattice spacing = &amp;lt;math&amp;gt;\frac{r}{cos({\frac{\pi}{4}})} = \frac{1.02}{cos({\frac{\pi}{4}})} \approx 1.44&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using method b): Lattice spacing &amp;lt;math&amp;gt;\approx 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can take an average between the two get an approximate value for the lattice spacing: &amp;lt;math&amp;gt;1.46 \plusmn 0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These values for distance are all in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
The ability of atoms to move around in a solid liquid or gas can be characterised by the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. In this section, we will explore two different ways to calculate the diffusion coefficient and compare the results. &lt;br /&gt;
&lt;br /&gt;
=== The Mean Squared Displacement ===&lt;br /&gt;
The diffusion coefficient can be measured easily be calculating the mean squared displacement of atoms in the solution; the diffusion coefficient is proportional to the first derivative of the mean squared displacement. By plotting the mean squared displacement as a function of time, the gradient can be taken to calculate the diffusion coefficient when its has equilibrated and become linear.&lt;br /&gt;
&lt;br /&gt;
The temperature and density parameters used were the same as in the previous section:&lt;br /&gt;
* Solid: T=1.5, D=1.2&lt;br /&gt;
* Liquid: T=1.1, D=0.8&lt;br /&gt;
* Gas: T=1.1, D=0.01&lt;br /&gt;
&lt;br /&gt;
Mean density squared calculations were run for all three Lennard-Jones phases and the data plotted as function of timestep below. The data from a simulation containing 1,000,000 atoms was plotted for comparision.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!Plots for the 8,000 atom data (&#039;&#039;figures p-r)&#039;&#039;&lt;br /&gt;
!Plots for the 1,000,000 atom data (&#039;&#039;figures s-u)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|[[File:Rmt_MSDsolid.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt_MAsolid.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|[[File:Rmt MSDliquid.png|700x700px]]&lt;br /&gt;
|[[File:Rmt MAliquid.png|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|[[File:Rmt MSDgas.png|700x700px]]&lt;br /&gt;
|[[File:Rmt dataplots 25894 image001.png|700x700px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The exact relationship between the mean squared displacement and the diffusion coefficient is:&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;
Taking the gradients of each of the curves at the point at which they become linear and dividing by six will give the diffusion coefficient for each set of data. The gradient also needs to be converted to a function of time; this is done by dividing by the timestep, which in this case is 0.002:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom data diffusion coefficients, &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
!1,000,000 atom data diffusion coefficients &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 0.9999&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|Gradient = 0.0972&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{48.6}{6} = \mathbf{8.1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient = 0.0386&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{19.6}{6} = \mathbf{3.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For both of the solid approximations, the diffusion coefficient can be approximated as zero. This is because, when equilibrated, the function has a constant value of around 0.2 for the mean squared displacement. A gradient with a value of zero means that the atoms take an infinite amount of time to change their mean squared displacement; to move away from their equilibrium position, and so this means that we can approximate in this system, there will be no diffusion. In real system, however, this is not the case; diffusion occurs but it is very slow. A plot for a real system will give a very shallow positive gradient.&lt;br /&gt;
&lt;br /&gt;
The liquid approximations are very well correlated. This is because in both cases, the mean squared displacement of particles in a liquid increases linearly with time and the gradient of both plots are almost identical. We can assume from this that identical starting conditions were used to calculate this data. Also, we can estimate that 8,000 atoms is a large enough simulation to give an accurate result for the diffusion coefficient for the Lennard-Jones liquid.&lt;br /&gt;
&lt;br /&gt;
The gas approximations are very different. This is most probably due to the fact that the density specified in calculations are different. The 8,000 data can be estimated to be a much lower density because the diffusion coefficient is faster and this means diffusion will happen faster; at a higher density a particle will take longer to diffuse over a given distance. Because of the difference in density, the two values of the diffusion coefficient cannot be qualitatively compared. The reason for the initial deviation for linearity in the gas plots is due to the momentum of the particles initially dominating over the diffusion and the diffusion coefficient is dependent on time. As the system equilibrates, the diffusion coefficient becomes constant and the plots become linear.&lt;br /&gt;
&lt;br /&gt;
=== The Velocity Autocorrelation Function ===&lt;br /&gt;
&lt;br /&gt;
Another way to calculate the diffusion coefficient is by using the velocity correlation function, which determines how the velocity of an atom changes with time. The function determines the difference in time (&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;) when the velocity becomes uncorrelated, i.e. the difference between the velocity at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; and at time &amp;lt;math&amp;gt;t+\tau&amp;lt;/math&amp;gt;. By integrating over this function, we can find the diffusion coefficient. &lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function: &amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can also be written as the integral: &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;
Using the function which defines the position of a classical harmonic oscillator, we can differentiate this to give the equation for the velocity which we can plug into the integral:&lt;br /&gt;
&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;
&amp;lt;math&amp;gt;dv{x(t)}{t} = v(t) = -A\omega sin(\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also needed for the integral:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t+\tau) = -A\omega sin(\omega(t+\tau)+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v^2(t) = A^2\omega^2 sin^2(\omega t +\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Putting all this into the integral to find the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega sin(\omega t + \phi) \times A\omega sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} A^2\omega^2 sin^2(\omega t +\tau)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A^2\omega^2&amp;lt;/math&amp;gt; can be take out of each of the integrals and cancelled. A substituion can then be made to make solving the integral much simpler:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = \omega t + \phi&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \omega\tau&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the integral becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a) \times sin(a+b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the compound angle rule &amp;lt;math&amp;gt;sin(a+b)=sin(a)cos(b)+cos(a)sin(b)&amp;lt;/math&amp;gt;, the integral can be simplified to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a)sin(a)cos(b) + sin(a)cos(a)sin(b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Separating out into two integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)\frac{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the rule &amp;lt;math&amp;gt;sin(a)cos(a) = \frac{1}{2}sin(2a)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} \frac{1}{2}(sin(2a))\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because the function &amp;lt;math&amp;gt;\frac{1}{2}sin(2a)&amp;lt;/math&amp;gt; is symmetric over all space, the second term in this equation becomes zero. Therefore, the integral simplifies to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b) = cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same calculations from the mean squared displacement section gave an output of the velocity autocorrelation function. The function for the Lennard-Jones solid, liquid and gas were plotted against the timestep along with the approximate function for the velocity autocorrelation function, &amp;lt;math&amp;gt;cos(\omega\tau)&amp;lt;/math&amp;gt;, where \omega = \frac{1}{2\pi}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure v. &#039;&#039;Plots for the velocity autocorrelation function of a Lennard-Jones solid, liquid and gas; 8,000 atoms&lt;br /&gt;
!&#039;&#039;Figure w. &#039;&#039;Plots for the velocity autocorrelation function of a Lennard-Jones solid, liquid and gas, 1,000,000 atoms&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt VACF 5721 image001.png|800x800px|]]&lt;br /&gt;
|[[File:Rmt MAVACF.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
The diffusion coefficient is calculated from: &amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty C\left(\tau\right)\mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the approximate value for the diffusion coefficient using the velocity autocorrelation function is &amp;lt;math&amp;gt;D = \frac{1}{3}cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The running integral of the velocity autocorrelation functions was plotted using the &#039;&#039;trapesium rule&#039;&#039;, and so the final value on the integral plot is proportional to the diffusion coefficient.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom VACF integral &#039;&#039;(figures w-z)&#039;&#039;&lt;br /&gt;
!1,000,000 VACF integral (&#039;&#039;figures aa-cc)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|[[File:Rmt mysi.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt masi.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|[[File:Rmt myli.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt mali.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|[[File:Rmt mygi.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt ligi.png|frameless|700x700px]]&lt;br /&gt;
|}&lt;br /&gt;
The diffusion coefficients for each of the plots above are tabulated below using the final data point from the integral plot. This is the integral over the whole graph using the trapesium rule. This must be corrected for the &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom data diffusion coefficients, &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
!1,000,000 atom data diffusion coefficients &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;-0.00055&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{-0.00055}{6} = -0.00018 \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.00014&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.00014}{6} = 0.000046 \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.242&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.242}{6} = \mathbf{0.0807}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.270&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.270}{6} = \mathbf{0.901}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;25.6&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{25.6}{6} = \mathbf{8.55}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;9.81&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{9.81}{6} = \mathbf{3.27}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=541492</id>
		<title>Rep:Mod:hakunamatata</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=541492"/>
		<updated>2016-02-25T13:50:49Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: /* The Velocity Autocorrelation Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Introduction to Molecular Dynamics Simulations ==&lt;br /&gt;
===The Classical Particle Approximation and Numerical Integration===&lt;br /&gt;
The verit and verit-velocity algorithms are numerical methods to approximate the average position and velocity respectively of randomly moving atoms in a particular medium (solid, liquid, fliud etc.). This position and velocity can be applied to Newtonian mechanics to calculate such properties as the force and potential energy of the system. The algorithms work by splitting the function into discrete time steps, calculating the values of position and velocity at this particular time step, and then effectively &amp;quot;joining the dots&amp;quot; to create an approximate function. These simulations always use the answer from the previous timestep to compute the new timestep, so initial conditions must be given for the first step. Both of the algorithms are shown below and are derived from the Taylor expansion of the position or velocity of the atoms at the timestep &amp;quot;n+1&amp;quot; or &amp;lt;math&amp;gt;t+\delta t&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit Algorithum:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{x}_i\left(t + \delta t\right) \approx 2\mathbf{x}_i\left(t\right) - \mathbf{x}_i\left(t - \delta t\right) + \frac{\mathbf{F}_i\left(t\right)}{m_i}\delta t^2  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit-Velocity Algorithum:&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i\left(t\right)&amp;lt;/math&amp;gt; is the force acting on a particular atom as a function of time&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i&amp;lt;/math&amp;gt; is the acceleration &lt;br /&gt;
&lt;br /&gt;
The smaller the timestep, the closer the numerical approximation is to the true solution function, which can be modeled as a classical harmonic oscillator. &#039;&#039;Figure a.&#039;&#039; in the table below shows the comparison between the two methods in &#039;&#039;time&#039;&#039; space. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure a. &#039;&#039;Plots of position vs time comparing the verit algorithm and harmonic spring results&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure b. &#039;&#039;Plot of the total classical energy of the system (potential + kinetic)&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory xanalytical.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory energy.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The harmonic spring position values are modeled from the harmonic oscillator or particle on a spring. The equation of &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; was used to calculate these values, where &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; are 1 and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; is zero. As seen on the plot, the curves produced from the two different methods of calculating the position are in good agreement.&lt;br /&gt;
|The potential energy is calculated using the equation U = 1/2 kx^2, with a value of k given as 1. The kinetic energy is calculated using the velcity from the verit-velocity algorithm using the equation T = 1/2 mv^2, with a value of m given as 1. The total energy of the system, E, is equal to T + U. The values for x (potential energy) and v (kinetic energy) are taken from the verity algorithm and verit-velocity algorthim respectively. &lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;Figure c. &#039;&#039;Plot of the difference (error) between the harmonic spring and verit algorithm data&lt;br /&gt;
!&#039;&#039;Figure d. &#039;&#039;Plot of the peaks in the error plot in &#039;&#039;figure c.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory error.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory errorpeaks.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The peaks in the error between the harmonic spring and verit algorithm results are at the place where the position curve crosses the time axis. This is because the harmonic spring data (x(t)) has a slightly shorter wave period than that of the verit velocity algorithm, and therefore the difference will get larger with each period of the wave, shown by the error getting larger in &#039;&#039;figure c. &#039;&#039;The period of the plot of the two methods are different because the verit algorithm is much more approximate so does not give the correct solution.&lt;br /&gt;
|The change in the error/difference between the harmonic spring data and verit algorthm data increases linearly and so therefore period of each of the plots in &#039;&#039;figure 1&#039;&#039;. must be constant. &lt;br /&gt;
|}&lt;br /&gt;
The error can also be quantified on a &#039;&#039;phase space&#039;&#039; plot; phase space is momentum or velocity plotted as a function of position. The true solution for motion of an atom is a perfect ellipse, and the more elliptic the shape (less circular) the more momentum or velocity is in the system. A numerical solution, like the verit algorithms, will produce a set of points very close to this ellipse but not perfectly following the curve. A good numerical solution will remain in an elliptical shape, whereas a bad numerical solution, for example one with a large timestep, will spiral away from the true solution. Two examples of such systems using the data from &#039;&#039;figures a-d&#039;&#039; are shown below.  &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure e. &#039;&#039;Phase plot of the harmonic spring data with a good numerical solution (timestep = 0.1) &lt;br /&gt;
!&#039;&#039;Figure f. &#039;&#039;Phase plot of the harmonic spring data with a bad numerical solution (timestep = 0.3) &lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory phasegood.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory badphase.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The timestep at which this data is plotted is 0.1, which results in a very small change in the energy, as seen in &#039;&#039;figure b. &#039;&#039;Increasing the time step will increase the variation in the energy. To keep the variation in the total energy of the system under 1%, the time step must be no larger than approximately 0.28. The energy varies more with increasing time step because the jumps in the algorithm  are getting larger due to less data points. The algorithm assumes these points are joined by a straight line; that the halfway point in the jump is the average between the starting and finishing point of the jump. The phase space plot will become less elliptic and the jumps eventually become so larger that the plot is no longer a continuous shape.  &lt;br /&gt;
&lt;br /&gt;
It is essential to monitor the energy of a numerically modeled system because a good solution for the motion of an atom has a constant energy and a plot in phase space of a perfect ellipse.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance and Force at Zero Potential===&lt;br /&gt;
From classical mechanics, the force calculated from the Newtonian mechanics above can be used to calculate the potential experienced by an atom in the system. They are related by the equation: &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;
This potential gives the shape and dimension of the potential surface on which the system can be modeled. A simple 1D potential that is used to describe the inter atomic forces of a liquid is the Lennard-Jones potential. It has the characteristic features of a short range repulsion potential and harmonic character around the equilibrium bond distance. The value of &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the inter atomic separation when the potential, &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;, is equal to zero, can be calculated by equating the equation for the Lennard-Jones potential to zero and solving for &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The equation for the Lennard-Jones potential: &amp;lt;math&amp;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;
Equating this to zero: &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;
And rearranging in order to separate the variables: &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;
Rearranging this gives &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in terms of &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt; r^6 = \sigma^6&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r = r_0&amp;lt;/math&amp;gt; in this case.&lt;br /&gt;
&lt;br /&gt;
This, therefore, gives the result that interatomic distance at zero potential, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, is equal to &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; in the Lennard-Jones potential is effectively the diameter of one of the particles in the system being measured; in this case, the liquid we are simulating. This is the point where the potential curve crosses the x-axis on an Energy vs interatomic distance plot. The force, &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt;, at this point on the curve corresponds to the gradient; it is found by calculating the derivative of the curve at this point. &lt;br /&gt;
&lt;br /&gt;
To calculate the force, we must differentiate the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As force is equal to the negative differential of the potential energy, the value of the force is: &amp;lt;math&amp;gt;\mathbf{F}_i = 48\epsilon \sigma^{12} r^{-13} - 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting in the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at zero potential from the calculation before: &amp;lt;math&amp;gt;\mathbf{F}_i = \frac{48\epsilon}{\sigma} - \frac{24\epsilon}{\sigma} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The gradient where the Lennard-Jones plot crosses the axis is negative; &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; in the term obtained for &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is negative and therefore the overall value of the force will be negative.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance, Force and Well Depth of the Potential at Equilibrium===&lt;br /&gt;
To calculate the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at the equilibrium position, we need to use the derivative of the potential energy curve. The equilibrium value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is the value at the minimum of the Lennard-Jones curve; when &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Therefore, equating the derivative to zero gives: &amp;lt;math&amp;gt;0 = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rearranging this: &amp;lt;math&amp;gt;48\epsilon \sigma^{12} r^{-13} = 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And simplifying and cancelling gives: &amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6&amp;lt;/math&amp;gt;. Therefore the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at equilibrium is: &amp;lt;math&amp;gt;r_{eq} = \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Physically, this result means that the equilibrium distance is 1.12 times the diameter of one of the particles; the particles have a small gap between them so do not touch. A short range repulsion potential, as seen in the Lennard-Jones curve, is a result of the particles coming into contact. &lt;br /&gt;
&lt;br /&gt;
Again, the force can be calculated from the derivative of the potential curve at the equilibrium point. As the derivative at this point is zero (a minimum on the curve), the force will therefore also be zero.&lt;br /&gt;
&lt;br /&gt;
The well-depth of the potential curve is the difference between zero potential and the potential at the equilibrium bond length. This can be calculated by substituting the value for the equilibrium bond length into the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 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;
Cancelling and simplifying this equation gives: &amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \times \frac{1}{4}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the absolute value for the well depth is &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;. The actual value of this potential is &amp;lt;math&amp;gt;-\epsilon&amp;lt;/math&amp;gt;, as the equilibrium bond length gives the most stable configuration of the molecules and therefore suggests attractive interactions are involved in the arrangement of the molecules; this attractive potential means its negative. &lt;br /&gt;
&lt;br /&gt;
===Boundary Conditions and the Lennard-Jones Cutoff===&lt;br /&gt;
When simulating a liquid, it is computationally impractical to simulate a realistic liquid. Therefore a smaller &#039;box&#039; containing &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; particles is simulated and the computer program will use &#039;&#039;periodic boundary conditions&#039;&#039; to simulate infinite repetitions of this box; when the atom reaches one edge of the box, in periodic boundary conditions, it will reappear again at the opposite edge of the box as if they were connected. For example, an atom at the position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a box of size &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;. Without periodic boundary conditions, we would assume that the atom would end up at the position &amp;lt;math&amp;gt;(1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;. However, in this box, there is no such position and so the particle must reappear at the opposite edge to where it effectively &#039;left&#039; the box. Therefore, it&#039;s ending position will be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The number of particles, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; simulated by the computer is usually between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt;. Physically, this is a very small volume. Considering water, we can calculate the number of molecules in 1 mL or 1 cm^3, a volume that would be considered small in the lab. Taking the concentration of water at standard conditions, &amp;lt;math&amp;gt;55\ mol\ dm^{-3}&amp;lt;/math&amp;gt;, we can convert it to the number of moles per mL: &amp;lt;math&amp;gt;0.055\ mol\ mL^{-1}&amp;lt;/math&amp;gt;. Multiplying this value by Avagadro&#039;s constant (&amp;lt;math&amp;gt;N_A&amp;lt;/math&amp;gt;) gives the number of molcules of water per mL: &amp;lt;math&amp;gt;3.02 \times 10^{22}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The reverse procedure can be used to compare this to the volume of 10,000 molecules: 10,000 divided by Avagadro&#039;s constant gives the number of moles of water which 10,000 molecules makes up: &amp;lt;math&amp;gt;1.66 \times 10^{-20}\ moles&amp;lt;/math&amp;gt;. Dividing this value by the concentration (from &amp;lt;math&amp;gt;n=cV&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is the number of moles, &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; is the concentration and &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume), gives the volume: &amp;lt;math&amp;gt;3.02 \times 10^{-22}\ dm&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;3.02 \times 10^{-19}\ mL&amp;lt;/math&amp;gt;. Physically, of course, this is far too small a volume to be recorded in the lab.&lt;br /&gt;
 &lt;br /&gt;
Periodic boundary conditions simulate an infinite lattice and therefore, when computing the potential, will calculate an infinite amount of pair interactions. Therefore, it is only practical to calculate the energies up to a certain interatomic distance; the Lennard-Jones cutoff distance. Beyond this point, the potential energy and the integral of the curve beyond this point become insignificant and do not impact on the overall energy; removing interactions beyond this point from the calculations will not effect the accuracy. Multiplying the Lennard-Jones potential with the radial distribution function gives a plot of the probability of finding an atom at a particular interatomic distance. The larger the interatomic distance, the lower the probability and so the energy after the cutoff can be disregarded. &lt;br /&gt;
&lt;br /&gt;
Integrating over the Lennard-Jones curve and applying this cutoff as the lower limit can show how small the integral is:&lt;br /&gt;
&lt;br /&gt;
For a general cutoff of with value &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;I = \int_{x}^\infty \phi\left(r\right)\mathrm{d}r = \int_{x}^\infty \frac{4\epsilon\sigma^{12}}{r^{12}}\mathrm{d}r - \int_{x}^\infty \frac{4\epsilon\sigma^6}{r^6}\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving this: &amp;lt;math&amp;gt;I = 4\epsilon\sigma^{12} {\frac{-1}{11r^{11}}\,\Bigg\vert\,}_x^\infty - 4\epsilon\sigma^{6} {\frac{-1}{5r^{5}}\,\Bigg\vert\,}_x^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This gives the general solution: &amp;lt;math&amp;gt;I = \frac{4\epsilon\sigma^{12}}{11x^{11}} - \frac{4\epsilon\sigma^{6}}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating this for &amp;lt;math&amp;gt;\epsilon = \sigma = 1&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;I = \frac{4}{11x^{11}} - \frac{4}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt; (or 2 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.025&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt; (or 2.5 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0082&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt; (or 3 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0033&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All values are taken to 2 significant figures. As the cutoff value for the interatomic distance gets larger, the integral gets smaller, and therefore the energy excluded from the calculation becomes smaller, and the second term in the solved integral, &amp;lt;math&amp;gt;I&amp;lt;/math&amp;gt;, dominates the energy value.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
When using the Lennard-Jones potential, it is appropriate to use reduced units for intermolecular distance, energy and temperature. Reduced units can be calculated by the following relationships:&lt;br /&gt;
&lt;br /&gt;
Intermolecular 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;
&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; are scaling factors. For example, if the parameters for Argon are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\sigma = 0.34 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt; \epsilon\ /\ k_B = 120 K&amp;lt;/math&amp;gt;&lt;br /&gt;
* Lennard-Jones cutoff &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;. The well-depth, &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;, is &amp;lt;math&amp;gt;0.999 kJ mol^{-1} \approx 1 kJ mol^{-1}&amp;lt;/math&amp;gt;. The value of &amp;lt;math&amp;gt;T* = 1.5&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;180 K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
The first aim of the simulations is to determine the most appropriate timestep to use in the vert algorithm simulations. This timestep is a balance between the accuracy of the results (the smaller the timestep, the closer to the true functing the result will be) and the length of real time over which the simluation is run (the smaller the timestep, the less real time over which the simulation will give a result). The appropriateness of the timestep will be determined by plotting how the total free energy of the simulated lattice equilibrates over time.  &lt;br /&gt;
&lt;br /&gt;
Five different calculations, which simulated the melting of a crystal and subsequent equilibration of the energy of the melted crystal, were run at five different timesteps; 0.001, 0.0025, 0.0075, 0.01 and 0.015, and were described by the NVE or &#039;&#039;&amp;quot;microcanonical ensemble&amp;quot;&#039;&#039;. An ensemble is a collection of samples of a system which are under three thermodynamic constraints (three properties are kept constant); in the microcanonical ensemble, the number of particles, the volume and the total energy is kept constant (NVE). &lt;br /&gt;
&lt;br /&gt;
These calculations simulate a box of 1000 unit cells and use periodic boundary conditions to replicate the simulation to a larger scale. Because these simulations use the numerical methods defined in the previous section, the initial position and velocity of the atoms must be defined in the input file. The Brownian (uncorrelated, random) motion of the atoms in the simulation means that there is no long range order in the system and so the atoms in a real system would start in random positions. However, assigning random starting coordinates to the atoms in a simulated liquid is not a relative process; the coordinates are generate independently of each other. Therefore there is a probability that the coordinates simulated will cause the atoms to overlap, which would give a very large repulsion potential, as seen in the Lennard-Jones potential at very small interatomic distances. This short-range repulsion potential comes from the hard-sphere model of atomic simulation.&lt;br /&gt;
&lt;br /&gt;
The input file also defines the structure and density of the lattice. The number density of lattice points in any lattice is the number of lattice points per volume of the unit cell. In a simple cubic lattice, there is one lattice point in the unit cell. From an sc lattice with lattice spacing (length of one side of the unit cell) being &amp;lt;math&amp;gt;1.07722&amp;lt;/math&amp;gt;, the number density of the lattice points is calculated by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{1}{1.07722^3} = 0.7999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a face-centered cubic lattice (fcc), there are four lattice points in the unit cell. Rearranging the above relationship, the lattice spacing can be calculated from the number of lattice points in a unit cell and number density, &amp;lt;math&amp;gt;1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Lattice\ spacing = \sqrt[3]{\frac{number\ of\ lattice\ points\ per\ unit\ cell}{number\ density}} = \sqrt[3]{\frac{4}{1.2}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation creates a box which includes 1000 unit cells, which is 10 unit cells in each dimension. For a simple cubic lattice, because there is one lattice point per unit cell, there will be 1000 atoms created as seen in the input file. The &#039;&#039;create_atom&#039;&#039; command in the input file determines how many boxes are created in the simulation and therefore how many atoms will be created. If a face centered cubic lattice is simulated, because there are 4 lattice points per unit cell, 4000 atoms will be created in the &#039;&#039;create_atom&#039;&#039; command. &lt;br /&gt;
&lt;br /&gt;
The input script also contains the following commands which defines the potential surface which is used to model the intermolecular reactions:&lt;br /&gt;
 mass 1 1.0&lt;br /&gt;
This instruction sets the mass type for the atoms being simulated. It takes the general form of “mass I value”, where mass is the keyword which tells LAMMPS what the input is, I is the atom type and value is the mass of the atom. In this case, I is defined by a specific numerical value; 1 as there is only 1 type of atom in the simulation, but it can be defined with an asterisk (1*), which means “all atom types of 1 to n inclusive”. &lt;br /&gt;
 pair_style lj/cut 3.0&lt;br /&gt;
This instruction sets the type of potential which LAMMPS uses in its calculation of pairwise interactions. It takes the general form of “pair_style style args”, where pair_style is the keyword for LAMMPS, style defines the potential and any specifications it may have, and args are the arguments required for this particular potential. In this case, the Lennard-Jones potential has been used (lj) with a cutoff point (cut) of 3σ. The cutoff point is explained in the introduction section. &lt;br /&gt;
 pair_coeff * * 1.0 1.0&lt;br /&gt;
This instruction specifies the coefficients for the pairwise interactions of each pair of atoms, and it takes the general form “pair_coeff I J args”. Pair_coeff is the keyword, I and J are the atom types, and args are the coefficients which the different atoms types take. In this case, the asterisk in place of I and J refers to all atoms types from 1 to n. The coefficients are the pairwise interactions are 1 for each atom, meaning each atom has an equal contribution to the interaction.&lt;br /&gt;
&lt;br /&gt;
In these initial calculations, the initial conditions for the numerical methods, &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. For this experiment, the verit-velocity algorithm would be the most appropriate, as both the starting position and velocity is specified for this algorithm. &lt;br /&gt;
&lt;br /&gt;
To define the timestep for the algorithm the following code is used defining the timestep as a variable instead of just giving it a definite value&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;
It is much easier to use the variable version of defining the timestep because the length of time over which the simulation is run depends on the time step. By using a variable, you can keep the length of the simulation the same, no matter the size of the timestep. It also makes it easier if multiple properties depend on the timestep – only the variable needs to be changed, not all the parts of the script where timestep is defined. &lt;br /&gt;
&lt;br /&gt;
The calculations produce the values for the total energy of the system, temperature and pressure in the output files, which can be plotted against time. How well these values equilibrate determines the appropriateness of the timestep to use in further calculations in the experiment.   &lt;br /&gt;
[[File:Rmt totalenergy plot.png|none|thumb|800x800px|&#039;&#039;Figure h. &#039;&#039;Plot of the equilibration of total energy for five different timesteps]]&lt;br /&gt;
The largest time step to give an acceptable result is 0.01. However, for any simluation we would expect energy to be independent of the timestep, something which is not true at a timestep greater than 0.0025. Therefore, the most appropriate timestep to use for a balance between accuracy and length of time which the simulation covers is 0.0025.  &lt;br /&gt;
&lt;br /&gt;
0.015 is a particularly bad choice of timestep. This is because the verit-velocity algorithm gives an approximate result to the velocity (kinetic energy term) and position (potential energy term), and so when the timestep becomes too large with respect to the time, the algorithm no longer becomes a suitable way to calculate the energy. As seen in the graph of 0.015, the energy does not equilibrate and diverges.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions ==&lt;br /&gt;
The calculations in this section are run in the isobaric-isothermal ensemble, where the number of particles in the system, the pressure and the temperature are kept constant (NpT). This means that the temperature and the pressure are recalculated in every step, so are no longer constant like they were in the NVE ensemble. From the &#039;&#039;equipartition theorem&#039;&#039;, each degree of freedom will contribute &amp;lt;math&amp;gt;\frac{1}{2} k_B T&amp;lt;/math&amp;gt; of energy to the system. As the system is in three dimensions, there are three degrees of translational freedom and so the total internal energy is equal to &amp;lt;math&amp;gt;\frac{3}{2} k_B T&amp;lt;/math&amp;gt;. Equating this to the kinetic energy, &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt;, at the end of every step and rearranging will allow calculation of the temperature after every step. &lt;br /&gt;
&lt;br /&gt;
A target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, is defined in the input script and the system will equilibrate by multiplying the velocity by a factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, in order to accommodate for the fluctuation and keep the system at approximately the target temperature and therefore constant internal energy. If the temperature of the system is greater than the target temperature, the system&#039;s kinetic energy is too high, so &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is reduced to compensate for this. The same is true for is the temperature is lower than the target temperature; &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than one in the next step to increase the kinetic energy which is now too low. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; can be derived from equating the kinetic and internal energy of the system at an arbitrary time step:&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;
Expanding the brackets inside the sum and moving the term containing &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; out of the sum: &amp;lt;math&amp;gt;\frac{\gamma^2}{2}\sum_i m_i \left(v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;, we can replace &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt; on the left hand side of the equation with &amp;lt;math&amp;gt;\frac{3}{2} N k_B T&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;\frac{3\gamma^2}{2}N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Simplifying and rearranging for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, gives: &amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The principle is the same for controlling the pressure.&lt;br /&gt;
&lt;br /&gt;
As temperature and pressure are no longer constant, he input files require specification of the pressure and the temperature for each of the systems run. 10 simulations were run at two different pressures with five different temperatures at each. &lt;br /&gt;
* Temperatures: 1.6, 1.9, 2.2, 2.5, 2.8&lt;br /&gt;
* Pressures: 2.5, 3.0&lt;br /&gt;
These pressures were chosen because the data simulated when choosing an appropriate timestep gave a pressure between 2.5 and 3.0.  &lt;br /&gt;
&lt;br /&gt;
For the code which computes the thermodynamic potentials, this particular line defines how many steps contribute towards the average of the thermodynamic parameters computed in the calculation. &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;
&#039;&#039;fix&#039;&#039; is the keyword, &#039;&#039;aves&#039;&#039; is the name of the group of fixes which in this case is the average of the thermodynamic values, &#039;&#039;all&#039;&#039; specifies the atoms which the fix is applied to which in this case is all the atoms in the simulated system and &#039;&#039;ave/time&#039;&#039; means that compute global time averages are calculated. The following three numbers have the following meaning:&lt;br /&gt;
&lt;br /&gt;
*100 = use the input values every 100 timesteps&lt;br /&gt;
*1000 = use input values 1000 times for calculating the average&lt;br /&gt;
*100000 = calculate the average every 100000 timesteps&lt;br /&gt;
&lt;br /&gt;
Therefore for the total calculation which lasts for 100000 will only have the average calculated once. Assuming 1 value every timestep, there will be 100000/100 values = 1000. The amount of time simulated is 100,000 steps, read from the following line.&lt;br /&gt;
&lt;br /&gt;
The density data from all ten calculation were plotted on the same graph, along with the density for an &amp;quot;ideal&amp;quot; gas. This density can be derived from the ideal gas law:&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;
Rearranging in terms of density: &amp;lt;math&amp;gt;\frac{N}{V} = \frac{P}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As these simulations are being run under reduced units, we can take &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt;, and so the density of the ideal gas becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the density of the ideal gas is plotted as the pressure divided by the temperature in pressure-temperature phase space.&lt;br /&gt;
[[File:Rmt dvt plot.png|none|thumb|800x800px|&#039;&#039;Figure i. &#039;&#039;Plot of the variation in density with temperature at a defined pressure for the numerically simulated and ideal systems]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that calculated in the ideal gas law. This is because for an ideal gas, an assumption is made that there are no intermolecular interactions, and therefore forces such as electron repulsion forces are ignored; repulsion forces dominate over attractive ones, as all the atoms in this simulation are the same and so partial charges or dipoles are created. This will mean that the particles move closer together than a real gas and so the density will be larger. This discrepancy between the ideal and non-ideal systems becomes larger at a higher pressure because with a higher pressure, the atoms in the system are closer together and therefore the intermolecular repulsion will become larger. This greater repulsion will in turn have a larger effect on decreasing the density.&lt;br /&gt;
&lt;br /&gt;
== Statistical Physics Calculations of the Heat Capacity ==&lt;br /&gt;
The heat capacity of a system at constant volume can be calculated from the variance in the total energy of the system. The relationship used to calculate the heat capacity is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = 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;\left\langle E^2\right\rangle&amp;lt;/math&amp;gt; is the continuous average of the total square energy at each temperature as a function of temperature. &amp;lt;math&amp;gt;\left\langle E\right\rangle^2&amp;lt;/math&amp;gt; is the continuous average of the total energy at each temperature as a function of temperature squared. The heat capacity is multiplied by &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; in this case because the version of LAMMPS calculates every energy divided by the number of molecules in the system simulated.&lt;br /&gt;
&lt;br /&gt;
The calculations in this sections are run in density-temperature phase space and the ensemble has changed to the canonical ensemble (NVT). A set of input files were written for ten calculations for, like the previous section, two pressures and five different temperatures at each pressure:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 0.2, 0.8&lt;br /&gt;
*Temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{C_V}{V}&amp;lt;/math&amp;gt; was plotted against temperature to determine the relationship in density-temperature phase space. An example of an input file can be found [[Media:nvt_-_0220.in|here]]. The lines which have been changed from the previous input files are at the end of the script:&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 &lt;br /&gt;
 thermo_style custom step etotal temp&lt;br /&gt;
 variable energy equal etotal&lt;br /&gt;
 variable energy2 equal etotal*etotal&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_energy v_energy2 v_temp&lt;br /&gt;
 run 100000&lt;br /&gt;
 &lt;br /&gt;
 variable aveenergy equal f_aves[1]&lt;br /&gt;
 variable aveenergy2 equal f_aves[2]&lt;br /&gt;
 variable avetemp equal f_aves[3]&lt;br /&gt;
 variable heatcapacitydv equal atoms*atoms*(v_aveenergy2-v_aveenergy*v_aveenergy)/(v_avetemp*v_avetemp*vol)&lt;br /&gt;
 &lt;br /&gt;
 print &amp;quot;Averages&amp;quot;&lt;br /&gt;
 print &amp;quot;--------&amp;quot;&lt;br /&gt;
 print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Heat Capacity per Volume: ${heatcapacitydv}&amp;quot;&lt;br /&gt;
The line with the keyword &#039;fix&#039; determines which thermodynamic values are averaged and over how many steps they are averaged. The next section takes these averages as variables and uses them to define the heat capacity which is calculated from the equation at the beginning of this section. Only the energy and temperature are needed to define the heat capacity and so only these values are calculated by the simulation. [[File:Rmt heatcapacitybyv.png|none|thumb|800x800px|&#039;&#039;Figure j. &#039;&#039;C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V against temperature for the two different pressures 0.2 and 0.8]]As seen in the above figure, the heat capacity decreases with temperature for both pressures. It would be expected for an ideal system that as the temperature increases, the heat capacity at constant volume increases and tends to a constant volume at very high T of 3R; R = the universal gas constant. This means increasing the temperature increases the amount of energy being stored in the system and this energy is stored as vibrational energy. However, for a Lennard-Jones liquid, the system being simulated here, the heat capacity decreases with temperature. This is because the simulation has two components to the simulation; the atoms are vibrating in a quasi-harmonic fashion around the equilibrium position and also diffuse between neighbouring equilibrium positions in a gas like fashion. As the temperature increases, the amount of diffusion increases and the vibrations decreases, therefore decreasing the ability of the system to absorb vibrational energy, resulting in the decrease in heat capacity. &amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www.nature.com/ncomms/2013/130816/ncomms3331/full/ncomms3331.html?message-global=remove&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural Properties and the Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a single atom in a system is a plot of the probability that an atom can be found at a certain distance from the central atom. The peaks in this plot can give the distance of an atom from its nearest neighbours in the Lennard-Jones simulated system. &lt;br /&gt;
&lt;br /&gt;
The calculations in this section simulate a Lennard-Jones solid, liquid and gas and, using the output of the LAMMPS trajectory file, plots both the radial distribution function and its integral using DLV. The temperature and pressure parameters for these calculations were taken from the phase diagram or coexistence curve for a Lennard-Jones system.&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt; The parameters used are displayed in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! Temperature, &amp;lt;math&amp;gt;T^*&amp;lt;/math&amp;gt;&lt;br /&gt;
! Pressure, &amp;lt;math&amp;gt;p^*&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| LJ Solid&lt;br /&gt;
| 1.5&lt;br /&gt;
| 1.2&lt;br /&gt;
|-&lt;br /&gt;
| LJ Liquid&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.8&lt;br /&gt;
|-&lt;br /&gt;
| LJ Gas&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.01&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The data obtained from the plots and the radial distribution functions and their integrals were plotted and shown in the table below.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure k. &#039;&#039;The radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
!&#039;&#039;Figure l. &#039;&#039;The integrals of the radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt fullrdfs.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt allintegralsrdf.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
[[File:Rmt Nearest neighbours.png|left|thumb|300x300px|&#039;&#039;Figure m. &#039;&#039;Representation of a cross section of the first three shells of nearest neighbours in an fcc solid. The black atom is the central atom being considered, the blue atoms are the first shell, the orange atoms the second shell and the purple atoms are the third.]]&lt;br /&gt;
The RDF of the solid gives a very irregular curve because of the irregular structure of the lattice. For a simple cubic lattice, a regular structure of the RDF would be expected because of the equal number of atoms in each of the nearest neighbour shells of the atoms. However, for face-centered cubic, the solid in this simulation, the structure is much more irregular and as the atoms move from their equilibrium position in the lattice due to vibrations, the peaks in the radial distribution will broaden. The irregular heights of the peaks are due to the varying numbers of atoms in each of the nearest neighbour shells for the central atom. The first shell gives the highest peak as it contains the most atoms; in total, considering all four surrounding unit cells, this shell contains 12 atoms and ideally takes the geometry of an icosahedron. The second shell is smaller and contains only 6 atoms in an octahedral coordination shape. The following shell again contributes 12 atoms, 3 from each unit cell. This therefore explains why the heights of the peaks in the solid plot in &#039;&#039;figure k.&#039;&#039; vary. These values can be confirmed by the plot in &#039;&#039;figure o.&#039;&#039; which is the integral; it cumulatively adds the numbers in each shell. The size of the first &amp;quot;step&amp;quot; is 12; there are 12 atoms in the first shell. The size of the second step is approximately 18; there are 18-12=6 steps in the second shell. The same theory applies for the third shell which gives a value of 13. This is slightly different to the predicted value possibly due to error in the calculation of the radial distribution function and therefore its integral. &lt;br /&gt;
&lt;br /&gt;
The RDF of the liquid has a representation of far fewer shells, which means that there are less atoms in the space close to a &amp;quot;central&amp;quot; atom in the bulk solution. The particles have more energy and therefore do not keep to a regular lattice structure. As they move about, some regualrity is maintained around each atom, but only to the extend of two or three shells, meaning there is no long range order in a Lennard-Jones liquid. &lt;br /&gt;
&lt;br /&gt;
The RDF of the gas again omits more shells as there is almost no order in a Lennard-Jones gas. The single peak on this plot considers only the set of atoms closest to the central atom and all others are disregarded as they are too far apart. &lt;br /&gt;
&lt;br /&gt;
Considering &#039;&#039;figure l.&#039;&#039;, the size of the integral of the radial distribution function decreases from solid to liquid to gas. This makes sense as the number of atoms in the surrounding shells decreases with density of the system; the atoms become further apart. &lt;br /&gt;
&lt;br /&gt;
From the plot of the radial distribution function of the solid, the lattice spacing can be determined. For this, we can consider just the first three peaks of the RDF plot. The lattice spacing refers to the length of one unit cell, and so, using &#039;&#039;figure m&#039;&#039;, we can calculate this using two different methods; a) we can use the distance between the central atom and the first shell of nearest neighbours, and use trigonometry to calculate the lattice spacing. Or alternatively b) we can use the distance between the central atom and the second nearest neighbour shell to get the lattice spacing.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure n. &#039;&#039;The radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
!&#039;&#039;Figure o. &#039;&#039;The integral of the radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt solidgr3.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt solidint3.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
Using method a) (with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; as the distance between the central atom and the nearest neighbour: Lattice spacing = &amp;lt;math&amp;gt;\frac{r}{cos({\frac{\pi}{4}})} = \frac{1.02}{cos({\frac{\pi}{4}})} \approx 1.44&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using method b): Lattice spacing &amp;lt;math&amp;gt;\approx 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can take an average between the two get an approximate value for the lattice spacing: &amp;lt;math&amp;gt;1.46 \plusmn 0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These values for distance are all in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
The ability of atoms to move around in a solid liquid or gas can be characterised by the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. In this section, we will explore two different ways to calculate the diffusion coefficient and compare the results. &lt;br /&gt;
&lt;br /&gt;
=== The Mean Squared Displacement ===&lt;br /&gt;
The diffusion coefficient can be measured easily be calculating the mean squared displacement of atoms in the solution; the diffusion coefficient is proportional to the first derivative of the mean squared displacement. By plotting the mean squared displacement as a function of time, the gradient can be taken to calculate the diffusion coefficient when its has equilibrated and become linear.&lt;br /&gt;
&lt;br /&gt;
The temperature and density parameters used were the same as in the previous section:&lt;br /&gt;
* Solid: T=1.5, D=1.2&lt;br /&gt;
* Liquid: T=1.1, D=0.8&lt;br /&gt;
* Gas: T=1.1, D=0.01&lt;br /&gt;
&lt;br /&gt;
Mean density squared calculations were run for all three Lennard-Jones phases and the data plotted as function of timestep below. The data from a simulation containing 1,000,000 atoms was plotted for comparision.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!Plots for the 8,000 atom data (&#039;&#039;figures p-r)&#039;&#039;&lt;br /&gt;
!Plots for the 1,000,000 atom data (&#039;&#039;figures s-u)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|[[File:Rmt_MSDsolid.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt_MAsolid.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|[[File:Rmt MSDliquid.png|700x700px]]&lt;br /&gt;
|[[File:Rmt MAliquid.png|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|[[File:Rmt MSDgas.png|700x700px]]&lt;br /&gt;
|[[File:Rmt dataplots 25894 image001.png|700x700px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The exact relationship between the mean squared displacement and the diffusion coefficient is:&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;
Taking the gradients of each of the curves at the point at which they become linear and dividing by six will give the diffusion coefficient for each set of data. The gradient also needs to be converted to a function of time; this is done by dividing by the timestep, which in this case is 0.002:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom data diffusion coefficients, &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
!1,000,000 atom data diffusion coefficients &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 0.9999&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|Gradient = 0.0972&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{48.6}{6} = \mathbf{8.1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient = 0.0386&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{19.6}{6} = \mathbf{3.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For both of the solid approximations, the diffusion coefficient can be approximated as zero. This is because, when equilibrated, the function has a constant value of around 0.2 for the mean squared displacement. A gradient with a value of zero means that the atoms take an infinite amount of time to change their mean squared displacement; to move away from their equilibrium position, and so this means that we can approximate in this system, there will be no diffusion. In real system, however, this is not the case; diffusion occurs but it is very slow. A plot for a real system will give a very shallow positive gradient.&lt;br /&gt;
&lt;br /&gt;
The liquid approximations are very well correlated. This is because in both cases, the mean squared displacement of particles in a liquid increases linearly with time and the gradient of both plots are almost identical. We can assume from this that identical starting conditions were used to calculate this data. Also, we can estimate that 8,000 atoms is a large enough simulation to give an accurate result for the diffusion coefficient for the Lennard-Jones liquid.&lt;br /&gt;
&lt;br /&gt;
The gas approximations are very different. This is most probably due to the fact that the density specified in calculations are different. The 8,000 data can be estimated to be a much lower density because the diffusion coefficient is faster and this means diffusion will happen faster; at a higher density a particle will take longer to diffuse over a given distance. Because of the difference in density, the two values of the diffusion coefficient cannot be qualitatively compared. The reason for the initial deviation for linearity in the gas plots is due to the momentum of the particles initially dominating over the diffusion and the diffusion coefficient is dependent on time. As the system equilibrates, the diffusion coefficient becomes constant and the plots become linear.&lt;br /&gt;
&lt;br /&gt;
=== The Velocity Autocorrelation Function ===&lt;br /&gt;
&lt;br /&gt;
Another way to calculate the diffusion coefficient is by using the velocity correlation function, which determines how the velocity of an atom changes with time. The function determines the difference in time (&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;) when the velocity becomes uncorrelated, i.e. the difference between the velocity at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; and at time &amp;lt;math&amp;gt;t+\tau&amp;lt;/math&amp;gt;. By integrating over this function, we can find the diffusion coefficient. &lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function: &amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can also be written as the integral: &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;
Using the function which defines the position of a classical harmonic oscillator, we can differentiate this to give the equation for the velocity which we can plug into the integral:&lt;br /&gt;
&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;
&amp;lt;math&amp;gt;dv{x(t)}{t} = v(t) = -A\omega sin(\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also needed for the integral:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t+\tau) = -A\omega sin(\omega(t+\tau)+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v^2(t) = A^2\omega^2 sin^2(\omega t +\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Putting all this into the integral to find the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega sin(\omega t + \phi) \times A\omega sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} A^2\omega^2 sin^2(\omega t +\tau)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A^2\omega^2&amp;lt;/math&amp;gt; can be take out of each of the integrals and cancelled. A substituion can then be made to make solving the integral much simpler:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = \omega t + \phi&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \omega\tau&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the integral becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a) \times sin(a+b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the compound angle rule &amp;lt;math&amp;gt;sin(a+b)=sin(a)cos(b)+cos(a)sin(b)&amp;lt;/math&amp;gt;, the integral can be simplified to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a)sin(a)cos(b) + sin(a)cos(a)sin(b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Separating out into two integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)\frac{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the rule &amp;lt;math&amp;gt;sin(a)cos(a) = \frac{1}{2}sin(2a)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} \frac{1}{2}(sin(2a))\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because the function &amp;lt;math&amp;gt;\frac{1}{2}sin(2a)&amp;lt;/math&amp;gt; is symmetric over all space, the second term in this equation becomes zero. Therefore, the integral simplifies to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b) = cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same calculations from the mean squared displacement section gave an output of the velocity autocorrelation function. The function for the Lennard-Jones solid, liquid and gas were plotted against the timestep along with the approximate function for the velocity autocorrelation function, &amp;lt;math&amp;gt;cos(\omega\tau)&amp;lt;/math&amp;gt;, where \omega = \frac{1}{2\pi}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure v. &#039;&#039;Plots for the velocity autocorrelation function of a Lennard-Jones solid, liquid and gas; 8,000 atoms&lt;br /&gt;
!&#039;&#039;Figure w. &#039;&#039;Plots for the velocity autocorrelation function of a Lennard-Jones solid, liquid and gas, 1,000,000 atoms&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt VACF 5721 image001.png|800x800px|]]&lt;br /&gt;
|[[File:Rmt MAVACF.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
The diffusion coefficient is calculated from: &amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty C\left(\tau\right)\mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the approximate value for the diffusion coefficient using the velocity autocorrelation function is &amp;lt;math&amp;gt;D = \frac{1}{3}cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The running integral of the velocity autocorrelation functions was plotted using the &#039;&#039;trapesium rule&#039;&#039;, and so the final value on the integral plot is proportional to the diffusion coefficient.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom VACF integral &#039;&#039;(figures w-z)&#039;&#039;&lt;br /&gt;
!1,000,000 VACF integral (&#039;&#039;figures aa-cc)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|[[File:Rmt mysi.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt masi.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|[[File:Rmt myli.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt mali.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|[[File:Rmt mygi.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt ligi.png|frameless|700x700px]]&lt;br /&gt;
|}&lt;br /&gt;
The diffusion coefficients for each of the plots above are tabulated below using the final data point from the integral plot. This is the integral over the whole graph using the trapesium rule. This must be corrected for the &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom data diffusion coefficients, &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
!1,000,000 atom data diffusion coefficients &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;-0.00055&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{-0.00055}{6} = -0.00018 \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.00014&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.00014}{6} = 0.000046 \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.242&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.242}{6} = \mathbf{0.0807}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;0.270&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.270}{6} = \mathbf{0.901}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;25.6&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{25.6}{6} = \mathbf{8.55}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected integral = &amp;lt;math&amp;gt;9.81&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{9.81}{6} = 3.27&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=541434</id>
		<title>Rep:Mod:hakunamatata</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=541434"/>
		<updated>2016-02-25T13:19:23Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: /* The Velocity Autocorrelation Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Introduction to Molecular Dynamics Simulations ==&lt;br /&gt;
===The Classical Particle Approximation and Numerical Integration===&lt;br /&gt;
The verit and verit-velocity algorithms are numerical methods to approximate the average position and velocity respectively of randomly moving atoms in a particular medium (solid, liquid, fliud etc.). This position and velocity can be applied to Newtonian mechanics to calculate such properties as the force and potential energy of the system. The algorithms work by splitting the function into discrete time steps, calculating the values of position and velocity at this particular time step, and then effectively &amp;quot;joining the dots&amp;quot; to create an approximate function. These simulations always use the answer from the previous timestep to compute the new timestep, so initial conditions must be given for the first step. Both of the algorithms are shown below and are derived from the Taylor expansion of the position or velocity of the atoms at the timestep &amp;quot;n+1&amp;quot; or &amp;lt;math&amp;gt;t+\delta t&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit Algorithum:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{x}_i\left(t + \delta t\right) \approx 2\mathbf{x}_i\left(t\right) - \mathbf{x}_i\left(t - \delta t\right) + \frac{\mathbf{F}_i\left(t\right)}{m_i}\delta t^2  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit-Velocity Algorithum:&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i\left(t\right)&amp;lt;/math&amp;gt; is the force acting on a particular atom as a function of time&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i&amp;lt;/math&amp;gt; is the acceleration &lt;br /&gt;
&lt;br /&gt;
The smaller the timestep, the closer the numerical approximation is to the true solution function, which can be modeled as a classical harmonic oscillator. &#039;&#039;Figure a.&#039;&#039; in the table below shows the comparison between the two methods in &#039;&#039;time&#039;&#039; space. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure a. &#039;&#039;Plots of position vs time comparing the verit algorithm and harmonic spring results&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure b. &#039;&#039;Plot of the total classical energy of the system (potential + kinetic)&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory xanalytical.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory energy.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The harmonic spring position values are modeled from the harmonic oscillator or particle on a spring. The equation of &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; was used to calculate these values, where &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; are 1 and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; is zero. As seen on the plot, the curves produced from the two different methods of calculating the position are in good agreement.&lt;br /&gt;
|The potential energy is calculated using the equation U = 1/2 kx^2, with a value of k given as 1. The kinetic energy is calculated using the velcity from the verit-velocity algorithm using the equation T = 1/2 mv^2, with a value of m given as 1. The total energy of the system, E, is equal to T + U. The values for x (potential energy) and v (kinetic energy) are taken from the verity algorithm and verit-velocity algorthim respectively. &lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;Figure c. &#039;&#039;Plot of the difference (error) between the harmonic spring and verit algorithm data&lt;br /&gt;
!&#039;&#039;Figure d. &#039;&#039;Plot of the peaks in the error plot in &#039;&#039;figure c.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory error.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory errorpeaks.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The peaks in the error between the harmonic spring and verit algorithm results are at the place where the position curve crosses the time axis. This is because the harmonic spring data (x(t)) has a slightly shorter wave period than that of the verit velocity algorithm, and therefore the difference will get larger with each period of the wave, shown by the error getting larger in &#039;&#039;figure c. &#039;&#039;The period of the plot of the two methods are different because the verit algorithm is much more approximate so does not give the correct solution.&lt;br /&gt;
|The change in the error/difference between the harmonic spring data and verit algorthm data increases linearly and so therefore period of each of the plots in &#039;&#039;figure 1&#039;&#039;. must be constant. &lt;br /&gt;
|}&lt;br /&gt;
The error can also be quantified on a &#039;&#039;phase space&#039;&#039; plot; phase space is momentum or velocity plotted as a function of position. The true solution for motion of an atom is a perfect ellipse, and the more elliptic the shape (less circular) the more momentum or velocity is in the system. A numerical solution, like the verit algorithms, will produce a set of points very close to this ellipse but not perfectly following the curve. A good numerical solution will remain in an elliptical shape, whereas a bad numerical solution, for example one with a large timestep, will spiral away from the true solution. Two examples of such systems using the data from &#039;&#039;figures a-d&#039;&#039; are shown below.  &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure e. &#039;&#039;Phase plot of the harmonic spring data with a good numerical solution (timestep = 0.1) &lt;br /&gt;
!&#039;&#039;Figure f. &#039;&#039;Phase plot of the harmonic spring data with a bad numerical solution (timestep = 0.3) &lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory phasegood.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory badphase.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The timestep at which this data is plotted is 0.1, which results in a very small change in the energy, as seen in &#039;&#039;figure b. &#039;&#039;Increasing the time step will increase the variation in the energy. To keep the variation in the total energy of the system under 1%, the time step must be no larger than approximately 0.28. The energy varies more with increasing time step because the jumps in the algorithm  are getting larger due to less data points. The algorithm assumes these points are joined by a straight line; that the halfway point in the jump is the average between the starting and finishing point of the jump. The phase space plot will become less elliptic and the jumps eventually become so larger that the plot is no longer a continuous shape.  &lt;br /&gt;
&lt;br /&gt;
It is essential to monitor the energy of a numerically modeled system because a good solution for the motion of an atom has a constant energy and a plot in phase space of a perfect ellipse.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance and Force at Zero Potential===&lt;br /&gt;
From classical mechanics, the force calculated from the Newtonian mechanics above can be used to calculate the potential experienced by an atom in the system. They are related by the equation: &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;
This potential gives the shape and dimension of the potential surface on which the system can be modeled. A simple 1D potential that is used to describe the inter atomic forces of a liquid is the Lennard-Jones potential. It has the characteristic features of a short range repulsion potential and harmonic character around the equilibrium bond distance. The value of &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the inter atomic separation when the potential, &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;, is equal to zero, can be calculated by equating the equation for the Lennard-Jones potential to zero and solving for &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The equation for the Lennard-Jones potential: &amp;lt;math&amp;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;
Equating this to zero: &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;
And rearranging in order to separate the variables: &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;
Rearranging this gives &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in terms of &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt; r^6 = \sigma^6&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r = r_0&amp;lt;/math&amp;gt; in this case.&lt;br /&gt;
&lt;br /&gt;
This, therefore, gives the result that interatomic distance at zero potential, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, is equal to &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; in the Lennard-Jones potential is effectively the diameter of one of the particles in the system being measured; in this case, the liquid we are simulating. This is the point where the potential curve crosses the x-axis on an Energy vs interatomic distance plot. The force, &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt;, at this point on the curve corresponds to the gradient; it is found by calculating the derivative of the curve at this point. &lt;br /&gt;
&lt;br /&gt;
To calculate the force, we must differentiate the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As force is equal to the negative differential of the potential energy, the value of the force is: &amp;lt;math&amp;gt;\mathbf{F}_i = 48\epsilon \sigma^{12} r^{-13} - 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting in the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at zero potential from the calculation before: &amp;lt;math&amp;gt;\mathbf{F}_i = \frac{48\epsilon}{\sigma} - \frac{24\epsilon}{\sigma} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The gradient where the Lennard-Jones plot crosses the axis is negative; &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; in the term obtained for &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is negative and therefore the overall value of the force will be negative.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance, Force and Well Depth of the Potential at Equilibrium===&lt;br /&gt;
To calculate the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at the equilibrium position, we need to use the derivative of the potential energy curve. The equilibrium value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is the value at the minimum of the Lennard-Jones curve; when &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Therefore, equating the derivative to zero gives: &amp;lt;math&amp;gt;0 = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rearranging this: &amp;lt;math&amp;gt;48\epsilon \sigma^{12} r^{-13} = 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And simplifying and cancelling gives: &amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6&amp;lt;/math&amp;gt;. Therefore the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at equilibrium is: &amp;lt;math&amp;gt;r_{eq} = \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Physically, this result means that the equilibrium distance is 1.12 times the diameter of one of the particles; the particles have a small gap between them so do not touch. A short range repulsion potential, as seen in the Lennard-Jones curve, is a result of the particles coming into contact. &lt;br /&gt;
&lt;br /&gt;
Again, the force can be calculated from the derivative of the potential curve at the equilibrium point. As the derivative at this point is zero (a minimum on the curve), the force will therefore also be zero.&lt;br /&gt;
&lt;br /&gt;
The well-depth of the potential curve is the difference between zero potential and the potential at the equilibrium bond length. This can be calculated by substituting the value for the equilibrium bond length into the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 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;
Cancelling and simplifying this equation gives: &amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \times \frac{1}{4}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the absolute value for the well depth is &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;. The actual value of this potential is &amp;lt;math&amp;gt;-\epsilon&amp;lt;/math&amp;gt;, as the equilibrium bond length gives the most stable configuration of the molecules and therefore suggests attractive interactions are involved in the arrangement of the molecules; this attractive potential means its negative. &lt;br /&gt;
&lt;br /&gt;
===Boundary Conditions and the Lennard-Jones Cutoff===&lt;br /&gt;
When simulating a liquid, it is computationally impractical to simulate a realistic liquid. Therefore a smaller &#039;box&#039; containing &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; particles is simulated and the computer program will use &#039;&#039;periodic boundary conditions&#039;&#039; to simulate infinite repetitions of this box; when the atom reaches one edge of the box, in periodic boundary conditions, it will reappear again at the opposite edge of the box as if they were connected. For example, an atom at the position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a box of size &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;. Without periodic boundary conditions, we would assume that the atom would end up at the position &amp;lt;math&amp;gt;(1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;. However, in this box, there is no such position and so the particle must reappear at the opposite edge to where it effectively &#039;left&#039; the box. Therefore, it&#039;s ending position will be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The number of particles, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; simulated by the computer is usually between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt;. Physically, this is a very small volume. Considering water, we can calculate the number of molecules in 1 mL or 1 cm^3, a volume that would be considered small in the lab. Taking the concentration of water at standard conditions, &amp;lt;math&amp;gt;55\ mol\ dm^{-3}&amp;lt;/math&amp;gt;, we can convert it to the number of moles per mL: &amp;lt;math&amp;gt;0.055\ mol\ mL^{-1}&amp;lt;/math&amp;gt;. Multiplying this value by Avagadro&#039;s constant (&amp;lt;math&amp;gt;N_A&amp;lt;/math&amp;gt;) gives the number of molcules of water per mL: &amp;lt;math&amp;gt;3.02 \times 10^{22}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The reverse procedure can be used to compare this to the volume of 10,000 molecules: 10,000 divided by Avagadro&#039;s constant gives the number of moles of water which 10,000 molecules makes up: &amp;lt;math&amp;gt;1.66 \times 10^{-20}\ moles&amp;lt;/math&amp;gt;. Dividing this value by the concentration (from &amp;lt;math&amp;gt;n=cV&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is the number of moles, &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; is the concentration and &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume), gives the volume: &amp;lt;math&amp;gt;3.02 \times 10^{-22}\ dm&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;3.02 \times 10^{-19}\ mL&amp;lt;/math&amp;gt;. Physically, of course, this is far too small a volume to be recorded in the lab.&lt;br /&gt;
 &lt;br /&gt;
Periodic boundary conditions simulate an infinite lattice and therefore, when computing the potential, will calculate an infinite amount of pair interactions. Therefore, it is only practical to calculate the energies up to a certain interatomic distance; the Lennard-Jones cutoff distance. Beyond this point, the potential energy and the integral of the curve beyond this point become insignificant and do not impact on the overall energy; removing interactions beyond this point from the calculations will not effect the accuracy. Multiplying the Lennard-Jones potential with the radial distribution function gives a plot of the probability of finding an atom at a particular interatomic distance. The larger the interatomic distance, the lower the probability and so the energy after the cutoff can be disregarded. &lt;br /&gt;
&lt;br /&gt;
Integrating over the Lennard-Jones curve and applying this cutoff as the lower limit can show how small the integral is:&lt;br /&gt;
&lt;br /&gt;
For a general cutoff of with value &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;I = \int_{x}^\infty \phi\left(r\right)\mathrm{d}r = \int_{x}^\infty \frac{4\epsilon\sigma^{12}}{r^{12}}\mathrm{d}r - \int_{x}^\infty \frac{4\epsilon\sigma^6}{r^6}\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving this: &amp;lt;math&amp;gt;I = 4\epsilon\sigma^{12} {\frac{-1}{11r^{11}}\,\Bigg\vert\,}_x^\infty - 4\epsilon\sigma^{6} {\frac{-1}{5r^{5}}\,\Bigg\vert\,}_x^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This gives the general solution: &amp;lt;math&amp;gt;I = \frac{4\epsilon\sigma^{12}}{11x^{11}} - \frac{4\epsilon\sigma^{6}}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating this for &amp;lt;math&amp;gt;\epsilon = \sigma = 1&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;I = \frac{4}{11x^{11}} - \frac{4}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt; (or 2 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.025&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt; (or 2.5 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0082&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt; (or 3 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0033&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All values are taken to 2 significant figures. As the cutoff value for the interatomic distance gets larger, the integral gets smaller, and therefore the energy excluded from the calculation becomes smaller, and the second term in the solved integral, &amp;lt;math&amp;gt;I&amp;lt;/math&amp;gt;, dominates the energy value.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
When using the Lennard-Jones potential, it is appropriate to use reduced units for intermolecular distance, energy and temperature. Reduced units can be calculated by the following relationships:&lt;br /&gt;
&lt;br /&gt;
Intermolecular 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;
&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; are scaling factors. For example, if the parameters for Argon are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\sigma = 0.34 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt; \epsilon\ /\ k_B = 120 K&amp;lt;/math&amp;gt;&lt;br /&gt;
* Lennard-Jones cutoff &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;. The well-depth, &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;, is &amp;lt;math&amp;gt;0.999 kJ mol^{-1} \approx 1 kJ mol^{-1}&amp;lt;/math&amp;gt;. The value of &amp;lt;math&amp;gt;T* = 1.5&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;180 K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
The first aim of the simulations is to determine the most appropriate timestep to use in the vert algorithm simulations. This timestep is a balance between the accuracy of the results (the smaller the timestep, the closer to the true functing the result will be) and the length of real time over which the simluation is run (the smaller the timestep, the less real time over which the simulation will give a result). The appropriateness of the timestep will be determined by plotting how the total free energy of the simulated lattice equilibrates over time.  &lt;br /&gt;
&lt;br /&gt;
Five different calculations, which simulated the melting of a crystal and subsequent equilibration of the energy of the melted crystal, were run at five different timesteps; 0.001, 0.0025, 0.0075, 0.01 and 0.015, and were described by the NVE or &#039;&#039;&amp;quot;microcanonical ensemble&amp;quot;&#039;&#039;. An ensemble is a collection of samples of a system which are under three thermodynamic constraints (three properties are kept constant); in the microcanonical ensemble, the number of particles, the volume and the total energy is kept constant (NVE). &lt;br /&gt;
&lt;br /&gt;
These calculations simulate a box of 1000 unit cells and use periodic boundary conditions to replicate the simulation to a larger scale. Because these simulations use the numerical methods defined in the previous section, the initial position and velocity of the atoms must be defined in the input file. The Brownian (uncorrelated, random) motion of the atoms in the simulation means that there is no long range order in the system and so the atoms in a real system would start in random positions. However, assigning random starting coordinates to the atoms in a simulated liquid is not a relative process; the coordinates are generate independently of each other. Therefore there is a probability that the coordinates simulated will cause the atoms to overlap, which would give a very large repulsion potential, as seen in the Lennard-Jones potential at very small interatomic distances. This short-range repulsion potential comes from the hard-sphere model of atomic simulation.&lt;br /&gt;
&lt;br /&gt;
The input file also defines the structure and density of the lattice. The number density of lattice points in any lattice is the number of lattice points per volume of the unit cell. In a simple cubic lattice, there is one lattice point in the unit cell. From an sc lattice with lattice spacing (length of one side of the unit cell) being &amp;lt;math&amp;gt;1.07722&amp;lt;/math&amp;gt;, the number density of the lattice points is calculated by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{1}{1.07722^3} = 0.7999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a face-centered cubic lattice (fcc), there are four lattice points in the unit cell. Rearranging the above relationship, the lattice spacing can be calculated from the number of lattice points in a unit cell and number density, &amp;lt;math&amp;gt;1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Lattice\ spacing = \sqrt[3]{\frac{number\ of\ lattice\ points\ per\ unit\ cell}{number\ density}} = \sqrt[3]{\frac{4}{1.2}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation creates a box which includes 1000 unit cells, which is 10 unit cells in each dimension. For a simple cubic lattice, because there is one lattice point per unit cell, there will be 1000 atoms created as seen in the input file. The &#039;&#039;create_atom&#039;&#039; command in the input file determines how many boxes are created in the simulation and therefore how many atoms will be created. If a face centered cubic lattice is simulated, because there are 4 lattice points per unit cell, 4000 atoms will be created in the &#039;&#039;create_atom&#039;&#039; command. &lt;br /&gt;
&lt;br /&gt;
The input script also contains the following commands which defines the potential surface which is used to model the intermolecular reactions:&lt;br /&gt;
 mass 1 1.0&lt;br /&gt;
This instruction sets the mass type for the atoms being simulated. It takes the general form of “mass I value”, where mass is the keyword which tells LAMMPS what the input is, I is the atom type and value is the mass of the atom. In this case, I is defined by a specific numerical value; 1 as there is only 1 type of atom in the simulation, but it can be defined with an asterisk (1*), which means “all atom types of 1 to n inclusive”. &lt;br /&gt;
 pair_style lj/cut 3.0&lt;br /&gt;
This instruction sets the type of potential which LAMMPS uses in its calculation of pairwise interactions. It takes the general form of “pair_style style args”, where pair_style is the keyword for LAMMPS, style defines the potential and any specifications it may have, and args are the arguments required for this particular potential. In this case, the Lennard-Jones potential has been used (lj) with a cutoff point (cut) of 3σ. The cutoff point is explained in the introduction section. &lt;br /&gt;
 pair_coeff * * 1.0 1.0&lt;br /&gt;
This instruction specifies the coefficients for the pairwise interactions of each pair of atoms, and it takes the general form “pair_coeff I J args”. Pair_coeff is the keyword, I and J are the atom types, and args are the coefficients which the different atoms types take. In this case, the asterisk in place of I and J refers to all atoms types from 1 to n. The coefficients are the pairwise interactions are 1 for each atom, meaning each atom has an equal contribution to the interaction.&lt;br /&gt;
&lt;br /&gt;
In these initial calculations, the initial conditions for the numerical methods, &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. For this experiment, the verit-velocity algorithm would be the most appropriate, as both the starting position and velocity is specified for this algorithm. &lt;br /&gt;
&lt;br /&gt;
To define the timestep for the algorithm the following code is used defining the timestep as a variable instead of just giving it a definite value&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;
It is much easier to use the variable version of defining the timestep because the length of time over which the simulation is run depends on the time step. By using a variable, you can keep the length of the simulation the same, no matter the size of the timestep. It also makes it easier if multiple properties depend on the timestep – only the variable needs to be changed, not all the parts of the script where timestep is defined. &lt;br /&gt;
&lt;br /&gt;
The calculations produce the values for the total energy of the system, temperature and pressure in the output files, which can be plotted against time. How well these values equilibrate determines the appropriateness of the timestep to use in further calculations in the experiment.   &lt;br /&gt;
[[File:Rmt totalenergy plot.png|none|thumb|800x800px|&#039;&#039;Figure h. &#039;&#039;Plot of the equilibration of total energy for five different timesteps]]&lt;br /&gt;
The largest time step to give an acceptable result is 0.01. However, for any simluation we would expect energy to be independent of the timestep, something which is not true at a timestep greater than 0.0025. Therefore, the most appropriate timestep to use for a balance between accuracy and length of time which the simulation covers is 0.0025.  &lt;br /&gt;
&lt;br /&gt;
0.015 is a particularly bad choice of timestep. This is because the verit-velocity algorithm gives an approximate result to the velocity (kinetic energy term) and position (potential energy term), and so when the timestep becomes too large with respect to the time, the algorithm no longer becomes a suitable way to calculate the energy. As seen in the graph of 0.015, the energy does not equilibrate and diverges.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions ==&lt;br /&gt;
The calculations in this section are run in the isobaric-isothermal ensemble, where the number of particles in the system, the pressure and the temperature are kept constant (NpT). This means that the temperature and the pressure are recalculated in every step, so are no longer constant like they were in the NVE ensemble. From the &#039;&#039;equipartition theorem&#039;&#039;, each degree of freedom will contribute &amp;lt;math&amp;gt;\frac{1}{2} k_B T&amp;lt;/math&amp;gt; of energy to the system. As the system is in three dimensions, there are three degrees of translational freedom and so the total internal energy is equal to &amp;lt;math&amp;gt;\frac{3}{2} k_B T&amp;lt;/math&amp;gt;. Equating this to the kinetic energy, &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt;, at the end of every step and rearranging will allow calculation of the temperature after every step. &lt;br /&gt;
&lt;br /&gt;
A target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, is defined in the input script and the system will equilibrate by multiplying the velocity by a factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, in order to accommodate for the fluctuation and keep the system at approximately the target temperature and therefore constant internal energy. If the temperature of the system is greater than the target temperature, the system&#039;s kinetic energy is too high, so &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is reduced to compensate for this. The same is true for is the temperature is lower than the target temperature; &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than one in the next step to increase the kinetic energy which is now too low. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; can be derived from equating the kinetic and internal energy of the system at an arbitrary time step:&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;
Expanding the brackets inside the sum and moving the term containing &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; out of the sum: &amp;lt;math&amp;gt;\frac{\gamma^2}{2}\sum_i m_i \left(v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;, we can replace &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt; on the left hand side of the equation with &amp;lt;math&amp;gt;\frac{3}{2} N k_B T&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;\frac{3\gamma^2}{2}N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Simplifying and rearranging for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, gives: &amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The principle is the same for controlling the pressure.&lt;br /&gt;
&lt;br /&gt;
As temperature and pressure are no longer constant, he input files require specification of the pressure and the temperature for each of the systems run. 10 simulations were run at two different pressures with five different temperatures at each. &lt;br /&gt;
* Temperatures: 1.6, 1.9, 2.2, 2.5, 2.8&lt;br /&gt;
* Pressures: 2.5, 3.0&lt;br /&gt;
These pressures were chosen because the data simulated when choosing an appropriate timestep gave a pressure between 2.5 and 3.0.  &lt;br /&gt;
&lt;br /&gt;
For the code which computes the thermodynamic potentials, this particular line defines how many steps contribute towards the average of the thermodynamic parameters computed in the calculation. &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;
&#039;&#039;fix&#039;&#039; is the keyword, &#039;&#039;aves&#039;&#039; is the name of the group of fixes which in this case is the average of the thermodynamic values, &#039;&#039;all&#039;&#039; specifies the atoms which the fix is applied to which in this case is all the atoms in the simulated system and &#039;&#039;ave/time&#039;&#039; means that compute global time averages are calculated. The following three numbers have the following meaning:&lt;br /&gt;
&lt;br /&gt;
*100 = use the input values every 100 timesteps&lt;br /&gt;
*1000 = use input values 1000 times for calculating the average&lt;br /&gt;
*100000 = calculate the average every 100000 timesteps&lt;br /&gt;
&lt;br /&gt;
Therefore for the total calculation which lasts for 100000 will only have the average calculated once. Assuming 1 value every timestep, there will be 100000/100 values = 1000. The amount of time simulated is 100,000 steps, read from the following line.&lt;br /&gt;
&lt;br /&gt;
The density data from all ten calculation were plotted on the same graph, along with the density for an &amp;quot;ideal&amp;quot; gas. This density can be derived from the ideal gas law:&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;
Rearranging in terms of density: &amp;lt;math&amp;gt;\frac{N}{V} = \frac{P}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As these simulations are being run under reduced units, we can take &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt;, and so the density of the ideal gas becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the density of the ideal gas is plotted as the pressure divided by the temperature in pressure-temperature phase space.&lt;br /&gt;
[[File:Rmt dvt plot.png|none|thumb|800x800px|&#039;&#039;Figure i. &#039;&#039;Plot of the variation in density with temperature at a defined pressure for the numerically simulated and ideal systems]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that calculated in the ideal gas law. This is because for an ideal gas, an assumption is made that there are no intermolecular interactions, and therefore forces such as electron repulsion forces are ignored; repulsion forces dominate over attractive ones, as all the atoms in this simulation are the same and so partial charges or dipoles are created. This will mean that the particles move closer together than a real gas and so the density will be larger. This discrepancy between the ideal and non-ideal systems becomes larger at a higher pressure because with a higher pressure, the atoms in the system are closer together and therefore the intermolecular repulsion will become larger. This greater repulsion will in turn have a larger effect on decreasing the density.&lt;br /&gt;
&lt;br /&gt;
== Statistical Physics Calculations of the Heat Capacity ==&lt;br /&gt;
The heat capacity of a system at constant volume can be calculated from the variance in the total energy of the system. The relationship used to calculate the heat capacity is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = 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;\left\langle E^2\right\rangle&amp;lt;/math&amp;gt; is the continuous average of the total square energy at each temperature as a function of temperature. &amp;lt;math&amp;gt;\left\langle E\right\rangle^2&amp;lt;/math&amp;gt; is the continuous average of the total energy at each temperature as a function of temperature squared. The heat capacity is multiplied by &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; in this case because the version of LAMMPS calculates every energy divided by the number of molecules in the system simulated.&lt;br /&gt;
&lt;br /&gt;
The calculations in this sections are run in density-temperature phase space and the ensemble has changed to the canonical ensemble (NVT). A set of input files were written for ten calculations for, like the previous section, two pressures and five different temperatures at each pressure:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 0.2, 0.8&lt;br /&gt;
*Temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{C_V}{V}&amp;lt;/math&amp;gt; was plotted against temperature to determine the relationship in density-temperature phase space. An example of an input file can be found [[Media:nvt_-_0220.in|here]]. The lines which have been changed from the previous input files are at the end of the script:&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 &lt;br /&gt;
 thermo_style custom step etotal temp&lt;br /&gt;
 variable energy equal etotal&lt;br /&gt;
 variable energy2 equal etotal*etotal&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_energy v_energy2 v_temp&lt;br /&gt;
 run 100000&lt;br /&gt;
 &lt;br /&gt;
 variable aveenergy equal f_aves[1]&lt;br /&gt;
 variable aveenergy2 equal f_aves[2]&lt;br /&gt;
 variable avetemp equal f_aves[3]&lt;br /&gt;
 variable heatcapacitydv equal atoms*atoms*(v_aveenergy2-v_aveenergy*v_aveenergy)/(v_avetemp*v_avetemp*vol)&lt;br /&gt;
 &lt;br /&gt;
 print &amp;quot;Averages&amp;quot;&lt;br /&gt;
 print &amp;quot;--------&amp;quot;&lt;br /&gt;
 print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Heat Capacity per Volume: ${heatcapacitydv}&amp;quot;&lt;br /&gt;
The line with the keyword &#039;fix&#039; determines which thermodynamic values are averaged and over how many steps they are averaged. The next section takes these averages as variables and uses them to define the heat capacity which is calculated from the equation at the beginning of this section. Only the energy and temperature are needed to define the heat capacity and so only these values are calculated by the simulation. [[File:Rmt heatcapacitybyv.png|none|thumb|800x800px|&#039;&#039;Figure j. &#039;&#039;C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V against temperature for the two different pressures 0.2 and 0.8]]As seen in the above figure, the heat capacity decreases with temperature for both pressures. It would be expected for an ideal system that as the temperature increases, the heat capacity at constant volume increases and tends to a constant volume at very high T of 3R; R = the universal gas constant. This means increasing the temperature increases the amount of energy being stored in the system and this energy is stored as vibrational energy. However, for a Lennard-Jones liquid, the system being simulated here, the heat capacity decreases with temperature. This is because the simulation has two components to the simulation; the atoms are vibrating in a quasi-harmonic fashion around the equilibrium position and also diffuse between neighbouring equilibrium positions in a gas like fashion. As the temperature increases, the amount of diffusion increases and the vibrations decreases, therefore decreasing the ability of the system to absorb vibrational energy, resulting in the decrease in heat capacity. &amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www.nature.com/ncomms/2013/130816/ncomms3331/full/ncomms3331.html?message-global=remove&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural Properties and the Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a single atom in a system is a plot of the probability that an atom can be found at a certain distance from the central atom. The peaks in this plot can give the distance of an atom from its nearest neighbours in the Lennard-Jones simulated system. &lt;br /&gt;
&lt;br /&gt;
The calculations in this section simulate a Lennard-Jones solid, liquid and gas and, using the output of the LAMMPS trajectory file, plots both the radial distribution function and its integral using DLV. The temperature and pressure parameters for these calculations were taken from the phase diagram or coexistence curve for a Lennard-Jones system.&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt; The parameters used are displayed in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! Temperature, &amp;lt;math&amp;gt;T^*&amp;lt;/math&amp;gt;&lt;br /&gt;
! Pressure, &amp;lt;math&amp;gt;p^*&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| LJ Solid&lt;br /&gt;
| 1.5&lt;br /&gt;
| 1.2&lt;br /&gt;
|-&lt;br /&gt;
| LJ Liquid&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.8&lt;br /&gt;
|-&lt;br /&gt;
| LJ Gas&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.01&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The data obtained from the plots and the radial distribution functions and their integrals were plotted and shown in the table below.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure k. &#039;&#039;The radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
!&#039;&#039;Figure l. &#039;&#039;The integrals of the radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt fullrdfs.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt allintegralsrdf.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
[[File:Rmt Nearest neighbours.png|left|thumb|300x300px|&#039;&#039;Figure m. &#039;&#039;Representation of a cross section of the first three shells of nearest neighbours in an fcc solid. The black atom is the central atom being considered, the blue atoms are the first shell, the orange atoms the second shell and the purple atoms are the third.]]&lt;br /&gt;
The RDF of the solid gives a very irregular curve because of the irregular structure of the lattice. For a simple cubic lattice, a regular structure of the RDF would be expected because of the equal number of atoms in each of the nearest neighbour shells of the atoms. However, for face-centered cubic, the solid in this simulation, the structure is much more irregular and as the atoms move from their equilibrium position in the lattice due to vibrations, the peaks in the radial distribution will broaden. The irregular heights of the peaks are due to the varying numbers of atoms in each of the nearest neighbour shells for the central atom. The first shell gives the highest peak as it contains the most atoms; in total, considering all four surrounding unit cells, this shell contains 12 atoms and ideally takes the geometry of an icosahedron. The second shell is smaller and contains only 6 atoms in an octahedral coordination shape. The following shell again contributes 12 atoms, 3 from each unit cell. This therefore explains why the heights of the peaks in the solid plot in &#039;&#039;figure k.&#039;&#039; vary. These values can be confirmed by the plot in &#039;&#039;figure o.&#039;&#039; which is the integral; it cumulatively adds the numbers in each shell. The size of the first &amp;quot;step&amp;quot; is 12; there are 12 atoms in the first shell. The size of the second step is approximately 18; there are 18-12=6 steps in the second shell. The same theory applies for the third shell which gives a value of 13. This is slightly different to the predicted value possibly due to error in the calculation of the radial distribution function and therefore its integral. &lt;br /&gt;
&lt;br /&gt;
The RDF of the liquid has a representation of far fewer shells, which means that there are less atoms in the space close to a &amp;quot;central&amp;quot; atom in the bulk solution. The particles have more energy and therefore do not keep to a regular lattice structure. As they move about, some regualrity is maintained around each atom, but only to the extend of two or three shells, meaning there is no long range order in a Lennard-Jones liquid. &lt;br /&gt;
&lt;br /&gt;
The RDF of the gas again omits more shells as there is almost no order in a Lennard-Jones gas. The single peak on this plot considers only the set of atoms closest to the central atom and all others are disregarded as they are too far apart. &lt;br /&gt;
&lt;br /&gt;
Considering &#039;&#039;figure l.&#039;&#039;, the size of the integral of the radial distribution function decreases from solid to liquid to gas. This makes sense as the number of atoms in the surrounding shells decreases with density of the system; the atoms become further apart. &lt;br /&gt;
&lt;br /&gt;
From the plot of the radial distribution function of the solid, the lattice spacing can be determined. For this, we can consider just the first three peaks of the RDF plot. The lattice spacing refers to the length of one unit cell, and so, using &#039;&#039;figure m&#039;&#039;, we can calculate this using two different methods; a) we can use the distance between the central atom and the first shell of nearest neighbours, and use trigonometry to calculate the lattice spacing. Or alternatively b) we can use the distance between the central atom and the second nearest neighbour shell to get the lattice spacing.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure n. &#039;&#039;The radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
!&#039;&#039;Figure o. &#039;&#039;The integral of the radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt solidgr3.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt solidint3.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
Using method a) (with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; as the distance between the central atom and the nearest neighbour: Lattice spacing = &amp;lt;math&amp;gt;\frac{r}{cos({\frac{\pi}{4}})} = \frac{1.02}{cos({\frac{\pi}{4}})} \approx 1.44&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using method b): Lattice spacing &amp;lt;math&amp;gt;\approx 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can take an average between the two get an approximate value for the lattice spacing: &amp;lt;math&amp;gt;1.46 \plusmn 0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These values for distance are all in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
The ability of atoms to move around in a solid liquid or gas can be characterised by the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. In this section, we will explore two different ways to calculate the diffusion coefficient and compare the results. &lt;br /&gt;
&lt;br /&gt;
=== The Mean Squared Displacement ===&lt;br /&gt;
The diffusion coefficient can be measured easily be calculating the mean squared displacement of atoms in the solution; the diffusion coefficient is proportional to the first derivative of the mean squared displacement. By plotting the mean squared displacement as a function of time, the gradient can be taken to calculate the diffusion coefficient when its has equilibrated and become linear.&lt;br /&gt;
&lt;br /&gt;
The temperature and density parameters used were the same as in the previous section:&lt;br /&gt;
* Solid: T=1.5, D=1.2&lt;br /&gt;
* Liquid: T=1.1, D=0.8&lt;br /&gt;
* Gas: T=1.1, D=0.01&lt;br /&gt;
&lt;br /&gt;
Mean density squared calculations were run for all three Lennard-Jones phases and the data plotted as function of timestep below. The data from a simulation containing 1,000,000 atoms was plotted for comparision.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!Plots for the 8,000 atom data (&#039;&#039;figures p-r)&#039;&#039;&lt;br /&gt;
!Plots for the 1,000,000 atom data (&#039;&#039;figures s-u)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|[[File:Rmt_MSDsolid.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt_MAsolid.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|[[File:Rmt MSDliquid.png|700x700px]]&lt;br /&gt;
|[[File:Rmt MAliquid.png|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|[[File:Rmt MSDgas.png|700x700px]]&lt;br /&gt;
|[[File:Rmt dataplots 25894 image001.png|700x700px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The exact relationship between the mean squared displacement and the diffusion coefficient is:&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;
Taking the gradients of each of the curves at the point at which they become linear and dividing by six will give the diffusion coefficient for each set of data. The gradient also needs to be converted to a function of time; this is done by dividing by the timestep, which in this case is 0.002:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom data diffusion coefficients, &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
!1,000,000 atom data diffusion coefficients &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 0.9999&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|Gradient = 0.0972&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{48.6}{6} = \mathbf{8.1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient = 0.0386&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{19.6}{6} = \mathbf{3.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For both of the solid approximations, the diffusion coefficient can be approximated as zero. This is because, when equilibrated, the function has a constant value of around 0.2 for the mean squared displacement. A gradient with a value of zero means that the atoms take an infinite amount of time to change their mean squared displacement; to move away from their equilibrium position, and so this means that we can approximate in this system, there will be no diffusion. In real system, however, this is not the case; diffusion occurs but it is very slow. A plot for a real system will give a very shallow positive gradient.&lt;br /&gt;
&lt;br /&gt;
The liquid approximations are very well correlated. This is because in both cases, the mean squared displacement of particles in a liquid increases linearly with time and the gradient of both plots are almost identical. We can assume from this that identical starting conditions were used to calculate this data. Also, we can estimate that 8,000 atoms is a large enough simulation to give an accurate result for the diffusion coefficient for the Lennard-Jones liquid.&lt;br /&gt;
&lt;br /&gt;
The gas approximations are very different. This is most probably due to the fact that the density specified in calculations are different. The 8,000 data can be estimated to be a much lower density because the diffusion coefficient is faster and this means diffusion will happen faster; at a higher density a particle will take longer to diffuse over a given distance. Because of the difference in density, the two values of the diffusion coefficient cannot be qualitatively compared. The reason for the initial deviation for linearity in the gas plots is due to the momentum of the particles initially dominating over the diffusion and the diffusion coefficient is dependent on time. As the system equilibrates, the diffusion coefficient becomes constant and the plots become linear.&lt;br /&gt;
&lt;br /&gt;
=== The Velocity Autocorrelation Function ===&lt;br /&gt;
&lt;br /&gt;
Another way to calculate the diffusion coefficient is by using the velocity correlation function, which determines how the velocity of an atom changes with time. The function determines the difference in time (&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;) when the velocity becomes uncorrelated, i.e. the difference between the velocity at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; and at time &amp;lt;math&amp;gt;t+\tau&amp;lt;/math&amp;gt;. By integrating over this function, we can find the diffusion coefficient. &lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function: &amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can also be written as the integral: &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;
Using the function which defines the position of a classical harmonic oscillator, we can differentiate this to give the equation for the velocity which we can plug into the integral:&lt;br /&gt;
&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;
&amp;lt;math&amp;gt;dv{x(t)}{t} = v(t) = -A\omega sin(\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also needed for the integral:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t+\tau) = -A\omega sin(\omega(t+\tau)+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v^2(t) = A^2\omega^2 sin^2(\omega t +\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Putting all this into the integral to find the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega sin(\omega t + \phi) \times A\omega sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} A^2\omega^2 sin^2(\omega t +\tau)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A^2\omega^2&amp;lt;/math&amp;gt; can be take out of each of the integrals and cancelled. A substituion can then be made to make solving the integral much simpler:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = \omega t + \phi&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \omega\tau&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the integral becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a) \times sin(a+b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the compound angle rule &amp;lt;math&amp;gt;sin(a+b)=sin(a)cos(b)+cos(a)sin(b)&amp;lt;/math&amp;gt;, the integral can be simplified to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a)sin(a)cos(b) + sin(a)cos(a)sin(b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Separating out into two integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)\frac{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the rule &amp;lt;math&amp;gt;sin(a)cos(a) = \frac{1}{2}sin(2a)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} \frac{1}{2}(sin(2a))\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because the function &amp;lt;math&amp;gt;\frac{1}{2}sin(2a)&amp;lt;/math&amp;gt; is symmetric over all space, the second term in this equation becomes zero. Therefore, the integral simplifies to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b) = cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same calculations from the mean squared displacement section gave an output of the velocity autocorrelation function. The function for the Lennard-Jones solid, liquid and gas were plotted against the timestep along with the approximate function for the velocity autocorrelation function, &amp;lt;math&amp;gt;cos(\omega\tau)&amp;lt;/math&amp;gt;, where \omega = \frac{1}{2\pi}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure v. &#039;&#039;Plots for the velocity autocorrelation function of a Lennard-Jones solid, liquid and gas; 8,000 atoms&lt;br /&gt;
!&#039;&#039;Figure w. &#039;&#039;Plots for the velocity autocorrelation function of a Lennard-Jones solid, liquid and gas, 1,000,000 atoms&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt VACF 5721 image001.png|800x800px|]]&lt;br /&gt;
|[[File:Rmt MAVACF.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
The diffusion coefficient is calculated from: &amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty C\left(\tau\right)\mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the approximate value for the diffusion coefficient using the velocity autocorrelation function is &amp;lt;math&amp;gt;D = \frac{1}{3}cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The running integral of the velocity autocorrelation functions was plotted using the &#039;&#039;trapesium rule&#039;&#039;, and so the final value on the integral plot is proportional to the diffusion coefficient.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom VACF integral &#039;&#039;(figures w-z)&#039;&#039;&lt;br /&gt;
!1,000,000 VACF integral (&#039;&#039;figures aa-cc)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|[[File:Rmt mysi.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt masi.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|[[File:Rmt myli.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt mali.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|[[File:Rmt mygi.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt ligi.png|frameless|700x700px]]&lt;br /&gt;
|}&lt;br /&gt;
The diffusion coefficients for each of the plots above are tabulated below using the final data point from the integral plot.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom data diffusion coefficients, &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
!1,000,000 atom data diffusion coefficients &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|Final value of the data = &amp;lt;math&amp;gt;-0.27645&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{-0.27645}{6} = 0.0461&amp;lt;/math&amp;gt;&lt;br /&gt;
|Final value of the data = &amp;lt;math&amp;gt;0.93483956&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.93483956}{6} = 0.156&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|Final value of the data = &amp;lt;math&amp;gt;61.4118947&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{61.4118947}{6} = 10.24&amp;lt;/math&amp;gt;&lt;br /&gt;
|Final value of the data = &amp;lt;math&amp;gt;68.4686822&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{68.4686822}{6} = 11.4&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|Final value of the data = &amp;lt;math&amp;gt;6413.17509&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{6413.17509}{6} = 1069&amp;lt;/math&amp;gt;&lt;br /&gt;
|Final value of the data = &amp;lt;math&amp;gt;2452.28218&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{2452.28218}{6} = 409&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=541419</id>
		<title>Rep:Mod:hakunamatata</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=541419"/>
		<updated>2016-02-25T13:11:35Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: /* The Velocity Autocorrelation Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Introduction to Molecular Dynamics Simulations ==&lt;br /&gt;
===The Classical Particle Approximation and Numerical Integration===&lt;br /&gt;
The verit and verit-velocity algorithms are numerical methods to approximate the average position and velocity respectively of randomly moving atoms in a particular medium (solid, liquid, fliud etc.). This position and velocity can be applied to Newtonian mechanics to calculate such properties as the force and potential energy of the system. The algorithms work by splitting the function into discrete time steps, calculating the values of position and velocity at this particular time step, and then effectively &amp;quot;joining the dots&amp;quot; to create an approximate function. These simulations always use the answer from the previous timestep to compute the new timestep, so initial conditions must be given for the first step. Both of the algorithms are shown below and are derived from the Taylor expansion of the position or velocity of the atoms at the timestep &amp;quot;n+1&amp;quot; or &amp;lt;math&amp;gt;t+\delta t&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit Algorithum:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{x}_i\left(t + \delta t\right) \approx 2\mathbf{x}_i\left(t\right) - \mathbf{x}_i\left(t - \delta t\right) + \frac{\mathbf{F}_i\left(t\right)}{m_i}\delta t^2  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit-Velocity Algorithum:&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i\left(t\right)&amp;lt;/math&amp;gt; is the force acting on a particular atom as a function of time&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i&amp;lt;/math&amp;gt; is the acceleration &lt;br /&gt;
&lt;br /&gt;
The smaller the timestep, the closer the numerical approximation is to the true solution function, which can be modeled as a classical harmonic oscillator. &#039;&#039;Figure a.&#039;&#039; in the table below shows the comparison between the two methods in &#039;&#039;time&#039;&#039; space. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure a. &#039;&#039;Plots of position vs time comparing the verit algorithm and harmonic spring results&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure b. &#039;&#039;Plot of the total classical energy of the system (potential + kinetic)&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory xanalytical.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory energy.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The harmonic spring position values are modeled from the harmonic oscillator or particle on a spring. The equation of &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; was used to calculate these values, where &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; are 1 and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; is zero. As seen on the plot, the curves produced from the two different methods of calculating the position are in good agreement.&lt;br /&gt;
|The potential energy is calculated using the equation U = 1/2 kx^2, with a value of k given as 1. The kinetic energy is calculated using the velcity from the verit-velocity algorithm using the equation T = 1/2 mv^2, with a value of m given as 1. The total energy of the system, E, is equal to T + U. The values for x (potential energy) and v (kinetic energy) are taken from the verity algorithm and verit-velocity algorthim respectively. &lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;Figure c. &#039;&#039;Plot of the difference (error) between the harmonic spring and verit algorithm data&lt;br /&gt;
!&#039;&#039;Figure d. &#039;&#039;Plot of the peaks in the error plot in &#039;&#039;figure c.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory error.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory errorpeaks.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The peaks in the error between the harmonic spring and verit algorithm results are at the place where the position curve crosses the time axis. This is because the harmonic spring data (x(t)) has a slightly shorter wave period than that of the verit velocity algorithm, and therefore the difference will get larger with each period of the wave, shown by the error getting larger in &#039;&#039;figure c. &#039;&#039;The period of the plot of the two methods are different because the verit algorithm is much more approximate so does not give the correct solution.&lt;br /&gt;
|The change in the error/difference between the harmonic spring data and verit algorthm data increases linearly and so therefore period of each of the plots in &#039;&#039;figure 1&#039;&#039;. must be constant. &lt;br /&gt;
|}&lt;br /&gt;
The error can also be quantified on a &#039;&#039;phase space&#039;&#039; plot; phase space is momentum or velocity plotted as a function of position. The true solution for motion of an atom is a perfect ellipse, and the more elliptic the shape (less circular) the more momentum or velocity is in the system. A numerical solution, like the verit algorithms, will produce a set of points very close to this ellipse but not perfectly following the curve. A good numerical solution will remain in an elliptical shape, whereas a bad numerical solution, for example one with a large timestep, will spiral away from the true solution. Two examples of such systems using the data from &#039;&#039;figures a-d&#039;&#039; are shown below.  &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure e. &#039;&#039;Phase plot of the harmonic spring data with a good numerical solution (timestep = 0.1) &lt;br /&gt;
!&#039;&#039;Figure f. &#039;&#039;Phase plot of the harmonic spring data with a bad numerical solution (timestep = 0.3) &lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory phasegood.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory badphase.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The timestep at which this data is plotted is 0.1, which results in a very small change in the energy, as seen in &#039;&#039;figure b. &#039;&#039;Increasing the time step will increase the variation in the energy. To keep the variation in the total energy of the system under 1%, the time step must be no larger than approximately 0.28. The energy varies more with increasing time step because the jumps in the algorithm  are getting larger due to less data points. The algorithm assumes these points are joined by a straight line; that the halfway point in the jump is the average between the starting and finishing point of the jump. The phase space plot will become less elliptic and the jumps eventually become so larger that the plot is no longer a continuous shape.  &lt;br /&gt;
&lt;br /&gt;
It is essential to monitor the energy of a numerically modeled system because a good solution for the motion of an atom has a constant energy and a plot in phase space of a perfect ellipse.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance and Force at Zero Potential===&lt;br /&gt;
From classical mechanics, the force calculated from the Newtonian mechanics above can be used to calculate the potential experienced by an atom in the system. They are related by the equation: &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;
This potential gives the shape and dimension of the potential surface on which the system can be modeled. A simple 1D potential that is used to describe the inter atomic forces of a liquid is the Lennard-Jones potential. It has the characteristic features of a short range repulsion potential and harmonic character around the equilibrium bond distance. The value of &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the inter atomic separation when the potential, &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;, is equal to zero, can be calculated by equating the equation for the Lennard-Jones potential to zero and solving for &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The equation for the Lennard-Jones potential: &amp;lt;math&amp;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;
Equating this to zero: &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;
And rearranging in order to separate the variables: &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;
Rearranging this gives &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in terms of &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt; r^6 = \sigma^6&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r = r_0&amp;lt;/math&amp;gt; in this case.&lt;br /&gt;
&lt;br /&gt;
This, therefore, gives the result that interatomic distance at zero potential, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, is equal to &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; in the Lennard-Jones potential is effectively the diameter of one of the particles in the system being measured; in this case, the liquid we are simulating. This is the point where the potential curve crosses the x-axis on an Energy vs interatomic distance plot. The force, &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt;, at this point on the curve corresponds to the gradient; it is found by calculating the derivative of the curve at this point. &lt;br /&gt;
&lt;br /&gt;
To calculate the force, we must differentiate the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As force is equal to the negative differential of the potential energy, the value of the force is: &amp;lt;math&amp;gt;\mathbf{F}_i = 48\epsilon \sigma^{12} r^{-13} - 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting in the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at zero potential from the calculation before: &amp;lt;math&amp;gt;\mathbf{F}_i = \frac{48\epsilon}{\sigma} - \frac{24\epsilon}{\sigma} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The gradient where the Lennard-Jones plot crosses the axis is negative; &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; in the term obtained for &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is negative and therefore the overall value of the force will be negative.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance, Force and Well Depth of the Potential at Equilibrium===&lt;br /&gt;
To calculate the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at the equilibrium position, we need to use the derivative of the potential energy curve. The equilibrium value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is the value at the minimum of the Lennard-Jones curve; when &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Therefore, equating the derivative to zero gives: &amp;lt;math&amp;gt;0 = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rearranging this: &amp;lt;math&amp;gt;48\epsilon \sigma^{12} r^{-13} = 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And simplifying and cancelling gives: &amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6&amp;lt;/math&amp;gt;. Therefore the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at equilibrium is: &amp;lt;math&amp;gt;r_{eq} = \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Physically, this result means that the equilibrium distance is 1.12 times the diameter of one of the particles; the particles have a small gap between them so do not touch. A short range repulsion potential, as seen in the Lennard-Jones curve, is a result of the particles coming into contact. &lt;br /&gt;
&lt;br /&gt;
Again, the force can be calculated from the derivative of the potential curve at the equilibrium point. As the derivative at this point is zero (a minimum on the curve), the force will therefore also be zero.&lt;br /&gt;
&lt;br /&gt;
The well-depth of the potential curve is the difference between zero potential and the potential at the equilibrium bond length. This can be calculated by substituting the value for the equilibrium bond length into the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 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;
Cancelling and simplifying this equation gives: &amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \times \frac{1}{4}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the absolute value for the well depth is &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;. The actual value of this potential is &amp;lt;math&amp;gt;-\epsilon&amp;lt;/math&amp;gt;, as the equilibrium bond length gives the most stable configuration of the molecules and therefore suggests attractive interactions are involved in the arrangement of the molecules; this attractive potential means its negative. &lt;br /&gt;
&lt;br /&gt;
===Boundary Conditions and the Lennard-Jones Cutoff===&lt;br /&gt;
When simulating a liquid, it is computationally impractical to simulate a realistic liquid. Therefore a smaller &#039;box&#039; containing &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; particles is simulated and the computer program will use &#039;&#039;periodic boundary conditions&#039;&#039; to simulate infinite repetitions of this box; when the atom reaches one edge of the box, in periodic boundary conditions, it will reappear again at the opposite edge of the box as if they were connected. For example, an atom at the position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a box of size &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;. Without periodic boundary conditions, we would assume that the atom would end up at the position &amp;lt;math&amp;gt;(1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;. However, in this box, there is no such position and so the particle must reappear at the opposite edge to where it effectively &#039;left&#039; the box. Therefore, it&#039;s ending position will be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The number of particles, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; simulated by the computer is usually between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt;. Physically, this is a very small volume. Considering water, we can calculate the number of molecules in 1 mL or 1 cm^3, a volume that would be considered small in the lab. Taking the concentration of water at standard conditions, &amp;lt;math&amp;gt;55\ mol\ dm^{-3}&amp;lt;/math&amp;gt;, we can convert it to the number of moles per mL: &amp;lt;math&amp;gt;0.055\ mol\ mL^{-1}&amp;lt;/math&amp;gt;. Multiplying this value by Avagadro&#039;s constant (&amp;lt;math&amp;gt;N_A&amp;lt;/math&amp;gt;) gives the number of molcules of water per mL: &amp;lt;math&amp;gt;3.02 \times 10^{22}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The reverse procedure can be used to compare this to the volume of 10,000 molecules: 10,000 divided by Avagadro&#039;s constant gives the number of moles of water which 10,000 molecules makes up: &amp;lt;math&amp;gt;1.66 \times 10^{-20}\ moles&amp;lt;/math&amp;gt;. Dividing this value by the concentration (from &amp;lt;math&amp;gt;n=cV&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is the number of moles, &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; is the concentration and &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume), gives the volume: &amp;lt;math&amp;gt;3.02 \times 10^{-22}\ dm&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;3.02 \times 10^{-19}\ mL&amp;lt;/math&amp;gt;. Physically, of course, this is far too small a volume to be recorded in the lab.&lt;br /&gt;
 &lt;br /&gt;
Periodic boundary conditions simulate an infinite lattice and therefore, when computing the potential, will calculate an infinite amount of pair interactions. Therefore, it is only practical to calculate the energies up to a certain interatomic distance; the Lennard-Jones cutoff distance. Beyond this point, the potential energy and the integral of the curve beyond this point become insignificant and do not impact on the overall energy; removing interactions beyond this point from the calculations will not effect the accuracy. Multiplying the Lennard-Jones potential with the radial distribution function gives a plot of the probability of finding an atom at a particular interatomic distance. The larger the interatomic distance, the lower the probability and so the energy after the cutoff can be disregarded. &lt;br /&gt;
&lt;br /&gt;
Integrating over the Lennard-Jones curve and applying this cutoff as the lower limit can show how small the integral is:&lt;br /&gt;
&lt;br /&gt;
For a general cutoff of with value &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;I = \int_{x}^\infty \phi\left(r\right)\mathrm{d}r = \int_{x}^\infty \frac{4\epsilon\sigma^{12}}{r^{12}}\mathrm{d}r - \int_{x}^\infty \frac{4\epsilon\sigma^6}{r^6}\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving this: &amp;lt;math&amp;gt;I = 4\epsilon\sigma^{12} {\frac{-1}{11r^{11}}\,\Bigg\vert\,}_x^\infty - 4\epsilon\sigma^{6} {\frac{-1}{5r^{5}}\,\Bigg\vert\,}_x^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This gives the general solution: &amp;lt;math&amp;gt;I = \frac{4\epsilon\sigma^{12}}{11x^{11}} - \frac{4\epsilon\sigma^{6}}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating this for &amp;lt;math&amp;gt;\epsilon = \sigma = 1&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;I = \frac{4}{11x^{11}} - \frac{4}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt; (or 2 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.025&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt; (or 2.5 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0082&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt; (or 3 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0033&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All values are taken to 2 significant figures. As the cutoff value for the interatomic distance gets larger, the integral gets smaller, and therefore the energy excluded from the calculation becomes smaller, and the second term in the solved integral, &amp;lt;math&amp;gt;I&amp;lt;/math&amp;gt;, dominates the energy value.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
When using the Lennard-Jones potential, it is appropriate to use reduced units for intermolecular distance, energy and temperature. Reduced units can be calculated by the following relationships:&lt;br /&gt;
&lt;br /&gt;
Intermolecular 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;
&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; are scaling factors. For example, if the parameters for Argon are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\sigma = 0.34 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt; \epsilon\ /\ k_B = 120 K&amp;lt;/math&amp;gt;&lt;br /&gt;
* Lennard-Jones cutoff &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;. The well-depth, &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;, is &amp;lt;math&amp;gt;0.999 kJ mol^{-1} \approx 1 kJ mol^{-1}&amp;lt;/math&amp;gt;. The value of &amp;lt;math&amp;gt;T* = 1.5&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;180 K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
The first aim of the simulations is to determine the most appropriate timestep to use in the vert algorithm simulations. This timestep is a balance between the accuracy of the results (the smaller the timestep, the closer to the true functing the result will be) and the length of real time over which the simluation is run (the smaller the timestep, the less real time over which the simulation will give a result). The appropriateness of the timestep will be determined by plotting how the total free energy of the simulated lattice equilibrates over time.  &lt;br /&gt;
&lt;br /&gt;
Five different calculations, which simulated the melting of a crystal and subsequent equilibration of the energy of the melted crystal, were run at five different timesteps; 0.001, 0.0025, 0.0075, 0.01 and 0.015, and were described by the NVE or &#039;&#039;&amp;quot;microcanonical ensemble&amp;quot;&#039;&#039;. An ensemble is a collection of samples of a system which are under three thermodynamic constraints (three properties are kept constant); in the microcanonical ensemble, the number of particles, the volume and the total energy is kept constant (NVE). &lt;br /&gt;
&lt;br /&gt;
These calculations simulate a box of 1000 unit cells and use periodic boundary conditions to replicate the simulation to a larger scale. Because these simulations use the numerical methods defined in the previous section, the initial position and velocity of the atoms must be defined in the input file. The Brownian (uncorrelated, random) motion of the atoms in the simulation means that there is no long range order in the system and so the atoms in a real system would start in random positions. However, assigning random starting coordinates to the atoms in a simulated liquid is not a relative process; the coordinates are generate independently of each other. Therefore there is a probability that the coordinates simulated will cause the atoms to overlap, which would give a very large repulsion potential, as seen in the Lennard-Jones potential at very small interatomic distances. This short-range repulsion potential comes from the hard-sphere model of atomic simulation.&lt;br /&gt;
&lt;br /&gt;
The input file also defines the structure and density of the lattice. The number density of lattice points in any lattice is the number of lattice points per volume of the unit cell. In a simple cubic lattice, there is one lattice point in the unit cell. From an sc lattice with lattice spacing (length of one side of the unit cell) being &amp;lt;math&amp;gt;1.07722&amp;lt;/math&amp;gt;, the number density of the lattice points is calculated by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{1}{1.07722^3} = 0.7999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a face-centered cubic lattice (fcc), there are four lattice points in the unit cell. Rearranging the above relationship, the lattice spacing can be calculated from the number of lattice points in a unit cell and number density, &amp;lt;math&amp;gt;1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Lattice\ spacing = \sqrt[3]{\frac{number\ of\ lattice\ points\ per\ unit\ cell}{number\ density}} = \sqrt[3]{\frac{4}{1.2}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation creates a box which includes 1000 unit cells, which is 10 unit cells in each dimension. For a simple cubic lattice, because there is one lattice point per unit cell, there will be 1000 atoms created as seen in the input file. The &#039;&#039;create_atom&#039;&#039; command in the input file determines how many boxes are created in the simulation and therefore how many atoms will be created. If a face centered cubic lattice is simulated, because there are 4 lattice points per unit cell, 4000 atoms will be created in the &#039;&#039;create_atom&#039;&#039; command. &lt;br /&gt;
&lt;br /&gt;
The input script also contains the following commands which defines the potential surface which is used to model the intermolecular reactions:&lt;br /&gt;
 mass 1 1.0&lt;br /&gt;
This instruction sets the mass type for the atoms being simulated. It takes the general form of “mass I value”, where mass is the keyword which tells LAMMPS what the input is, I is the atom type and value is the mass of the atom. In this case, I is defined by a specific numerical value; 1 as there is only 1 type of atom in the simulation, but it can be defined with an asterisk (1*), which means “all atom types of 1 to n inclusive”. &lt;br /&gt;
 pair_style lj/cut 3.0&lt;br /&gt;
This instruction sets the type of potential which LAMMPS uses in its calculation of pairwise interactions. It takes the general form of “pair_style style args”, where pair_style is the keyword for LAMMPS, style defines the potential and any specifications it may have, and args are the arguments required for this particular potential. In this case, the Lennard-Jones potential has been used (lj) with a cutoff point (cut) of 3σ. The cutoff point is explained in the introduction section. &lt;br /&gt;
 pair_coeff * * 1.0 1.0&lt;br /&gt;
This instruction specifies the coefficients for the pairwise interactions of each pair of atoms, and it takes the general form “pair_coeff I J args”. Pair_coeff is the keyword, I and J are the atom types, and args are the coefficients which the different atoms types take. In this case, the asterisk in place of I and J refers to all atoms types from 1 to n. The coefficients are the pairwise interactions are 1 for each atom, meaning each atom has an equal contribution to the interaction.&lt;br /&gt;
&lt;br /&gt;
In these initial calculations, the initial conditions for the numerical methods, &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. For this experiment, the verit-velocity algorithm would be the most appropriate, as both the starting position and velocity is specified for this algorithm. &lt;br /&gt;
&lt;br /&gt;
To define the timestep for the algorithm the following code is used defining the timestep as a variable instead of just giving it a definite value&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;
It is much easier to use the variable version of defining the timestep because the length of time over which the simulation is run depends on the time step. By using a variable, you can keep the length of the simulation the same, no matter the size of the timestep. It also makes it easier if multiple properties depend on the timestep – only the variable needs to be changed, not all the parts of the script where timestep is defined. &lt;br /&gt;
&lt;br /&gt;
The calculations produce the values for the total energy of the system, temperature and pressure in the output files, which can be plotted against time. How well these values equilibrate determines the appropriateness of the timestep to use in further calculations in the experiment.   &lt;br /&gt;
[[File:Rmt totalenergy plot.png|none|thumb|800x800px|&#039;&#039;Figure h. &#039;&#039;Plot of the equilibration of total energy for five different timesteps]]&lt;br /&gt;
The largest time step to give an acceptable result is 0.01. However, for any simluation we would expect energy to be independent of the timestep, something which is not true at a timestep greater than 0.0025. Therefore, the most appropriate timestep to use for a balance between accuracy and length of time which the simulation covers is 0.0025.  &lt;br /&gt;
&lt;br /&gt;
0.015 is a particularly bad choice of timestep. This is because the verit-velocity algorithm gives an approximate result to the velocity (kinetic energy term) and position (potential energy term), and so when the timestep becomes too large with respect to the time, the algorithm no longer becomes a suitable way to calculate the energy. As seen in the graph of 0.015, the energy does not equilibrate and diverges.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions ==&lt;br /&gt;
The calculations in this section are run in the isobaric-isothermal ensemble, where the number of particles in the system, the pressure and the temperature are kept constant (NpT). This means that the temperature and the pressure are recalculated in every step, so are no longer constant like they were in the NVE ensemble. From the &#039;&#039;equipartition theorem&#039;&#039;, each degree of freedom will contribute &amp;lt;math&amp;gt;\frac{1}{2} k_B T&amp;lt;/math&amp;gt; of energy to the system. As the system is in three dimensions, there are three degrees of translational freedom and so the total internal energy is equal to &amp;lt;math&amp;gt;\frac{3}{2} k_B T&amp;lt;/math&amp;gt;. Equating this to the kinetic energy, &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt;, at the end of every step and rearranging will allow calculation of the temperature after every step. &lt;br /&gt;
&lt;br /&gt;
A target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, is defined in the input script and the system will equilibrate by multiplying the velocity by a factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, in order to accommodate for the fluctuation and keep the system at approximately the target temperature and therefore constant internal energy. If the temperature of the system is greater than the target temperature, the system&#039;s kinetic energy is too high, so &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is reduced to compensate for this. The same is true for is the temperature is lower than the target temperature; &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than one in the next step to increase the kinetic energy which is now too low. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; can be derived from equating the kinetic and internal energy of the system at an arbitrary time step:&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;
Expanding the brackets inside the sum and moving the term containing &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; out of the sum: &amp;lt;math&amp;gt;\frac{\gamma^2}{2}\sum_i m_i \left(v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;, we can replace &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt; on the left hand side of the equation with &amp;lt;math&amp;gt;\frac{3}{2} N k_B T&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;\frac{3\gamma^2}{2}N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Simplifying and rearranging for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, gives: &amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The principle is the same for controlling the pressure.&lt;br /&gt;
&lt;br /&gt;
As temperature and pressure are no longer constant, he input files require specification of the pressure and the temperature for each of the systems run. 10 simulations were run at two different pressures with five different temperatures at each. &lt;br /&gt;
* Temperatures: 1.6, 1.9, 2.2, 2.5, 2.8&lt;br /&gt;
* Pressures: 2.5, 3.0&lt;br /&gt;
These pressures were chosen because the data simulated when choosing an appropriate timestep gave a pressure between 2.5 and 3.0.  &lt;br /&gt;
&lt;br /&gt;
For the code which computes the thermodynamic potentials, this particular line defines how many steps contribute towards the average of the thermodynamic parameters computed in the calculation. &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;
&#039;&#039;fix&#039;&#039; is the keyword, &#039;&#039;aves&#039;&#039; is the name of the group of fixes which in this case is the average of the thermodynamic values, &#039;&#039;all&#039;&#039; specifies the atoms which the fix is applied to which in this case is all the atoms in the simulated system and &#039;&#039;ave/time&#039;&#039; means that compute global time averages are calculated. The following three numbers have the following meaning:&lt;br /&gt;
&lt;br /&gt;
*100 = use the input values every 100 timesteps&lt;br /&gt;
*1000 = use input values 1000 times for calculating the average&lt;br /&gt;
*100000 = calculate the average every 100000 timesteps&lt;br /&gt;
&lt;br /&gt;
Therefore for the total calculation which lasts for 100000 will only have the average calculated once. Assuming 1 value every timestep, there will be 100000/100 values = 1000. The amount of time simulated is 100,000 steps, read from the following line.&lt;br /&gt;
&lt;br /&gt;
The density data from all ten calculation were plotted on the same graph, along with the density for an &amp;quot;ideal&amp;quot; gas. This density can be derived from the ideal gas law:&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;
Rearranging in terms of density: &amp;lt;math&amp;gt;\frac{N}{V} = \frac{P}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As these simulations are being run under reduced units, we can take &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt;, and so the density of the ideal gas becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the density of the ideal gas is plotted as the pressure divided by the temperature in pressure-temperature phase space.&lt;br /&gt;
[[File:Rmt dvt plot.png|none|thumb|800x800px|&#039;&#039;Figure i. &#039;&#039;Plot of the variation in density with temperature at a defined pressure for the numerically simulated and ideal systems]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that calculated in the ideal gas law. This is because for an ideal gas, an assumption is made that there are no intermolecular interactions, and therefore forces such as electron repulsion forces are ignored; repulsion forces dominate over attractive ones, as all the atoms in this simulation are the same and so partial charges or dipoles are created. This will mean that the particles move closer together than a real gas and so the density will be larger. This discrepancy between the ideal and non-ideal systems becomes larger at a higher pressure because with a higher pressure, the atoms in the system are closer together and therefore the intermolecular repulsion will become larger. This greater repulsion will in turn have a larger effect on decreasing the density.&lt;br /&gt;
&lt;br /&gt;
== Statistical Physics Calculations of the Heat Capacity ==&lt;br /&gt;
The heat capacity of a system at constant volume can be calculated from the variance in the total energy of the system. The relationship used to calculate the heat capacity is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = 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;\left\langle E^2\right\rangle&amp;lt;/math&amp;gt; is the continuous average of the total square energy at each temperature as a function of temperature. &amp;lt;math&amp;gt;\left\langle E\right\rangle^2&amp;lt;/math&amp;gt; is the continuous average of the total energy at each temperature as a function of temperature squared. The heat capacity is multiplied by &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; in this case because the version of LAMMPS calculates every energy divided by the number of molecules in the system simulated.&lt;br /&gt;
&lt;br /&gt;
The calculations in this sections are run in density-temperature phase space and the ensemble has changed to the canonical ensemble (NVT). A set of input files were written for ten calculations for, like the previous section, two pressures and five different temperatures at each pressure:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 0.2, 0.8&lt;br /&gt;
*Temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{C_V}{V}&amp;lt;/math&amp;gt; was plotted against temperature to determine the relationship in density-temperature phase space. An example of an input file can be found [[Media:nvt_-_0220.in|here]]. The lines which have been changed from the previous input files are at the end of the script:&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 &lt;br /&gt;
 thermo_style custom step etotal temp&lt;br /&gt;
 variable energy equal etotal&lt;br /&gt;
 variable energy2 equal etotal*etotal&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_energy v_energy2 v_temp&lt;br /&gt;
 run 100000&lt;br /&gt;
 &lt;br /&gt;
 variable aveenergy equal f_aves[1]&lt;br /&gt;
 variable aveenergy2 equal f_aves[2]&lt;br /&gt;
 variable avetemp equal f_aves[3]&lt;br /&gt;
 variable heatcapacitydv equal atoms*atoms*(v_aveenergy2-v_aveenergy*v_aveenergy)/(v_avetemp*v_avetemp*vol)&lt;br /&gt;
 &lt;br /&gt;
 print &amp;quot;Averages&amp;quot;&lt;br /&gt;
 print &amp;quot;--------&amp;quot;&lt;br /&gt;
 print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Heat Capacity per Volume: ${heatcapacitydv}&amp;quot;&lt;br /&gt;
The line with the keyword &#039;fix&#039; determines which thermodynamic values are averaged and over how many steps they are averaged. The next section takes these averages as variables and uses them to define the heat capacity which is calculated from the equation at the beginning of this section. Only the energy and temperature are needed to define the heat capacity and so only these values are calculated by the simulation. [[File:Rmt heatcapacitybyv.png|none|thumb|800x800px|&#039;&#039;Figure j. &#039;&#039;C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V against temperature for the two different pressures 0.2 and 0.8]]As seen in the above figure, the heat capacity decreases with temperature for both pressures. It would be expected for an ideal system that as the temperature increases, the heat capacity at constant volume increases and tends to a constant volume at very high T of 3R; R = the universal gas constant. This means increasing the temperature increases the amount of energy being stored in the system and this energy is stored as vibrational energy. However, for a Lennard-Jones liquid, the system being simulated here, the heat capacity decreases with temperature. This is because the simulation has two components to the simulation; the atoms are vibrating in a quasi-harmonic fashion around the equilibrium position and also diffuse between neighbouring equilibrium positions in a gas like fashion. As the temperature increases, the amount of diffusion increases and the vibrations decreases, therefore decreasing the ability of the system to absorb vibrational energy, resulting in the decrease in heat capacity. &amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www.nature.com/ncomms/2013/130816/ncomms3331/full/ncomms3331.html?message-global=remove&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural Properties and the Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a single atom in a system is a plot of the probability that an atom can be found at a certain distance from the central atom. The peaks in this plot can give the distance of an atom from its nearest neighbours in the Lennard-Jones simulated system. &lt;br /&gt;
&lt;br /&gt;
The calculations in this section simulate a Lennard-Jones solid, liquid and gas and, using the output of the LAMMPS trajectory file, plots both the radial distribution function and its integral using DLV. The temperature and pressure parameters for these calculations were taken from the phase diagram or coexistence curve for a Lennard-Jones system.&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt; The parameters used are displayed in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! Temperature, &amp;lt;math&amp;gt;T^*&amp;lt;/math&amp;gt;&lt;br /&gt;
! Pressure, &amp;lt;math&amp;gt;p^*&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| LJ Solid&lt;br /&gt;
| 1.5&lt;br /&gt;
| 1.2&lt;br /&gt;
|-&lt;br /&gt;
| LJ Liquid&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.8&lt;br /&gt;
|-&lt;br /&gt;
| LJ Gas&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.01&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The data obtained from the plots and the radial distribution functions and their integrals were plotted and shown in the table below.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure k. &#039;&#039;The radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
!&#039;&#039;Figure l. &#039;&#039;The integrals of the radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt fullrdfs.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt allintegralsrdf.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
[[File:Rmt Nearest neighbours.png|left|thumb|300x300px|&#039;&#039;Figure m. &#039;&#039;Representation of a cross section of the first three shells of nearest neighbours in an fcc solid. The black atom is the central atom being considered, the blue atoms are the first shell, the orange atoms the second shell and the purple atoms are the third.]]&lt;br /&gt;
The RDF of the solid gives a very irregular curve because of the irregular structure of the lattice. For a simple cubic lattice, a regular structure of the RDF would be expected because of the equal number of atoms in each of the nearest neighbour shells of the atoms. However, for face-centered cubic, the solid in this simulation, the structure is much more irregular and as the atoms move from their equilibrium position in the lattice due to vibrations, the peaks in the radial distribution will broaden. The irregular heights of the peaks are due to the varying numbers of atoms in each of the nearest neighbour shells for the central atom. The first shell gives the highest peak as it contains the most atoms; in total, considering all four surrounding unit cells, this shell contains 12 atoms and ideally takes the geometry of an icosahedron. The second shell is smaller and contains only 6 atoms in an octahedral coordination shape. The following shell again contributes 12 atoms, 3 from each unit cell. This therefore explains why the heights of the peaks in the solid plot in &#039;&#039;figure k.&#039;&#039; vary. These values can be confirmed by the plot in &#039;&#039;figure o.&#039;&#039; which is the integral; it cumulatively adds the numbers in each shell. The size of the first &amp;quot;step&amp;quot; is 12; there are 12 atoms in the first shell. The size of the second step is approximately 18; there are 18-12=6 steps in the second shell. The same theory applies for the third shell which gives a value of 13. This is slightly different to the predicted value possibly due to error in the calculation of the radial distribution function and therefore its integral. &lt;br /&gt;
&lt;br /&gt;
The RDF of the liquid has a representation of far fewer shells, which means that there are less atoms in the space close to a &amp;quot;central&amp;quot; atom in the bulk solution. The particles have more energy and therefore do not keep to a regular lattice structure. As they move about, some regualrity is maintained around each atom, but only to the extend of two or three shells, meaning there is no long range order in a Lennard-Jones liquid. &lt;br /&gt;
&lt;br /&gt;
The RDF of the gas again omits more shells as there is almost no order in a Lennard-Jones gas. The single peak on this plot considers only the set of atoms closest to the central atom and all others are disregarded as they are too far apart. &lt;br /&gt;
&lt;br /&gt;
Considering &#039;&#039;figure l.&#039;&#039;, the size of the integral of the radial distribution function decreases from solid to liquid to gas. This makes sense as the number of atoms in the surrounding shells decreases with density of the system; the atoms become further apart. &lt;br /&gt;
&lt;br /&gt;
From the plot of the radial distribution function of the solid, the lattice spacing can be determined. For this, we can consider just the first three peaks of the RDF plot. The lattice spacing refers to the length of one unit cell, and so, using &#039;&#039;figure m&#039;&#039;, we can calculate this using two different methods; a) we can use the distance between the central atom and the first shell of nearest neighbours, and use trigonometry to calculate the lattice spacing. Or alternatively b) we can use the distance between the central atom and the second nearest neighbour shell to get the lattice spacing.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure n. &#039;&#039;The radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
!&#039;&#039;Figure o. &#039;&#039;The integral of the radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt solidgr3.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt solidint3.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
Using method a) (with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; as the distance between the central atom and the nearest neighbour: Lattice spacing = &amp;lt;math&amp;gt;\frac{r}{cos({\frac{\pi}{4}})} = \frac{1.02}{cos({\frac{\pi}{4}})} \approx 1.44&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using method b): Lattice spacing &amp;lt;math&amp;gt;\approx 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can take an average between the two get an approximate value for the lattice spacing: &amp;lt;math&amp;gt;1.46 \plusmn 0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These values for distance are all in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
The ability of atoms to move around in a solid liquid or gas can be characterised by the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. In this section, we will explore two different ways to calculate the diffusion coefficient and compare the results. &lt;br /&gt;
&lt;br /&gt;
=== The Mean Squared Displacement ===&lt;br /&gt;
The diffusion coefficient can be measured easily be calculating the mean squared displacement of atoms in the solution; the diffusion coefficient is proportional to the first derivative of the mean squared displacement. By plotting the mean squared displacement as a function of time, the gradient can be taken to calculate the diffusion coefficient when its has equilibrated and become linear.&lt;br /&gt;
&lt;br /&gt;
The temperature and density parameters used were the same as in the previous section:&lt;br /&gt;
* Solid: T=1.5, D=1.2&lt;br /&gt;
* Liquid: T=1.1, D=0.8&lt;br /&gt;
* Gas: T=1.1, D=0.01&lt;br /&gt;
&lt;br /&gt;
Mean density squared calculations were run for all three Lennard-Jones phases and the data plotted as function of timestep below. The data from a simulation containing 1,000,000 atoms was plotted for comparision.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!Plots for the 8,000 atom data (&#039;&#039;figures p-r)&#039;&#039;&lt;br /&gt;
!Plots for the 1,000,000 atom data (&#039;&#039;figures s-u)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|[[File:Rmt_MSDsolid.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt_MAsolid.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|[[File:Rmt MSDliquid.png|700x700px]]&lt;br /&gt;
|[[File:Rmt MAliquid.png|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|[[File:Rmt MSDgas.png|700x700px]]&lt;br /&gt;
|[[File:Rmt dataplots 25894 image001.png|700x700px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The exact relationship between the mean squared displacement and the diffusion coefficient is:&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;
Taking the gradients of each of the curves at the point at which they become linear and dividing by six will give the diffusion coefficient for each set of data. The gradient also needs to be converted to a function of time; this is done by dividing by the timestep, which in this case is 0.002:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom data diffusion coefficients, &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
!1,000,000 atom data diffusion coefficients &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 0.9999&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|Gradient = 0.0972&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{48.6}{6} = \mathbf{8.1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient = 0.0386&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{19.6}{6} = \mathbf{3.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For both of the solid approximations, the diffusion coefficient can be approximated as zero. This is because, when equilibrated, the function has a constant value of around 0.2 for the mean squared displacement. A gradient with a value of zero means that the atoms take an infinite amount of time to change their mean squared displacement; to move away from their equilibrium position, and so this means that we can approximate in this system, there will be no diffusion. In real system, however, this is not the case; diffusion occurs but it is very slow. A plot for a real system will give a very shallow positive gradient.&lt;br /&gt;
&lt;br /&gt;
The liquid approximations are very well correlated. This is because in both cases, the mean squared displacement of particles in a liquid increases linearly with time and the gradient of both plots are almost identical. We can assume from this that identical starting conditions were used to calculate this data. Also, we can estimate that 8,000 atoms is a large enough simulation to give an accurate result for the diffusion coefficient for the Lennard-Jones liquid.&lt;br /&gt;
&lt;br /&gt;
The gas approximations are very different. This is most probably due to the fact that the density specified in calculations are different. The 8,000 data can be estimated to be a much lower density because the diffusion coefficient is faster and this means diffusion will happen faster; at a higher density a particle will take longer to diffuse over a given distance. Because of the difference in density, the two values of the diffusion coefficient cannot be qualitatively compared. The reason for the initial deviation for linearity in the gas plots is due to the momentum of the particles initially dominating over the diffusion and the diffusion coefficient is dependent on time. As the system equilibrates, the diffusion coefficient becomes constant and the plots become linear.&lt;br /&gt;
&lt;br /&gt;
=== The Velocity Autocorrelation Function ===&lt;br /&gt;
&lt;br /&gt;
Another way to calculate the diffusion coefficient is by using the velocity correlation function, which determines how the velocity of an atom changes with time. The function determines the difference in time (&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;) when the velocity becomes uncorrelated, i.e. the difference between the velocity at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; and at time &amp;lt;math&amp;gt;t+\tau&amp;lt;/math&amp;gt;. By integrating over this function, we can find the diffusion coefficient. &lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function: &amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can also be written as the integral: &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;
Using the function which defines the position of a classical harmonic oscillator, we can differentiate this to give the equation for the velocity which we can plug into the integral:&lt;br /&gt;
&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;
&amp;lt;math&amp;gt;dv{x(t)}{t} = v(t) = -A\omega sin(\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also needed for the integral:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t+\tau) = -A\omega sin(\omega(t+\tau)+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v^2(t) = A^2\omega^2 sin^2(\omega t +\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Putting all this into the integral to find the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega sin(\omega t + \phi) \times A\omega sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} A^2\omega^2 sin^2(\omega t +\tau)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A^2\omega^2&amp;lt;/math&amp;gt; can be take out of each of the integrals and cancelled. A substituion can then be made to make solving the integral much simpler:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = \omega t + \phi&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \omega\tau&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the integral becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a) \times sin(a+b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the compound angle rule &amp;lt;math&amp;gt;sin(a+b)=sin(a)cos(b)+cos(a)sin(b)&amp;lt;/math&amp;gt;, the integral can be simplified to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a)sin(a)cos(b) + sin(a)cos(a)sin(b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Separating out into two integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)\frac{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the rule &amp;lt;math&amp;gt;sin(a)cos(a) = \frac{1}{2}sin(2a)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} \frac{1}{2}(sin(2a))\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because the function &amp;lt;math&amp;gt;\frac{1}{2}sin(2a)&amp;lt;/math&amp;gt; is symmetric over all space, the second term in this equation becomes zero. Therefore, the integral simplifies to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b) = cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same calculations from the mean squared displacement section gave an output of the velocity autocorrelation function. The function for the Lennard-Jones solid, liquid and gas were plotted against the timestep along with the approximate function for the velocity autocorrelation function, &amp;lt;math&amp;gt;cos(\omega\tau)&amp;lt;/math&amp;gt;, where \omega = \frac{1}{2\pi}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure v. &#039;&#039;Plots for the velocity autocorrelation function of a Lennard-Jones solid, liquid and gas; 8,000 atoms&lt;br /&gt;
!&#039;&#039;Figure w. &#039;&#039;Plots for the velocity autocorrelation function of a Lennard-Jones solid, liquid and gas, 1,000,000 atoms&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt VACF 5721 image001.png|800x800px|]]&lt;br /&gt;
|[[File:Rmt MAVACF.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
The diffusion coefficient is calculated from: &amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty C\left(\tau\right)\mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the approximate value for the diffusion coefficient using the velocity autocorrelation function is &amp;lt;math&amp;gt;D = \frac{1}{3}cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The running integral of the velocity autocorrelation functions was plotted using the &#039;&#039;trapesium rule&#039;&#039;, and so the final value on the integral plot is proportional to the diffusion coefficient.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom VACF integral &#039;&#039;(figures w-z)&#039;&#039;&lt;br /&gt;
!1,000,000 VACF integral (&#039;&#039;figures aa-cc)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|[[File:Rmt mysi.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt masi.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|[[File:Rmt myli.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt mali.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|[[File:Rmt mygi.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt ligi.png|frameless|700x700px]]&lt;br /&gt;
|}&lt;br /&gt;
The diffusion coefficients for each of the plots above are tabulated below using the final data point from the integral plot.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom data diffusion coefficients, &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
!1,000,000 atom data diffusion coefficients &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|Final value of the data &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Rmt_ligi.png&amp;diff=541412</id>
		<title>File:Rmt ligi.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Rmt_ligi.png&amp;diff=541412"/>
		<updated>2016-02-25T13:03:46Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Rmt_mali.png&amp;diff=541410</id>
		<title>File:Rmt mali.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Rmt_mali.png&amp;diff=541410"/>
		<updated>2016-02-25T13:03:16Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Rmt_masi.png&amp;diff=541407</id>
		<title>File:Rmt masi.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Rmt_masi.png&amp;diff=541407"/>
		<updated>2016-02-25T13:02:10Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Rmt_mygi.png&amp;diff=541405</id>
		<title>File:Rmt mygi.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Rmt_mygi.png&amp;diff=541405"/>
		<updated>2016-02-25T13:01:40Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Rmt_myli.png&amp;diff=541403</id>
		<title>File:Rmt myli.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Rmt_myli.png&amp;diff=541403"/>
		<updated>2016-02-25T13:01:13Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Rmt_mysi.png&amp;diff=541401</id>
		<title>File:Rmt mysi.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Rmt_mysi.png&amp;diff=541401"/>
		<updated>2016-02-25T13:00:44Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=541399</id>
		<title>Rep:Mod:hakunamatata</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=541399"/>
		<updated>2016-02-25T12:59:01Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: /* The Velocity Autocorrelation Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Introduction to Molecular Dynamics Simulations ==&lt;br /&gt;
===The Classical Particle Approximation and Numerical Integration===&lt;br /&gt;
The verit and verit-velocity algorithms are numerical methods to approximate the average position and velocity respectively of randomly moving atoms in a particular medium (solid, liquid, fliud etc.). This position and velocity can be applied to Newtonian mechanics to calculate such properties as the force and potential energy of the system. The algorithms work by splitting the function into discrete time steps, calculating the values of position and velocity at this particular time step, and then effectively &amp;quot;joining the dots&amp;quot; to create an approximate function. These simulations always use the answer from the previous timestep to compute the new timestep, so initial conditions must be given for the first step. Both of the algorithms are shown below and are derived from the Taylor expansion of the position or velocity of the atoms at the timestep &amp;quot;n+1&amp;quot; or &amp;lt;math&amp;gt;t+\delta t&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit Algorithum:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{x}_i\left(t + \delta t\right) \approx 2\mathbf{x}_i\left(t\right) - \mathbf{x}_i\left(t - \delta t\right) + \frac{\mathbf{F}_i\left(t\right)}{m_i}\delta t^2  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit-Velocity Algorithum:&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i\left(t\right)&amp;lt;/math&amp;gt; is the force acting on a particular atom as a function of time&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i&amp;lt;/math&amp;gt; is the acceleration &lt;br /&gt;
&lt;br /&gt;
The smaller the timestep, the closer the numerical approximation is to the true solution function, which can be modeled as a classical harmonic oscillator. &#039;&#039;Figure a.&#039;&#039; in the table below shows the comparison between the two methods in &#039;&#039;time&#039;&#039; space. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure a. &#039;&#039;Plots of position vs time comparing the verit algorithm and harmonic spring results&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure b. &#039;&#039;Plot of the total classical energy of the system (potential + kinetic)&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory xanalytical.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory energy.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The harmonic spring position values are modeled from the harmonic oscillator or particle on a spring. The equation of &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; was used to calculate these values, where &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; are 1 and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; is zero. As seen on the plot, the curves produced from the two different methods of calculating the position are in good agreement.&lt;br /&gt;
|The potential energy is calculated using the equation U = 1/2 kx^2, with a value of k given as 1. The kinetic energy is calculated using the velcity from the verit-velocity algorithm using the equation T = 1/2 mv^2, with a value of m given as 1. The total energy of the system, E, is equal to T + U. The values for x (potential energy) and v (kinetic energy) are taken from the verity algorithm and verit-velocity algorthim respectively. &lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;Figure c. &#039;&#039;Plot of the difference (error) between the harmonic spring and verit algorithm data&lt;br /&gt;
!&#039;&#039;Figure d. &#039;&#039;Plot of the peaks in the error plot in &#039;&#039;figure c.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory error.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory errorpeaks.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The peaks in the error between the harmonic spring and verit algorithm results are at the place where the position curve crosses the time axis. This is because the harmonic spring data (x(t)) has a slightly shorter wave period than that of the verit velocity algorithm, and therefore the difference will get larger with each period of the wave, shown by the error getting larger in &#039;&#039;figure c. &#039;&#039;The period of the plot of the two methods are different because the verit algorithm is much more approximate so does not give the correct solution.&lt;br /&gt;
|The change in the error/difference between the harmonic spring data and verit algorthm data increases linearly and so therefore period of each of the plots in &#039;&#039;figure 1&#039;&#039;. must be constant. &lt;br /&gt;
|}&lt;br /&gt;
The error can also be quantified on a &#039;&#039;phase space&#039;&#039; plot; phase space is momentum or velocity plotted as a function of position. The true solution for motion of an atom is a perfect ellipse, and the more elliptic the shape (less circular) the more momentum or velocity is in the system. A numerical solution, like the verit algorithms, will produce a set of points very close to this ellipse but not perfectly following the curve. A good numerical solution will remain in an elliptical shape, whereas a bad numerical solution, for example one with a large timestep, will spiral away from the true solution. Two examples of such systems using the data from &#039;&#039;figures a-d&#039;&#039; are shown below.  &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure e. &#039;&#039;Phase plot of the harmonic spring data with a good numerical solution (timestep = 0.1) &lt;br /&gt;
!&#039;&#039;Figure f. &#039;&#039;Phase plot of the harmonic spring data with a bad numerical solution (timestep = 0.3) &lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory phasegood.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory badphase.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The timestep at which this data is plotted is 0.1, which results in a very small change in the energy, as seen in &#039;&#039;figure b. &#039;&#039;Increasing the time step will increase the variation in the energy. To keep the variation in the total energy of the system under 1%, the time step must be no larger than approximately 0.28. The energy varies more with increasing time step because the jumps in the algorithm  are getting larger due to less data points. The algorithm assumes these points are joined by a straight line; that the halfway point in the jump is the average between the starting and finishing point of the jump. The phase space plot will become less elliptic and the jumps eventually become so larger that the plot is no longer a continuous shape.  &lt;br /&gt;
&lt;br /&gt;
It is essential to monitor the energy of a numerically modeled system because a good solution for the motion of an atom has a constant energy and a plot in phase space of a perfect ellipse.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance and Force at Zero Potential===&lt;br /&gt;
From classical mechanics, the force calculated from the Newtonian mechanics above can be used to calculate the potential experienced by an atom in the system. They are related by the equation: &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;
This potential gives the shape and dimension of the potential surface on which the system can be modeled. A simple 1D potential that is used to describe the inter atomic forces of a liquid is the Lennard-Jones potential. It has the characteristic features of a short range repulsion potential and harmonic character around the equilibrium bond distance. The value of &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the inter atomic separation when the potential, &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;, is equal to zero, can be calculated by equating the equation for the Lennard-Jones potential to zero and solving for &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The equation for the Lennard-Jones potential: &amp;lt;math&amp;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;
Equating this to zero: &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;
And rearranging in order to separate the variables: &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;
Rearranging this gives &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in terms of &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt; r^6 = \sigma^6&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r = r_0&amp;lt;/math&amp;gt; in this case.&lt;br /&gt;
&lt;br /&gt;
This, therefore, gives the result that interatomic distance at zero potential, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, is equal to &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; in the Lennard-Jones potential is effectively the diameter of one of the particles in the system being measured; in this case, the liquid we are simulating. This is the point where the potential curve crosses the x-axis on an Energy vs interatomic distance plot. The force, &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt;, at this point on the curve corresponds to the gradient; it is found by calculating the derivative of the curve at this point. &lt;br /&gt;
&lt;br /&gt;
To calculate the force, we must differentiate the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As force is equal to the negative differential of the potential energy, the value of the force is: &amp;lt;math&amp;gt;\mathbf{F}_i = 48\epsilon \sigma^{12} r^{-13} - 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting in the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at zero potential from the calculation before: &amp;lt;math&amp;gt;\mathbf{F}_i = \frac{48\epsilon}{\sigma} - \frac{24\epsilon}{\sigma} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The gradient where the Lennard-Jones plot crosses the axis is negative; &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; in the term obtained for &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is negative and therefore the overall value of the force will be negative.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance, Force and Well Depth of the Potential at Equilibrium===&lt;br /&gt;
To calculate the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at the equilibrium position, we need to use the derivative of the potential energy curve. The equilibrium value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is the value at the minimum of the Lennard-Jones curve; when &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Therefore, equating the derivative to zero gives: &amp;lt;math&amp;gt;0 = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rearranging this: &amp;lt;math&amp;gt;48\epsilon \sigma^{12} r^{-13} = 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And simplifying and cancelling gives: &amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6&amp;lt;/math&amp;gt;. Therefore the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at equilibrium is: &amp;lt;math&amp;gt;r_{eq} = \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Physically, this result means that the equilibrium distance is 1.12 times the diameter of one of the particles; the particles have a small gap between them so do not touch. A short range repulsion potential, as seen in the Lennard-Jones curve, is a result of the particles coming into contact. &lt;br /&gt;
&lt;br /&gt;
Again, the force can be calculated from the derivative of the potential curve at the equilibrium point. As the derivative at this point is zero (a minimum on the curve), the force will therefore also be zero.&lt;br /&gt;
&lt;br /&gt;
The well-depth of the potential curve is the difference between zero potential and the potential at the equilibrium bond length. This can be calculated by substituting the value for the equilibrium bond length into the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 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;
Cancelling and simplifying this equation gives: &amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \times \frac{1}{4}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the absolute value for the well depth is &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;. The actual value of this potential is &amp;lt;math&amp;gt;-\epsilon&amp;lt;/math&amp;gt;, as the equilibrium bond length gives the most stable configuration of the molecules and therefore suggests attractive interactions are involved in the arrangement of the molecules; this attractive potential means its negative. &lt;br /&gt;
&lt;br /&gt;
===Boundary Conditions and the Lennard-Jones Cutoff===&lt;br /&gt;
When simulating a liquid, it is computationally impractical to simulate a realistic liquid. Therefore a smaller &#039;box&#039; containing &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; particles is simulated and the computer program will use &#039;&#039;periodic boundary conditions&#039;&#039; to simulate infinite repetitions of this box; when the atom reaches one edge of the box, in periodic boundary conditions, it will reappear again at the opposite edge of the box as if they were connected. For example, an atom at the position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a box of size &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;. Without periodic boundary conditions, we would assume that the atom would end up at the position &amp;lt;math&amp;gt;(1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;. However, in this box, there is no such position and so the particle must reappear at the opposite edge to where it effectively &#039;left&#039; the box. Therefore, it&#039;s ending position will be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The number of particles, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; simulated by the computer is usually between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt;. Physically, this is a very small volume. Considering water, we can calculate the number of molecules in 1 mL or 1 cm^3, a volume that would be considered small in the lab. Taking the concentration of water at standard conditions, &amp;lt;math&amp;gt;55\ mol\ dm^{-3}&amp;lt;/math&amp;gt;, we can convert it to the number of moles per mL: &amp;lt;math&amp;gt;0.055\ mol\ mL^{-1}&amp;lt;/math&amp;gt;. Multiplying this value by Avagadro&#039;s constant (&amp;lt;math&amp;gt;N_A&amp;lt;/math&amp;gt;) gives the number of molcules of water per mL: &amp;lt;math&amp;gt;3.02 \times 10^{22}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The reverse procedure can be used to compare this to the volume of 10,000 molecules: 10,000 divided by Avagadro&#039;s constant gives the number of moles of water which 10,000 molecules makes up: &amp;lt;math&amp;gt;1.66 \times 10^{-20}\ moles&amp;lt;/math&amp;gt;. Dividing this value by the concentration (from &amp;lt;math&amp;gt;n=cV&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is the number of moles, &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; is the concentration and &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume), gives the volume: &amp;lt;math&amp;gt;3.02 \times 10^{-22}\ dm&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;3.02 \times 10^{-19}\ mL&amp;lt;/math&amp;gt;. Physically, of course, this is far too small a volume to be recorded in the lab.&lt;br /&gt;
 &lt;br /&gt;
Periodic boundary conditions simulate an infinite lattice and therefore, when computing the potential, will calculate an infinite amount of pair interactions. Therefore, it is only practical to calculate the energies up to a certain interatomic distance; the Lennard-Jones cutoff distance. Beyond this point, the potential energy and the integral of the curve beyond this point become insignificant and do not impact on the overall energy; removing interactions beyond this point from the calculations will not effect the accuracy. Multiplying the Lennard-Jones potential with the radial distribution function gives a plot of the probability of finding an atom at a particular interatomic distance. The larger the interatomic distance, the lower the probability and so the energy after the cutoff can be disregarded. &lt;br /&gt;
&lt;br /&gt;
Integrating over the Lennard-Jones curve and applying this cutoff as the lower limit can show how small the integral is:&lt;br /&gt;
&lt;br /&gt;
For a general cutoff of with value &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;I = \int_{x}^\infty \phi\left(r\right)\mathrm{d}r = \int_{x}^\infty \frac{4\epsilon\sigma^{12}}{r^{12}}\mathrm{d}r - \int_{x}^\infty \frac{4\epsilon\sigma^6}{r^6}\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving this: &amp;lt;math&amp;gt;I = 4\epsilon\sigma^{12} {\frac{-1}{11r^{11}}\,\Bigg\vert\,}_x^\infty - 4\epsilon\sigma^{6} {\frac{-1}{5r^{5}}\,\Bigg\vert\,}_x^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This gives the general solution: &amp;lt;math&amp;gt;I = \frac{4\epsilon\sigma^{12}}{11x^{11}} - \frac{4\epsilon\sigma^{6}}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating this for &amp;lt;math&amp;gt;\epsilon = \sigma = 1&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;I = \frac{4}{11x^{11}} - \frac{4}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt; (or 2 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.025&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt; (or 2.5 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0082&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt; (or 3 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0033&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All values are taken to 2 significant figures. As the cutoff value for the interatomic distance gets larger, the integral gets smaller, and therefore the energy excluded from the calculation becomes smaller, and the second term in the solved integral, &amp;lt;math&amp;gt;I&amp;lt;/math&amp;gt;, dominates the energy value.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
When using the Lennard-Jones potential, it is appropriate to use reduced units for intermolecular distance, energy and temperature. Reduced units can be calculated by the following relationships:&lt;br /&gt;
&lt;br /&gt;
Intermolecular 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;
&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; are scaling factors. For example, if the parameters for Argon are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\sigma = 0.34 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt; \epsilon\ /\ k_B = 120 K&amp;lt;/math&amp;gt;&lt;br /&gt;
* Lennard-Jones cutoff &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;. The well-depth, &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;, is &amp;lt;math&amp;gt;0.999 kJ mol^{-1} \approx 1 kJ mol^{-1}&amp;lt;/math&amp;gt;. The value of &amp;lt;math&amp;gt;T* = 1.5&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;180 K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
The first aim of the simulations is to determine the most appropriate timestep to use in the vert algorithm simulations. This timestep is a balance between the accuracy of the results (the smaller the timestep, the closer to the true functing the result will be) and the length of real time over which the simluation is run (the smaller the timestep, the less real time over which the simulation will give a result). The appropriateness of the timestep will be determined by plotting how the total free energy of the simulated lattice equilibrates over time.  &lt;br /&gt;
&lt;br /&gt;
Five different calculations, which simulated the melting of a crystal and subsequent equilibration of the energy of the melted crystal, were run at five different timesteps; 0.001, 0.0025, 0.0075, 0.01 and 0.015, and were described by the NVE or &#039;&#039;&amp;quot;microcanonical ensemble&amp;quot;&#039;&#039;. An ensemble is a collection of samples of a system which are under three thermodynamic constraints (three properties are kept constant); in the microcanonical ensemble, the number of particles, the volume and the total energy is kept constant (NVE). &lt;br /&gt;
&lt;br /&gt;
These calculations simulate a box of 1000 unit cells and use periodic boundary conditions to replicate the simulation to a larger scale. Because these simulations use the numerical methods defined in the previous section, the initial position and velocity of the atoms must be defined in the input file. The Brownian (uncorrelated, random) motion of the atoms in the simulation means that there is no long range order in the system and so the atoms in a real system would start in random positions. However, assigning random starting coordinates to the atoms in a simulated liquid is not a relative process; the coordinates are generate independently of each other. Therefore there is a probability that the coordinates simulated will cause the atoms to overlap, which would give a very large repulsion potential, as seen in the Lennard-Jones potential at very small interatomic distances. This short-range repulsion potential comes from the hard-sphere model of atomic simulation.&lt;br /&gt;
&lt;br /&gt;
The input file also defines the structure and density of the lattice. The number density of lattice points in any lattice is the number of lattice points per volume of the unit cell. In a simple cubic lattice, there is one lattice point in the unit cell. From an sc lattice with lattice spacing (length of one side of the unit cell) being &amp;lt;math&amp;gt;1.07722&amp;lt;/math&amp;gt;, the number density of the lattice points is calculated by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{1}{1.07722^3} = 0.7999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a face-centered cubic lattice (fcc), there are four lattice points in the unit cell. Rearranging the above relationship, the lattice spacing can be calculated from the number of lattice points in a unit cell and number density, &amp;lt;math&amp;gt;1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Lattice\ spacing = \sqrt[3]{\frac{number\ of\ lattice\ points\ per\ unit\ cell}{number\ density}} = \sqrt[3]{\frac{4}{1.2}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation creates a box which includes 1000 unit cells, which is 10 unit cells in each dimension. For a simple cubic lattice, because there is one lattice point per unit cell, there will be 1000 atoms created as seen in the input file. The &#039;&#039;create_atom&#039;&#039; command in the input file determines how many boxes are created in the simulation and therefore how many atoms will be created. If a face centered cubic lattice is simulated, because there are 4 lattice points per unit cell, 4000 atoms will be created in the &#039;&#039;create_atom&#039;&#039; command. &lt;br /&gt;
&lt;br /&gt;
The input script also contains the following commands which defines the potential surface which is used to model the intermolecular reactions:&lt;br /&gt;
 mass 1 1.0&lt;br /&gt;
This instruction sets the mass type for the atoms being simulated. It takes the general form of “mass I value”, where mass is the keyword which tells LAMMPS what the input is, I is the atom type and value is the mass of the atom. In this case, I is defined by a specific numerical value; 1 as there is only 1 type of atom in the simulation, but it can be defined with an asterisk (1*), which means “all atom types of 1 to n inclusive”. &lt;br /&gt;
 pair_style lj/cut 3.0&lt;br /&gt;
This instruction sets the type of potential which LAMMPS uses in its calculation of pairwise interactions. It takes the general form of “pair_style style args”, where pair_style is the keyword for LAMMPS, style defines the potential and any specifications it may have, and args are the arguments required for this particular potential. In this case, the Lennard-Jones potential has been used (lj) with a cutoff point (cut) of 3σ. The cutoff point is explained in the introduction section. &lt;br /&gt;
 pair_coeff * * 1.0 1.0&lt;br /&gt;
This instruction specifies the coefficients for the pairwise interactions of each pair of atoms, and it takes the general form “pair_coeff I J args”. Pair_coeff is the keyword, I and J are the atom types, and args are the coefficients which the different atoms types take. In this case, the asterisk in place of I and J refers to all atoms types from 1 to n. The coefficients are the pairwise interactions are 1 for each atom, meaning each atom has an equal contribution to the interaction.&lt;br /&gt;
&lt;br /&gt;
In these initial calculations, the initial conditions for the numerical methods, &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. For this experiment, the verit-velocity algorithm would be the most appropriate, as both the starting position and velocity is specified for this algorithm. &lt;br /&gt;
&lt;br /&gt;
To define the timestep for the algorithm the following code is used defining the timestep as a variable instead of just giving it a definite value&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;
It is much easier to use the variable version of defining the timestep because the length of time over which the simulation is run depends on the time step. By using a variable, you can keep the length of the simulation the same, no matter the size of the timestep. It also makes it easier if multiple properties depend on the timestep – only the variable needs to be changed, not all the parts of the script where timestep is defined. &lt;br /&gt;
&lt;br /&gt;
The calculations produce the values for the total energy of the system, temperature and pressure in the output files, which can be plotted against time. How well these values equilibrate determines the appropriateness of the timestep to use in further calculations in the experiment.   &lt;br /&gt;
[[File:Rmt totalenergy plot.png|none|thumb|800x800px|&#039;&#039;Figure h. &#039;&#039;Plot of the equilibration of total energy for five different timesteps]]&lt;br /&gt;
The largest time step to give an acceptable result is 0.01. However, for any simluation we would expect energy to be independent of the timestep, something which is not true at a timestep greater than 0.0025. Therefore, the most appropriate timestep to use for a balance between accuracy and length of time which the simulation covers is 0.0025.  &lt;br /&gt;
&lt;br /&gt;
0.015 is a particularly bad choice of timestep. This is because the verit-velocity algorithm gives an approximate result to the velocity (kinetic energy term) and position (potential energy term), and so when the timestep becomes too large with respect to the time, the algorithm no longer becomes a suitable way to calculate the energy. As seen in the graph of 0.015, the energy does not equilibrate and diverges.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions ==&lt;br /&gt;
The calculations in this section are run in the isobaric-isothermal ensemble, where the number of particles in the system, the pressure and the temperature are kept constant (NpT). This means that the temperature and the pressure are recalculated in every step, so are no longer constant like they were in the NVE ensemble. From the &#039;&#039;equipartition theorem&#039;&#039;, each degree of freedom will contribute &amp;lt;math&amp;gt;\frac{1}{2} k_B T&amp;lt;/math&amp;gt; of energy to the system. As the system is in three dimensions, there are three degrees of translational freedom and so the total internal energy is equal to &amp;lt;math&amp;gt;\frac{3}{2} k_B T&amp;lt;/math&amp;gt;. Equating this to the kinetic energy, &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt;, at the end of every step and rearranging will allow calculation of the temperature after every step. &lt;br /&gt;
&lt;br /&gt;
A target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, is defined in the input script and the system will equilibrate by multiplying the velocity by a factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, in order to accommodate for the fluctuation and keep the system at approximately the target temperature and therefore constant internal energy. If the temperature of the system is greater than the target temperature, the system&#039;s kinetic energy is too high, so &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is reduced to compensate for this. The same is true for is the temperature is lower than the target temperature; &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than one in the next step to increase the kinetic energy which is now too low. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; can be derived from equating the kinetic and internal energy of the system at an arbitrary time step:&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;
Expanding the brackets inside the sum and moving the term containing &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; out of the sum: &amp;lt;math&amp;gt;\frac{\gamma^2}{2}\sum_i m_i \left(v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;, we can replace &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt; on the left hand side of the equation with &amp;lt;math&amp;gt;\frac{3}{2} N k_B T&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;\frac{3\gamma^2}{2}N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Simplifying and rearranging for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, gives: &amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The principle is the same for controlling the pressure.&lt;br /&gt;
&lt;br /&gt;
As temperature and pressure are no longer constant, he input files require specification of the pressure and the temperature for each of the systems run. 10 simulations were run at two different pressures with five different temperatures at each. &lt;br /&gt;
* Temperatures: 1.6, 1.9, 2.2, 2.5, 2.8&lt;br /&gt;
* Pressures: 2.5, 3.0&lt;br /&gt;
These pressures were chosen because the data simulated when choosing an appropriate timestep gave a pressure between 2.5 and 3.0.  &lt;br /&gt;
&lt;br /&gt;
For the code which computes the thermodynamic potentials, this particular line defines how many steps contribute towards the average of the thermodynamic parameters computed in the calculation. &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;
&#039;&#039;fix&#039;&#039; is the keyword, &#039;&#039;aves&#039;&#039; is the name of the group of fixes which in this case is the average of the thermodynamic values, &#039;&#039;all&#039;&#039; specifies the atoms which the fix is applied to which in this case is all the atoms in the simulated system and &#039;&#039;ave/time&#039;&#039; means that compute global time averages are calculated. The following three numbers have the following meaning:&lt;br /&gt;
&lt;br /&gt;
*100 = use the input values every 100 timesteps&lt;br /&gt;
*1000 = use input values 1000 times for calculating the average&lt;br /&gt;
*100000 = calculate the average every 100000 timesteps&lt;br /&gt;
&lt;br /&gt;
Therefore for the total calculation which lasts for 100000 will only have the average calculated once. Assuming 1 value every timestep, there will be 100000/100 values = 1000. The amount of time simulated is 100,000 steps, read from the following line.&lt;br /&gt;
&lt;br /&gt;
The density data from all ten calculation were plotted on the same graph, along with the density for an &amp;quot;ideal&amp;quot; gas. This density can be derived from the ideal gas law:&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;
Rearranging in terms of density: &amp;lt;math&amp;gt;\frac{N}{V} = \frac{P}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As these simulations are being run under reduced units, we can take &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt;, and so the density of the ideal gas becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the density of the ideal gas is plotted as the pressure divided by the temperature in pressure-temperature phase space.&lt;br /&gt;
[[File:Rmt dvt plot.png|none|thumb|800x800px|&#039;&#039;Figure i. &#039;&#039;Plot of the variation in density with temperature at a defined pressure for the numerically simulated and ideal systems]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that calculated in the ideal gas law. This is because for an ideal gas, an assumption is made that there are no intermolecular interactions, and therefore forces such as electron repulsion forces are ignored; repulsion forces dominate over attractive ones, as all the atoms in this simulation are the same and so partial charges or dipoles are created. This will mean that the particles move closer together than a real gas and so the density will be larger. This discrepancy between the ideal and non-ideal systems becomes larger at a higher pressure because with a higher pressure, the atoms in the system are closer together and therefore the intermolecular repulsion will become larger. This greater repulsion will in turn have a larger effect on decreasing the density.&lt;br /&gt;
&lt;br /&gt;
== Statistical Physics Calculations of the Heat Capacity ==&lt;br /&gt;
The heat capacity of a system at constant volume can be calculated from the variance in the total energy of the system. The relationship used to calculate the heat capacity is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = 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;\left\langle E^2\right\rangle&amp;lt;/math&amp;gt; is the continuous average of the total square energy at each temperature as a function of temperature. &amp;lt;math&amp;gt;\left\langle E\right\rangle^2&amp;lt;/math&amp;gt; is the continuous average of the total energy at each temperature as a function of temperature squared. The heat capacity is multiplied by &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; in this case because the version of LAMMPS calculates every energy divided by the number of molecules in the system simulated.&lt;br /&gt;
&lt;br /&gt;
The calculations in this sections are run in density-temperature phase space and the ensemble has changed to the canonical ensemble (NVT). A set of input files were written for ten calculations for, like the previous section, two pressures and five different temperatures at each pressure:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 0.2, 0.8&lt;br /&gt;
*Temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{C_V}{V}&amp;lt;/math&amp;gt; was plotted against temperature to determine the relationship in density-temperature phase space. An example of an input file can be found [[Media:nvt_-_0220.in|here]]. The lines which have been changed from the previous input files are at the end of the script:&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 &lt;br /&gt;
 thermo_style custom step etotal temp&lt;br /&gt;
 variable energy equal etotal&lt;br /&gt;
 variable energy2 equal etotal*etotal&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_energy v_energy2 v_temp&lt;br /&gt;
 run 100000&lt;br /&gt;
 &lt;br /&gt;
 variable aveenergy equal f_aves[1]&lt;br /&gt;
 variable aveenergy2 equal f_aves[2]&lt;br /&gt;
 variable avetemp equal f_aves[3]&lt;br /&gt;
 variable heatcapacitydv equal atoms*atoms*(v_aveenergy2-v_aveenergy*v_aveenergy)/(v_avetemp*v_avetemp*vol)&lt;br /&gt;
 &lt;br /&gt;
 print &amp;quot;Averages&amp;quot;&lt;br /&gt;
 print &amp;quot;--------&amp;quot;&lt;br /&gt;
 print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Heat Capacity per Volume: ${heatcapacitydv}&amp;quot;&lt;br /&gt;
The line with the keyword &#039;fix&#039; determines which thermodynamic values are averaged and over how many steps they are averaged. The next section takes these averages as variables and uses them to define the heat capacity which is calculated from the equation at the beginning of this section. Only the energy and temperature are needed to define the heat capacity and so only these values are calculated by the simulation. [[File:Rmt heatcapacitybyv.png|none|thumb|800x800px|&#039;&#039;Figure j. &#039;&#039;C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V against temperature for the two different pressures 0.2 and 0.8]]As seen in the above figure, the heat capacity decreases with temperature for both pressures. It would be expected for an ideal system that as the temperature increases, the heat capacity at constant volume increases and tends to a constant volume at very high T of 3R; R = the universal gas constant. This means increasing the temperature increases the amount of energy being stored in the system and this energy is stored as vibrational energy. However, for a Lennard-Jones liquid, the system being simulated here, the heat capacity decreases with temperature. This is because the simulation has two components to the simulation; the atoms are vibrating in a quasi-harmonic fashion around the equilibrium position and also diffuse between neighbouring equilibrium positions in a gas like fashion. As the temperature increases, the amount of diffusion increases and the vibrations decreases, therefore decreasing the ability of the system to absorb vibrational energy, resulting in the decrease in heat capacity. &amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www.nature.com/ncomms/2013/130816/ncomms3331/full/ncomms3331.html?message-global=remove&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural Properties and the Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a single atom in a system is a plot of the probability that an atom can be found at a certain distance from the central atom. The peaks in this plot can give the distance of an atom from its nearest neighbours in the Lennard-Jones simulated system. &lt;br /&gt;
&lt;br /&gt;
The calculations in this section simulate a Lennard-Jones solid, liquid and gas and, using the output of the LAMMPS trajectory file, plots both the radial distribution function and its integral using DLV. The temperature and pressure parameters for these calculations were taken from the phase diagram or coexistence curve for a Lennard-Jones system.&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt; The parameters used are displayed in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! Temperature, &amp;lt;math&amp;gt;T^*&amp;lt;/math&amp;gt;&lt;br /&gt;
! Pressure, &amp;lt;math&amp;gt;p^*&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| LJ Solid&lt;br /&gt;
| 1.5&lt;br /&gt;
| 1.2&lt;br /&gt;
|-&lt;br /&gt;
| LJ Liquid&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.8&lt;br /&gt;
|-&lt;br /&gt;
| LJ Gas&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.01&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The data obtained from the plots and the radial distribution functions and their integrals were plotted and shown in the table below.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure k. &#039;&#039;The radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
!&#039;&#039;Figure l. &#039;&#039;The integrals of the radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt fullrdfs.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt allintegralsrdf.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
[[File:Rmt Nearest neighbours.png|left|thumb|300x300px|&#039;&#039;Figure m. &#039;&#039;Representation of a cross section of the first three shells of nearest neighbours in an fcc solid. The black atom is the central atom being considered, the blue atoms are the first shell, the orange atoms the second shell and the purple atoms are the third.]]&lt;br /&gt;
The RDF of the solid gives a very irregular curve because of the irregular structure of the lattice. For a simple cubic lattice, a regular structure of the RDF would be expected because of the equal number of atoms in each of the nearest neighbour shells of the atoms. However, for face-centered cubic, the solid in this simulation, the structure is much more irregular and as the atoms move from their equilibrium position in the lattice due to vibrations, the peaks in the radial distribution will broaden. The irregular heights of the peaks are due to the varying numbers of atoms in each of the nearest neighbour shells for the central atom. The first shell gives the highest peak as it contains the most atoms; in total, considering all four surrounding unit cells, this shell contains 12 atoms and ideally takes the geometry of an icosahedron. The second shell is smaller and contains only 6 atoms in an octahedral coordination shape. The following shell again contributes 12 atoms, 3 from each unit cell. This therefore explains why the heights of the peaks in the solid plot in &#039;&#039;figure k.&#039;&#039; vary. These values can be confirmed by the plot in &#039;&#039;figure o.&#039;&#039; which is the integral; it cumulatively adds the numbers in each shell. The size of the first &amp;quot;step&amp;quot; is 12; there are 12 atoms in the first shell. The size of the second step is approximately 18; there are 18-12=6 steps in the second shell. The same theory applies for the third shell which gives a value of 13. This is slightly different to the predicted value possibly due to error in the calculation of the radial distribution function and therefore its integral. &lt;br /&gt;
&lt;br /&gt;
The RDF of the liquid has a representation of far fewer shells, which means that there are less atoms in the space close to a &amp;quot;central&amp;quot; atom in the bulk solution. The particles have more energy and therefore do not keep to a regular lattice structure. As they move about, some regualrity is maintained around each atom, but only to the extend of two or three shells, meaning there is no long range order in a Lennard-Jones liquid. &lt;br /&gt;
&lt;br /&gt;
The RDF of the gas again omits more shells as there is almost no order in a Lennard-Jones gas. The single peak on this plot considers only the set of atoms closest to the central atom and all others are disregarded as they are too far apart. &lt;br /&gt;
&lt;br /&gt;
Considering &#039;&#039;figure l.&#039;&#039;, the size of the integral of the radial distribution function decreases from solid to liquid to gas. This makes sense as the number of atoms in the surrounding shells decreases with density of the system; the atoms become further apart. &lt;br /&gt;
&lt;br /&gt;
From the plot of the radial distribution function of the solid, the lattice spacing can be determined. For this, we can consider just the first three peaks of the RDF plot. The lattice spacing refers to the length of one unit cell, and so, using &#039;&#039;figure m&#039;&#039;, we can calculate this using two different methods; a) we can use the distance between the central atom and the first shell of nearest neighbours, and use trigonometry to calculate the lattice spacing. Or alternatively b) we can use the distance between the central atom and the second nearest neighbour shell to get the lattice spacing.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure n. &#039;&#039;The radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
!&#039;&#039;Figure o. &#039;&#039;The integral of the radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt solidgr3.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt solidint3.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
Using method a) (with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; as the distance between the central atom and the nearest neighbour: Lattice spacing = &amp;lt;math&amp;gt;\frac{r}{cos({\frac{\pi}{4}})} = \frac{1.02}{cos({\frac{\pi}{4}})} \approx 1.44&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using method b): Lattice spacing &amp;lt;math&amp;gt;\approx 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can take an average between the two get an approximate value for the lattice spacing: &amp;lt;math&amp;gt;1.46 \plusmn 0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These values for distance are all in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
The ability of atoms to move around in a solid liquid or gas can be characterised by the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. In this section, we will explore two different ways to calculate the diffusion coefficient and compare the results. &lt;br /&gt;
&lt;br /&gt;
=== The Mean Squared Displacement ===&lt;br /&gt;
The diffusion coefficient can be measured easily be calculating the mean squared displacement of atoms in the solution; the diffusion coefficient is proportional to the first derivative of the mean squared displacement. By plotting the mean squared displacement as a function of time, the gradient can be taken to calculate the diffusion coefficient when its has equilibrated and become linear.&lt;br /&gt;
&lt;br /&gt;
The temperature and density parameters used were the same as in the previous section:&lt;br /&gt;
* Solid: T=1.5, D=1.2&lt;br /&gt;
* Liquid: T=1.1, D=0.8&lt;br /&gt;
* Gas: T=1.1, D=0.01&lt;br /&gt;
&lt;br /&gt;
Mean density squared calculations were run for all three Lennard-Jones phases and the data plotted as function of timestep below. The data from a simulation containing 1,000,000 atoms was plotted for comparision.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!Plots for the 8,000 atom data (&#039;&#039;figures p-r)&#039;&#039;&lt;br /&gt;
!Plots for the 1,000,000 atom data (&#039;&#039;figures s-u)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|[[File:Rmt_MSDsolid.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt_MAsolid.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|[[File:Rmt MSDliquid.png|700x700px]]&lt;br /&gt;
|[[File:Rmt MAliquid.png|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|[[File:Rmt MSDgas.png|700x700px]]&lt;br /&gt;
|[[File:Rmt dataplots 25894 image001.png|700x700px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The exact relationship between the mean squared displacement and the diffusion coefficient is:&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;
Taking the gradients of each of the curves at the point at which they become linear and dividing by six will give the diffusion coefficient for each set of data. The gradient also needs to be converted to a function of time; this is done by dividing by the timestep, which in this case is 0.002:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom data diffusion coefficients, &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
!1,000,000 atom data diffusion coefficients &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 0.9999&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|Gradient = 0.0972&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{48.6}{6} = \mathbf{8.1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient = 0.0386&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{19.6}{6} = \mathbf{3.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For both of the solid approximations, the diffusion coefficient can be approximated as zero. This is because, when equilibrated, the function has a constant value of around 0.2 for the mean squared displacement. A gradient with a value of zero means that the atoms take an infinite amount of time to change their mean squared displacement; to move away from their equilibrium position, and so this means that we can approximate in this system, there will be no diffusion. In real system, however, this is not the case; diffusion occurs but it is very slow. A plot for a real system will give a very shallow positive gradient.&lt;br /&gt;
&lt;br /&gt;
The liquid approximations are very well correlated. This is because in both cases, the mean squared displacement of particles in a liquid increases linearly with time and the gradient of both plots are almost identical. We can assume from this that identical starting conditions were used to calculate this data. Also, we can estimate that 8,000 atoms is a large enough simulation to give an accurate result for the diffusion coefficient for the Lennard-Jones liquid.&lt;br /&gt;
&lt;br /&gt;
The gas approximations are very different. This is most probably due to the fact that the density specified in calculations are different. The 8,000 data can be estimated to be a much lower density because the diffusion coefficient is faster and this means diffusion will happen faster; at a higher density a particle will take longer to diffuse over a given distance. Because of the difference in density, the two values of the diffusion coefficient cannot be qualitatively compared. The reason for the initial deviation for linearity in the gas plots is due to the momentum of the particles initially dominating over the diffusion and the diffusion coefficient is dependent on time. As the system equilibrates, the diffusion coefficient becomes constant and the plots become linear.&lt;br /&gt;
&lt;br /&gt;
=== The Velocity Autocorrelation Function ===&lt;br /&gt;
&lt;br /&gt;
Another way to calculate the diffusion coefficient is by using the velocity correlation function, which determines how the velocity of an atom changes with time. The function determines the difference in time (&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;) when the velocity becomes uncorrelated, i.e. the difference between the velocity at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; and at time &amp;lt;math&amp;gt;t+\tau&amp;lt;/math&amp;gt;. By integrating over this function, we can find the diffusion coefficient. &lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function: &amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can also be written as the integral: &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;
Using the function which defines the position of a classical harmonic oscillator, we can differentiate this to give the equation for the velocity which we can plug into the integral:&lt;br /&gt;
&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;
&amp;lt;math&amp;gt;dv{x(t)}{t} = v(t) = -A\omega sin(\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also needed for the integral:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t+\tau) = -A\omega sin(\omega(t+\tau)+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v^2(t) = A^2\omega^2 sin^2(\omega t +\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Putting all this into the integral to find the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega sin(\omega t + \phi) \times A\omega sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} A^2\omega^2 sin^2(\omega t +\tau)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A^2\omega^2&amp;lt;/math&amp;gt; can be take out of each of the integrals and cancelled. A substituion can then be made to make solving the integral much simpler:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = \omega t + \phi&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \omega\tau&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the integral becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a) \times sin(a+b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the compound angle rule &amp;lt;math&amp;gt;sin(a+b)=sin(a)cos(b)+cos(a)sin(b)&amp;lt;/math&amp;gt;, the integral can be simplified to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a)sin(a)cos(b) + sin(a)cos(a)sin(b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Separating out into two integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)\frac{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the rule &amp;lt;math&amp;gt;sin(a)cos(a) = \frac{1}{2}sin(2a)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} \frac{1}{2}(sin(2a))\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because the function &amp;lt;math&amp;gt;\frac{1}{2}sin(2a)&amp;lt;/math&amp;gt; is symmetric over all space, the second term in this equation becomes zero. Therefore, the integral simplifies to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b) = cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same calculations from the mean squared displacement section gave an output of the velocity autocorrelation function. The function for the Lennard-Jones solid, liquid and gas were plotted against the timestep along with the approximate function for the velocity autocorrelation function, &amp;lt;math&amp;gt;cos(\omega\tau)&amp;lt;/math&amp;gt;, where \omega = \frac{1}{2\pi}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure v. &#039;&#039;Plots for the velocity autocorrelation function of a Lennard-Jones solid, liquid and gas; 8,000 atoms&lt;br /&gt;
!&#039;&#039;Figure w. &#039;&#039;Plots for the velocity autocorrelation function of a Lennard-Jones solid, liquid and gas, 1,000,000 atoms&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt VACF 5721 image001.png|800x800px|]]&lt;br /&gt;
|[[Rmt_MAVACF.png|800x800px|]]&lt;br /&gt;
|}&lt;br /&gt;
The diffusion coefficient is calculated from: &amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty C\left(\tau\right)\mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the approximate value for the diffusion coefficient using the velocity autocorrelation function is &amp;lt;math&amp;gt;D = \frac{1}{3}cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The running integral of the velocity autocorrelation functions was plotted using the &#039;&#039;trapesium rule&#039;&#039;, and so the final value on the integral plot is proportional to the diffusion coefficient.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom VACF integral &#039;&#039;(figures w-y)&#039;&#039;&lt;br /&gt;
!1,000,000 VACF integral (&#039;&#039;figures z-bb)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Rmt_MAVACF.png&amp;diff=541398</id>
		<title>File:Rmt MAVACF.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Rmt_MAVACF.png&amp;diff=541398"/>
		<updated>2016-02-25T12:58:51Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=541393</id>
		<title>Rep:Mod:hakunamatata</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=541393"/>
		<updated>2016-02-25T12:56:26Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: /* The Velocity Autocorrelation Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Introduction to Molecular Dynamics Simulations ==&lt;br /&gt;
===The Classical Particle Approximation and Numerical Integration===&lt;br /&gt;
The verit and verit-velocity algorithms are numerical methods to approximate the average position and velocity respectively of randomly moving atoms in a particular medium (solid, liquid, fliud etc.). This position and velocity can be applied to Newtonian mechanics to calculate such properties as the force and potential energy of the system. The algorithms work by splitting the function into discrete time steps, calculating the values of position and velocity at this particular time step, and then effectively &amp;quot;joining the dots&amp;quot; to create an approximate function. These simulations always use the answer from the previous timestep to compute the new timestep, so initial conditions must be given for the first step. Both of the algorithms are shown below and are derived from the Taylor expansion of the position or velocity of the atoms at the timestep &amp;quot;n+1&amp;quot; or &amp;lt;math&amp;gt;t+\delta t&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit Algorithum:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{x}_i\left(t + \delta t\right) \approx 2\mathbf{x}_i\left(t\right) - \mathbf{x}_i\left(t - \delta t\right) + \frac{\mathbf{F}_i\left(t\right)}{m_i}\delta t^2  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit-Velocity Algorithum:&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i\left(t\right)&amp;lt;/math&amp;gt; is the force acting on a particular atom as a function of time&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i&amp;lt;/math&amp;gt; is the acceleration &lt;br /&gt;
&lt;br /&gt;
The smaller the timestep, the closer the numerical approximation is to the true solution function, which can be modeled as a classical harmonic oscillator. &#039;&#039;Figure a.&#039;&#039; in the table below shows the comparison between the two methods in &#039;&#039;time&#039;&#039; space. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure a. &#039;&#039;Plots of position vs time comparing the verit algorithm and harmonic spring results&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure b. &#039;&#039;Plot of the total classical energy of the system (potential + kinetic)&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory xanalytical.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory energy.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The harmonic spring position values are modeled from the harmonic oscillator or particle on a spring. The equation of &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; was used to calculate these values, where &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; are 1 and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; is zero. As seen on the plot, the curves produced from the two different methods of calculating the position are in good agreement.&lt;br /&gt;
|The potential energy is calculated using the equation U = 1/2 kx^2, with a value of k given as 1. The kinetic energy is calculated using the velcity from the verit-velocity algorithm using the equation T = 1/2 mv^2, with a value of m given as 1. The total energy of the system, E, is equal to T + U. The values for x (potential energy) and v (kinetic energy) are taken from the verity algorithm and verit-velocity algorthim respectively. &lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;Figure c. &#039;&#039;Plot of the difference (error) between the harmonic spring and verit algorithm data&lt;br /&gt;
!&#039;&#039;Figure d. &#039;&#039;Plot of the peaks in the error plot in &#039;&#039;figure c.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory error.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory errorpeaks.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The peaks in the error between the harmonic spring and verit algorithm results are at the place where the position curve crosses the time axis. This is because the harmonic spring data (x(t)) has a slightly shorter wave period than that of the verit velocity algorithm, and therefore the difference will get larger with each period of the wave, shown by the error getting larger in &#039;&#039;figure c. &#039;&#039;The period of the plot of the two methods are different because the verit algorithm is much more approximate so does not give the correct solution.&lt;br /&gt;
|The change in the error/difference between the harmonic spring data and verit algorthm data increases linearly and so therefore period of each of the plots in &#039;&#039;figure 1&#039;&#039;. must be constant. &lt;br /&gt;
|}&lt;br /&gt;
The error can also be quantified on a &#039;&#039;phase space&#039;&#039; plot; phase space is momentum or velocity plotted as a function of position. The true solution for motion of an atom is a perfect ellipse, and the more elliptic the shape (less circular) the more momentum or velocity is in the system. A numerical solution, like the verit algorithms, will produce a set of points very close to this ellipse but not perfectly following the curve. A good numerical solution will remain in an elliptical shape, whereas a bad numerical solution, for example one with a large timestep, will spiral away from the true solution. Two examples of such systems using the data from &#039;&#039;figures a-d&#039;&#039; are shown below.  &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure e. &#039;&#039;Phase plot of the harmonic spring data with a good numerical solution (timestep = 0.1) &lt;br /&gt;
!&#039;&#039;Figure f. &#039;&#039;Phase plot of the harmonic spring data with a bad numerical solution (timestep = 0.3) &lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory phasegood.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory badphase.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The timestep at which this data is plotted is 0.1, which results in a very small change in the energy, as seen in &#039;&#039;figure b. &#039;&#039;Increasing the time step will increase the variation in the energy. To keep the variation in the total energy of the system under 1%, the time step must be no larger than approximately 0.28. The energy varies more with increasing time step because the jumps in the algorithm  are getting larger due to less data points. The algorithm assumes these points are joined by a straight line; that the halfway point in the jump is the average between the starting and finishing point of the jump. The phase space plot will become less elliptic and the jumps eventually become so larger that the plot is no longer a continuous shape.  &lt;br /&gt;
&lt;br /&gt;
It is essential to monitor the energy of a numerically modeled system because a good solution for the motion of an atom has a constant energy and a plot in phase space of a perfect ellipse.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance and Force at Zero Potential===&lt;br /&gt;
From classical mechanics, the force calculated from the Newtonian mechanics above can be used to calculate the potential experienced by an atom in the system. They are related by the equation: &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;
This potential gives the shape and dimension of the potential surface on which the system can be modeled. A simple 1D potential that is used to describe the inter atomic forces of a liquid is the Lennard-Jones potential. It has the characteristic features of a short range repulsion potential and harmonic character around the equilibrium bond distance. The value of &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the inter atomic separation when the potential, &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;, is equal to zero, can be calculated by equating the equation for the Lennard-Jones potential to zero and solving for &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The equation for the Lennard-Jones potential: &amp;lt;math&amp;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;
Equating this to zero: &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;
And rearranging in order to separate the variables: &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;
Rearranging this gives &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in terms of &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt; r^6 = \sigma^6&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r = r_0&amp;lt;/math&amp;gt; in this case.&lt;br /&gt;
&lt;br /&gt;
This, therefore, gives the result that interatomic distance at zero potential, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, is equal to &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; in the Lennard-Jones potential is effectively the diameter of one of the particles in the system being measured; in this case, the liquid we are simulating. This is the point where the potential curve crosses the x-axis on an Energy vs interatomic distance plot. The force, &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt;, at this point on the curve corresponds to the gradient; it is found by calculating the derivative of the curve at this point. &lt;br /&gt;
&lt;br /&gt;
To calculate the force, we must differentiate the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As force is equal to the negative differential of the potential energy, the value of the force is: &amp;lt;math&amp;gt;\mathbf{F}_i = 48\epsilon \sigma^{12} r^{-13} - 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting in the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at zero potential from the calculation before: &amp;lt;math&amp;gt;\mathbf{F}_i = \frac{48\epsilon}{\sigma} - \frac{24\epsilon}{\sigma} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The gradient where the Lennard-Jones plot crosses the axis is negative; &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; in the term obtained for &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is negative and therefore the overall value of the force will be negative.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance, Force and Well Depth of the Potential at Equilibrium===&lt;br /&gt;
To calculate the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at the equilibrium position, we need to use the derivative of the potential energy curve. The equilibrium value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is the value at the minimum of the Lennard-Jones curve; when &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Therefore, equating the derivative to zero gives: &amp;lt;math&amp;gt;0 = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rearranging this: &amp;lt;math&amp;gt;48\epsilon \sigma^{12} r^{-13} = 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And simplifying and cancelling gives: &amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6&amp;lt;/math&amp;gt;. Therefore the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at equilibrium is: &amp;lt;math&amp;gt;r_{eq} = \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Physically, this result means that the equilibrium distance is 1.12 times the diameter of one of the particles; the particles have a small gap between them so do not touch. A short range repulsion potential, as seen in the Lennard-Jones curve, is a result of the particles coming into contact. &lt;br /&gt;
&lt;br /&gt;
Again, the force can be calculated from the derivative of the potential curve at the equilibrium point. As the derivative at this point is zero (a minimum on the curve), the force will therefore also be zero.&lt;br /&gt;
&lt;br /&gt;
The well-depth of the potential curve is the difference between zero potential and the potential at the equilibrium bond length. This can be calculated by substituting the value for the equilibrium bond length into the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 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;
Cancelling and simplifying this equation gives: &amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \times \frac{1}{4}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the absolute value for the well depth is &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;. The actual value of this potential is &amp;lt;math&amp;gt;-\epsilon&amp;lt;/math&amp;gt;, as the equilibrium bond length gives the most stable configuration of the molecules and therefore suggests attractive interactions are involved in the arrangement of the molecules; this attractive potential means its negative. &lt;br /&gt;
&lt;br /&gt;
===Boundary Conditions and the Lennard-Jones Cutoff===&lt;br /&gt;
When simulating a liquid, it is computationally impractical to simulate a realistic liquid. Therefore a smaller &#039;box&#039; containing &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; particles is simulated and the computer program will use &#039;&#039;periodic boundary conditions&#039;&#039; to simulate infinite repetitions of this box; when the atom reaches one edge of the box, in periodic boundary conditions, it will reappear again at the opposite edge of the box as if they were connected. For example, an atom at the position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a box of size &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;. Without periodic boundary conditions, we would assume that the atom would end up at the position &amp;lt;math&amp;gt;(1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;. However, in this box, there is no such position and so the particle must reappear at the opposite edge to where it effectively &#039;left&#039; the box. Therefore, it&#039;s ending position will be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The number of particles, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; simulated by the computer is usually between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt;. Physically, this is a very small volume. Considering water, we can calculate the number of molecules in 1 mL or 1 cm^3, a volume that would be considered small in the lab. Taking the concentration of water at standard conditions, &amp;lt;math&amp;gt;55\ mol\ dm^{-3}&amp;lt;/math&amp;gt;, we can convert it to the number of moles per mL: &amp;lt;math&amp;gt;0.055\ mol\ mL^{-1}&amp;lt;/math&amp;gt;. Multiplying this value by Avagadro&#039;s constant (&amp;lt;math&amp;gt;N_A&amp;lt;/math&amp;gt;) gives the number of molcules of water per mL: &amp;lt;math&amp;gt;3.02 \times 10^{22}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The reverse procedure can be used to compare this to the volume of 10,000 molecules: 10,000 divided by Avagadro&#039;s constant gives the number of moles of water which 10,000 molecules makes up: &amp;lt;math&amp;gt;1.66 \times 10^{-20}\ moles&amp;lt;/math&amp;gt;. Dividing this value by the concentration (from &amp;lt;math&amp;gt;n=cV&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is the number of moles, &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; is the concentration and &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume), gives the volume: &amp;lt;math&amp;gt;3.02 \times 10^{-22}\ dm&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;3.02 \times 10^{-19}\ mL&amp;lt;/math&amp;gt;. Physically, of course, this is far too small a volume to be recorded in the lab.&lt;br /&gt;
 &lt;br /&gt;
Periodic boundary conditions simulate an infinite lattice and therefore, when computing the potential, will calculate an infinite amount of pair interactions. Therefore, it is only practical to calculate the energies up to a certain interatomic distance; the Lennard-Jones cutoff distance. Beyond this point, the potential energy and the integral of the curve beyond this point become insignificant and do not impact on the overall energy; removing interactions beyond this point from the calculations will not effect the accuracy. Multiplying the Lennard-Jones potential with the radial distribution function gives a plot of the probability of finding an atom at a particular interatomic distance. The larger the interatomic distance, the lower the probability and so the energy after the cutoff can be disregarded. &lt;br /&gt;
&lt;br /&gt;
Integrating over the Lennard-Jones curve and applying this cutoff as the lower limit can show how small the integral is:&lt;br /&gt;
&lt;br /&gt;
For a general cutoff of with value &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;I = \int_{x}^\infty \phi\left(r\right)\mathrm{d}r = \int_{x}^\infty \frac{4\epsilon\sigma^{12}}{r^{12}}\mathrm{d}r - \int_{x}^\infty \frac{4\epsilon\sigma^6}{r^6}\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving this: &amp;lt;math&amp;gt;I = 4\epsilon\sigma^{12} {\frac{-1}{11r^{11}}\,\Bigg\vert\,}_x^\infty - 4\epsilon\sigma^{6} {\frac{-1}{5r^{5}}\,\Bigg\vert\,}_x^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This gives the general solution: &amp;lt;math&amp;gt;I = \frac{4\epsilon\sigma^{12}}{11x^{11}} - \frac{4\epsilon\sigma^{6}}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating this for &amp;lt;math&amp;gt;\epsilon = \sigma = 1&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;I = \frac{4}{11x^{11}} - \frac{4}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt; (or 2 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.025&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt; (or 2.5 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0082&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt; (or 3 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0033&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All values are taken to 2 significant figures. As the cutoff value for the interatomic distance gets larger, the integral gets smaller, and therefore the energy excluded from the calculation becomes smaller, and the second term in the solved integral, &amp;lt;math&amp;gt;I&amp;lt;/math&amp;gt;, dominates the energy value.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
When using the Lennard-Jones potential, it is appropriate to use reduced units for intermolecular distance, energy and temperature. Reduced units can be calculated by the following relationships:&lt;br /&gt;
&lt;br /&gt;
Intermolecular 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;
&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; are scaling factors. For example, if the parameters for Argon are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\sigma = 0.34 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt; \epsilon\ /\ k_B = 120 K&amp;lt;/math&amp;gt;&lt;br /&gt;
* Lennard-Jones cutoff &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;. The well-depth, &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;, is &amp;lt;math&amp;gt;0.999 kJ mol^{-1} \approx 1 kJ mol^{-1}&amp;lt;/math&amp;gt;. The value of &amp;lt;math&amp;gt;T* = 1.5&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;180 K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
The first aim of the simulations is to determine the most appropriate timestep to use in the vert algorithm simulations. This timestep is a balance between the accuracy of the results (the smaller the timestep, the closer to the true functing the result will be) and the length of real time over which the simluation is run (the smaller the timestep, the less real time over which the simulation will give a result). The appropriateness of the timestep will be determined by plotting how the total free energy of the simulated lattice equilibrates over time.  &lt;br /&gt;
&lt;br /&gt;
Five different calculations, which simulated the melting of a crystal and subsequent equilibration of the energy of the melted crystal, were run at five different timesteps; 0.001, 0.0025, 0.0075, 0.01 and 0.015, and were described by the NVE or &#039;&#039;&amp;quot;microcanonical ensemble&amp;quot;&#039;&#039;. An ensemble is a collection of samples of a system which are under three thermodynamic constraints (three properties are kept constant); in the microcanonical ensemble, the number of particles, the volume and the total energy is kept constant (NVE). &lt;br /&gt;
&lt;br /&gt;
These calculations simulate a box of 1000 unit cells and use periodic boundary conditions to replicate the simulation to a larger scale. Because these simulations use the numerical methods defined in the previous section, the initial position and velocity of the atoms must be defined in the input file. The Brownian (uncorrelated, random) motion of the atoms in the simulation means that there is no long range order in the system and so the atoms in a real system would start in random positions. However, assigning random starting coordinates to the atoms in a simulated liquid is not a relative process; the coordinates are generate independently of each other. Therefore there is a probability that the coordinates simulated will cause the atoms to overlap, which would give a very large repulsion potential, as seen in the Lennard-Jones potential at very small interatomic distances. This short-range repulsion potential comes from the hard-sphere model of atomic simulation.&lt;br /&gt;
&lt;br /&gt;
The input file also defines the structure and density of the lattice. The number density of lattice points in any lattice is the number of lattice points per volume of the unit cell. In a simple cubic lattice, there is one lattice point in the unit cell. From an sc lattice with lattice spacing (length of one side of the unit cell) being &amp;lt;math&amp;gt;1.07722&amp;lt;/math&amp;gt;, the number density of the lattice points is calculated by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{1}{1.07722^3} = 0.7999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a face-centered cubic lattice (fcc), there are four lattice points in the unit cell. Rearranging the above relationship, the lattice spacing can be calculated from the number of lattice points in a unit cell and number density, &amp;lt;math&amp;gt;1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Lattice\ spacing = \sqrt[3]{\frac{number\ of\ lattice\ points\ per\ unit\ cell}{number\ density}} = \sqrt[3]{\frac{4}{1.2}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation creates a box which includes 1000 unit cells, which is 10 unit cells in each dimension. For a simple cubic lattice, because there is one lattice point per unit cell, there will be 1000 atoms created as seen in the input file. The &#039;&#039;create_atom&#039;&#039; command in the input file determines how many boxes are created in the simulation and therefore how many atoms will be created. If a face centered cubic lattice is simulated, because there are 4 lattice points per unit cell, 4000 atoms will be created in the &#039;&#039;create_atom&#039;&#039; command. &lt;br /&gt;
&lt;br /&gt;
The input script also contains the following commands which defines the potential surface which is used to model the intermolecular reactions:&lt;br /&gt;
 mass 1 1.0&lt;br /&gt;
This instruction sets the mass type for the atoms being simulated. It takes the general form of “mass I value”, where mass is the keyword which tells LAMMPS what the input is, I is the atom type and value is the mass of the atom. In this case, I is defined by a specific numerical value; 1 as there is only 1 type of atom in the simulation, but it can be defined with an asterisk (1*), which means “all atom types of 1 to n inclusive”. &lt;br /&gt;
 pair_style lj/cut 3.0&lt;br /&gt;
This instruction sets the type of potential which LAMMPS uses in its calculation of pairwise interactions. It takes the general form of “pair_style style args”, where pair_style is the keyword for LAMMPS, style defines the potential and any specifications it may have, and args are the arguments required for this particular potential. In this case, the Lennard-Jones potential has been used (lj) with a cutoff point (cut) of 3σ. The cutoff point is explained in the introduction section. &lt;br /&gt;
 pair_coeff * * 1.0 1.0&lt;br /&gt;
This instruction specifies the coefficients for the pairwise interactions of each pair of atoms, and it takes the general form “pair_coeff I J args”. Pair_coeff is the keyword, I and J are the atom types, and args are the coefficients which the different atoms types take. In this case, the asterisk in place of I and J refers to all atoms types from 1 to n. The coefficients are the pairwise interactions are 1 for each atom, meaning each atom has an equal contribution to the interaction.&lt;br /&gt;
&lt;br /&gt;
In these initial calculations, the initial conditions for the numerical methods, &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. For this experiment, the verit-velocity algorithm would be the most appropriate, as both the starting position and velocity is specified for this algorithm. &lt;br /&gt;
&lt;br /&gt;
To define the timestep for the algorithm the following code is used defining the timestep as a variable instead of just giving it a definite value&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;
It is much easier to use the variable version of defining the timestep because the length of time over which the simulation is run depends on the time step. By using a variable, you can keep the length of the simulation the same, no matter the size of the timestep. It also makes it easier if multiple properties depend on the timestep – only the variable needs to be changed, not all the parts of the script where timestep is defined. &lt;br /&gt;
&lt;br /&gt;
The calculations produce the values for the total energy of the system, temperature and pressure in the output files, which can be plotted against time. How well these values equilibrate determines the appropriateness of the timestep to use in further calculations in the experiment.   &lt;br /&gt;
[[File:Rmt totalenergy plot.png|none|thumb|800x800px|&#039;&#039;Figure h. &#039;&#039;Plot of the equilibration of total energy for five different timesteps]]&lt;br /&gt;
The largest time step to give an acceptable result is 0.01. However, for any simluation we would expect energy to be independent of the timestep, something which is not true at a timestep greater than 0.0025. Therefore, the most appropriate timestep to use for a balance between accuracy and length of time which the simulation covers is 0.0025.  &lt;br /&gt;
&lt;br /&gt;
0.015 is a particularly bad choice of timestep. This is because the verit-velocity algorithm gives an approximate result to the velocity (kinetic energy term) and position (potential energy term), and so when the timestep becomes too large with respect to the time, the algorithm no longer becomes a suitable way to calculate the energy. As seen in the graph of 0.015, the energy does not equilibrate and diverges.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions ==&lt;br /&gt;
The calculations in this section are run in the isobaric-isothermal ensemble, where the number of particles in the system, the pressure and the temperature are kept constant (NpT). This means that the temperature and the pressure are recalculated in every step, so are no longer constant like they were in the NVE ensemble. From the &#039;&#039;equipartition theorem&#039;&#039;, each degree of freedom will contribute &amp;lt;math&amp;gt;\frac{1}{2} k_B T&amp;lt;/math&amp;gt; of energy to the system. As the system is in three dimensions, there are three degrees of translational freedom and so the total internal energy is equal to &amp;lt;math&amp;gt;\frac{3}{2} k_B T&amp;lt;/math&amp;gt;. Equating this to the kinetic energy, &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt;, at the end of every step and rearranging will allow calculation of the temperature after every step. &lt;br /&gt;
&lt;br /&gt;
A target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, is defined in the input script and the system will equilibrate by multiplying the velocity by a factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, in order to accommodate for the fluctuation and keep the system at approximately the target temperature and therefore constant internal energy. If the temperature of the system is greater than the target temperature, the system&#039;s kinetic energy is too high, so &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is reduced to compensate for this. The same is true for is the temperature is lower than the target temperature; &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than one in the next step to increase the kinetic energy which is now too low. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; can be derived from equating the kinetic and internal energy of the system at an arbitrary time step:&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;
Expanding the brackets inside the sum and moving the term containing &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; out of the sum: &amp;lt;math&amp;gt;\frac{\gamma^2}{2}\sum_i m_i \left(v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;, we can replace &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt; on the left hand side of the equation with &amp;lt;math&amp;gt;\frac{3}{2} N k_B T&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;\frac{3\gamma^2}{2}N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Simplifying and rearranging for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, gives: &amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The principle is the same for controlling the pressure.&lt;br /&gt;
&lt;br /&gt;
As temperature and pressure are no longer constant, he input files require specification of the pressure and the temperature for each of the systems run. 10 simulations were run at two different pressures with five different temperatures at each. &lt;br /&gt;
* Temperatures: 1.6, 1.9, 2.2, 2.5, 2.8&lt;br /&gt;
* Pressures: 2.5, 3.0&lt;br /&gt;
These pressures were chosen because the data simulated when choosing an appropriate timestep gave a pressure between 2.5 and 3.0.  &lt;br /&gt;
&lt;br /&gt;
For the code which computes the thermodynamic potentials, this particular line defines how many steps contribute towards the average of the thermodynamic parameters computed in the calculation. &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;
&#039;&#039;fix&#039;&#039; is the keyword, &#039;&#039;aves&#039;&#039; is the name of the group of fixes which in this case is the average of the thermodynamic values, &#039;&#039;all&#039;&#039; specifies the atoms which the fix is applied to which in this case is all the atoms in the simulated system and &#039;&#039;ave/time&#039;&#039; means that compute global time averages are calculated. The following three numbers have the following meaning:&lt;br /&gt;
&lt;br /&gt;
*100 = use the input values every 100 timesteps&lt;br /&gt;
*1000 = use input values 1000 times for calculating the average&lt;br /&gt;
*100000 = calculate the average every 100000 timesteps&lt;br /&gt;
&lt;br /&gt;
Therefore for the total calculation which lasts for 100000 will only have the average calculated once. Assuming 1 value every timestep, there will be 100000/100 values = 1000. The amount of time simulated is 100,000 steps, read from the following line.&lt;br /&gt;
&lt;br /&gt;
The density data from all ten calculation were plotted on the same graph, along with the density for an &amp;quot;ideal&amp;quot; gas. This density can be derived from the ideal gas law:&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;
Rearranging in terms of density: &amp;lt;math&amp;gt;\frac{N}{V} = \frac{P}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As these simulations are being run under reduced units, we can take &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt;, and so the density of the ideal gas becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the density of the ideal gas is plotted as the pressure divided by the temperature in pressure-temperature phase space.&lt;br /&gt;
[[File:Rmt dvt plot.png|none|thumb|800x800px|&#039;&#039;Figure i. &#039;&#039;Plot of the variation in density with temperature at a defined pressure for the numerically simulated and ideal systems]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that calculated in the ideal gas law. This is because for an ideal gas, an assumption is made that there are no intermolecular interactions, and therefore forces such as electron repulsion forces are ignored; repulsion forces dominate over attractive ones, as all the atoms in this simulation are the same and so partial charges or dipoles are created. This will mean that the particles move closer together than a real gas and so the density will be larger. This discrepancy between the ideal and non-ideal systems becomes larger at a higher pressure because with a higher pressure, the atoms in the system are closer together and therefore the intermolecular repulsion will become larger. This greater repulsion will in turn have a larger effect on decreasing the density.&lt;br /&gt;
&lt;br /&gt;
== Statistical Physics Calculations of the Heat Capacity ==&lt;br /&gt;
The heat capacity of a system at constant volume can be calculated from the variance in the total energy of the system. The relationship used to calculate the heat capacity is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = 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;\left\langle E^2\right\rangle&amp;lt;/math&amp;gt; is the continuous average of the total square energy at each temperature as a function of temperature. &amp;lt;math&amp;gt;\left\langle E\right\rangle^2&amp;lt;/math&amp;gt; is the continuous average of the total energy at each temperature as a function of temperature squared. The heat capacity is multiplied by &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; in this case because the version of LAMMPS calculates every energy divided by the number of molecules in the system simulated.&lt;br /&gt;
&lt;br /&gt;
The calculations in this sections are run in density-temperature phase space and the ensemble has changed to the canonical ensemble (NVT). A set of input files were written for ten calculations for, like the previous section, two pressures and five different temperatures at each pressure:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 0.2, 0.8&lt;br /&gt;
*Temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{C_V}{V}&amp;lt;/math&amp;gt; was plotted against temperature to determine the relationship in density-temperature phase space. An example of an input file can be found [[Media:nvt_-_0220.in|here]]. The lines which have been changed from the previous input files are at the end of the script:&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 &lt;br /&gt;
 thermo_style custom step etotal temp&lt;br /&gt;
 variable energy equal etotal&lt;br /&gt;
 variable energy2 equal etotal*etotal&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_energy v_energy2 v_temp&lt;br /&gt;
 run 100000&lt;br /&gt;
 &lt;br /&gt;
 variable aveenergy equal f_aves[1]&lt;br /&gt;
 variable aveenergy2 equal f_aves[2]&lt;br /&gt;
 variable avetemp equal f_aves[3]&lt;br /&gt;
 variable heatcapacitydv equal atoms*atoms*(v_aveenergy2-v_aveenergy*v_aveenergy)/(v_avetemp*v_avetemp*vol)&lt;br /&gt;
 &lt;br /&gt;
 print &amp;quot;Averages&amp;quot;&lt;br /&gt;
 print &amp;quot;--------&amp;quot;&lt;br /&gt;
 print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Heat Capacity per Volume: ${heatcapacitydv}&amp;quot;&lt;br /&gt;
The line with the keyword &#039;fix&#039; determines which thermodynamic values are averaged and over how many steps they are averaged. The next section takes these averages as variables and uses them to define the heat capacity which is calculated from the equation at the beginning of this section. Only the energy and temperature are needed to define the heat capacity and so only these values are calculated by the simulation. [[File:Rmt heatcapacitybyv.png|none|thumb|800x800px|&#039;&#039;Figure j. &#039;&#039;C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V against temperature for the two different pressures 0.2 and 0.8]]As seen in the above figure, the heat capacity decreases with temperature for both pressures. It would be expected for an ideal system that as the temperature increases, the heat capacity at constant volume increases and tends to a constant volume at very high T of 3R; R = the universal gas constant. This means increasing the temperature increases the amount of energy being stored in the system and this energy is stored as vibrational energy. However, for a Lennard-Jones liquid, the system being simulated here, the heat capacity decreases with temperature. This is because the simulation has two components to the simulation; the atoms are vibrating in a quasi-harmonic fashion around the equilibrium position and also diffuse between neighbouring equilibrium positions in a gas like fashion. As the temperature increases, the amount of diffusion increases and the vibrations decreases, therefore decreasing the ability of the system to absorb vibrational energy, resulting in the decrease in heat capacity. &amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www.nature.com/ncomms/2013/130816/ncomms3331/full/ncomms3331.html?message-global=remove&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural Properties and the Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a single atom in a system is a plot of the probability that an atom can be found at a certain distance from the central atom. The peaks in this plot can give the distance of an atom from its nearest neighbours in the Lennard-Jones simulated system. &lt;br /&gt;
&lt;br /&gt;
The calculations in this section simulate a Lennard-Jones solid, liquid and gas and, using the output of the LAMMPS trajectory file, plots both the radial distribution function and its integral using DLV. The temperature and pressure parameters for these calculations were taken from the phase diagram or coexistence curve for a Lennard-Jones system.&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt; The parameters used are displayed in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! Temperature, &amp;lt;math&amp;gt;T^*&amp;lt;/math&amp;gt;&lt;br /&gt;
! Pressure, &amp;lt;math&amp;gt;p^*&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| LJ Solid&lt;br /&gt;
| 1.5&lt;br /&gt;
| 1.2&lt;br /&gt;
|-&lt;br /&gt;
| LJ Liquid&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.8&lt;br /&gt;
|-&lt;br /&gt;
| LJ Gas&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.01&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The data obtained from the plots and the radial distribution functions and their integrals were plotted and shown in the table below.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure k. &#039;&#039;The radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
!&#039;&#039;Figure l. &#039;&#039;The integrals of the radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt fullrdfs.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt allintegralsrdf.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
[[File:Rmt Nearest neighbours.png|left|thumb|300x300px|&#039;&#039;Figure m. &#039;&#039;Representation of a cross section of the first three shells of nearest neighbours in an fcc solid. The black atom is the central atom being considered, the blue atoms are the first shell, the orange atoms the second shell and the purple atoms are the third.]]&lt;br /&gt;
The RDF of the solid gives a very irregular curve because of the irregular structure of the lattice. For a simple cubic lattice, a regular structure of the RDF would be expected because of the equal number of atoms in each of the nearest neighbour shells of the atoms. However, for face-centered cubic, the solid in this simulation, the structure is much more irregular and as the atoms move from their equilibrium position in the lattice due to vibrations, the peaks in the radial distribution will broaden. The irregular heights of the peaks are due to the varying numbers of atoms in each of the nearest neighbour shells for the central atom. The first shell gives the highest peak as it contains the most atoms; in total, considering all four surrounding unit cells, this shell contains 12 atoms and ideally takes the geometry of an icosahedron. The second shell is smaller and contains only 6 atoms in an octahedral coordination shape. The following shell again contributes 12 atoms, 3 from each unit cell. This therefore explains why the heights of the peaks in the solid plot in &#039;&#039;figure k.&#039;&#039; vary. These values can be confirmed by the plot in &#039;&#039;figure o.&#039;&#039; which is the integral; it cumulatively adds the numbers in each shell. The size of the first &amp;quot;step&amp;quot; is 12; there are 12 atoms in the first shell. The size of the second step is approximately 18; there are 18-12=6 steps in the second shell. The same theory applies for the third shell which gives a value of 13. This is slightly different to the predicted value possibly due to error in the calculation of the radial distribution function and therefore its integral. &lt;br /&gt;
&lt;br /&gt;
The RDF of the liquid has a representation of far fewer shells, which means that there are less atoms in the space close to a &amp;quot;central&amp;quot; atom in the bulk solution. The particles have more energy and therefore do not keep to a regular lattice structure. As they move about, some regualrity is maintained around each atom, but only to the extend of two or three shells, meaning there is no long range order in a Lennard-Jones liquid. &lt;br /&gt;
&lt;br /&gt;
The RDF of the gas again omits more shells as there is almost no order in a Lennard-Jones gas. The single peak on this plot considers only the set of atoms closest to the central atom and all others are disregarded as they are too far apart. &lt;br /&gt;
&lt;br /&gt;
Considering &#039;&#039;figure l.&#039;&#039;, the size of the integral of the radial distribution function decreases from solid to liquid to gas. This makes sense as the number of atoms in the surrounding shells decreases with density of the system; the atoms become further apart. &lt;br /&gt;
&lt;br /&gt;
From the plot of the radial distribution function of the solid, the lattice spacing can be determined. For this, we can consider just the first three peaks of the RDF plot. The lattice spacing refers to the length of one unit cell, and so, using &#039;&#039;figure m&#039;&#039;, we can calculate this using two different methods; a) we can use the distance between the central atom and the first shell of nearest neighbours, and use trigonometry to calculate the lattice spacing. Or alternatively b) we can use the distance between the central atom and the second nearest neighbour shell to get the lattice spacing.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure n. &#039;&#039;The radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
!&#039;&#039;Figure o. &#039;&#039;The integral of the radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt solidgr3.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt solidint3.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
Using method a) (with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; as the distance between the central atom and the nearest neighbour: Lattice spacing = &amp;lt;math&amp;gt;\frac{r}{cos({\frac{\pi}{4}})} = \frac{1.02}{cos({\frac{\pi}{4}})} \approx 1.44&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using method b): Lattice spacing &amp;lt;math&amp;gt;\approx 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can take an average between the two get an approximate value for the lattice spacing: &amp;lt;math&amp;gt;1.46 \plusmn 0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These values for distance are all in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
The ability of atoms to move around in a solid liquid or gas can be characterised by the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. In this section, we will explore two different ways to calculate the diffusion coefficient and compare the results. &lt;br /&gt;
&lt;br /&gt;
=== The Mean Squared Displacement ===&lt;br /&gt;
The diffusion coefficient can be measured easily be calculating the mean squared displacement of atoms in the solution; the diffusion coefficient is proportional to the first derivative of the mean squared displacement. By plotting the mean squared displacement as a function of time, the gradient can be taken to calculate the diffusion coefficient when its has equilibrated and become linear.&lt;br /&gt;
&lt;br /&gt;
The temperature and density parameters used were the same as in the previous section:&lt;br /&gt;
* Solid: T=1.5, D=1.2&lt;br /&gt;
* Liquid: T=1.1, D=0.8&lt;br /&gt;
* Gas: T=1.1, D=0.01&lt;br /&gt;
&lt;br /&gt;
Mean density squared calculations were run for all three Lennard-Jones phases and the data plotted as function of timestep below. The data from a simulation containing 1,000,000 atoms was plotted for comparision.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!Plots for the 8,000 atom data (&#039;&#039;figures p-r)&#039;&#039;&lt;br /&gt;
!Plots for the 1,000,000 atom data (&#039;&#039;figures s-u)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|[[File:Rmt_MSDsolid.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt_MAsolid.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|[[File:Rmt MSDliquid.png|700x700px]]&lt;br /&gt;
|[[File:Rmt MAliquid.png|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|[[File:Rmt MSDgas.png|700x700px]]&lt;br /&gt;
|[[File:Rmt dataplots 25894 image001.png|700x700px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The exact relationship between the mean squared displacement and the diffusion coefficient is:&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;
Taking the gradients of each of the curves at the point at which they become linear and dividing by six will give the diffusion coefficient for each set of data. The gradient also needs to be converted to a function of time; this is done by dividing by the timestep, which in this case is 0.002:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom data diffusion coefficients, &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
!1,000,000 atom data diffusion coefficients &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 0.9999&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|Gradient = 0.0972&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{48.6}{6} = \mathbf{8.1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient = 0.0386&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{19.6}{6} = \mathbf{3.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For both of the solid approximations, the diffusion coefficient can be approximated as zero. This is because, when equilibrated, the function has a constant value of around 0.2 for the mean squared displacement. A gradient with a value of zero means that the atoms take an infinite amount of time to change their mean squared displacement; to move away from their equilibrium position, and so this means that we can approximate in this system, there will be no diffusion. In real system, however, this is not the case; diffusion occurs but it is very slow. A plot for a real system will give a very shallow positive gradient.&lt;br /&gt;
&lt;br /&gt;
The liquid approximations are very well correlated. This is because in both cases, the mean squared displacement of particles in a liquid increases linearly with time and the gradient of both plots are almost identical. We can assume from this that identical starting conditions were used to calculate this data. Also, we can estimate that 8,000 atoms is a large enough simulation to give an accurate result for the diffusion coefficient for the Lennard-Jones liquid.&lt;br /&gt;
&lt;br /&gt;
The gas approximations are very different. This is most probably due to the fact that the density specified in calculations are different. The 8,000 data can be estimated to be a much lower density because the diffusion coefficient is faster and this means diffusion will happen faster; at a higher density a particle will take longer to diffuse over a given distance. Because of the difference in density, the two values of the diffusion coefficient cannot be qualitatively compared. The reason for the initial deviation for linearity in the gas plots is due to the momentum of the particles initially dominating over the diffusion and the diffusion coefficient is dependent on time. As the system equilibrates, the diffusion coefficient becomes constant and the plots become linear.&lt;br /&gt;
&lt;br /&gt;
=== The Velocity Autocorrelation Function ===&lt;br /&gt;
&lt;br /&gt;
Another way to calculate the diffusion coefficient is by using the velocity correlation function, which determines how the velocity of an atom changes with time. The function determines the difference in time (&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;) when the velocity becomes uncorrelated, i.e. the difference between the velocity at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; and at time &amp;lt;math&amp;gt;t+\tau&amp;lt;/math&amp;gt;. By integrating over this function, we can find the diffusion coefficient. &lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function: &amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can also be written as the integral: &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;
Using the function which defines the position of a classical harmonic oscillator, we can differentiate this to give the equation for the velocity which we can plug into the integral:&lt;br /&gt;
&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;
&amp;lt;math&amp;gt;dv{x(t)}{t} = v(t) = -A\omega sin(\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also needed for the integral:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t+\tau) = -A\omega sin(\omega(t+\tau)+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v^2(t) = A^2\omega^2 sin^2(\omega t +\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Putting all this into the integral to find the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega sin(\omega t + \phi) \times A\omega sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} A^2\omega^2 sin^2(\omega t +\tau)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A^2\omega^2&amp;lt;/math&amp;gt; can be take out of each of the integrals and cancelled. A substituion can then be made to make solving the integral much simpler:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = \omega t + \phi&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \omega\tau&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the integral becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a) \times sin(a+b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the compound angle rule &amp;lt;math&amp;gt;sin(a+b)=sin(a)cos(b)+cos(a)sin(b)&amp;lt;/math&amp;gt;, the integral can be simplified to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a)sin(a)cos(b) + sin(a)cos(a)sin(b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Separating out into two integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)\frac{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the rule &amp;lt;math&amp;gt;sin(a)cos(a) = \frac{1}{2}sin(2a)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} \frac{1}{2}(sin(2a))\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because the function &amp;lt;math&amp;gt;\frac{1}{2}sin(2a)&amp;lt;/math&amp;gt; is symmetric over all space, the second term in this equation becomes zero. Therefore, the integral simplifies to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b) = cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same calculations from the mean squared displacement section gave an output of the velocity autocorrelation function. The function for the Lennard-Jones solid, liquid and gas were plotted against the timestep along with the approximate function for the velocity autocorrelation function, &amp;lt;math&amp;gt;cos(\omega\tau)&amp;lt;/math&amp;gt;, where &lt;br /&gt;
[[File:Rmt VACF 5721 image001.png|none|thumb|800x800px|&#039;&#039;Figure v. &#039;&#039;Plots for the velocity autocorrelation function of a Lennard-Jones solid, liquid and gas]]&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated from: &amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty C\left(\tau\right)\mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the approximate value for the diffusion coefficient using the velocity autocorrelation function is &amp;lt;math&amp;gt;D = \frac{1}{3}cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The running integral of the velocity autocorrelation functions was plotted using the &#039;&#039;trapesium rule&#039;&#039;, and so the final value on the integral plot is proportional to the diffusion coefficient.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom VACF integral &#039;&#039;(figures w-y)&#039;&#039;&lt;br /&gt;
!1,000,000 VACF integral (&#039;&#039;figures z-bb)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=541381</id>
		<title>Rep:Mod:hakunamatata</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=541381"/>
		<updated>2016-02-25T12:42:06Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: /* Dynamical Properties and the Diffusion Coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Introduction to Molecular Dynamics Simulations ==&lt;br /&gt;
===The Classical Particle Approximation and Numerical Integration===&lt;br /&gt;
The verit and verit-velocity algorithms are numerical methods to approximate the average position and velocity respectively of randomly moving atoms in a particular medium (solid, liquid, fliud etc.). This position and velocity can be applied to Newtonian mechanics to calculate such properties as the force and potential energy of the system. The algorithms work by splitting the function into discrete time steps, calculating the values of position and velocity at this particular time step, and then effectively &amp;quot;joining the dots&amp;quot; to create an approximate function. These simulations always use the answer from the previous timestep to compute the new timestep, so initial conditions must be given for the first step. Both of the algorithms are shown below and are derived from the Taylor expansion of the position or velocity of the atoms at the timestep &amp;quot;n+1&amp;quot; or &amp;lt;math&amp;gt;t+\delta t&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit Algorithum:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{x}_i\left(t + \delta t\right) \approx 2\mathbf{x}_i\left(t\right) - \mathbf{x}_i\left(t - \delta t\right) + \frac{\mathbf{F}_i\left(t\right)}{m_i}\delta t^2  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit-Velocity Algorithum:&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i\left(t\right)&amp;lt;/math&amp;gt; is the force acting on a particular atom as a function of time&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i&amp;lt;/math&amp;gt; is the acceleration &lt;br /&gt;
&lt;br /&gt;
The smaller the timestep, the closer the numerical approximation is to the true solution function, which can be modeled as a classical harmonic oscillator. &#039;&#039;Figure a.&#039;&#039; in the table below shows the comparison between the two methods in &#039;&#039;time&#039;&#039; space. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure a. &#039;&#039;Plots of position vs time comparing the verit algorithm and harmonic spring results&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure b. &#039;&#039;Plot of the total classical energy of the system (potential + kinetic)&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory xanalytical.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory energy.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The harmonic spring position values are modeled from the harmonic oscillator or particle on a spring. The equation of &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; was used to calculate these values, where &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; are 1 and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; is zero. As seen on the plot, the curves produced from the two different methods of calculating the position are in good agreement.&lt;br /&gt;
|The potential energy is calculated using the equation U = 1/2 kx^2, with a value of k given as 1. The kinetic energy is calculated using the velcity from the verit-velocity algorithm using the equation T = 1/2 mv^2, with a value of m given as 1. The total energy of the system, E, is equal to T + U. The values for x (potential energy) and v (kinetic energy) are taken from the verity algorithm and verit-velocity algorthim respectively. &lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;Figure c. &#039;&#039;Plot of the difference (error) between the harmonic spring and verit algorithm data&lt;br /&gt;
!&#039;&#039;Figure d. &#039;&#039;Plot of the peaks in the error plot in &#039;&#039;figure c.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory error.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory errorpeaks.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The peaks in the error between the harmonic spring and verit algorithm results are at the place where the position curve crosses the time axis. This is because the harmonic spring data (x(t)) has a slightly shorter wave period than that of the verit velocity algorithm, and therefore the difference will get larger with each period of the wave, shown by the error getting larger in &#039;&#039;figure c. &#039;&#039;The period of the plot of the two methods are different because the verit algorithm is much more approximate so does not give the correct solution.&lt;br /&gt;
|The change in the error/difference between the harmonic spring data and verit algorthm data increases linearly and so therefore period of each of the plots in &#039;&#039;figure 1&#039;&#039;. must be constant. &lt;br /&gt;
|}&lt;br /&gt;
The error can also be quantified on a &#039;&#039;phase space&#039;&#039; plot; phase space is momentum or velocity plotted as a function of position. The true solution for motion of an atom is a perfect ellipse, and the more elliptic the shape (less circular) the more momentum or velocity is in the system. A numerical solution, like the verit algorithms, will produce a set of points very close to this ellipse but not perfectly following the curve. A good numerical solution will remain in an elliptical shape, whereas a bad numerical solution, for example one with a large timestep, will spiral away from the true solution. Two examples of such systems using the data from &#039;&#039;figures a-d&#039;&#039; are shown below.  &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure e. &#039;&#039;Phase plot of the harmonic spring data with a good numerical solution (timestep = 0.1) &lt;br /&gt;
!&#039;&#039;Figure f. &#039;&#039;Phase plot of the harmonic spring data with a bad numerical solution (timestep = 0.3) &lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory phasegood.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory badphase.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The timestep at which this data is plotted is 0.1, which results in a very small change in the energy, as seen in &#039;&#039;figure b. &#039;&#039;Increasing the time step will increase the variation in the energy. To keep the variation in the total energy of the system under 1%, the time step must be no larger than approximately 0.28. The energy varies more with increasing time step because the jumps in the algorithm  are getting larger due to less data points. The algorithm assumes these points are joined by a straight line; that the halfway point in the jump is the average between the starting and finishing point of the jump. The phase space plot will become less elliptic and the jumps eventually become so larger that the plot is no longer a continuous shape.  &lt;br /&gt;
&lt;br /&gt;
It is essential to monitor the energy of a numerically modeled system because a good solution for the motion of an atom has a constant energy and a plot in phase space of a perfect ellipse.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance and Force at Zero Potential===&lt;br /&gt;
From classical mechanics, the force calculated from the Newtonian mechanics above can be used to calculate the potential experienced by an atom in the system. They are related by the equation: &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;
This potential gives the shape and dimension of the potential surface on which the system can be modeled. A simple 1D potential that is used to describe the inter atomic forces of a liquid is the Lennard-Jones potential. It has the characteristic features of a short range repulsion potential and harmonic character around the equilibrium bond distance. The value of &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the inter atomic separation when the potential, &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;, is equal to zero, can be calculated by equating the equation for the Lennard-Jones potential to zero and solving for &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The equation for the Lennard-Jones potential: &amp;lt;math&amp;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;
Equating this to zero: &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;
And rearranging in order to separate the variables: &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;
Rearranging this gives &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in terms of &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt; r^6 = \sigma^6&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r = r_0&amp;lt;/math&amp;gt; in this case.&lt;br /&gt;
&lt;br /&gt;
This, therefore, gives the result that interatomic distance at zero potential, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, is equal to &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; in the Lennard-Jones potential is effectively the diameter of one of the particles in the system being measured; in this case, the liquid we are simulating. This is the point where the potential curve crosses the x-axis on an Energy vs interatomic distance plot. The force, &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt;, at this point on the curve corresponds to the gradient; it is found by calculating the derivative of the curve at this point. &lt;br /&gt;
&lt;br /&gt;
To calculate the force, we must differentiate the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As force is equal to the negative differential of the potential energy, the value of the force is: &amp;lt;math&amp;gt;\mathbf{F}_i = 48\epsilon \sigma^{12} r^{-13} - 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting in the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at zero potential from the calculation before: &amp;lt;math&amp;gt;\mathbf{F}_i = \frac{48\epsilon}{\sigma} - \frac{24\epsilon}{\sigma} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The gradient where the Lennard-Jones plot crosses the axis is negative; &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; in the term obtained for &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is negative and therefore the overall value of the force will be negative.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance, Force and Well Depth of the Potential at Equilibrium===&lt;br /&gt;
To calculate the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at the equilibrium position, we need to use the derivative of the potential energy curve. The equilibrium value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is the value at the minimum of the Lennard-Jones curve; when &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Therefore, equating the derivative to zero gives: &amp;lt;math&amp;gt;0 = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rearranging this: &amp;lt;math&amp;gt;48\epsilon \sigma^{12} r^{-13} = 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And simplifying and cancelling gives: &amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6&amp;lt;/math&amp;gt;. Therefore the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at equilibrium is: &amp;lt;math&amp;gt;r_{eq} = \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Physically, this result means that the equilibrium distance is 1.12 times the diameter of one of the particles; the particles have a small gap between them so do not touch. A short range repulsion potential, as seen in the Lennard-Jones curve, is a result of the particles coming into contact. &lt;br /&gt;
&lt;br /&gt;
Again, the force can be calculated from the derivative of the potential curve at the equilibrium point. As the derivative at this point is zero (a minimum on the curve), the force will therefore also be zero.&lt;br /&gt;
&lt;br /&gt;
The well-depth of the potential curve is the difference between zero potential and the potential at the equilibrium bond length. This can be calculated by substituting the value for the equilibrium bond length into the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 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;
Cancelling and simplifying this equation gives: &amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \times \frac{1}{4}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the absolute value for the well depth is &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;. The actual value of this potential is &amp;lt;math&amp;gt;-\epsilon&amp;lt;/math&amp;gt;, as the equilibrium bond length gives the most stable configuration of the molecules and therefore suggests attractive interactions are involved in the arrangement of the molecules; this attractive potential means its negative. &lt;br /&gt;
&lt;br /&gt;
===Boundary Conditions and the Lennard-Jones Cutoff===&lt;br /&gt;
When simulating a liquid, it is computationally impractical to simulate a realistic liquid. Therefore a smaller &#039;box&#039; containing &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; particles is simulated and the computer program will use &#039;&#039;periodic boundary conditions&#039;&#039; to simulate infinite repetitions of this box; when the atom reaches one edge of the box, in periodic boundary conditions, it will reappear again at the opposite edge of the box as if they were connected. For example, an atom at the position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a box of size &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;. Without periodic boundary conditions, we would assume that the atom would end up at the position &amp;lt;math&amp;gt;(1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;. However, in this box, there is no such position and so the particle must reappear at the opposite edge to where it effectively &#039;left&#039; the box. Therefore, it&#039;s ending position will be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The number of particles, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; simulated by the computer is usually between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt;. Physically, this is a very small volume. Considering water, we can calculate the number of molecules in 1 mL or 1 cm^3, a volume that would be considered small in the lab. Taking the concentration of water at standard conditions, &amp;lt;math&amp;gt;55\ mol\ dm^{-3}&amp;lt;/math&amp;gt;, we can convert it to the number of moles per mL: &amp;lt;math&amp;gt;0.055\ mol\ mL^{-1}&amp;lt;/math&amp;gt;. Multiplying this value by Avagadro&#039;s constant (&amp;lt;math&amp;gt;N_A&amp;lt;/math&amp;gt;) gives the number of molcules of water per mL: &amp;lt;math&amp;gt;3.02 \times 10^{22}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The reverse procedure can be used to compare this to the volume of 10,000 molecules: 10,000 divided by Avagadro&#039;s constant gives the number of moles of water which 10,000 molecules makes up: &amp;lt;math&amp;gt;1.66 \times 10^{-20}\ moles&amp;lt;/math&amp;gt;. Dividing this value by the concentration (from &amp;lt;math&amp;gt;n=cV&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is the number of moles, &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; is the concentration and &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume), gives the volume: &amp;lt;math&amp;gt;3.02 \times 10^{-22}\ dm&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;3.02 \times 10^{-19}\ mL&amp;lt;/math&amp;gt;. Physically, of course, this is far too small a volume to be recorded in the lab.&lt;br /&gt;
 &lt;br /&gt;
Periodic boundary conditions simulate an infinite lattice and therefore, when computing the potential, will calculate an infinite amount of pair interactions. Therefore, it is only practical to calculate the energies up to a certain interatomic distance; the Lennard-Jones cutoff distance. Beyond this point, the potential energy and the integral of the curve beyond this point become insignificant and do not impact on the overall energy; removing interactions beyond this point from the calculations will not effect the accuracy. Multiplying the Lennard-Jones potential with the radial distribution function gives a plot of the probability of finding an atom at a particular interatomic distance. The larger the interatomic distance, the lower the probability and so the energy after the cutoff can be disregarded. &lt;br /&gt;
&lt;br /&gt;
Integrating over the Lennard-Jones curve and applying this cutoff as the lower limit can show how small the integral is:&lt;br /&gt;
&lt;br /&gt;
For a general cutoff of with value &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;I = \int_{x}^\infty \phi\left(r\right)\mathrm{d}r = \int_{x}^\infty \frac{4\epsilon\sigma^{12}}{r^{12}}\mathrm{d}r - \int_{x}^\infty \frac{4\epsilon\sigma^6}{r^6}\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving this: &amp;lt;math&amp;gt;I = 4\epsilon\sigma^{12} {\frac{-1}{11r^{11}}\,\Bigg\vert\,}_x^\infty - 4\epsilon\sigma^{6} {\frac{-1}{5r^{5}}\,\Bigg\vert\,}_x^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This gives the general solution: &amp;lt;math&amp;gt;I = \frac{4\epsilon\sigma^{12}}{11x^{11}} - \frac{4\epsilon\sigma^{6}}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating this for &amp;lt;math&amp;gt;\epsilon = \sigma = 1&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;I = \frac{4}{11x^{11}} - \frac{4}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt; (or 2 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.025&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt; (or 2.5 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0082&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt; (or 3 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0033&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All values are taken to 2 significant figures. As the cutoff value for the interatomic distance gets larger, the integral gets smaller, and therefore the energy excluded from the calculation becomes smaller, and the second term in the solved integral, &amp;lt;math&amp;gt;I&amp;lt;/math&amp;gt;, dominates the energy value.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
When using the Lennard-Jones potential, it is appropriate to use reduced units for intermolecular distance, energy and temperature. Reduced units can be calculated by the following relationships:&lt;br /&gt;
&lt;br /&gt;
Intermolecular 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;
&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; are scaling factors. For example, if the parameters for Argon are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\sigma = 0.34 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt; \epsilon\ /\ k_B = 120 K&amp;lt;/math&amp;gt;&lt;br /&gt;
* Lennard-Jones cutoff &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;. The well-depth, &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;, is &amp;lt;math&amp;gt;0.999 kJ mol^{-1} \approx 1 kJ mol^{-1}&amp;lt;/math&amp;gt;. The value of &amp;lt;math&amp;gt;T* = 1.5&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;180 K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
The first aim of the simulations is to determine the most appropriate timestep to use in the vert algorithm simulations. This timestep is a balance between the accuracy of the results (the smaller the timestep, the closer to the true functing the result will be) and the length of real time over which the simluation is run (the smaller the timestep, the less real time over which the simulation will give a result). The appropriateness of the timestep will be determined by plotting how the total free energy of the simulated lattice equilibrates over time.  &lt;br /&gt;
&lt;br /&gt;
Five different calculations, which simulated the melting of a crystal and subsequent equilibration of the energy of the melted crystal, were run at five different timesteps; 0.001, 0.0025, 0.0075, 0.01 and 0.015, and were described by the NVE or &#039;&#039;&amp;quot;microcanonical ensemble&amp;quot;&#039;&#039;. An ensemble is a collection of samples of a system which are under three thermodynamic constraints (three properties are kept constant); in the microcanonical ensemble, the number of particles, the volume and the total energy is kept constant (NVE). &lt;br /&gt;
&lt;br /&gt;
These calculations simulate a box of 1000 unit cells and use periodic boundary conditions to replicate the simulation to a larger scale. Because these simulations use the numerical methods defined in the previous section, the initial position and velocity of the atoms must be defined in the input file. The Brownian (uncorrelated, random) motion of the atoms in the simulation means that there is no long range order in the system and so the atoms in a real system would start in random positions. However, assigning random starting coordinates to the atoms in a simulated liquid is not a relative process; the coordinates are generate independently of each other. Therefore there is a probability that the coordinates simulated will cause the atoms to overlap, which would give a very large repulsion potential, as seen in the Lennard-Jones potential at very small interatomic distances. This short-range repulsion potential comes from the hard-sphere model of atomic simulation.&lt;br /&gt;
&lt;br /&gt;
The input file also defines the structure and density of the lattice. The number density of lattice points in any lattice is the number of lattice points per volume of the unit cell. In a simple cubic lattice, there is one lattice point in the unit cell. From an sc lattice with lattice spacing (length of one side of the unit cell) being &amp;lt;math&amp;gt;1.07722&amp;lt;/math&amp;gt;, the number density of the lattice points is calculated by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{1}{1.07722^3} = 0.7999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a face-centered cubic lattice (fcc), there are four lattice points in the unit cell. Rearranging the above relationship, the lattice spacing can be calculated from the number of lattice points in a unit cell and number density, &amp;lt;math&amp;gt;1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Lattice\ spacing = \sqrt[3]{\frac{number\ of\ lattice\ points\ per\ unit\ cell}{number\ density}} = \sqrt[3]{\frac{4}{1.2}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation creates a box which includes 1000 unit cells, which is 10 unit cells in each dimension. For a simple cubic lattice, because there is one lattice point per unit cell, there will be 1000 atoms created as seen in the input file. The &#039;&#039;create_atom&#039;&#039; command in the input file determines how many boxes are created in the simulation and therefore how many atoms will be created. If a face centered cubic lattice is simulated, because there are 4 lattice points per unit cell, 4000 atoms will be created in the &#039;&#039;create_atom&#039;&#039; command. &lt;br /&gt;
&lt;br /&gt;
The input script also contains the following commands which defines the potential surface which is used to model the intermolecular reactions:&lt;br /&gt;
 mass 1 1.0&lt;br /&gt;
This instruction sets the mass type for the atoms being simulated. It takes the general form of “mass I value”, where mass is the keyword which tells LAMMPS what the input is, I is the atom type and value is the mass of the atom. In this case, I is defined by a specific numerical value; 1 as there is only 1 type of atom in the simulation, but it can be defined with an asterisk (1*), which means “all atom types of 1 to n inclusive”. &lt;br /&gt;
 pair_style lj/cut 3.0&lt;br /&gt;
This instruction sets the type of potential which LAMMPS uses in its calculation of pairwise interactions. It takes the general form of “pair_style style args”, where pair_style is the keyword for LAMMPS, style defines the potential and any specifications it may have, and args are the arguments required for this particular potential. In this case, the Lennard-Jones potential has been used (lj) with a cutoff point (cut) of 3σ. The cutoff point is explained in the introduction section. &lt;br /&gt;
 pair_coeff * * 1.0 1.0&lt;br /&gt;
This instruction specifies the coefficients for the pairwise interactions of each pair of atoms, and it takes the general form “pair_coeff I J args”. Pair_coeff is the keyword, I and J are the atom types, and args are the coefficients which the different atoms types take. In this case, the asterisk in place of I and J refers to all atoms types from 1 to n. The coefficients are the pairwise interactions are 1 for each atom, meaning each atom has an equal contribution to the interaction.&lt;br /&gt;
&lt;br /&gt;
In these initial calculations, the initial conditions for the numerical methods, &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. For this experiment, the verit-velocity algorithm would be the most appropriate, as both the starting position and velocity is specified for this algorithm. &lt;br /&gt;
&lt;br /&gt;
To define the timestep for the algorithm the following code is used defining the timestep as a variable instead of just giving it a definite value&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;
It is much easier to use the variable version of defining the timestep because the length of time over which the simulation is run depends on the time step. By using a variable, you can keep the length of the simulation the same, no matter the size of the timestep. It also makes it easier if multiple properties depend on the timestep – only the variable needs to be changed, not all the parts of the script where timestep is defined. &lt;br /&gt;
&lt;br /&gt;
The calculations produce the values for the total energy of the system, temperature and pressure in the output files, which can be plotted against time. How well these values equilibrate determines the appropriateness of the timestep to use in further calculations in the experiment.   &lt;br /&gt;
[[File:Rmt totalenergy plot.png|none|thumb|800x800px|&#039;&#039;Figure h. &#039;&#039;Plot of the equilibration of total energy for five different timesteps]]&lt;br /&gt;
The largest time step to give an acceptable result is 0.01. However, for any simluation we would expect energy to be independent of the timestep, something which is not true at a timestep greater than 0.0025. Therefore, the most appropriate timestep to use for a balance between accuracy and length of time which the simulation covers is 0.0025.  &lt;br /&gt;
&lt;br /&gt;
0.015 is a particularly bad choice of timestep. This is because the verit-velocity algorithm gives an approximate result to the velocity (kinetic energy term) and position (potential energy term), and so when the timestep becomes too large with respect to the time, the algorithm no longer becomes a suitable way to calculate the energy. As seen in the graph of 0.015, the energy does not equilibrate and diverges.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions ==&lt;br /&gt;
The calculations in this section are run in the isobaric-isothermal ensemble, where the number of particles in the system, the pressure and the temperature are kept constant (NpT). This means that the temperature and the pressure are recalculated in every step, so are no longer constant like they were in the NVE ensemble. From the &#039;&#039;equipartition theorem&#039;&#039;, each degree of freedom will contribute &amp;lt;math&amp;gt;\frac{1}{2} k_B T&amp;lt;/math&amp;gt; of energy to the system. As the system is in three dimensions, there are three degrees of translational freedom and so the total internal energy is equal to &amp;lt;math&amp;gt;\frac{3}{2} k_B T&amp;lt;/math&amp;gt;. Equating this to the kinetic energy, &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt;, at the end of every step and rearranging will allow calculation of the temperature after every step. &lt;br /&gt;
&lt;br /&gt;
A target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, is defined in the input script and the system will equilibrate by multiplying the velocity by a factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, in order to accommodate for the fluctuation and keep the system at approximately the target temperature and therefore constant internal energy. If the temperature of the system is greater than the target temperature, the system&#039;s kinetic energy is too high, so &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is reduced to compensate for this. The same is true for is the temperature is lower than the target temperature; &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than one in the next step to increase the kinetic energy which is now too low. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; can be derived from equating the kinetic and internal energy of the system at an arbitrary time step:&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;
Expanding the brackets inside the sum and moving the term containing &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; out of the sum: &amp;lt;math&amp;gt;\frac{\gamma^2}{2}\sum_i m_i \left(v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;, we can replace &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt; on the left hand side of the equation with &amp;lt;math&amp;gt;\frac{3}{2} N k_B T&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;\frac{3\gamma^2}{2}N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Simplifying and rearranging for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, gives: &amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The principle is the same for controlling the pressure.&lt;br /&gt;
&lt;br /&gt;
As temperature and pressure are no longer constant, he input files require specification of the pressure and the temperature for each of the systems run. 10 simulations were run at two different pressures with five different temperatures at each. &lt;br /&gt;
* Temperatures: 1.6, 1.9, 2.2, 2.5, 2.8&lt;br /&gt;
* Pressures: 2.5, 3.0&lt;br /&gt;
These pressures were chosen because the data simulated when choosing an appropriate timestep gave a pressure between 2.5 and 3.0.  &lt;br /&gt;
&lt;br /&gt;
For the code which computes the thermodynamic potentials, this particular line defines how many steps contribute towards the average of the thermodynamic parameters computed in the calculation. &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;
&#039;&#039;fix&#039;&#039; is the keyword, &#039;&#039;aves&#039;&#039; is the name of the group of fixes which in this case is the average of the thermodynamic values, &#039;&#039;all&#039;&#039; specifies the atoms which the fix is applied to which in this case is all the atoms in the simulated system and &#039;&#039;ave/time&#039;&#039; means that compute global time averages are calculated. The following three numbers have the following meaning:&lt;br /&gt;
&lt;br /&gt;
*100 = use the input values every 100 timesteps&lt;br /&gt;
*1000 = use input values 1000 times for calculating the average&lt;br /&gt;
*100000 = calculate the average every 100000 timesteps&lt;br /&gt;
&lt;br /&gt;
Therefore for the total calculation which lasts for 100000 will only have the average calculated once. Assuming 1 value every timestep, there will be 100000/100 values = 1000. The amount of time simulated is 100,000 steps, read from the following line.&lt;br /&gt;
&lt;br /&gt;
The density data from all ten calculation were plotted on the same graph, along with the density for an &amp;quot;ideal&amp;quot; gas. This density can be derived from the ideal gas law:&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;
Rearranging in terms of density: &amp;lt;math&amp;gt;\frac{N}{V} = \frac{P}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As these simulations are being run under reduced units, we can take &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt;, and so the density of the ideal gas becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the density of the ideal gas is plotted as the pressure divided by the temperature in pressure-temperature phase space.&lt;br /&gt;
[[File:Rmt dvt plot.png|none|thumb|800x800px|&#039;&#039;Figure i. &#039;&#039;Plot of the variation in density with temperature at a defined pressure for the numerically simulated and ideal systems]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that calculated in the ideal gas law. This is because for an ideal gas, an assumption is made that there are no intermolecular interactions, and therefore forces such as electron repulsion forces are ignored; repulsion forces dominate over attractive ones, as all the atoms in this simulation are the same and so partial charges or dipoles are created. This will mean that the particles move closer together than a real gas and so the density will be larger. This discrepancy between the ideal and non-ideal systems becomes larger at a higher pressure because with a higher pressure, the atoms in the system are closer together and therefore the intermolecular repulsion will become larger. This greater repulsion will in turn have a larger effect on decreasing the density.&lt;br /&gt;
&lt;br /&gt;
== Statistical Physics Calculations of the Heat Capacity ==&lt;br /&gt;
The heat capacity of a system at constant volume can be calculated from the variance in the total energy of the system. The relationship used to calculate the heat capacity is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = 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;\left\langle E^2\right\rangle&amp;lt;/math&amp;gt; is the continuous average of the total square energy at each temperature as a function of temperature. &amp;lt;math&amp;gt;\left\langle E\right\rangle^2&amp;lt;/math&amp;gt; is the continuous average of the total energy at each temperature as a function of temperature squared. The heat capacity is multiplied by &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; in this case because the version of LAMMPS calculates every energy divided by the number of molecules in the system simulated.&lt;br /&gt;
&lt;br /&gt;
The calculations in this sections are run in density-temperature phase space and the ensemble has changed to the canonical ensemble (NVT). A set of input files were written for ten calculations for, like the previous section, two pressures and five different temperatures at each pressure:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 0.2, 0.8&lt;br /&gt;
*Temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{C_V}{V}&amp;lt;/math&amp;gt; was plotted against temperature to determine the relationship in density-temperature phase space. An example of an input file can be found [[Media:nvt_-_0220.in|here]]. The lines which have been changed from the previous input files are at the end of the script:&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 &lt;br /&gt;
 thermo_style custom step etotal temp&lt;br /&gt;
 variable energy equal etotal&lt;br /&gt;
 variable energy2 equal etotal*etotal&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_energy v_energy2 v_temp&lt;br /&gt;
 run 100000&lt;br /&gt;
 &lt;br /&gt;
 variable aveenergy equal f_aves[1]&lt;br /&gt;
 variable aveenergy2 equal f_aves[2]&lt;br /&gt;
 variable avetemp equal f_aves[3]&lt;br /&gt;
 variable heatcapacitydv equal atoms*atoms*(v_aveenergy2-v_aveenergy*v_aveenergy)/(v_avetemp*v_avetemp*vol)&lt;br /&gt;
 &lt;br /&gt;
 print &amp;quot;Averages&amp;quot;&lt;br /&gt;
 print &amp;quot;--------&amp;quot;&lt;br /&gt;
 print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Heat Capacity per Volume: ${heatcapacitydv}&amp;quot;&lt;br /&gt;
The line with the keyword &#039;fix&#039; determines which thermodynamic values are averaged and over how many steps they are averaged. The next section takes these averages as variables and uses them to define the heat capacity which is calculated from the equation at the beginning of this section. Only the energy and temperature are needed to define the heat capacity and so only these values are calculated by the simulation. [[File:Rmt heatcapacitybyv.png|none|thumb|800x800px|&#039;&#039;Figure j. &#039;&#039;C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V against temperature for the two different pressures 0.2 and 0.8]]As seen in the above figure, the heat capacity decreases with temperature for both pressures. It would be expected for an ideal system that as the temperature increases, the heat capacity at constant volume increases and tends to a constant volume at very high T of 3R; R = the universal gas constant. This means increasing the temperature increases the amount of energy being stored in the system and this energy is stored as vibrational energy. However, for a Lennard-Jones liquid, the system being simulated here, the heat capacity decreases with temperature. This is because the simulation has two components to the simulation; the atoms are vibrating in a quasi-harmonic fashion around the equilibrium position and also diffuse between neighbouring equilibrium positions in a gas like fashion. As the temperature increases, the amount of diffusion increases and the vibrations decreases, therefore decreasing the ability of the system to absorb vibrational energy, resulting in the decrease in heat capacity. &amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www.nature.com/ncomms/2013/130816/ncomms3331/full/ncomms3331.html?message-global=remove&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural Properties and the Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a single atom in a system is a plot of the probability that an atom can be found at a certain distance from the central atom. The peaks in this plot can give the distance of an atom from its nearest neighbours in the Lennard-Jones simulated system. &lt;br /&gt;
&lt;br /&gt;
The calculations in this section simulate a Lennard-Jones solid, liquid and gas and, using the output of the LAMMPS trajectory file, plots both the radial distribution function and its integral using DLV. The temperature and pressure parameters for these calculations were taken from the phase diagram or coexistence curve for a Lennard-Jones system.&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt; The parameters used are displayed in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! Temperature, &amp;lt;math&amp;gt;T^*&amp;lt;/math&amp;gt;&lt;br /&gt;
! Pressure, &amp;lt;math&amp;gt;p^*&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| LJ Solid&lt;br /&gt;
| 1.5&lt;br /&gt;
| 1.2&lt;br /&gt;
|-&lt;br /&gt;
| LJ Liquid&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.8&lt;br /&gt;
|-&lt;br /&gt;
| LJ Gas&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.01&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The data obtained from the plots and the radial distribution functions and their integrals were plotted and shown in the table below.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure k. &#039;&#039;The radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
!&#039;&#039;Figure l. &#039;&#039;The integrals of the radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt fullrdfs.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt allintegralsrdf.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
[[File:Rmt Nearest neighbours.png|left|thumb|300x300px|&#039;&#039;Figure m. &#039;&#039;Representation of a cross section of the first three shells of nearest neighbours in an fcc solid. The black atom is the central atom being considered, the blue atoms are the first shell, the orange atoms the second shell and the purple atoms are the third.]]&lt;br /&gt;
The RDF of the solid gives a very irregular curve because of the irregular structure of the lattice. For a simple cubic lattice, a regular structure of the RDF would be expected because of the equal number of atoms in each of the nearest neighbour shells of the atoms. However, for face-centered cubic, the solid in this simulation, the structure is much more irregular and as the atoms move from their equilibrium position in the lattice due to vibrations, the peaks in the radial distribution will broaden. The irregular heights of the peaks are due to the varying numbers of atoms in each of the nearest neighbour shells for the central atom. The first shell gives the highest peak as it contains the most atoms; in total, considering all four surrounding unit cells, this shell contains 12 atoms and ideally takes the geometry of an icosahedron. The second shell is smaller and contains only 6 atoms in an octahedral coordination shape. The following shell again contributes 12 atoms, 3 from each unit cell. This therefore explains why the heights of the peaks in the solid plot in &#039;&#039;figure k.&#039;&#039; vary. These values can be confirmed by the plot in &#039;&#039;figure o.&#039;&#039; which is the integral; it cumulatively adds the numbers in each shell. The size of the first &amp;quot;step&amp;quot; is 12; there are 12 atoms in the first shell. The size of the second step is approximately 18; there are 18-12=6 steps in the second shell. The same theory applies for the third shell which gives a value of 13. This is slightly different to the predicted value possibly due to error in the calculation of the radial distribution function and therefore its integral. &lt;br /&gt;
&lt;br /&gt;
The RDF of the liquid has a representation of far fewer shells, which means that there are less atoms in the space close to a &amp;quot;central&amp;quot; atom in the bulk solution. The particles have more energy and therefore do not keep to a regular lattice structure. As they move about, some regualrity is maintained around each atom, but only to the extend of two or three shells, meaning there is no long range order in a Lennard-Jones liquid. &lt;br /&gt;
&lt;br /&gt;
The RDF of the gas again omits more shells as there is almost no order in a Lennard-Jones gas. The single peak on this plot considers only the set of atoms closest to the central atom and all others are disregarded as they are too far apart. &lt;br /&gt;
&lt;br /&gt;
Considering &#039;&#039;figure l.&#039;&#039;, the size of the integral of the radial distribution function decreases from solid to liquid to gas. This makes sense as the number of atoms in the surrounding shells decreases with density of the system; the atoms become further apart. &lt;br /&gt;
&lt;br /&gt;
From the plot of the radial distribution function of the solid, the lattice spacing can be determined. For this, we can consider just the first three peaks of the RDF plot. The lattice spacing refers to the length of one unit cell, and so, using &#039;&#039;figure m&#039;&#039;, we can calculate this using two different methods; a) we can use the distance between the central atom and the first shell of nearest neighbours, and use trigonometry to calculate the lattice spacing. Or alternatively b) we can use the distance between the central atom and the second nearest neighbour shell to get the lattice spacing.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure n. &#039;&#039;The radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
!&#039;&#039;Figure o. &#039;&#039;The integral of the radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt solidgr3.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt solidint3.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
Using method a) (with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; as the distance between the central atom and the nearest neighbour: Lattice spacing = &amp;lt;math&amp;gt;\frac{r}{cos({\frac{\pi}{4}})} = \frac{1.02}{cos({\frac{\pi}{4}})} \approx 1.44&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using method b): Lattice spacing &amp;lt;math&amp;gt;\approx 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can take an average between the two get an approximate value for the lattice spacing: &amp;lt;math&amp;gt;1.46 \plusmn 0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These values for distance are all in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
The ability of atoms to move around in a solid liquid or gas can be characterised by the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. In this section, we will explore two different ways to calculate the diffusion coefficient and compare the results. &lt;br /&gt;
&lt;br /&gt;
=== The Mean Squared Displacement ===&lt;br /&gt;
The diffusion coefficient can be measured easily be calculating the mean squared displacement of atoms in the solution; the diffusion coefficient is proportional to the first derivative of the mean squared displacement. By plotting the mean squared displacement as a function of time, the gradient can be taken to calculate the diffusion coefficient when its has equilibrated and become linear.&lt;br /&gt;
&lt;br /&gt;
The temperature and density parameters used were the same as in the previous section:&lt;br /&gt;
* Solid: T=1.5, D=1.2&lt;br /&gt;
* Liquid: T=1.1, D=0.8&lt;br /&gt;
* Gas: T=1.1, D=0.01&lt;br /&gt;
&lt;br /&gt;
Mean density squared calculations were run for all three Lennard-Jones phases and the data plotted as function of timestep below. The data from a simulation containing 1,000,000 atoms was plotted for comparision.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!Plots for the 8,000 atom data (&#039;&#039;figures p-r)&#039;&#039;&lt;br /&gt;
!Plots for the 1,000,000 atom data (&#039;&#039;figures s-u)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|[[File:Rmt_MSDsolid.png|frameless|700x700px]]&lt;br /&gt;
|[[File:Rmt_MAsolid.png|frameless|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|[[File:Rmt MSDliquid.png|700x700px]]&lt;br /&gt;
|[[File:Rmt MAliquid.png|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|[[File:Rmt MSDgas.png|700x700px]]&lt;br /&gt;
|[[File:Rmt dataplots 25894 image001.png|700x700px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The exact relationship between the mean squared displacement and the diffusion coefficient is:&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;
Taking the gradients of each of the curves at the point at which they become linear and dividing by six will give the diffusion coefficient for each set of data. The gradient also needs to be converted to a function of time; this is done by dividing by the timestep, which in this case is 0.002:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom data diffusion coefficients, &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
!1,000,000 atom data diffusion coefficients &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 0.9999&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|Gradient = 0.0972&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{48.6}{6} = \mathbf{8.1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient = 0.0386&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{19.6}{6} = \mathbf{3.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For both of the solid approximations, the diffusion coefficient can be approximated as zero. This is because, when equilibrated, the function has a constant value of around 0.2 for the mean squared displacement. A gradient with a value of zero means that the atoms take an infinite amount of time to change their mean squared displacement; to move away from their equilibrium position, and so this means that we can approximate in this system, there will be no diffusion. In real system, however, this is not the case; diffusion occurs but it is very slow. A plot for a real system will give a very shallow positive gradient.&lt;br /&gt;
&lt;br /&gt;
The liquid approximations are very well correlated. This is because in both cases, the mean squared displacement of particles in a liquid increases linearly with time and the gradient of both plots are almost identical. We can assume from this that identical starting conditions were used to calculate this data. Also, we can estimate that 8,000 atoms is a large enough simulation to give an accurate result for the diffusion coefficient for the Lennard-Jones liquid.&lt;br /&gt;
&lt;br /&gt;
The gas approximations are very different. This is most probably due to the fact that the density specified in calculations are different. The 8,000 data can be estimated to be a much lower density because the diffusion coefficient is faster and this means diffusion will happen faster; at a higher density a particle will take longer to diffuse over a given distance. Because of the difference in density, the two values of the diffusion coefficient cannot be qualitatively compared. The reason for the initial deviation for linearity in the gas plots is due to the momentum of the particles initially dominating over the diffusion and the diffusion coefficient is dependent on time. As the system equilibrates, the diffusion coefficient becomes constant and the plots become linear.&lt;br /&gt;
&lt;br /&gt;
=== The Velocity Autocorrelation Function ===&lt;br /&gt;
&lt;br /&gt;
Another way to calculate the diffusion coefficient is by using the velocity correlation function, which determines how the velocity of an atom changes with time. The function determines the difference in time (&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;) when the velocity becomes uncorrelated, i.e. the difference between the velocity at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; and at time &amp;lt;math&amp;gt;t+\tau&amp;lt;/math&amp;gt;. By integrating over this function, we can find the diffusion coefficient. &lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function: &amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can also be written as the integral: &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;
Using the function which defines the position of a classical harmonic oscillator, we can differentiate this to give the equation for the velocity which we can plug into the integral:&lt;br /&gt;
&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;
&amp;lt;math&amp;gt;dv{x(t)}{t} = v(t) = -A\omega sin(\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also needed for the integral:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t+\tau) = -A\omega sin(\omega(t+\tau)+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v^2(t) = A^2\omega^2 sin^2(\omega t +\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Putting all this into the integral to find the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega sin(\omega t + \phi) \times A\omega sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} A^2\omega^2 sin^2(\omega t +\tau)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A^2\omega^2&amp;lt;/math&amp;gt; can be take out of each of the integrals and cancelled. A substituion can then be made to make solving the integral much simpler:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = \omega t + \phi&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \omega\tau&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the integral becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a) \times sin(a+b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the compound angle rule &amp;lt;math&amp;gt;sin(a+b)=sin(a)cos(b)+cos(a)sin(b)&amp;lt;/math&amp;gt;, the integral can be simplified to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a)sin(a)cos(b) + sin(a)cos(a)sin(b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Separating out into two integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)\frac{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the rule &amp;lt;math&amp;gt;sin(a)cos(a) = \frac{1}{2}sin(2a)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} \frac{1}{2}(sin(2a))\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because the function &amp;lt;math&amp;gt;\frac{1}{2}sin(2a)&amp;lt;/math&amp;gt; is symmetric over all space, the second term in this equation becomes zero. Therefore, the integral simplifies to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b) = cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same calculations from the mean squared displacement section gave an output of the velocity autocorrelation function. The function for the Lennard-Jones solid, liquid and gas were plotted against the timestep along with the approximate function for the velocity autocorrelation function, &amp;lt;math&amp;gt;cos(\omega\tau)&amp;lt;/math&amp;gt;, where &lt;br /&gt;
[[File:Rmt VACF 5721 image001.png|none|thumb|800x800px|&#039;&#039;Figure t. &#039;&#039;Plots for the velocity autocorrelation function of a Lennard-Jones solid, liquid and gas]]&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated from: &amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty C\left(\tau\right)\mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the approximate value for the diffusion coefficient using the velocity autocorrelation function is &amp;lt;math&amp;gt;D = \frac{1}{3}cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The running integral of the velocity autocorrelation functions was plotted using the &#039;&#039;trapesium rule&#039;&#039;, and so the final value on the integral plot is proportional to the diffusion coefficient.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom VACF integral&lt;br /&gt;
!1,000,000 VACF integral&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=541380</id>
		<title>Rep:Mod:hakunamatata</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=541380"/>
		<updated>2016-02-25T12:41:17Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: /* The Velocity Autocorrelation Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Introduction to Molecular Dynamics Simulations ==&lt;br /&gt;
===The Classical Particle Approximation and Numerical Integration===&lt;br /&gt;
The verit and verit-velocity algorithms are numerical methods to approximate the average position and velocity respectively of randomly moving atoms in a particular medium (solid, liquid, fliud etc.). This position and velocity can be applied to Newtonian mechanics to calculate such properties as the force and potential energy of the system. The algorithms work by splitting the function into discrete time steps, calculating the values of position and velocity at this particular time step, and then effectively &amp;quot;joining the dots&amp;quot; to create an approximate function. These simulations always use the answer from the previous timestep to compute the new timestep, so initial conditions must be given for the first step. Both of the algorithms are shown below and are derived from the Taylor expansion of the position or velocity of the atoms at the timestep &amp;quot;n+1&amp;quot; or &amp;lt;math&amp;gt;t+\delta t&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit Algorithum:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{x}_i\left(t + \delta t\right) \approx 2\mathbf{x}_i\left(t\right) - \mathbf{x}_i\left(t - \delta t\right) + \frac{\mathbf{F}_i\left(t\right)}{m_i}\delta t^2  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit-Velocity Algorithum:&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i\left(t\right)&amp;lt;/math&amp;gt; is the force acting on a particular atom as a function of time&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i&amp;lt;/math&amp;gt; is the acceleration &lt;br /&gt;
&lt;br /&gt;
The smaller the timestep, the closer the numerical approximation is to the true solution function, which can be modeled as a classical harmonic oscillator. &#039;&#039;Figure a.&#039;&#039; in the table below shows the comparison between the two methods in &#039;&#039;time&#039;&#039; space. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure a. &#039;&#039;Plots of position vs time comparing the verit algorithm and harmonic spring results&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure b. &#039;&#039;Plot of the total classical energy of the system (potential + kinetic)&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory xanalytical.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory energy.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The harmonic spring position values are modeled from the harmonic oscillator or particle on a spring. The equation of &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; was used to calculate these values, where &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; are 1 and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; is zero. As seen on the plot, the curves produced from the two different methods of calculating the position are in good agreement.&lt;br /&gt;
|The potential energy is calculated using the equation U = 1/2 kx^2, with a value of k given as 1. The kinetic energy is calculated using the velcity from the verit-velocity algorithm using the equation T = 1/2 mv^2, with a value of m given as 1. The total energy of the system, E, is equal to T + U. The values for x (potential energy) and v (kinetic energy) are taken from the verity algorithm and verit-velocity algorthim respectively. &lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;Figure c. &#039;&#039;Plot of the difference (error) between the harmonic spring and verit algorithm data&lt;br /&gt;
!&#039;&#039;Figure d. &#039;&#039;Plot of the peaks in the error plot in &#039;&#039;figure c.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory error.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory errorpeaks.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The peaks in the error between the harmonic spring and verit algorithm results are at the place where the position curve crosses the time axis. This is because the harmonic spring data (x(t)) has a slightly shorter wave period than that of the verit velocity algorithm, and therefore the difference will get larger with each period of the wave, shown by the error getting larger in &#039;&#039;figure c. &#039;&#039;The period of the plot of the two methods are different because the verit algorithm is much more approximate so does not give the correct solution.&lt;br /&gt;
|The change in the error/difference between the harmonic spring data and verit algorthm data increases linearly and so therefore period of each of the plots in &#039;&#039;figure 1&#039;&#039;. must be constant. &lt;br /&gt;
|}&lt;br /&gt;
The error can also be quantified on a &#039;&#039;phase space&#039;&#039; plot; phase space is momentum or velocity plotted as a function of position. The true solution for motion of an atom is a perfect ellipse, and the more elliptic the shape (less circular) the more momentum or velocity is in the system. A numerical solution, like the verit algorithms, will produce a set of points very close to this ellipse but not perfectly following the curve. A good numerical solution will remain in an elliptical shape, whereas a bad numerical solution, for example one with a large timestep, will spiral away from the true solution. Two examples of such systems using the data from &#039;&#039;figures a-d&#039;&#039; are shown below.  &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure e. &#039;&#039;Phase plot of the harmonic spring data with a good numerical solution (timestep = 0.1) &lt;br /&gt;
!&#039;&#039;Figure f. &#039;&#039;Phase plot of the harmonic spring data with a bad numerical solution (timestep = 0.3) &lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory phasegood.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory badphase.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The timestep at which this data is plotted is 0.1, which results in a very small change in the energy, as seen in &#039;&#039;figure b. &#039;&#039;Increasing the time step will increase the variation in the energy. To keep the variation in the total energy of the system under 1%, the time step must be no larger than approximately 0.28. The energy varies more with increasing time step because the jumps in the algorithm  are getting larger due to less data points. The algorithm assumes these points are joined by a straight line; that the halfway point in the jump is the average between the starting and finishing point of the jump. The phase space plot will become less elliptic and the jumps eventually become so larger that the plot is no longer a continuous shape.  &lt;br /&gt;
&lt;br /&gt;
It is essential to monitor the energy of a numerically modeled system because a good solution for the motion of an atom has a constant energy and a plot in phase space of a perfect ellipse.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance and Force at Zero Potential===&lt;br /&gt;
From classical mechanics, the force calculated from the Newtonian mechanics above can be used to calculate the potential experienced by an atom in the system. They are related by the equation: &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;
This potential gives the shape and dimension of the potential surface on which the system can be modeled. A simple 1D potential that is used to describe the inter atomic forces of a liquid is the Lennard-Jones potential. It has the characteristic features of a short range repulsion potential and harmonic character around the equilibrium bond distance. The value of &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the inter atomic separation when the potential, &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;, is equal to zero, can be calculated by equating the equation for the Lennard-Jones potential to zero and solving for &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The equation for the Lennard-Jones potential: &amp;lt;math&amp;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;
Equating this to zero: &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;
And rearranging in order to separate the variables: &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;
Rearranging this gives &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in terms of &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt; r^6 = \sigma^6&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r = r_0&amp;lt;/math&amp;gt; in this case.&lt;br /&gt;
&lt;br /&gt;
This, therefore, gives the result that interatomic distance at zero potential, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, is equal to &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; in the Lennard-Jones potential is effectively the diameter of one of the particles in the system being measured; in this case, the liquid we are simulating. This is the point where the potential curve crosses the x-axis on an Energy vs interatomic distance plot. The force, &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt;, at this point on the curve corresponds to the gradient; it is found by calculating the derivative of the curve at this point. &lt;br /&gt;
&lt;br /&gt;
To calculate the force, we must differentiate the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As force is equal to the negative differential of the potential energy, the value of the force is: &amp;lt;math&amp;gt;\mathbf{F}_i = 48\epsilon \sigma^{12} r^{-13} - 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting in the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at zero potential from the calculation before: &amp;lt;math&amp;gt;\mathbf{F}_i = \frac{48\epsilon}{\sigma} - \frac{24\epsilon}{\sigma} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The gradient where the Lennard-Jones plot crosses the axis is negative; &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; in the term obtained for &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is negative and therefore the overall value of the force will be negative.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance, Force and Well Depth of the Potential at Equilibrium===&lt;br /&gt;
To calculate the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at the equilibrium position, we need to use the derivative of the potential energy curve. The equilibrium value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is the value at the minimum of the Lennard-Jones curve; when &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Therefore, equating the derivative to zero gives: &amp;lt;math&amp;gt;0 = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rearranging this: &amp;lt;math&amp;gt;48\epsilon \sigma^{12} r^{-13} = 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And simplifying and cancelling gives: &amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6&amp;lt;/math&amp;gt;. Therefore the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at equilibrium is: &amp;lt;math&amp;gt;r_{eq} = \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Physically, this result means that the equilibrium distance is 1.12 times the diameter of one of the particles; the particles have a small gap between them so do not touch. A short range repulsion potential, as seen in the Lennard-Jones curve, is a result of the particles coming into contact. &lt;br /&gt;
&lt;br /&gt;
Again, the force can be calculated from the derivative of the potential curve at the equilibrium point. As the derivative at this point is zero (a minimum on the curve), the force will therefore also be zero.&lt;br /&gt;
&lt;br /&gt;
The well-depth of the potential curve is the difference between zero potential and the potential at the equilibrium bond length. This can be calculated by substituting the value for the equilibrium bond length into the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 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;
Cancelling and simplifying this equation gives: &amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \times \frac{1}{4}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the absolute value for the well depth is &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;. The actual value of this potential is &amp;lt;math&amp;gt;-\epsilon&amp;lt;/math&amp;gt;, as the equilibrium bond length gives the most stable configuration of the molecules and therefore suggests attractive interactions are involved in the arrangement of the molecules; this attractive potential means its negative. &lt;br /&gt;
&lt;br /&gt;
===Boundary Conditions and the Lennard-Jones Cutoff===&lt;br /&gt;
When simulating a liquid, it is computationally impractical to simulate a realistic liquid. Therefore a smaller &#039;box&#039; containing &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; particles is simulated and the computer program will use &#039;&#039;periodic boundary conditions&#039;&#039; to simulate infinite repetitions of this box; when the atom reaches one edge of the box, in periodic boundary conditions, it will reappear again at the opposite edge of the box as if they were connected. For example, an atom at the position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a box of size &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;. Without periodic boundary conditions, we would assume that the atom would end up at the position &amp;lt;math&amp;gt;(1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;. However, in this box, there is no such position and so the particle must reappear at the opposite edge to where it effectively &#039;left&#039; the box. Therefore, it&#039;s ending position will be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The number of particles, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; simulated by the computer is usually between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt;. Physically, this is a very small volume. Considering water, we can calculate the number of molecules in 1 mL or 1 cm^3, a volume that would be considered small in the lab. Taking the concentration of water at standard conditions, &amp;lt;math&amp;gt;55\ mol\ dm^{-3}&amp;lt;/math&amp;gt;, we can convert it to the number of moles per mL: &amp;lt;math&amp;gt;0.055\ mol\ mL^{-1}&amp;lt;/math&amp;gt;. Multiplying this value by Avagadro&#039;s constant (&amp;lt;math&amp;gt;N_A&amp;lt;/math&amp;gt;) gives the number of molcules of water per mL: &amp;lt;math&amp;gt;3.02 \times 10^{22}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The reverse procedure can be used to compare this to the volume of 10,000 molecules: 10,000 divided by Avagadro&#039;s constant gives the number of moles of water which 10,000 molecules makes up: &amp;lt;math&amp;gt;1.66 \times 10^{-20}\ moles&amp;lt;/math&amp;gt;. Dividing this value by the concentration (from &amp;lt;math&amp;gt;n=cV&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is the number of moles, &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; is the concentration and &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume), gives the volume: &amp;lt;math&amp;gt;3.02 \times 10^{-22}\ dm&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;3.02 \times 10^{-19}\ mL&amp;lt;/math&amp;gt;. Physically, of course, this is far too small a volume to be recorded in the lab.&lt;br /&gt;
 &lt;br /&gt;
Periodic boundary conditions simulate an infinite lattice and therefore, when computing the potential, will calculate an infinite amount of pair interactions. Therefore, it is only practical to calculate the energies up to a certain interatomic distance; the Lennard-Jones cutoff distance. Beyond this point, the potential energy and the integral of the curve beyond this point become insignificant and do not impact on the overall energy; removing interactions beyond this point from the calculations will not effect the accuracy. Multiplying the Lennard-Jones potential with the radial distribution function gives a plot of the probability of finding an atom at a particular interatomic distance. The larger the interatomic distance, the lower the probability and so the energy after the cutoff can be disregarded. &lt;br /&gt;
&lt;br /&gt;
Integrating over the Lennard-Jones curve and applying this cutoff as the lower limit can show how small the integral is:&lt;br /&gt;
&lt;br /&gt;
For a general cutoff of with value &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;I = \int_{x}^\infty \phi\left(r\right)\mathrm{d}r = \int_{x}^\infty \frac{4\epsilon\sigma^{12}}{r^{12}}\mathrm{d}r - \int_{x}^\infty \frac{4\epsilon\sigma^6}{r^6}\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving this: &amp;lt;math&amp;gt;I = 4\epsilon\sigma^{12} {\frac{-1}{11r^{11}}\,\Bigg\vert\,}_x^\infty - 4\epsilon\sigma^{6} {\frac{-1}{5r^{5}}\,\Bigg\vert\,}_x^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This gives the general solution: &amp;lt;math&amp;gt;I = \frac{4\epsilon\sigma^{12}}{11x^{11}} - \frac{4\epsilon\sigma^{6}}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating this for &amp;lt;math&amp;gt;\epsilon = \sigma = 1&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;I = \frac{4}{11x^{11}} - \frac{4}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt; (or 2 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.025&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt; (or 2.5 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0082&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt; (or 3 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0033&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All values are taken to 2 significant figures. As the cutoff value for the interatomic distance gets larger, the integral gets smaller, and therefore the energy excluded from the calculation becomes smaller, and the second term in the solved integral, &amp;lt;math&amp;gt;I&amp;lt;/math&amp;gt;, dominates the energy value.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
When using the Lennard-Jones potential, it is appropriate to use reduced units for intermolecular distance, energy and temperature. Reduced units can be calculated by the following relationships:&lt;br /&gt;
&lt;br /&gt;
Intermolecular 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;
&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; are scaling factors. For example, if the parameters for Argon are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\sigma = 0.34 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt; \epsilon\ /\ k_B = 120 K&amp;lt;/math&amp;gt;&lt;br /&gt;
* Lennard-Jones cutoff &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;. The well-depth, &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;, is &amp;lt;math&amp;gt;0.999 kJ mol^{-1} \approx 1 kJ mol^{-1}&amp;lt;/math&amp;gt;. The value of &amp;lt;math&amp;gt;T* = 1.5&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;180 K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
The first aim of the simulations is to determine the most appropriate timestep to use in the vert algorithm simulations. This timestep is a balance between the accuracy of the results (the smaller the timestep, the closer to the true functing the result will be) and the length of real time over which the simluation is run (the smaller the timestep, the less real time over which the simulation will give a result). The appropriateness of the timestep will be determined by plotting how the total free energy of the simulated lattice equilibrates over time.  &lt;br /&gt;
&lt;br /&gt;
Five different calculations, which simulated the melting of a crystal and subsequent equilibration of the energy of the melted crystal, were run at five different timesteps; 0.001, 0.0025, 0.0075, 0.01 and 0.015, and were described by the NVE or &#039;&#039;&amp;quot;microcanonical ensemble&amp;quot;&#039;&#039;. An ensemble is a collection of samples of a system which are under three thermodynamic constraints (three properties are kept constant); in the microcanonical ensemble, the number of particles, the volume and the total energy is kept constant (NVE). &lt;br /&gt;
&lt;br /&gt;
These calculations simulate a box of 1000 unit cells and use periodic boundary conditions to replicate the simulation to a larger scale. Because these simulations use the numerical methods defined in the previous section, the initial position and velocity of the atoms must be defined in the input file. The Brownian (uncorrelated, random) motion of the atoms in the simulation means that there is no long range order in the system and so the atoms in a real system would start in random positions. However, assigning random starting coordinates to the atoms in a simulated liquid is not a relative process; the coordinates are generate independently of each other. Therefore there is a probability that the coordinates simulated will cause the atoms to overlap, which would give a very large repulsion potential, as seen in the Lennard-Jones potential at very small interatomic distances. This short-range repulsion potential comes from the hard-sphere model of atomic simulation.&lt;br /&gt;
&lt;br /&gt;
The input file also defines the structure and density of the lattice. The number density of lattice points in any lattice is the number of lattice points per volume of the unit cell. In a simple cubic lattice, there is one lattice point in the unit cell. From an sc lattice with lattice spacing (length of one side of the unit cell) being &amp;lt;math&amp;gt;1.07722&amp;lt;/math&amp;gt;, the number density of the lattice points is calculated by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{1}{1.07722^3} = 0.7999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a face-centered cubic lattice (fcc), there are four lattice points in the unit cell. Rearranging the above relationship, the lattice spacing can be calculated from the number of lattice points in a unit cell and number density, &amp;lt;math&amp;gt;1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Lattice\ spacing = \sqrt[3]{\frac{number\ of\ lattice\ points\ per\ unit\ cell}{number\ density}} = \sqrt[3]{\frac{4}{1.2}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation creates a box which includes 1000 unit cells, which is 10 unit cells in each dimension. For a simple cubic lattice, because there is one lattice point per unit cell, there will be 1000 atoms created as seen in the input file. The &#039;&#039;create_atom&#039;&#039; command in the input file determines how many boxes are created in the simulation and therefore how many atoms will be created. If a face centered cubic lattice is simulated, because there are 4 lattice points per unit cell, 4000 atoms will be created in the &#039;&#039;create_atom&#039;&#039; command. &lt;br /&gt;
&lt;br /&gt;
The input script also contains the following commands which defines the potential surface which is used to model the intermolecular reactions:&lt;br /&gt;
 mass 1 1.0&lt;br /&gt;
This instruction sets the mass type for the atoms being simulated. It takes the general form of “mass I value”, where mass is the keyword which tells LAMMPS what the input is, I is the atom type and value is the mass of the atom. In this case, I is defined by a specific numerical value; 1 as there is only 1 type of atom in the simulation, but it can be defined with an asterisk (1*), which means “all atom types of 1 to n inclusive”. &lt;br /&gt;
 pair_style lj/cut 3.0&lt;br /&gt;
This instruction sets the type of potential which LAMMPS uses in its calculation of pairwise interactions. It takes the general form of “pair_style style args”, where pair_style is the keyword for LAMMPS, style defines the potential and any specifications it may have, and args are the arguments required for this particular potential. In this case, the Lennard-Jones potential has been used (lj) with a cutoff point (cut) of 3σ. The cutoff point is explained in the introduction section. &lt;br /&gt;
 pair_coeff * * 1.0 1.0&lt;br /&gt;
This instruction specifies the coefficients for the pairwise interactions of each pair of atoms, and it takes the general form “pair_coeff I J args”. Pair_coeff is the keyword, I and J are the atom types, and args are the coefficients which the different atoms types take. In this case, the asterisk in place of I and J refers to all atoms types from 1 to n. The coefficients are the pairwise interactions are 1 for each atom, meaning each atom has an equal contribution to the interaction.&lt;br /&gt;
&lt;br /&gt;
In these initial calculations, the initial conditions for the numerical methods, &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. For this experiment, the verit-velocity algorithm would be the most appropriate, as both the starting position and velocity is specified for this algorithm. &lt;br /&gt;
&lt;br /&gt;
To define the timestep for the algorithm the following code is used defining the timestep as a variable instead of just giving it a definite value&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;
It is much easier to use the variable version of defining the timestep because the length of time over which the simulation is run depends on the time step. By using a variable, you can keep the length of the simulation the same, no matter the size of the timestep. It also makes it easier if multiple properties depend on the timestep – only the variable needs to be changed, not all the parts of the script where timestep is defined. &lt;br /&gt;
&lt;br /&gt;
The calculations produce the values for the total energy of the system, temperature and pressure in the output files, which can be plotted against time. How well these values equilibrate determines the appropriateness of the timestep to use in further calculations in the experiment.   &lt;br /&gt;
[[File:Rmt totalenergy plot.png|none|thumb|800x800px|&#039;&#039;Figure h. &#039;&#039;Plot of the equilibration of total energy for five different timesteps]]&lt;br /&gt;
The largest time step to give an acceptable result is 0.01. However, for any simluation we would expect energy to be independent of the timestep, something which is not true at a timestep greater than 0.0025. Therefore, the most appropriate timestep to use for a balance between accuracy and length of time which the simulation covers is 0.0025.  &lt;br /&gt;
&lt;br /&gt;
0.015 is a particularly bad choice of timestep. This is because the verit-velocity algorithm gives an approximate result to the velocity (kinetic energy term) and position (potential energy term), and so when the timestep becomes too large with respect to the time, the algorithm no longer becomes a suitable way to calculate the energy. As seen in the graph of 0.015, the energy does not equilibrate and diverges.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions ==&lt;br /&gt;
The calculations in this section are run in the isobaric-isothermal ensemble, where the number of particles in the system, the pressure and the temperature are kept constant (NpT). This means that the temperature and the pressure are recalculated in every step, so are no longer constant like they were in the NVE ensemble. From the &#039;&#039;equipartition theorem&#039;&#039;, each degree of freedom will contribute &amp;lt;math&amp;gt;\frac{1}{2} k_B T&amp;lt;/math&amp;gt; of energy to the system. As the system is in three dimensions, there are three degrees of translational freedom and so the total internal energy is equal to &amp;lt;math&amp;gt;\frac{3}{2} k_B T&amp;lt;/math&amp;gt;. Equating this to the kinetic energy, &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt;, at the end of every step and rearranging will allow calculation of the temperature after every step. &lt;br /&gt;
&lt;br /&gt;
A target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, is defined in the input script and the system will equilibrate by multiplying the velocity by a factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, in order to accommodate for the fluctuation and keep the system at approximately the target temperature and therefore constant internal energy. If the temperature of the system is greater than the target temperature, the system&#039;s kinetic energy is too high, so &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is reduced to compensate for this. The same is true for is the temperature is lower than the target temperature; &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than one in the next step to increase the kinetic energy which is now too low. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; can be derived from equating the kinetic and internal energy of the system at an arbitrary time step:&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;
Expanding the brackets inside the sum and moving the term containing &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; out of the sum: &amp;lt;math&amp;gt;\frac{\gamma^2}{2}\sum_i m_i \left(v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;, we can replace &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt; on the left hand side of the equation with &amp;lt;math&amp;gt;\frac{3}{2} N k_B T&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;\frac{3\gamma^2}{2}N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Simplifying and rearranging for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, gives: &amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The principle is the same for controlling the pressure.&lt;br /&gt;
&lt;br /&gt;
As temperature and pressure are no longer constant, he input files require specification of the pressure and the temperature for each of the systems run. 10 simulations were run at two different pressures with five different temperatures at each. &lt;br /&gt;
* Temperatures: 1.6, 1.9, 2.2, 2.5, 2.8&lt;br /&gt;
* Pressures: 2.5, 3.0&lt;br /&gt;
These pressures were chosen because the data simulated when choosing an appropriate timestep gave a pressure between 2.5 and 3.0.  &lt;br /&gt;
&lt;br /&gt;
For the code which computes the thermodynamic potentials, this particular line defines how many steps contribute towards the average of the thermodynamic parameters computed in the calculation. &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;
&#039;&#039;fix&#039;&#039; is the keyword, &#039;&#039;aves&#039;&#039; is the name of the group of fixes which in this case is the average of the thermodynamic values, &#039;&#039;all&#039;&#039; specifies the atoms which the fix is applied to which in this case is all the atoms in the simulated system and &#039;&#039;ave/time&#039;&#039; means that compute global time averages are calculated. The following three numbers have the following meaning:&lt;br /&gt;
&lt;br /&gt;
*100 = use the input values every 100 timesteps&lt;br /&gt;
*1000 = use input values 1000 times for calculating the average&lt;br /&gt;
*100000 = calculate the average every 100000 timesteps&lt;br /&gt;
&lt;br /&gt;
Therefore for the total calculation which lasts for 100000 will only have the average calculated once. Assuming 1 value every timestep, there will be 100000/100 values = 1000. The amount of time simulated is 100,000 steps, read from the following line.&lt;br /&gt;
&lt;br /&gt;
The density data from all ten calculation were plotted on the same graph, along with the density for an &amp;quot;ideal&amp;quot; gas. This density can be derived from the ideal gas law:&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;
Rearranging in terms of density: &amp;lt;math&amp;gt;\frac{N}{V} = \frac{P}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As these simulations are being run under reduced units, we can take &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt;, and so the density of the ideal gas becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the density of the ideal gas is plotted as the pressure divided by the temperature in pressure-temperature phase space.&lt;br /&gt;
[[File:Rmt dvt plot.png|none|thumb|800x800px|&#039;&#039;Figure i. &#039;&#039;Plot of the variation in density with temperature at a defined pressure for the numerically simulated and ideal systems]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that calculated in the ideal gas law. This is because for an ideal gas, an assumption is made that there are no intermolecular interactions, and therefore forces such as electron repulsion forces are ignored; repulsion forces dominate over attractive ones, as all the atoms in this simulation are the same and so partial charges or dipoles are created. This will mean that the particles move closer together than a real gas and so the density will be larger. This discrepancy between the ideal and non-ideal systems becomes larger at a higher pressure because with a higher pressure, the atoms in the system are closer together and therefore the intermolecular repulsion will become larger. This greater repulsion will in turn have a larger effect on decreasing the density.&lt;br /&gt;
&lt;br /&gt;
== Statistical Physics Calculations of the Heat Capacity ==&lt;br /&gt;
The heat capacity of a system at constant volume can be calculated from the variance in the total energy of the system. The relationship used to calculate the heat capacity is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = 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;\left\langle E^2\right\rangle&amp;lt;/math&amp;gt; is the continuous average of the total square energy at each temperature as a function of temperature. &amp;lt;math&amp;gt;\left\langle E\right\rangle^2&amp;lt;/math&amp;gt; is the continuous average of the total energy at each temperature as a function of temperature squared. The heat capacity is multiplied by &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; in this case because the version of LAMMPS calculates every energy divided by the number of molecules in the system simulated.&lt;br /&gt;
&lt;br /&gt;
The calculations in this sections are run in density-temperature phase space and the ensemble has changed to the canonical ensemble (NVT). A set of input files were written for ten calculations for, like the previous section, two pressures and five different temperatures at each pressure:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 0.2, 0.8&lt;br /&gt;
*Temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{C_V}{V}&amp;lt;/math&amp;gt; was plotted against temperature to determine the relationship in density-temperature phase space. An example of an input file can be found [[Media:nvt_-_0220.in|here]]. The lines which have been changed from the previous input files are at the end of the script:&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 &lt;br /&gt;
 thermo_style custom step etotal temp&lt;br /&gt;
 variable energy equal etotal&lt;br /&gt;
 variable energy2 equal etotal*etotal&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_energy v_energy2 v_temp&lt;br /&gt;
 run 100000&lt;br /&gt;
 &lt;br /&gt;
 variable aveenergy equal f_aves[1]&lt;br /&gt;
 variable aveenergy2 equal f_aves[2]&lt;br /&gt;
 variable avetemp equal f_aves[3]&lt;br /&gt;
 variable heatcapacitydv equal atoms*atoms*(v_aveenergy2-v_aveenergy*v_aveenergy)/(v_avetemp*v_avetemp*vol)&lt;br /&gt;
 &lt;br /&gt;
 print &amp;quot;Averages&amp;quot;&lt;br /&gt;
 print &amp;quot;--------&amp;quot;&lt;br /&gt;
 print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Heat Capacity per Volume: ${heatcapacitydv}&amp;quot;&lt;br /&gt;
The line with the keyword &#039;fix&#039; determines which thermodynamic values are averaged and over how many steps they are averaged. The next section takes these averages as variables and uses them to define the heat capacity which is calculated from the equation at the beginning of this section. Only the energy and temperature are needed to define the heat capacity and so only these values are calculated by the simulation. [[File:Rmt heatcapacitybyv.png|none|thumb|800x800px|&#039;&#039;Figure j. &#039;&#039;C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V against temperature for the two different pressures 0.2 and 0.8]]As seen in the above figure, the heat capacity decreases with temperature for both pressures. It would be expected for an ideal system that as the temperature increases, the heat capacity at constant volume increases and tends to a constant volume at very high T of 3R; R = the universal gas constant. This means increasing the temperature increases the amount of energy being stored in the system and this energy is stored as vibrational energy. However, for a Lennard-Jones liquid, the system being simulated here, the heat capacity decreases with temperature. This is because the simulation has two components to the simulation; the atoms are vibrating in a quasi-harmonic fashion around the equilibrium position and also diffuse between neighbouring equilibrium positions in a gas like fashion. As the temperature increases, the amount of diffusion increases and the vibrations decreases, therefore decreasing the ability of the system to absorb vibrational energy, resulting in the decrease in heat capacity. &amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www.nature.com/ncomms/2013/130816/ncomms3331/full/ncomms3331.html?message-global=remove&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural Properties and the Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a single atom in a system is a plot of the probability that an atom can be found at a certain distance from the central atom. The peaks in this plot can give the distance of an atom from its nearest neighbours in the Lennard-Jones simulated system. &lt;br /&gt;
&lt;br /&gt;
The calculations in this section simulate a Lennard-Jones solid, liquid and gas and, using the output of the LAMMPS trajectory file, plots both the radial distribution function and its integral using DLV. The temperature and pressure parameters for these calculations were taken from the phase diagram or coexistence curve for a Lennard-Jones system.&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt; The parameters used are displayed in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! Temperature, &amp;lt;math&amp;gt;T^*&amp;lt;/math&amp;gt;&lt;br /&gt;
! Pressure, &amp;lt;math&amp;gt;p^*&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| LJ Solid&lt;br /&gt;
| 1.5&lt;br /&gt;
| 1.2&lt;br /&gt;
|-&lt;br /&gt;
| LJ Liquid&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.8&lt;br /&gt;
|-&lt;br /&gt;
| LJ Gas&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.01&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The data obtained from the plots and the radial distribution functions and their integrals were plotted and shown in the table below.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure k. &#039;&#039;The radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
!&#039;&#039;Figure l. &#039;&#039;The integrals of the radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt fullrdfs.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt allintegralsrdf.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
[[File:Rmt Nearest neighbours.png|left|thumb|300x300px|&#039;&#039;Figure m. &#039;&#039;Representation of a cross section of the first three shells of nearest neighbours in an fcc solid. The black atom is the central atom being considered, the blue atoms are the first shell, the orange atoms the second shell and the purple atoms are the third.]]&lt;br /&gt;
The RDF of the solid gives a very irregular curve because of the irregular structure of the lattice. For a simple cubic lattice, a regular structure of the RDF would be expected because of the equal number of atoms in each of the nearest neighbour shells of the atoms. However, for face-centered cubic, the solid in this simulation, the structure is much more irregular and as the atoms move from their equilibrium position in the lattice due to vibrations, the peaks in the radial distribution will broaden. The irregular heights of the peaks are due to the varying numbers of atoms in each of the nearest neighbour shells for the central atom. The first shell gives the highest peak as it contains the most atoms; in total, considering all four surrounding unit cells, this shell contains 12 atoms and ideally takes the geometry of an icosahedron. The second shell is smaller and contains only 6 atoms in an octahedral coordination shape. The following shell again contributes 12 atoms, 3 from each unit cell. This therefore explains why the heights of the peaks in the solid plot in &#039;&#039;figure k.&#039;&#039; vary. These values can be confirmed by the plot in &#039;&#039;figure o.&#039;&#039; which is the integral; it cumulatively adds the numbers in each shell. The size of the first &amp;quot;step&amp;quot; is 12; there are 12 atoms in the first shell. The size of the second step is approximately 18; there are 18-12=6 steps in the second shell. The same theory applies for the third shell which gives a value of 13. This is slightly different to the predicted value possibly due to error in the calculation of the radial distribution function and therefore its integral. &lt;br /&gt;
&lt;br /&gt;
The RDF of the liquid has a representation of far fewer shells, which means that there are less atoms in the space close to a &amp;quot;central&amp;quot; atom in the bulk solution. The particles have more energy and therefore do not keep to a regular lattice structure. As they move about, some regualrity is maintained around each atom, but only to the extend of two or three shells, meaning there is no long range order in a Lennard-Jones liquid. &lt;br /&gt;
&lt;br /&gt;
The RDF of the gas again omits more shells as there is almost no order in a Lennard-Jones gas. The single peak on this plot considers only the set of atoms closest to the central atom and all others are disregarded as they are too far apart. &lt;br /&gt;
&lt;br /&gt;
Considering &#039;&#039;figure l.&#039;&#039;, the size of the integral of the radial distribution function decreases from solid to liquid to gas. This makes sense as the number of atoms in the surrounding shells decreases with density of the system; the atoms become further apart. &lt;br /&gt;
&lt;br /&gt;
From the plot of the radial distribution function of the solid, the lattice spacing can be determined. For this, we can consider just the first three peaks of the RDF plot. The lattice spacing refers to the length of one unit cell, and so, using &#039;&#039;figure m&#039;&#039;, we can calculate this using two different methods; a) we can use the distance between the central atom and the first shell of nearest neighbours, and use trigonometry to calculate the lattice spacing. Or alternatively b) we can use the distance between the central atom and the second nearest neighbour shell to get the lattice spacing.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure n. &#039;&#039;The radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
!&#039;&#039;Figure o. &#039;&#039;The integral of the radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt solidgr3.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt solidint3.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
Using method a) (with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; as the distance between the central atom and the nearest neighbour: Lattice spacing = &amp;lt;math&amp;gt;\frac{r}{cos({\frac{\pi}{4}})} = \frac{1.02}{cos({\frac{\pi}{4}})} \approx 1.44&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using method b): Lattice spacing &amp;lt;math&amp;gt;\approx 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can take an average between the two get an approximate value for the lattice spacing: &amp;lt;math&amp;gt;1.46 \plusmn 0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These values for distance are all in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
The ability of atoms to move around in a solid liquid or gas can be characterised by the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. In this section, we will explore two different ways to calculate the diffusion coefficient and compare the results. &lt;br /&gt;
&lt;br /&gt;
=== The Mean Squared Displacement ===&lt;br /&gt;
The diffusion coefficient can be measured easily be calculating the mean squared displacement of atoms in the solution; the diffusion coefficient is proportional to the first derivative of the mean squared displacement. By plotting the mean squared displacement as a function of time, the gradient can be taken to calculate the diffusion coefficient when its has equilibrated and become linear.&lt;br /&gt;
&lt;br /&gt;
The temperature and density parameters used were the same as in the previous section:&lt;br /&gt;
* Solid: T=1.5, D=1.2&lt;br /&gt;
* Liquid: T=1.1, D=0.8&lt;br /&gt;
* Gas: T=1.1, D=0.01&lt;br /&gt;
&lt;br /&gt;
Mean density squared calculations were run for all three Lennard-Jones phases and the data plotted as function of timestep below. The data from a simulation containing 1,000,000 atoms was plotted for comparision.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!Plots for the 8,000 atom data (&#039;&#039;figures p-r)&#039;&#039;&lt;br /&gt;
!Plots for the 1,000,000 atom data (&#039;&#039;figures s-u)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid[[File:Rmt_MSDsolid.png|frameless|700x700px]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
![[File:Rmt_MAsolid.png|frameless|700x700px]]Lennard-Jones liquid&lt;br /&gt;
|[[File:Rmt MSDliquid.png|none|thumb|700x700px]]&lt;br /&gt;
|[[File:Rmt MAliquid.png|none|thumb|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|[[File:Rmt MSDgas.png|none|thumb|700x700px]]&lt;br /&gt;
|[[File:Rmt dataplots 25894 image001.png|none|thumb|700x700px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The exact relationship between the mean squared displacement and the diffusion coefficient is:&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;
Taking the gradients of each of the curves at the point at which they become linear and dividing by six will give the diffusion coefficient for each set of data. The gradient also needs to be converted to a function of time; this is done by dividing by the timestep, which in this case is 0.002:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom data diffusion coefficients, &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
!1,000,000 atom data diffusion coefficients &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 0.9999&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|Gradient = 0.0972&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{48.6}{6} = \mathbf{8.1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient = 0.0386&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{19.6}{6} = \mathbf{3.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For both of the solid approximations, the diffusion coefficient can be approximated as zero. This is because, when equilibrated, the function has a constant value of around 0.2 for the mean squared displacement. A gradient with a value of zero means that the atoms take an infinite amount of time to change their mean squared displacement; to move away from their equilibrium position, and so this means that we can approximate in this system, there will be no diffusion. In real system, however, this is not the case; diffusion occurs but it is very slow. A plot for a real system will give a very shallow positive gradient.&lt;br /&gt;
&lt;br /&gt;
The liquid approximations are very well correlated. This is because in both cases, the mean squared displacement of particles in a liquid increases linearly with time and the gradient of both plots are almost identical. We can assume from this that identical starting conditions were used to calculate this data. Also, we can estimate that 8,000 atoms is a large enough simulation to give an accurate result for the diffusion coefficient for the Lennard-Jones liquid.&lt;br /&gt;
&lt;br /&gt;
The gas approximations are very different. This is most probably due to the fact that the density specified in calculations are different. The 8,000 data can be estimated to be a much lower density because the diffusion coefficient is faster and this means diffusion will happen faster; at a higher density a particle will take longer to diffuse over a given distance. Because of the difference in density, the two values of the diffusion coefficient cannot be qualitatively compared. The reason for the initial deviation for linearity in the gas plots is due to the momentum of the particles initially dominating over the diffusion and the diffusion coefficient is dependent on time. As the system equilibrates, the diffusion coefficient becomes constant and the plots become linear.&lt;br /&gt;
&lt;br /&gt;
=== The Velocity Autocorrelation Function ===&lt;br /&gt;
&lt;br /&gt;
Another way to calculate the diffusion coefficient is by using the velocity correlation function, which determines how the velocity of an atom changes with time. The function determines the difference in time (&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;) when the velocity becomes uncorrelated, i.e. the difference between the velocity at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; and at time &amp;lt;math&amp;gt;t+\tau&amp;lt;/math&amp;gt;. By integrating over this function, we can find the diffusion coefficient. &lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function: &amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can also be written as the integral: &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;
Using the function which defines the position of a classical harmonic oscillator, we can differentiate this to give the equation for the velocity which we can plug into the integral:&lt;br /&gt;
&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;
&amp;lt;math&amp;gt;dv{x(t)}{t} = v(t) = -A\omega sin(\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also needed for the integral:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t+\tau) = -A\omega sin(\omega(t+\tau)+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v^2(t) = A^2\omega^2 sin^2(\omega t +\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Putting all this into the integral to find the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega sin(\omega t + \phi) \times A\omega sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} A^2\omega^2 sin^2(\omega t +\tau)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A^2\omega^2&amp;lt;/math&amp;gt; can be take out of each of the integrals and cancelled. A substituion can then be made to make solving the integral much simpler:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = \omega t + \phi&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \omega\tau&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the integral becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a) \times sin(a+b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the compound angle rule &amp;lt;math&amp;gt;sin(a+b)=sin(a)cos(b)+cos(a)sin(b)&amp;lt;/math&amp;gt;, the integral can be simplified to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a)sin(a)cos(b) + sin(a)cos(a)sin(b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Separating out into two integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)\frac{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the rule &amp;lt;math&amp;gt;sin(a)cos(a) = \frac{1}{2}sin(2a)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} \frac{1}{2}(sin(2a))\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because the function &amp;lt;math&amp;gt;\frac{1}{2}sin(2a)&amp;lt;/math&amp;gt; is symmetric over all space, the second term in this equation becomes zero. Therefore, the integral simplifies to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b) = cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same calculations from the mean squared displacement section gave an output of the velocity autocorrelation function. The function for the Lennard-Jones solid, liquid and gas were plotted against the timestep along with the approximate function for the velocity autocorrelation function, &amp;lt;math&amp;gt;cos(\omega\tau)&amp;lt;/math&amp;gt;, where &lt;br /&gt;
[[File:Rmt VACF 5721 image001.png|none|thumb|800x800px|&#039;&#039;Figure t. &#039;&#039;Plots for the velocity autocorrelation function of a Lennard-Jones solid, liquid and gas]]&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated from: &amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty C\left(\tau\right)\mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the approximate value for the diffusion coefficient using the velocity autocorrelation function is &amp;lt;math&amp;gt;D = \frac{1}{3}cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The running integral of the velocity autocorrelation functions was plotted using the &#039;&#039;trapesium rule&#039;&#039;, and so the final value on the integral plot is proportional to the diffusion coefficient.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom VACF integral&lt;br /&gt;
!1,000,000 VACF integral&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=541373</id>
		<title>Rep:Mod:hakunamatata</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=541373"/>
		<updated>2016-02-25T12:36:48Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: /* The Velocity Autocorrelation Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Introduction to Molecular Dynamics Simulations ==&lt;br /&gt;
===The Classical Particle Approximation and Numerical Integration===&lt;br /&gt;
The verit and verit-velocity algorithms are numerical methods to approximate the average position and velocity respectively of randomly moving atoms in a particular medium (solid, liquid, fliud etc.). This position and velocity can be applied to Newtonian mechanics to calculate such properties as the force and potential energy of the system. The algorithms work by splitting the function into discrete time steps, calculating the values of position and velocity at this particular time step, and then effectively &amp;quot;joining the dots&amp;quot; to create an approximate function. These simulations always use the answer from the previous timestep to compute the new timestep, so initial conditions must be given for the first step. Both of the algorithms are shown below and are derived from the Taylor expansion of the position or velocity of the atoms at the timestep &amp;quot;n+1&amp;quot; or &amp;lt;math&amp;gt;t+\delta t&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit Algorithum:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{x}_i\left(t + \delta t\right) \approx 2\mathbf{x}_i\left(t\right) - \mathbf{x}_i\left(t - \delta t\right) + \frac{\mathbf{F}_i\left(t\right)}{m_i}\delta t^2  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit-Velocity Algorithum:&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i\left(t\right)&amp;lt;/math&amp;gt; is the force acting on a particular atom as a function of time&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i&amp;lt;/math&amp;gt; is the acceleration &lt;br /&gt;
&lt;br /&gt;
The smaller the timestep, the closer the numerical approximation is to the true solution function, which can be modeled as a classical harmonic oscillator. &#039;&#039;Figure a.&#039;&#039; in the table below shows the comparison between the two methods in &#039;&#039;time&#039;&#039; space. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure a. &#039;&#039;Plots of position vs time comparing the verit algorithm and harmonic spring results&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure b. &#039;&#039;Plot of the total classical energy of the system (potential + kinetic)&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory xanalytical.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory energy.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The harmonic spring position values are modeled from the harmonic oscillator or particle on a spring. The equation of &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; was used to calculate these values, where &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; are 1 and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; is zero. As seen on the plot, the curves produced from the two different methods of calculating the position are in good agreement.&lt;br /&gt;
|The potential energy is calculated using the equation U = 1/2 kx^2, with a value of k given as 1. The kinetic energy is calculated using the velcity from the verit-velocity algorithm using the equation T = 1/2 mv^2, with a value of m given as 1. The total energy of the system, E, is equal to T + U. The values for x (potential energy) and v (kinetic energy) are taken from the verity algorithm and verit-velocity algorthim respectively. &lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;Figure c. &#039;&#039;Plot of the difference (error) between the harmonic spring and verit algorithm data&lt;br /&gt;
!&#039;&#039;Figure d. &#039;&#039;Plot of the peaks in the error plot in &#039;&#039;figure c.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory error.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory errorpeaks.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The peaks in the error between the harmonic spring and verit algorithm results are at the place where the position curve crosses the time axis. This is because the harmonic spring data (x(t)) has a slightly shorter wave period than that of the verit velocity algorithm, and therefore the difference will get larger with each period of the wave, shown by the error getting larger in &#039;&#039;figure c. &#039;&#039;The period of the plot of the two methods are different because the verit algorithm is much more approximate so does not give the correct solution.&lt;br /&gt;
|The change in the error/difference between the harmonic spring data and verit algorthm data increases linearly and so therefore period of each of the plots in &#039;&#039;figure 1&#039;&#039;. must be constant. &lt;br /&gt;
|}&lt;br /&gt;
The error can also be quantified on a &#039;&#039;phase space&#039;&#039; plot; phase space is momentum or velocity plotted as a function of position. The true solution for motion of an atom is a perfect ellipse, and the more elliptic the shape (less circular) the more momentum or velocity is in the system. A numerical solution, like the verit algorithms, will produce a set of points very close to this ellipse but not perfectly following the curve. A good numerical solution will remain in an elliptical shape, whereas a bad numerical solution, for example one with a large timestep, will spiral away from the true solution. Two examples of such systems using the data from &#039;&#039;figures a-d&#039;&#039; are shown below.  &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure e. &#039;&#039;Phase plot of the harmonic spring data with a good numerical solution (timestep = 0.1) &lt;br /&gt;
!&#039;&#039;Figure f. &#039;&#039;Phase plot of the harmonic spring data with a bad numerical solution (timestep = 0.3) &lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory phasegood.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory badphase.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The timestep at which this data is plotted is 0.1, which results in a very small change in the energy, as seen in &#039;&#039;figure b. &#039;&#039;Increasing the time step will increase the variation in the energy. To keep the variation in the total energy of the system under 1%, the time step must be no larger than approximately 0.28. The energy varies more with increasing time step because the jumps in the algorithm  are getting larger due to less data points. The algorithm assumes these points are joined by a straight line; that the halfway point in the jump is the average between the starting and finishing point of the jump. The phase space plot will become less elliptic and the jumps eventually become so larger that the plot is no longer a continuous shape.  &lt;br /&gt;
&lt;br /&gt;
It is essential to monitor the energy of a numerically modeled system because a good solution for the motion of an atom has a constant energy and a plot in phase space of a perfect ellipse.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance and Force at Zero Potential===&lt;br /&gt;
From classical mechanics, the force calculated from the Newtonian mechanics above can be used to calculate the potential experienced by an atom in the system. They are related by the equation: &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;
This potential gives the shape and dimension of the potential surface on which the system can be modeled. A simple 1D potential that is used to describe the inter atomic forces of a liquid is the Lennard-Jones potential. It has the characteristic features of a short range repulsion potential and harmonic character around the equilibrium bond distance. The value of &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the inter atomic separation when the potential, &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;, is equal to zero, can be calculated by equating the equation for the Lennard-Jones potential to zero and solving for &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The equation for the Lennard-Jones potential: &amp;lt;math&amp;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;
Equating this to zero: &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;
And rearranging in order to separate the variables: &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;
Rearranging this gives &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in terms of &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt; r^6 = \sigma^6&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r = r_0&amp;lt;/math&amp;gt; in this case.&lt;br /&gt;
&lt;br /&gt;
This, therefore, gives the result that interatomic distance at zero potential, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, is equal to &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; in the Lennard-Jones potential is effectively the diameter of one of the particles in the system being measured; in this case, the liquid we are simulating. This is the point where the potential curve crosses the x-axis on an Energy vs interatomic distance plot. The force, &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt;, at this point on the curve corresponds to the gradient; it is found by calculating the derivative of the curve at this point. &lt;br /&gt;
&lt;br /&gt;
To calculate the force, we must differentiate the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As force is equal to the negative differential of the potential energy, the value of the force is: &amp;lt;math&amp;gt;\mathbf{F}_i = 48\epsilon \sigma^{12} r^{-13} - 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting in the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at zero potential from the calculation before: &amp;lt;math&amp;gt;\mathbf{F}_i = \frac{48\epsilon}{\sigma} - \frac{24\epsilon}{\sigma} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The gradient where the Lennard-Jones plot crosses the axis is negative; &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; in the term obtained for &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is negative and therefore the overall value of the force will be negative.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance, Force and Well Depth of the Potential at Equilibrium===&lt;br /&gt;
To calculate the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at the equilibrium position, we need to use the derivative of the potential energy curve. The equilibrium value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is the value at the minimum of the Lennard-Jones curve; when &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Therefore, equating the derivative to zero gives: &amp;lt;math&amp;gt;0 = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rearranging this: &amp;lt;math&amp;gt;48\epsilon \sigma^{12} r^{-13} = 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And simplifying and cancelling gives: &amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6&amp;lt;/math&amp;gt;. Therefore the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at equilibrium is: &amp;lt;math&amp;gt;r_{eq} = \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Physically, this result means that the equilibrium distance is 1.12 times the diameter of one of the particles; the particles have a small gap between them so do not touch. A short range repulsion potential, as seen in the Lennard-Jones curve, is a result of the particles coming into contact. &lt;br /&gt;
&lt;br /&gt;
Again, the force can be calculated from the derivative of the potential curve at the equilibrium point. As the derivative at this point is zero (a minimum on the curve), the force will therefore also be zero.&lt;br /&gt;
&lt;br /&gt;
The well-depth of the potential curve is the difference between zero potential and the potential at the equilibrium bond length. This can be calculated by substituting the value for the equilibrium bond length into the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 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;
Cancelling and simplifying this equation gives: &amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \times \frac{1}{4}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the absolute value for the well depth is &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;. The actual value of this potential is &amp;lt;math&amp;gt;-\epsilon&amp;lt;/math&amp;gt;, as the equilibrium bond length gives the most stable configuration of the molecules and therefore suggests attractive interactions are involved in the arrangement of the molecules; this attractive potential means its negative. &lt;br /&gt;
&lt;br /&gt;
===Boundary Conditions and the Lennard-Jones Cutoff===&lt;br /&gt;
When simulating a liquid, it is computationally impractical to simulate a realistic liquid. Therefore a smaller &#039;box&#039; containing &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; particles is simulated and the computer program will use &#039;&#039;periodic boundary conditions&#039;&#039; to simulate infinite repetitions of this box; when the atom reaches one edge of the box, in periodic boundary conditions, it will reappear again at the opposite edge of the box as if they were connected. For example, an atom at the position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a box of size &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;. Without periodic boundary conditions, we would assume that the atom would end up at the position &amp;lt;math&amp;gt;(1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;. However, in this box, there is no such position and so the particle must reappear at the opposite edge to where it effectively &#039;left&#039; the box. Therefore, it&#039;s ending position will be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The number of particles, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; simulated by the computer is usually between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt;. Physically, this is a very small volume. Considering water, we can calculate the number of molecules in 1 mL or 1 cm^3, a volume that would be considered small in the lab. Taking the concentration of water at standard conditions, &amp;lt;math&amp;gt;55\ mol\ dm^{-3}&amp;lt;/math&amp;gt;, we can convert it to the number of moles per mL: &amp;lt;math&amp;gt;0.055\ mol\ mL^{-1}&amp;lt;/math&amp;gt;. Multiplying this value by Avagadro&#039;s constant (&amp;lt;math&amp;gt;N_A&amp;lt;/math&amp;gt;) gives the number of molcules of water per mL: &amp;lt;math&amp;gt;3.02 \times 10^{22}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The reverse procedure can be used to compare this to the volume of 10,000 molecules: 10,000 divided by Avagadro&#039;s constant gives the number of moles of water which 10,000 molecules makes up: &amp;lt;math&amp;gt;1.66 \times 10^{-20}\ moles&amp;lt;/math&amp;gt;. Dividing this value by the concentration (from &amp;lt;math&amp;gt;n=cV&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is the number of moles, &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; is the concentration and &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume), gives the volume: &amp;lt;math&amp;gt;3.02 \times 10^{-22}\ dm&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;3.02 \times 10^{-19}\ mL&amp;lt;/math&amp;gt;. Physically, of course, this is far too small a volume to be recorded in the lab.&lt;br /&gt;
 &lt;br /&gt;
Periodic boundary conditions simulate an infinite lattice and therefore, when computing the potential, will calculate an infinite amount of pair interactions. Therefore, it is only practical to calculate the energies up to a certain interatomic distance; the Lennard-Jones cutoff distance. Beyond this point, the potential energy and the integral of the curve beyond this point become insignificant and do not impact on the overall energy; removing interactions beyond this point from the calculations will not effect the accuracy. Multiplying the Lennard-Jones potential with the radial distribution function gives a plot of the probability of finding an atom at a particular interatomic distance. The larger the interatomic distance, the lower the probability and so the energy after the cutoff can be disregarded. &lt;br /&gt;
&lt;br /&gt;
Integrating over the Lennard-Jones curve and applying this cutoff as the lower limit can show how small the integral is:&lt;br /&gt;
&lt;br /&gt;
For a general cutoff of with value &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;I = \int_{x}^\infty \phi\left(r\right)\mathrm{d}r = \int_{x}^\infty \frac{4\epsilon\sigma^{12}}{r^{12}}\mathrm{d}r - \int_{x}^\infty \frac{4\epsilon\sigma^6}{r^6}\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving this: &amp;lt;math&amp;gt;I = 4\epsilon\sigma^{12} {\frac{-1}{11r^{11}}\,\Bigg\vert\,}_x^\infty - 4\epsilon\sigma^{6} {\frac{-1}{5r^{5}}\,\Bigg\vert\,}_x^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This gives the general solution: &amp;lt;math&amp;gt;I = \frac{4\epsilon\sigma^{12}}{11x^{11}} - \frac{4\epsilon\sigma^{6}}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating this for &amp;lt;math&amp;gt;\epsilon = \sigma = 1&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;I = \frac{4}{11x^{11}} - \frac{4}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt; (or 2 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.025&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt; (or 2.5 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0082&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt; (or 3 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0033&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All values are taken to 2 significant figures. As the cutoff value for the interatomic distance gets larger, the integral gets smaller, and therefore the energy excluded from the calculation becomes smaller, and the second term in the solved integral, &amp;lt;math&amp;gt;I&amp;lt;/math&amp;gt;, dominates the energy value.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
When using the Lennard-Jones potential, it is appropriate to use reduced units for intermolecular distance, energy and temperature. Reduced units can be calculated by the following relationships:&lt;br /&gt;
&lt;br /&gt;
Intermolecular 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;
&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; are scaling factors. For example, if the parameters for Argon are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\sigma = 0.34 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt; \epsilon\ /\ k_B = 120 K&amp;lt;/math&amp;gt;&lt;br /&gt;
* Lennard-Jones cutoff &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;. The well-depth, &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;, is &amp;lt;math&amp;gt;0.999 kJ mol^{-1} \approx 1 kJ mol^{-1}&amp;lt;/math&amp;gt;. The value of &amp;lt;math&amp;gt;T* = 1.5&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;180 K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
The first aim of the simulations is to determine the most appropriate timestep to use in the vert algorithm simulations. This timestep is a balance between the accuracy of the results (the smaller the timestep, the closer to the true functing the result will be) and the length of real time over which the simluation is run (the smaller the timestep, the less real time over which the simulation will give a result). The appropriateness of the timestep will be determined by plotting how the total free energy of the simulated lattice equilibrates over time.  &lt;br /&gt;
&lt;br /&gt;
Five different calculations, which simulated the melting of a crystal and subsequent equilibration of the energy of the melted crystal, were run at five different timesteps; 0.001, 0.0025, 0.0075, 0.01 and 0.015, and were described by the NVE or &#039;&#039;&amp;quot;microcanonical ensemble&amp;quot;&#039;&#039;. An ensemble is a collection of samples of a system which are under three thermodynamic constraints (three properties are kept constant); in the microcanonical ensemble, the number of particles, the volume and the total energy is kept constant (NVE). &lt;br /&gt;
&lt;br /&gt;
These calculations simulate a box of 1000 unit cells and use periodic boundary conditions to replicate the simulation to a larger scale. Because these simulations use the numerical methods defined in the previous section, the initial position and velocity of the atoms must be defined in the input file. The Brownian (uncorrelated, random) motion of the atoms in the simulation means that there is no long range order in the system and so the atoms in a real system would start in random positions. However, assigning random starting coordinates to the atoms in a simulated liquid is not a relative process; the coordinates are generate independently of each other. Therefore there is a probability that the coordinates simulated will cause the atoms to overlap, which would give a very large repulsion potential, as seen in the Lennard-Jones potential at very small interatomic distances. This short-range repulsion potential comes from the hard-sphere model of atomic simulation.&lt;br /&gt;
&lt;br /&gt;
The input file also defines the structure and density of the lattice. The number density of lattice points in any lattice is the number of lattice points per volume of the unit cell. In a simple cubic lattice, there is one lattice point in the unit cell. From an sc lattice with lattice spacing (length of one side of the unit cell) being &amp;lt;math&amp;gt;1.07722&amp;lt;/math&amp;gt;, the number density of the lattice points is calculated by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{1}{1.07722^3} = 0.7999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a face-centered cubic lattice (fcc), there are four lattice points in the unit cell. Rearranging the above relationship, the lattice spacing can be calculated from the number of lattice points in a unit cell and number density, &amp;lt;math&amp;gt;1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Lattice\ spacing = \sqrt[3]{\frac{number\ of\ lattice\ points\ per\ unit\ cell}{number\ density}} = \sqrt[3]{\frac{4}{1.2}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation creates a box which includes 1000 unit cells, which is 10 unit cells in each dimension. For a simple cubic lattice, because there is one lattice point per unit cell, there will be 1000 atoms created as seen in the input file. The &#039;&#039;create_atom&#039;&#039; command in the input file determines how many boxes are created in the simulation and therefore how many atoms will be created. If a face centered cubic lattice is simulated, because there are 4 lattice points per unit cell, 4000 atoms will be created in the &#039;&#039;create_atom&#039;&#039; command. &lt;br /&gt;
&lt;br /&gt;
The input script also contains the following commands which defines the potential surface which is used to model the intermolecular reactions:&lt;br /&gt;
 mass 1 1.0&lt;br /&gt;
This instruction sets the mass type for the atoms being simulated. It takes the general form of “mass I value”, where mass is the keyword which tells LAMMPS what the input is, I is the atom type and value is the mass of the atom. In this case, I is defined by a specific numerical value; 1 as there is only 1 type of atom in the simulation, but it can be defined with an asterisk (1*), which means “all atom types of 1 to n inclusive”. &lt;br /&gt;
 pair_style lj/cut 3.0&lt;br /&gt;
This instruction sets the type of potential which LAMMPS uses in its calculation of pairwise interactions. It takes the general form of “pair_style style args”, where pair_style is the keyword for LAMMPS, style defines the potential and any specifications it may have, and args are the arguments required for this particular potential. In this case, the Lennard-Jones potential has been used (lj) with a cutoff point (cut) of 3σ. The cutoff point is explained in the introduction section. &lt;br /&gt;
 pair_coeff * * 1.0 1.0&lt;br /&gt;
This instruction specifies the coefficients for the pairwise interactions of each pair of atoms, and it takes the general form “pair_coeff I J args”. Pair_coeff is the keyword, I and J are the atom types, and args are the coefficients which the different atoms types take. In this case, the asterisk in place of I and J refers to all atoms types from 1 to n. The coefficients are the pairwise interactions are 1 for each atom, meaning each atom has an equal contribution to the interaction.&lt;br /&gt;
&lt;br /&gt;
In these initial calculations, the initial conditions for the numerical methods, &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. For this experiment, the verit-velocity algorithm would be the most appropriate, as both the starting position and velocity is specified for this algorithm. &lt;br /&gt;
&lt;br /&gt;
To define the timestep for the algorithm the following code is used defining the timestep as a variable instead of just giving it a definite value&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;
It is much easier to use the variable version of defining the timestep because the length of time over which the simulation is run depends on the time step. By using a variable, you can keep the length of the simulation the same, no matter the size of the timestep. It also makes it easier if multiple properties depend on the timestep – only the variable needs to be changed, not all the parts of the script where timestep is defined. &lt;br /&gt;
&lt;br /&gt;
The calculations produce the values for the total energy of the system, temperature and pressure in the output files, which can be plotted against time. How well these values equilibrate determines the appropriateness of the timestep to use in further calculations in the experiment.   &lt;br /&gt;
[[File:Rmt totalenergy plot.png|none|thumb|800x800px|&#039;&#039;Figure h. &#039;&#039;Plot of the equilibration of total energy for five different timesteps]]&lt;br /&gt;
The largest time step to give an acceptable result is 0.01. However, for any simluation we would expect energy to be independent of the timestep, something which is not true at a timestep greater than 0.0025. Therefore, the most appropriate timestep to use for a balance between accuracy and length of time which the simulation covers is 0.0025.  &lt;br /&gt;
&lt;br /&gt;
0.015 is a particularly bad choice of timestep. This is because the verit-velocity algorithm gives an approximate result to the velocity (kinetic energy term) and position (potential energy term), and so when the timestep becomes too large with respect to the time, the algorithm no longer becomes a suitable way to calculate the energy. As seen in the graph of 0.015, the energy does not equilibrate and diverges.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions ==&lt;br /&gt;
The calculations in this section are run in the isobaric-isothermal ensemble, where the number of particles in the system, the pressure and the temperature are kept constant (NpT). This means that the temperature and the pressure are recalculated in every step, so are no longer constant like they were in the NVE ensemble. From the &#039;&#039;equipartition theorem&#039;&#039;, each degree of freedom will contribute &amp;lt;math&amp;gt;\frac{1}{2} k_B T&amp;lt;/math&amp;gt; of energy to the system. As the system is in three dimensions, there are three degrees of translational freedom and so the total internal energy is equal to &amp;lt;math&amp;gt;\frac{3}{2} k_B T&amp;lt;/math&amp;gt;. Equating this to the kinetic energy, &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt;, at the end of every step and rearranging will allow calculation of the temperature after every step. &lt;br /&gt;
&lt;br /&gt;
A target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, is defined in the input script and the system will equilibrate by multiplying the velocity by a factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, in order to accommodate for the fluctuation and keep the system at approximately the target temperature and therefore constant internal energy. If the temperature of the system is greater than the target temperature, the system&#039;s kinetic energy is too high, so &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is reduced to compensate for this. The same is true for is the temperature is lower than the target temperature; &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than one in the next step to increase the kinetic energy which is now too low. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; can be derived from equating the kinetic and internal energy of the system at an arbitrary time step:&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;
Expanding the brackets inside the sum and moving the term containing &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; out of the sum: &amp;lt;math&amp;gt;\frac{\gamma^2}{2}\sum_i m_i \left(v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;, we can replace &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt; on the left hand side of the equation with &amp;lt;math&amp;gt;\frac{3}{2} N k_B T&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;\frac{3\gamma^2}{2}N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Simplifying and rearranging for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, gives: &amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The principle is the same for controlling the pressure.&lt;br /&gt;
&lt;br /&gt;
As temperature and pressure are no longer constant, he input files require specification of the pressure and the temperature for each of the systems run. 10 simulations were run at two different pressures with five different temperatures at each. &lt;br /&gt;
* Temperatures: 1.6, 1.9, 2.2, 2.5, 2.8&lt;br /&gt;
* Pressures: 2.5, 3.0&lt;br /&gt;
These pressures were chosen because the data simulated when choosing an appropriate timestep gave a pressure between 2.5 and 3.0.  &lt;br /&gt;
&lt;br /&gt;
For the code which computes the thermodynamic potentials, this particular line defines how many steps contribute towards the average of the thermodynamic parameters computed in the calculation. &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;
&#039;&#039;fix&#039;&#039; is the keyword, &#039;&#039;aves&#039;&#039; is the name of the group of fixes which in this case is the average of the thermodynamic values, &#039;&#039;all&#039;&#039; specifies the atoms which the fix is applied to which in this case is all the atoms in the simulated system and &#039;&#039;ave/time&#039;&#039; means that compute global time averages are calculated. The following three numbers have the following meaning:&lt;br /&gt;
&lt;br /&gt;
*100 = use the input values every 100 timesteps&lt;br /&gt;
*1000 = use input values 1000 times for calculating the average&lt;br /&gt;
*100000 = calculate the average every 100000 timesteps&lt;br /&gt;
&lt;br /&gt;
Therefore for the total calculation which lasts for 100000 will only have the average calculated once. Assuming 1 value every timestep, there will be 100000/100 values = 1000. The amount of time simulated is 100,000 steps, read from the following line.&lt;br /&gt;
&lt;br /&gt;
The density data from all ten calculation were plotted on the same graph, along with the density for an &amp;quot;ideal&amp;quot; gas. This density can be derived from the ideal gas law:&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;
Rearranging in terms of density: &amp;lt;math&amp;gt;\frac{N}{V} = \frac{P}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As these simulations are being run under reduced units, we can take &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt;, and so the density of the ideal gas becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the density of the ideal gas is plotted as the pressure divided by the temperature in pressure-temperature phase space.&lt;br /&gt;
[[File:Rmt dvt plot.png|none|thumb|800x800px|&#039;&#039;Figure i. &#039;&#039;Plot of the variation in density with temperature at a defined pressure for the numerically simulated and ideal systems]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that calculated in the ideal gas law. This is because for an ideal gas, an assumption is made that there are no intermolecular interactions, and therefore forces such as electron repulsion forces are ignored; repulsion forces dominate over attractive ones, as all the atoms in this simulation are the same and so partial charges or dipoles are created. This will mean that the particles move closer together than a real gas and so the density will be larger. This discrepancy between the ideal and non-ideal systems becomes larger at a higher pressure because with a higher pressure, the atoms in the system are closer together and therefore the intermolecular repulsion will become larger. This greater repulsion will in turn have a larger effect on decreasing the density.&lt;br /&gt;
&lt;br /&gt;
== Statistical Physics Calculations of the Heat Capacity ==&lt;br /&gt;
The heat capacity of a system at constant volume can be calculated from the variance in the total energy of the system. The relationship used to calculate the heat capacity is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = 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;\left\langle E^2\right\rangle&amp;lt;/math&amp;gt; is the continuous average of the total square energy at each temperature as a function of temperature. &amp;lt;math&amp;gt;\left\langle E\right\rangle^2&amp;lt;/math&amp;gt; is the continuous average of the total energy at each temperature as a function of temperature squared. The heat capacity is multiplied by &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; in this case because the version of LAMMPS calculates every energy divided by the number of molecules in the system simulated.&lt;br /&gt;
&lt;br /&gt;
The calculations in this sections are run in density-temperature phase space and the ensemble has changed to the canonical ensemble (NVT). A set of input files were written for ten calculations for, like the previous section, two pressures and five different temperatures at each pressure:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 0.2, 0.8&lt;br /&gt;
*Temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{C_V}{V}&amp;lt;/math&amp;gt; was plotted against temperature to determine the relationship in density-temperature phase space. An example of an input file can be found [[Media:nvt_-_0220.in|here]]. The lines which have been changed from the previous input files are at the end of the script:&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 &lt;br /&gt;
 thermo_style custom step etotal temp&lt;br /&gt;
 variable energy equal etotal&lt;br /&gt;
 variable energy2 equal etotal*etotal&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_energy v_energy2 v_temp&lt;br /&gt;
 run 100000&lt;br /&gt;
 &lt;br /&gt;
 variable aveenergy equal f_aves[1]&lt;br /&gt;
 variable aveenergy2 equal f_aves[2]&lt;br /&gt;
 variable avetemp equal f_aves[3]&lt;br /&gt;
 variable heatcapacitydv equal atoms*atoms*(v_aveenergy2-v_aveenergy*v_aveenergy)/(v_avetemp*v_avetemp*vol)&lt;br /&gt;
 &lt;br /&gt;
 print &amp;quot;Averages&amp;quot;&lt;br /&gt;
 print &amp;quot;--------&amp;quot;&lt;br /&gt;
 print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Heat Capacity per Volume: ${heatcapacitydv}&amp;quot;&lt;br /&gt;
The line with the keyword &#039;fix&#039; determines which thermodynamic values are averaged and over how many steps they are averaged. The next section takes these averages as variables and uses them to define the heat capacity which is calculated from the equation at the beginning of this section. Only the energy and temperature are needed to define the heat capacity and so only these values are calculated by the simulation. [[File:Rmt heatcapacitybyv.png|none|thumb|800x800px|&#039;&#039;Figure j. &#039;&#039;C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V against temperature for the two different pressures 0.2 and 0.8]]As seen in the above figure, the heat capacity decreases with temperature for both pressures. It would be expected for an ideal system that as the temperature increases, the heat capacity at constant volume increases and tends to a constant volume at very high T of 3R; R = the universal gas constant. This means increasing the temperature increases the amount of energy being stored in the system and this energy is stored as vibrational energy. However, for a Lennard-Jones liquid, the system being simulated here, the heat capacity decreases with temperature. This is because the simulation has two components to the simulation; the atoms are vibrating in a quasi-harmonic fashion around the equilibrium position and also diffuse between neighbouring equilibrium positions in a gas like fashion. As the temperature increases, the amount of diffusion increases and the vibrations decreases, therefore decreasing the ability of the system to absorb vibrational energy, resulting in the decrease in heat capacity. &amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www.nature.com/ncomms/2013/130816/ncomms3331/full/ncomms3331.html?message-global=remove&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural Properties and the Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a single atom in a system is a plot of the probability that an atom can be found at a certain distance from the central atom. The peaks in this plot can give the distance of an atom from its nearest neighbours in the Lennard-Jones simulated system. &lt;br /&gt;
&lt;br /&gt;
The calculations in this section simulate a Lennard-Jones solid, liquid and gas and, using the output of the LAMMPS trajectory file, plots both the radial distribution function and its integral using DLV. The temperature and pressure parameters for these calculations were taken from the phase diagram or coexistence curve for a Lennard-Jones system.&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt; The parameters used are displayed in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! Temperature, &amp;lt;math&amp;gt;T^*&amp;lt;/math&amp;gt;&lt;br /&gt;
! Pressure, &amp;lt;math&amp;gt;p^*&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| LJ Solid&lt;br /&gt;
| 1.5&lt;br /&gt;
| 1.2&lt;br /&gt;
|-&lt;br /&gt;
| LJ Liquid&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.8&lt;br /&gt;
|-&lt;br /&gt;
| LJ Gas&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.01&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The data obtained from the plots and the radial distribution functions and their integrals were plotted and shown in the table below.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure k. &#039;&#039;The radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
!&#039;&#039;Figure l. &#039;&#039;The integrals of the radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt fullrdfs.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt allintegralsrdf.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
[[File:Rmt Nearest neighbours.png|left|thumb|300x300px|&#039;&#039;Figure m. &#039;&#039;Representation of a cross section of the first three shells of nearest neighbours in an fcc solid. The black atom is the central atom being considered, the blue atoms are the first shell, the orange atoms the second shell and the purple atoms are the third.]]&lt;br /&gt;
The RDF of the solid gives a very irregular curve because of the irregular structure of the lattice. For a simple cubic lattice, a regular structure of the RDF would be expected because of the equal number of atoms in each of the nearest neighbour shells of the atoms. However, for face-centered cubic, the solid in this simulation, the structure is much more irregular and as the atoms move from their equilibrium position in the lattice due to vibrations, the peaks in the radial distribution will broaden. The irregular heights of the peaks are due to the varying numbers of atoms in each of the nearest neighbour shells for the central atom. The first shell gives the highest peak as it contains the most atoms; in total, considering all four surrounding unit cells, this shell contains 12 atoms and ideally takes the geometry of an icosahedron. The second shell is smaller and contains only 6 atoms in an octahedral coordination shape. The following shell again contributes 12 atoms, 3 from each unit cell. This therefore explains why the heights of the peaks in the solid plot in &#039;&#039;figure k.&#039;&#039; vary. These values can be confirmed by the plot in &#039;&#039;figure o.&#039;&#039; which is the integral; it cumulatively adds the numbers in each shell. The size of the first &amp;quot;step&amp;quot; is 12; there are 12 atoms in the first shell. The size of the second step is approximately 18; there are 18-12=6 steps in the second shell. The same theory applies for the third shell which gives a value of 13. This is slightly different to the predicted value possibly due to error in the calculation of the radial distribution function and therefore its integral. &lt;br /&gt;
&lt;br /&gt;
The RDF of the liquid has a representation of far fewer shells, which means that there are less atoms in the space close to a &amp;quot;central&amp;quot; atom in the bulk solution. The particles have more energy and therefore do not keep to a regular lattice structure. As they move about, some regualrity is maintained around each atom, but only to the extend of two or three shells, meaning there is no long range order in a Lennard-Jones liquid. &lt;br /&gt;
&lt;br /&gt;
The RDF of the gas again omits more shells as there is almost no order in a Lennard-Jones gas. The single peak on this plot considers only the set of atoms closest to the central atom and all others are disregarded as they are too far apart. &lt;br /&gt;
&lt;br /&gt;
Considering &#039;&#039;figure l.&#039;&#039;, the size of the integral of the radial distribution function decreases from solid to liquid to gas. This makes sense as the number of atoms in the surrounding shells decreases with density of the system; the atoms become further apart. &lt;br /&gt;
&lt;br /&gt;
From the plot of the radial distribution function of the solid, the lattice spacing can be determined. For this, we can consider just the first three peaks of the RDF plot. The lattice spacing refers to the length of one unit cell, and so, using &#039;&#039;figure m&#039;&#039;, we can calculate this using two different methods; a) we can use the distance between the central atom and the first shell of nearest neighbours, and use trigonometry to calculate the lattice spacing. Or alternatively b) we can use the distance between the central atom and the second nearest neighbour shell to get the lattice spacing.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure n. &#039;&#039;The radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
!&#039;&#039;Figure o. &#039;&#039;The integral of the radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt solidgr3.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt solidint3.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
Using method a) (with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; as the distance between the central atom and the nearest neighbour: Lattice spacing = &amp;lt;math&amp;gt;\frac{r}{cos({\frac{\pi}{4}})} = \frac{1.02}{cos({\frac{\pi}{4}})} \approx 1.44&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using method b): Lattice spacing &amp;lt;math&amp;gt;\approx 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can take an average between the two get an approximate value for the lattice spacing: &amp;lt;math&amp;gt;1.46 \plusmn 0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These values for distance are all in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
The ability of atoms to move around in a solid liquid or gas can be characterised by the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. In this section, we will explore two different ways to calculate the diffusion coefficient and compare the results. &lt;br /&gt;
&lt;br /&gt;
=== The Mean Squared Displacement ===&lt;br /&gt;
The diffusion coefficient can be measured easily be calculating the mean squared displacement of atoms in the solution; the diffusion coefficient is proportional to the first derivative of the mean squared displacement. By plotting the mean squared displacement as a function of time, the gradient can be taken to calculate the diffusion coefficient when its has equilibrated and become linear.&lt;br /&gt;
&lt;br /&gt;
The temperature and density parameters used were the same as in the previous section:&lt;br /&gt;
* Solid: T=1.5, D=1.2&lt;br /&gt;
* Liquid: T=1.1, D=0.8&lt;br /&gt;
* Gas: T=1.1, D=0.01&lt;br /&gt;
&lt;br /&gt;
Mean density squared calculations were run for all three Lennard-Jones phases and the data plotted as function of timestep below. The data from a simulation containing 1,000,000 atoms was plotted for comparision.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!Plots for the 8,000 atom data&lt;br /&gt;
!Plots for the 1,000,000 atom data&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|[[File:Rmt MSDsolid.png|none|thumb|700x700px]]&lt;br /&gt;
|[[File:Rmt MAsolid.png|none|thumb|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|[[File:Rmt MSDliquid.png|none|thumb|700x700px]]&lt;br /&gt;
|[[File:Rmt MAliquid.png|none|thumb|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|[[File:Rmt MSDgas.png|none|thumb|700x700px]]&lt;br /&gt;
|[[File:Rmt dataplots 25894 image001.png|none|thumb|700x700px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The exact relationship between the mean squared displacement and the diffusion coefficient is:&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;
Taking the gradients of each of the curves at the point at which they become linear and dividing by six will give the diffusion coefficient for each set of data. The gradient also needs to be converted to a function of time; this is done by dividing by the timestep, which in this case is 0.002:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom data diffusion coefficients, &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
!1,000,000 atom data diffusion coefficients &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 0.9999&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|Gradient = 0.0972&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{48.6}{6} = \mathbf{8.1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient = 0.0386&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{19.6}{6} = \mathbf{3.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For both of the solid approximations, the diffusion coefficient can be approximated as zero. This is because, when equilibrated, the function has a constant value of around 0.2 for the mean squared displacement. A gradient with a value of zero means that the atoms take an infinite amount of time to change their mean squared displacement; to move away from their equilibrium position, and so this means that we can approximate in this system, there will be no diffusion. In real system, however, this is not the case; diffusion occurs but it is very slow. A plot for a real system will give a very shallow positive gradient.&lt;br /&gt;
&lt;br /&gt;
The liquid approximations are very well correlated. This is because in both cases, the mean squared displacement of particles in a liquid increases linearly with time and the gradient of both plots are almost identical. We can assume from this that identical starting conditions were used to calculate this data. Also, we can estimate that 8,000 atoms is a large enough simulation to give an accurate result for the diffusion coefficient for the Lennard-Jones liquid.&lt;br /&gt;
&lt;br /&gt;
The gas approximations are very different. This is most probably due to the fact that the density specified in calculations are different. The 8,000 data can be estimated to be a much lower density because the diffusion coefficient is faster and this means diffusion will happen faster; at a higher density a particle will take longer to diffuse over a given distance. Because of the difference in density, the two values of the diffusion coefficient cannot be qualitatively compared. The reason for the initial deviation for linearity in the gas plots is due to the momentum of the particles initially dominating over the diffusion and the diffusion coefficient is dependent on time. As the system equilibrates, the diffusion coefficient becomes constant and the plots become linear.&lt;br /&gt;
&lt;br /&gt;
=== The Velocity Autocorrelation Function ===&lt;br /&gt;
&lt;br /&gt;
Another way to calculate the diffusion coefficient is by using the velocity correlation function, which determines how the velocity of an atom changes with time. The function determines the difference in time (&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;) when the velocity becomes uncorrelated, i.e. the difference between the velocity at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; and at time &amp;lt;math&amp;gt;t+\tau&amp;lt;/math&amp;gt;. By integrating over this function, we can find the diffusion coefficient. &lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function: &amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can also be written as the integral: &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;
Using the function which defines the position of a classical harmonic oscillator, we can differentiate this to give the equation for the velocity which we can plug into the integral:&lt;br /&gt;
&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;
&amp;lt;math&amp;gt;dv{x(t)}{t} = v(t) = -A\omega sin(\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also needed for the integral:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t+\tau) = -A\omega sin(\omega(t+\tau)+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v^2(t) = A^2\omega^2 sin^2(\omega t +\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Putting all this into the integral to find the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega sin(\omega t + \phi) \times A\omega sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} A^2\omega^2 sin^2(\omega t +\tau)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A^2\omega^2&amp;lt;/math&amp;gt; can be take out of each of the integrals and cancelled. A substituion can then be made to make solving the integral much simpler:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = \omega t + \phi&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \omega\tau&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the integral becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a) \times sin(a+b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the compound angle rule &amp;lt;math&amp;gt;sin(a+b)=sin(a)cos(b)+cos(a)sin(b)&amp;lt;/math&amp;gt;, the integral can be simplified to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a)sin(a)cos(b) + sin(a)cos(a)sin(b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Separating out into two integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)\frac{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the rule &amp;lt;math&amp;gt;sin(a)cos(a) = \frac{1}{2}sin(2a)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} \frac{1}{2}(sin(2a))\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because the function &amp;lt;math&amp;gt;\frac{1}{2}sin(2a)&amp;lt;/math&amp;gt; is symmetric over all space, the second term in this equation becomes zero. Therefore, the integral simplifies to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b) = cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same calculations from the mean squared displacement section gave an output of the velocity autocorrelation function. The function for the Lennard-Jones solid, liquid and gas were plotted against the timestep along with the approximate function for the velocity autocorrelation function, &amp;lt;math&amp;gt;cos(\omega\tau)&amp;lt;/math&amp;gt;, where &lt;br /&gt;
[[File:Rmt VACF 5721 image001.png|none|thumb|800x800px|&#039;&#039;Figure t. &#039;&#039;Plots for the velocity autocorrelation function of a Lennard-Jones solid, liquid and gas]]&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated from: &amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty C\left(\tau\right)\mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the approximate value for the diffusion coefficient using the velocity autocorrelation function is &amp;lt;math&amp;gt;D = \frac{1}{3}cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The running integral of the velocity autocorrelation functions was plotted using the &#039;&#039;trapesium rule&#039;&#039;, and so the final value on the integral plot is proportional to the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=541360</id>
		<title>Rep:Mod:hakunamatata</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=541360"/>
		<updated>2016-02-25T12:29:03Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: /* The Velocity Autocorrelation Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Introduction to Molecular Dynamics Simulations ==&lt;br /&gt;
===The Classical Particle Approximation and Numerical Integration===&lt;br /&gt;
The verit and verit-velocity algorithms are numerical methods to approximate the average position and velocity respectively of randomly moving atoms in a particular medium (solid, liquid, fliud etc.). This position and velocity can be applied to Newtonian mechanics to calculate such properties as the force and potential energy of the system. The algorithms work by splitting the function into discrete time steps, calculating the values of position and velocity at this particular time step, and then effectively &amp;quot;joining the dots&amp;quot; to create an approximate function. These simulations always use the answer from the previous timestep to compute the new timestep, so initial conditions must be given for the first step. Both of the algorithms are shown below and are derived from the Taylor expansion of the position or velocity of the atoms at the timestep &amp;quot;n+1&amp;quot; or &amp;lt;math&amp;gt;t+\delta t&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit Algorithum:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{x}_i\left(t + \delta t\right) \approx 2\mathbf{x}_i\left(t\right) - \mathbf{x}_i\left(t - \delta t\right) + \frac{\mathbf{F}_i\left(t\right)}{m_i}\delta t^2  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit-Velocity Algorithum:&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i\left(t\right)&amp;lt;/math&amp;gt; is the force acting on a particular atom as a function of time&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i&amp;lt;/math&amp;gt; is the acceleration &lt;br /&gt;
&lt;br /&gt;
The smaller the timestep, the closer the numerical approximation is to the true solution function, which can be modeled as a classical harmonic oscillator. &#039;&#039;Figure a.&#039;&#039; in the table below shows the comparison between the two methods in &#039;&#039;time&#039;&#039; space. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure a. &#039;&#039;Plots of position vs time comparing the verit algorithm and harmonic spring results&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure b. &#039;&#039;Plot of the total classical energy of the system (potential + kinetic)&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory xanalytical.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory energy.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The harmonic spring position values are modeled from the harmonic oscillator or particle on a spring. The equation of &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; was used to calculate these values, where &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; are 1 and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; is zero. As seen on the plot, the curves produced from the two different methods of calculating the position are in good agreement.&lt;br /&gt;
|The potential energy is calculated using the equation U = 1/2 kx^2, with a value of k given as 1. The kinetic energy is calculated using the velcity from the verit-velocity algorithm using the equation T = 1/2 mv^2, with a value of m given as 1. The total energy of the system, E, is equal to T + U. The values for x (potential energy) and v (kinetic energy) are taken from the verity algorithm and verit-velocity algorthim respectively. &lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;Figure c. &#039;&#039;Plot of the difference (error) between the harmonic spring and verit algorithm data&lt;br /&gt;
!&#039;&#039;Figure d. &#039;&#039;Plot of the peaks in the error plot in &#039;&#039;figure c.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory error.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory errorpeaks.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The peaks in the error between the harmonic spring and verit algorithm results are at the place where the position curve crosses the time axis. This is because the harmonic spring data (x(t)) has a slightly shorter wave period than that of the verit velocity algorithm, and therefore the difference will get larger with each period of the wave, shown by the error getting larger in &#039;&#039;figure c. &#039;&#039;The period of the plot of the two methods are different because the verit algorithm is much more approximate so does not give the correct solution.&lt;br /&gt;
|The change in the error/difference between the harmonic spring data and verit algorthm data increases linearly and so therefore period of each of the plots in &#039;&#039;figure 1&#039;&#039;. must be constant. &lt;br /&gt;
|}&lt;br /&gt;
The error can also be quantified on a &#039;&#039;phase space&#039;&#039; plot; phase space is momentum or velocity plotted as a function of position. The true solution for motion of an atom is a perfect ellipse, and the more elliptic the shape (less circular) the more momentum or velocity is in the system. A numerical solution, like the verit algorithms, will produce a set of points very close to this ellipse but not perfectly following the curve. A good numerical solution will remain in an elliptical shape, whereas a bad numerical solution, for example one with a large timestep, will spiral away from the true solution. Two examples of such systems using the data from &#039;&#039;figures a-d&#039;&#039; are shown below.  &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure e. &#039;&#039;Phase plot of the harmonic spring data with a good numerical solution (timestep = 0.1) &lt;br /&gt;
!&#039;&#039;Figure f. &#039;&#039;Phase plot of the harmonic spring data with a bad numerical solution (timestep = 0.3) &lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory phasegood.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory badphase.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The timestep at which this data is plotted is 0.1, which results in a very small change in the energy, as seen in &#039;&#039;figure b. &#039;&#039;Increasing the time step will increase the variation in the energy. To keep the variation in the total energy of the system under 1%, the time step must be no larger than approximately 0.28. The energy varies more with increasing time step because the jumps in the algorithm  are getting larger due to less data points. The algorithm assumes these points are joined by a straight line; that the halfway point in the jump is the average between the starting and finishing point of the jump. The phase space plot will become less elliptic and the jumps eventually become so larger that the plot is no longer a continuous shape.  &lt;br /&gt;
&lt;br /&gt;
It is essential to monitor the energy of a numerically modeled system because a good solution for the motion of an atom has a constant energy and a plot in phase space of a perfect ellipse.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance and Force at Zero Potential===&lt;br /&gt;
From classical mechanics, the force calculated from the Newtonian mechanics above can be used to calculate the potential experienced by an atom in the system. They are related by the equation: &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;
This potential gives the shape and dimension of the potential surface on which the system can be modeled. A simple 1D potential that is used to describe the inter atomic forces of a liquid is the Lennard-Jones potential. It has the characteristic features of a short range repulsion potential and harmonic character around the equilibrium bond distance. The value of &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the inter atomic separation when the potential, &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;, is equal to zero, can be calculated by equating the equation for the Lennard-Jones potential to zero and solving for &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The equation for the Lennard-Jones potential: &amp;lt;math&amp;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;
Equating this to zero: &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;
And rearranging in order to separate the variables: &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;
Rearranging this gives &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in terms of &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt; r^6 = \sigma^6&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r = r_0&amp;lt;/math&amp;gt; in this case.&lt;br /&gt;
&lt;br /&gt;
This, therefore, gives the result that interatomic distance at zero potential, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, is equal to &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; in the Lennard-Jones potential is effectively the diameter of one of the particles in the system being measured; in this case, the liquid we are simulating. This is the point where the potential curve crosses the x-axis on an Energy vs interatomic distance plot. The force, &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt;, at this point on the curve corresponds to the gradient; it is found by calculating the derivative of the curve at this point. &lt;br /&gt;
&lt;br /&gt;
To calculate the force, we must differentiate the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As force is equal to the negative differential of the potential energy, the value of the force is: &amp;lt;math&amp;gt;\mathbf{F}_i = 48\epsilon \sigma^{12} r^{-13} - 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting in the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at zero potential from the calculation before: &amp;lt;math&amp;gt;\mathbf{F}_i = \frac{48\epsilon}{\sigma} - \frac{24\epsilon}{\sigma} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The gradient where the Lennard-Jones plot crosses the axis is negative; &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; in the term obtained for &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is negative and therefore the overall value of the force will be negative.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance, Force and Well Depth of the Potential at Equilibrium===&lt;br /&gt;
To calculate the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at the equilibrium position, we need to use the derivative of the potential energy curve. The equilibrium value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is the value at the minimum of the Lennard-Jones curve; when &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Therefore, equating the derivative to zero gives: &amp;lt;math&amp;gt;0 = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rearranging this: &amp;lt;math&amp;gt;48\epsilon \sigma^{12} r^{-13} = 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And simplifying and cancelling gives: &amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6&amp;lt;/math&amp;gt;. Therefore the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at equilibrium is: &amp;lt;math&amp;gt;r_{eq} = \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Physically, this result means that the equilibrium distance is 1.12 times the diameter of one of the particles; the particles have a small gap between them so do not touch. A short range repulsion potential, as seen in the Lennard-Jones curve, is a result of the particles coming into contact. &lt;br /&gt;
&lt;br /&gt;
Again, the force can be calculated from the derivative of the potential curve at the equilibrium point. As the derivative at this point is zero (a minimum on the curve), the force will therefore also be zero.&lt;br /&gt;
&lt;br /&gt;
The well-depth of the potential curve is the difference between zero potential and the potential at the equilibrium bond length. This can be calculated by substituting the value for the equilibrium bond length into the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 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;
Cancelling and simplifying this equation gives: &amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \times \frac{1}{4}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the absolute value for the well depth is &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;. The actual value of this potential is &amp;lt;math&amp;gt;-\epsilon&amp;lt;/math&amp;gt;, as the equilibrium bond length gives the most stable configuration of the molecules and therefore suggests attractive interactions are involved in the arrangement of the molecules; this attractive potential means its negative. &lt;br /&gt;
&lt;br /&gt;
===Boundary Conditions and the Lennard-Jones Cutoff===&lt;br /&gt;
When simulating a liquid, it is computationally impractical to simulate a realistic liquid. Therefore a smaller &#039;box&#039; containing &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; particles is simulated and the computer program will use &#039;&#039;periodic boundary conditions&#039;&#039; to simulate infinite repetitions of this box; when the atom reaches one edge of the box, in periodic boundary conditions, it will reappear again at the opposite edge of the box as if they were connected. For example, an atom at the position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a box of size &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;. Without periodic boundary conditions, we would assume that the atom would end up at the position &amp;lt;math&amp;gt;(1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;. However, in this box, there is no such position and so the particle must reappear at the opposite edge to where it effectively &#039;left&#039; the box. Therefore, it&#039;s ending position will be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The number of particles, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; simulated by the computer is usually between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt;. Physically, this is a very small volume. Considering water, we can calculate the number of molecules in 1 mL or 1 cm^3, a volume that would be considered small in the lab. Taking the concentration of water at standard conditions, &amp;lt;math&amp;gt;55\ mol\ dm^{-3}&amp;lt;/math&amp;gt;, we can convert it to the number of moles per mL: &amp;lt;math&amp;gt;0.055\ mol\ mL^{-1}&amp;lt;/math&amp;gt;. Multiplying this value by Avagadro&#039;s constant (&amp;lt;math&amp;gt;N_A&amp;lt;/math&amp;gt;) gives the number of molcules of water per mL: &amp;lt;math&amp;gt;3.02 \times 10^{22}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The reverse procedure can be used to compare this to the volume of 10,000 molecules: 10,000 divided by Avagadro&#039;s constant gives the number of moles of water which 10,000 molecules makes up: &amp;lt;math&amp;gt;1.66 \times 10^{-20}\ moles&amp;lt;/math&amp;gt;. Dividing this value by the concentration (from &amp;lt;math&amp;gt;n=cV&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is the number of moles, &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; is the concentration and &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume), gives the volume: &amp;lt;math&amp;gt;3.02 \times 10^{-22}\ dm&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;3.02 \times 10^{-19}\ mL&amp;lt;/math&amp;gt;. Physically, of course, this is far too small a volume to be recorded in the lab.&lt;br /&gt;
 &lt;br /&gt;
Periodic boundary conditions simulate an infinite lattice and therefore, when computing the potential, will calculate an infinite amount of pair interactions. Therefore, it is only practical to calculate the energies up to a certain interatomic distance; the Lennard-Jones cutoff distance. Beyond this point, the potential energy and the integral of the curve beyond this point become insignificant and do not impact on the overall energy; removing interactions beyond this point from the calculations will not effect the accuracy. Multiplying the Lennard-Jones potential with the radial distribution function gives a plot of the probability of finding an atom at a particular interatomic distance. The larger the interatomic distance, the lower the probability and so the energy after the cutoff can be disregarded. &lt;br /&gt;
&lt;br /&gt;
Integrating over the Lennard-Jones curve and applying this cutoff as the lower limit can show how small the integral is:&lt;br /&gt;
&lt;br /&gt;
For a general cutoff of with value &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;I = \int_{x}^\infty \phi\left(r\right)\mathrm{d}r = \int_{x}^\infty \frac{4\epsilon\sigma^{12}}{r^{12}}\mathrm{d}r - \int_{x}^\infty \frac{4\epsilon\sigma^6}{r^6}\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving this: &amp;lt;math&amp;gt;I = 4\epsilon\sigma^{12} {\frac{-1}{11r^{11}}\,\Bigg\vert\,}_x^\infty - 4\epsilon\sigma^{6} {\frac{-1}{5r^{5}}\,\Bigg\vert\,}_x^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This gives the general solution: &amp;lt;math&amp;gt;I = \frac{4\epsilon\sigma^{12}}{11x^{11}} - \frac{4\epsilon\sigma^{6}}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating this for &amp;lt;math&amp;gt;\epsilon = \sigma = 1&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;I = \frac{4}{11x^{11}} - \frac{4}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt; (or 2 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.025&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt; (or 2.5 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0082&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt; (or 3 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0033&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All values are taken to 2 significant figures. As the cutoff value for the interatomic distance gets larger, the integral gets smaller, and therefore the energy excluded from the calculation becomes smaller, and the second term in the solved integral, &amp;lt;math&amp;gt;I&amp;lt;/math&amp;gt;, dominates the energy value.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
When using the Lennard-Jones potential, it is appropriate to use reduced units for intermolecular distance, energy and temperature. Reduced units can be calculated by the following relationships:&lt;br /&gt;
&lt;br /&gt;
Intermolecular 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;
&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; are scaling factors. For example, if the parameters for Argon are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\sigma = 0.34 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt; \epsilon\ /\ k_B = 120 K&amp;lt;/math&amp;gt;&lt;br /&gt;
* Lennard-Jones cutoff &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;. The well-depth, &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;, is &amp;lt;math&amp;gt;0.999 kJ mol^{-1} \approx 1 kJ mol^{-1}&amp;lt;/math&amp;gt;. The value of &amp;lt;math&amp;gt;T* = 1.5&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;180 K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
The first aim of the simulations is to determine the most appropriate timestep to use in the vert algorithm simulations. This timestep is a balance between the accuracy of the results (the smaller the timestep, the closer to the true functing the result will be) and the length of real time over which the simluation is run (the smaller the timestep, the less real time over which the simulation will give a result). The appropriateness of the timestep will be determined by plotting how the total free energy of the simulated lattice equilibrates over time.  &lt;br /&gt;
&lt;br /&gt;
Five different calculations, which simulated the melting of a crystal and subsequent equilibration of the energy of the melted crystal, were run at five different timesteps; 0.001, 0.0025, 0.0075, 0.01 and 0.015, and were described by the NVE or &#039;&#039;&amp;quot;microcanonical ensemble&amp;quot;&#039;&#039;. An ensemble is a collection of samples of a system which are under three thermodynamic constraints (three properties are kept constant); in the microcanonical ensemble, the number of particles, the volume and the total energy is kept constant (NVE). &lt;br /&gt;
&lt;br /&gt;
These calculations simulate a box of 1000 unit cells and use periodic boundary conditions to replicate the simulation to a larger scale. Because these simulations use the numerical methods defined in the previous section, the initial position and velocity of the atoms must be defined in the input file. The Brownian (uncorrelated, random) motion of the atoms in the simulation means that there is no long range order in the system and so the atoms in a real system would start in random positions. However, assigning random starting coordinates to the atoms in a simulated liquid is not a relative process; the coordinates are generate independently of each other. Therefore there is a probability that the coordinates simulated will cause the atoms to overlap, which would give a very large repulsion potential, as seen in the Lennard-Jones potential at very small interatomic distances. This short-range repulsion potential comes from the hard-sphere model of atomic simulation.&lt;br /&gt;
&lt;br /&gt;
The input file also defines the structure and density of the lattice. The number density of lattice points in any lattice is the number of lattice points per volume of the unit cell. In a simple cubic lattice, there is one lattice point in the unit cell. From an sc lattice with lattice spacing (length of one side of the unit cell) being &amp;lt;math&amp;gt;1.07722&amp;lt;/math&amp;gt;, the number density of the lattice points is calculated by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{1}{1.07722^3} = 0.7999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a face-centered cubic lattice (fcc), there are four lattice points in the unit cell. Rearranging the above relationship, the lattice spacing can be calculated from the number of lattice points in a unit cell and number density, &amp;lt;math&amp;gt;1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Lattice\ spacing = \sqrt[3]{\frac{number\ of\ lattice\ points\ per\ unit\ cell}{number\ density}} = \sqrt[3]{\frac{4}{1.2}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation creates a box which includes 1000 unit cells, which is 10 unit cells in each dimension. For a simple cubic lattice, because there is one lattice point per unit cell, there will be 1000 atoms created as seen in the input file. The &#039;&#039;create_atom&#039;&#039; command in the input file determines how many boxes are created in the simulation and therefore how many atoms will be created. If a face centered cubic lattice is simulated, because there are 4 lattice points per unit cell, 4000 atoms will be created in the &#039;&#039;create_atom&#039;&#039; command. &lt;br /&gt;
&lt;br /&gt;
The input script also contains the following commands which defines the potential surface which is used to model the intermolecular reactions:&lt;br /&gt;
 mass 1 1.0&lt;br /&gt;
This instruction sets the mass type for the atoms being simulated. It takes the general form of “mass I value”, where mass is the keyword which tells LAMMPS what the input is, I is the atom type and value is the mass of the atom. In this case, I is defined by a specific numerical value; 1 as there is only 1 type of atom in the simulation, but it can be defined with an asterisk (1*), which means “all atom types of 1 to n inclusive”. &lt;br /&gt;
 pair_style lj/cut 3.0&lt;br /&gt;
This instruction sets the type of potential which LAMMPS uses in its calculation of pairwise interactions. It takes the general form of “pair_style style args”, where pair_style is the keyword for LAMMPS, style defines the potential and any specifications it may have, and args are the arguments required for this particular potential. In this case, the Lennard-Jones potential has been used (lj) with a cutoff point (cut) of 3σ. The cutoff point is explained in the introduction section. &lt;br /&gt;
 pair_coeff * * 1.0 1.0&lt;br /&gt;
This instruction specifies the coefficients for the pairwise interactions of each pair of atoms, and it takes the general form “pair_coeff I J args”. Pair_coeff is the keyword, I and J are the atom types, and args are the coefficients which the different atoms types take. In this case, the asterisk in place of I and J refers to all atoms types from 1 to n. The coefficients are the pairwise interactions are 1 for each atom, meaning each atom has an equal contribution to the interaction.&lt;br /&gt;
&lt;br /&gt;
In these initial calculations, the initial conditions for the numerical methods, &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. For this experiment, the verit-velocity algorithm would be the most appropriate, as both the starting position and velocity is specified for this algorithm. &lt;br /&gt;
&lt;br /&gt;
To define the timestep for the algorithm the following code is used defining the timestep as a variable instead of just giving it a definite value&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;
It is much easier to use the variable version of defining the timestep because the length of time over which the simulation is run depends on the time step. By using a variable, you can keep the length of the simulation the same, no matter the size of the timestep. It also makes it easier if multiple properties depend on the timestep – only the variable needs to be changed, not all the parts of the script where timestep is defined. &lt;br /&gt;
&lt;br /&gt;
The calculations produce the values for the total energy of the system, temperature and pressure in the output files, which can be plotted against time. How well these values equilibrate determines the appropriateness of the timestep to use in further calculations in the experiment.   &lt;br /&gt;
[[File:Rmt totalenergy plot.png|none|thumb|800x800px|&#039;&#039;Figure h. &#039;&#039;Plot of the equilibration of total energy for five different timesteps]]&lt;br /&gt;
The largest time step to give an acceptable result is 0.01. However, for any simluation we would expect energy to be independent of the timestep, something which is not true at a timestep greater than 0.0025. Therefore, the most appropriate timestep to use for a balance between accuracy and length of time which the simulation covers is 0.0025.  &lt;br /&gt;
&lt;br /&gt;
0.015 is a particularly bad choice of timestep. This is because the verit-velocity algorithm gives an approximate result to the velocity (kinetic energy term) and position (potential energy term), and so when the timestep becomes too large with respect to the time, the algorithm no longer becomes a suitable way to calculate the energy. As seen in the graph of 0.015, the energy does not equilibrate and diverges.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions ==&lt;br /&gt;
The calculations in this section are run in the isobaric-isothermal ensemble, where the number of particles in the system, the pressure and the temperature are kept constant (NpT). This means that the temperature and the pressure are recalculated in every step, so are no longer constant like they were in the NVE ensemble. From the &#039;&#039;equipartition theorem&#039;&#039;, each degree of freedom will contribute &amp;lt;math&amp;gt;\frac{1}{2} k_B T&amp;lt;/math&amp;gt; of energy to the system. As the system is in three dimensions, there are three degrees of translational freedom and so the total internal energy is equal to &amp;lt;math&amp;gt;\frac{3}{2} k_B T&amp;lt;/math&amp;gt;. Equating this to the kinetic energy, &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt;, at the end of every step and rearranging will allow calculation of the temperature after every step. &lt;br /&gt;
&lt;br /&gt;
A target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, is defined in the input script and the system will equilibrate by multiplying the velocity by a factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, in order to accommodate for the fluctuation and keep the system at approximately the target temperature and therefore constant internal energy. If the temperature of the system is greater than the target temperature, the system&#039;s kinetic energy is too high, so &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is reduced to compensate for this. The same is true for is the temperature is lower than the target temperature; &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than one in the next step to increase the kinetic energy which is now too low. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; can be derived from equating the kinetic and internal energy of the system at an arbitrary time step:&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;
Expanding the brackets inside the sum and moving the term containing &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; out of the sum: &amp;lt;math&amp;gt;\frac{\gamma^2}{2}\sum_i m_i \left(v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;, we can replace &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt; on the left hand side of the equation with &amp;lt;math&amp;gt;\frac{3}{2} N k_B T&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;\frac{3\gamma^2}{2}N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Simplifying and rearranging for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, gives: &amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The principle is the same for controlling the pressure.&lt;br /&gt;
&lt;br /&gt;
As temperature and pressure are no longer constant, he input files require specification of the pressure and the temperature for each of the systems run. 10 simulations were run at two different pressures with five different temperatures at each. &lt;br /&gt;
* Temperatures: 1.6, 1.9, 2.2, 2.5, 2.8&lt;br /&gt;
* Pressures: 2.5, 3.0&lt;br /&gt;
These pressures were chosen because the data simulated when choosing an appropriate timestep gave a pressure between 2.5 and 3.0.  &lt;br /&gt;
&lt;br /&gt;
For the code which computes the thermodynamic potentials, this particular line defines how many steps contribute towards the average of the thermodynamic parameters computed in the calculation. &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;
&#039;&#039;fix&#039;&#039; is the keyword, &#039;&#039;aves&#039;&#039; is the name of the group of fixes which in this case is the average of the thermodynamic values, &#039;&#039;all&#039;&#039; specifies the atoms which the fix is applied to which in this case is all the atoms in the simulated system and &#039;&#039;ave/time&#039;&#039; means that compute global time averages are calculated. The following three numbers have the following meaning:&lt;br /&gt;
&lt;br /&gt;
*100 = use the input values every 100 timesteps&lt;br /&gt;
*1000 = use input values 1000 times for calculating the average&lt;br /&gt;
*100000 = calculate the average every 100000 timesteps&lt;br /&gt;
&lt;br /&gt;
Therefore for the total calculation which lasts for 100000 will only have the average calculated once. Assuming 1 value every timestep, there will be 100000/100 values = 1000. The amount of time simulated is 100,000 steps, read from the following line.&lt;br /&gt;
&lt;br /&gt;
The density data from all ten calculation were plotted on the same graph, along with the density for an &amp;quot;ideal&amp;quot; gas. This density can be derived from the ideal gas law:&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;
Rearranging in terms of density: &amp;lt;math&amp;gt;\frac{N}{V} = \frac{P}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As these simulations are being run under reduced units, we can take &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt;, and so the density of the ideal gas becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the density of the ideal gas is plotted as the pressure divided by the temperature in pressure-temperature phase space.&lt;br /&gt;
[[File:Rmt dvt plot.png|none|thumb|800x800px|&#039;&#039;Figure i. &#039;&#039;Plot of the variation in density with temperature at a defined pressure for the numerically simulated and ideal systems]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that calculated in the ideal gas law. This is because for an ideal gas, an assumption is made that there are no intermolecular interactions, and therefore forces such as electron repulsion forces are ignored; repulsion forces dominate over attractive ones, as all the atoms in this simulation are the same and so partial charges or dipoles are created. This will mean that the particles move closer together than a real gas and so the density will be larger. This discrepancy between the ideal and non-ideal systems becomes larger at a higher pressure because with a higher pressure, the atoms in the system are closer together and therefore the intermolecular repulsion will become larger. This greater repulsion will in turn have a larger effect on decreasing the density.&lt;br /&gt;
&lt;br /&gt;
== Statistical Physics Calculations of the Heat Capacity ==&lt;br /&gt;
The heat capacity of a system at constant volume can be calculated from the variance in the total energy of the system. The relationship used to calculate the heat capacity is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = 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;\left\langle E^2\right\rangle&amp;lt;/math&amp;gt; is the continuous average of the total square energy at each temperature as a function of temperature. &amp;lt;math&amp;gt;\left\langle E\right\rangle^2&amp;lt;/math&amp;gt; is the continuous average of the total energy at each temperature as a function of temperature squared. The heat capacity is multiplied by &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; in this case because the version of LAMMPS calculates every energy divided by the number of molecules in the system simulated.&lt;br /&gt;
&lt;br /&gt;
The calculations in this sections are run in density-temperature phase space and the ensemble has changed to the canonical ensemble (NVT). A set of input files were written for ten calculations for, like the previous section, two pressures and five different temperatures at each pressure:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 0.2, 0.8&lt;br /&gt;
*Temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{C_V}{V}&amp;lt;/math&amp;gt; was plotted against temperature to determine the relationship in density-temperature phase space. An example of an input file can be found [[Media:nvt_-_0220.in|here]]. The lines which have been changed from the previous input files are at the end of the script:&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 &lt;br /&gt;
 thermo_style custom step etotal temp&lt;br /&gt;
 variable energy equal etotal&lt;br /&gt;
 variable energy2 equal etotal*etotal&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_energy v_energy2 v_temp&lt;br /&gt;
 run 100000&lt;br /&gt;
 &lt;br /&gt;
 variable aveenergy equal f_aves[1]&lt;br /&gt;
 variable aveenergy2 equal f_aves[2]&lt;br /&gt;
 variable avetemp equal f_aves[3]&lt;br /&gt;
 variable heatcapacitydv equal atoms*atoms*(v_aveenergy2-v_aveenergy*v_aveenergy)/(v_avetemp*v_avetemp*vol)&lt;br /&gt;
 &lt;br /&gt;
 print &amp;quot;Averages&amp;quot;&lt;br /&gt;
 print &amp;quot;--------&amp;quot;&lt;br /&gt;
 print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Heat Capacity per Volume: ${heatcapacitydv}&amp;quot;&lt;br /&gt;
The line with the keyword &#039;fix&#039; determines which thermodynamic values are averaged and over how many steps they are averaged. The next section takes these averages as variables and uses them to define the heat capacity which is calculated from the equation at the beginning of this section. Only the energy and temperature are needed to define the heat capacity and so only these values are calculated by the simulation. [[File:Rmt heatcapacitybyv.png|none|thumb|800x800px|&#039;&#039;Figure j. &#039;&#039;C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V against temperature for the two different pressures 0.2 and 0.8]]As seen in the above figure, the heat capacity decreases with temperature for both pressures. It would be expected for an ideal system that as the temperature increases, the heat capacity at constant volume increases and tends to a constant volume at very high T of 3R; R = the universal gas constant. This means increasing the temperature increases the amount of energy being stored in the system and this energy is stored as vibrational energy. However, for a Lennard-Jones liquid, the system being simulated here, the heat capacity decreases with temperature. This is because the simulation has two components to the simulation; the atoms are vibrating in a quasi-harmonic fashion around the equilibrium position and also diffuse between neighbouring equilibrium positions in a gas like fashion. As the temperature increases, the amount of diffusion increases and the vibrations decreases, therefore decreasing the ability of the system to absorb vibrational energy, resulting in the decrease in heat capacity. &amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www.nature.com/ncomms/2013/130816/ncomms3331/full/ncomms3331.html?message-global=remove&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural Properties and the Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a single atom in a system is a plot of the probability that an atom can be found at a certain distance from the central atom. The peaks in this plot can give the distance of an atom from its nearest neighbours in the Lennard-Jones simulated system. &lt;br /&gt;
&lt;br /&gt;
The calculations in this section simulate a Lennard-Jones solid, liquid and gas and, using the output of the LAMMPS trajectory file, plots both the radial distribution function and its integral using DLV. The temperature and pressure parameters for these calculations were taken from the phase diagram or coexistence curve for a Lennard-Jones system.&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt; The parameters used are displayed in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! Temperature, &amp;lt;math&amp;gt;T^*&amp;lt;/math&amp;gt;&lt;br /&gt;
! Pressure, &amp;lt;math&amp;gt;p^*&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| LJ Solid&lt;br /&gt;
| 1.5&lt;br /&gt;
| 1.2&lt;br /&gt;
|-&lt;br /&gt;
| LJ Liquid&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.8&lt;br /&gt;
|-&lt;br /&gt;
| LJ Gas&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.01&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The data obtained from the plots and the radial distribution functions and their integrals were plotted and shown in the table below.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure k. &#039;&#039;The radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
!&#039;&#039;Figure l. &#039;&#039;The integrals of the radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt fullrdfs.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt allintegralsrdf.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
[[File:Rmt Nearest neighbours.png|left|thumb|300x300px|&#039;&#039;Figure m. &#039;&#039;Representation of a cross section of the first three shells of nearest neighbours in an fcc solid. The black atom is the central atom being considered, the blue atoms are the first shell, the orange atoms the second shell and the purple atoms are the third.]]&lt;br /&gt;
The RDF of the solid gives a very irregular curve because of the irregular structure of the lattice. For a simple cubic lattice, a regular structure of the RDF would be expected because of the equal number of atoms in each of the nearest neighbour shells of the atoms. However, for face-centered cubic, the solid in this simulation, the structure is much more irregular and as the atoms move from their equilibrium position in the lattice due to vibrations, the peaks in the radial distribution will broaden. The irregular heights of the peaks are due to the varying numbers of atoms in each of the nearest neighbour shells for the central atom. The first shell gives the highest peak as it contains the most atoms; in total, considering all four surrounding unit cells, this shell contains 12 atoms and ideally takes the geometry of an icosahedron. The second shell is smaller and contains only 6 atoms in an octahedral coordination shape. The following shell again contributes 12 atoms, 3 from each unit cell. This therefore explains why the heights of the peaks in the solid plot in &#039;&#039;figure k.&#039;&#039; vary. These values can be confirmed by the plot in &#039;&#039;figure o.&#039;&#039; which is the integral; it cumulatively adds the numbers in each shell. The size of the first &amp;quot;step&amp;quot; is 12; there are 12 atoms in the first shell. The size of the second step is approximately 18; there are 18-12=6 steps in the second shell. The same theory applies for the third shell which gives a value of 13. This is slightly different to the predicted value possibly due to error in the calculation of the radial distribution function and therefore its integral. &lt;br /&gt;
&lt;br /&gt;
The RDF of the liquid has a representation of far fewer shells, which means that there are less atoms in the space close to a &amp;quot;central&amp;quot; atom in the bulk solution. The particles have more energy and therefore do not keep to a regular lattice structure. As they move about, some regualrity is maintained around each atom, but only to the extend of two or three shells, meaning there is no long range order in a Lennard-Jones liquid. &lt;br /&gt;
&lt;br /&gt;
The RDF of the gas again omits more shells as there is almost no order in a Lennard-Jones gas. The single peak on this plot considers only the set of atoms closest to the central atom and all others are disregarded as they are too far apart. &lt;br /&gt;
&lt;br /&gt;
Considering &#039;&#039;figure l.&#039;&#039;, the size of the integral of the radial distribution function decreases from solid to liquid to gas. This makes sense as the number of atoms in the surrounding shells decreases with density of the system; the atoms become further apart. &lt;br /&gt;
&lt;br /&gt;
From the plot of the radial distribution function of the solid, the lattice spacing can be determined. For this, we can consider just the first three peaks of the RDF plot. The lattice spacing refers to the length of one unit cell, and so, using &#039;&#039;figure m&#039;&#039;, we can calculate this using two different methods; a) we can use the distance between the central atom and the first shell of nearest neighbours, and use trigonometry to calculate the lattice spacing. Or alternatively b) we can use the distance between the central atom and the second nearest neighbour shell to get the lattice spacing.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure n. &#039;&#039;The radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
!&#039;&#039;Figure o. &#039;&#039;The integral of the radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt solidgr3.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt solidint3.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
Using method a) (with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; as the distance between the central atom and the nearest neighbour: Lattice spacing = &amp;lt;math&amp;gt;\frac{r}{cos({\frac{\pi}{4}})} = \frac{1.02}{cos({\frac{\pi}{4}})} \approx 1.44&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using method b): Lattice spacing &amp;lt;math&amp;gt;\approx 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can take an average between the two get an approximate value for the lattice spacing: &amp;lt;math&amp;gt;1.46 \plusmn 0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These values for distance are all in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
The ability of atoms to move around in a solid liquid or gas can be characterised by the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. In this section, we will explore two different ways to calculate the diffusion coefficient and compare the results. &lt;br /&gt;
&lt;br /&gt;
=== The Mean Squared Displacement ===&lt;br /&gt;
The diffusion coefficient can be measured easily be calculating the mean squared displacement of atoms in the solution; the diffusion coefficient is proportional to the first derivative of the mean squared displacement. By plotting the mean squared displacement as a function of time, the gradient can be taken to calculate the diffusion coefficient when its has equilibrated and become linear.&lt;br /&gt;
&lt;br /&gt;
The temperature and density parameters used were the same as in the previous section:&lt;br /&gt;
* Solid: T=1.5, D=1.2&lt;br /&gt;
* Liquid: T=1.1, D=0.8&lt;br /&gt;
* Gas: T=1.1, D=0.01&lt;br /&gt;
&lt;br /&gt;
Mean density squared calculations were run for all three Lennard-Jones phases and the data plotted as function of timestep below. The data from a simulation containing 1,000,000 atoms was plotted for comparision.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!Plots for the 8,000 atom data&lt;br /&gt;
!Plots for the 1,000,000 atom data&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|[[File:Rmt MSDsolid.png|none|thumb|700x700px]]&lt;br /&gt;
|[[File:Rmt MAsolid.png|none|thumb|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|[[File:Rmt MSDliquid.png|none|thumb|700x700px]]&lt;br /&gt;
|[[File:Rmt MAliquid.png|none|thumb|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|[[File:Rmt MSDgas.png|none|thumb|700x700px]]&lt;br /&gt;
|[[File:Rmt dataplots 25894 image001.png|none|thumb|700x700px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The exact relationship between the mean squared displacement and the diffusion coefficient is:&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;
Taking the gradients of each of the curves at the point at which they become linear and dividing by six will give the diffusion coefficient for each set of data. The gradient also needs to be converted to a function of time; this is done by dividing by the timestep, which in this case is 0.002:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom data diffusion coefficients, &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
!1,000,000 atom data diffusion coefficients &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 0.9999&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|Gradient = 0.0972&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{48.6}{6} = \mathbf{8.1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient = 0.0386&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{19.6}{6} = \mathbf{3.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For both of the solid approximations, the diffusion coefficient can be approximated as zero. This is because, when equilibrated, the function has a constant value of around 0.2 for the mean squared displacement. A gradient with a value of zero means that the atoms take an infinite amount of time to change their mean squared displacement; to move away from their equilibrium position, and so this means that we can approximate in this system, there will be no diffusion. In real system, however, this is not the case; diffusion occurs but it is very slow. A plot for a real system will give a very shallow positive gradient.&lt;br /&gt;
&lt;br /&gt;
The liquid approximations are very well correlated. This is because in both cases, the mean squared displacement of particles in a liquid increases linearly with time and the gradient of both plots are almost identical. We can assume from this that identical starting conditions were used to calculate this data. Also, we can estimate that 8,000 atoms is a large enough simulation to give an accurate result for the diffusion coefficient for the Lennard-Jones liquid.&lt;br /&gt;
&lt;br /&gt;
The gas approximations are very different. This is most probably due to the fact that the density specified in calculations are different. The 8,000 data can be estimated to be a much lower density because the diffusion coefficient is faster and this means diffusion will happen faster; at a higher density a particle will take longer to diffuse over a given distance. Because of the difference in density, the two values of the diffusion coefficient cannot be qualitatively compared. The reason for the initial deviation for linearity in the gas plots is due to the momentum of the particles initially dominating over the diffusion and the diffusion coefficient is dependent on time. As the system equilibrates, the diffusion coefficient becomes constant and the plots become linear.&lt;br /&gt;
&lt;br /&gt;
=== The Velocity Autocorrelation Function ===&lt;br /&gt;
&lt;br /&gt;
Another way to calculate the diffusion coefficient is by using the velocity correlation function, which determines how the velocity of an atom changes with time. The function determines the difference in time (&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;) when the velocity becomes uncorrelated, i.e. the difference between the velocity at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; and at time &amp;lt;math&amp;gt;t+\tau&amp;lt;/math&amp;gt;. By integrating over this function, we can find the diffusion coefficient. &lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function: &amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can also be written as the integral: &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;
Using the function which defines the position of a classical harmonic oscillator, we can differentiate this to give the equation for the velocity which we can plug into the integral:&lt;br /&gt;
&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;
&amp;lt;math&amp;gt;dv{x(t)}{t} = v(t) = -A\omega sin(\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also needed for the integral:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t+\tau) = -A\omega sin(\omega(t+\tau)+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v^2(t) = A^2\omega^2 sin^2(\omega t +\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Putting all this into the integral to find the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega sin(\omega t + \phi) \times A\omega sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} A^2\omega^2 sin^2(\omega t +\tau)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A^2\omega^2&amp;lt;/math&amp;gt; can be take out of each of the integrals and cancelled. A substituion can then be made to make solving the integral much simpler:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = \omega t + \phi&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \omega\tau&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the integral becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a) \times sin(a+b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the compound angle rule &amp;lt;math&amp;gt;sin(a+b)=sin(a)cos(b)+cos(a)sin(b)&amp;lt;/math&amp;gt;, the integral can be simplified to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a)sin(a)cos(b) + sin(a)cos(a)sin(b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Separating out into two integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)\frac{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the rule &amp;lt;math&amp;gt;sin(a)cos(a) = \frac{1}{2}sin(2a)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} \frac{1}{2}(sin(2a))\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because the function &amp;lt;math&amp;gt;\frac{1}{2}sin(2a)&amp;lt;/math&amp;gt; is symmetric over all space, the second term in this equation becomes zero. Therefore, the integral simplifies to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b) = cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated from: &amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty C\left(\tau\right)\mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the approximate value for the diffusion coefficient using the velocity autocorrelation function is &amp;lt;math&amp;gt;D = \frac{1}{3}cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same calculations from the mean squared displacement section gave an output of the velocity autocorrelation function. The function for the Lennard-Jones solid, liquid and gas were plotted against the timestep along with the approximate function for the velocity autocorrelation function, &amp;lt;math&amp;gt;cos(\omega\tau)&amp;lt;/math&amp;gt;, where &lt;br /&gt;
[[File:Rmt VACF 5721 image001.png|none|thumb|800x800px|&#039;&#039;Figure t. &#039;&#039;Plots for the velocity autocorrelation function of a Lennard-Jones solid, liquid and gas]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Rmt_VACF_5721_image001.png&amp;diff=541357</id>
		<title>File:Rmt VACF 5721 image001.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Rmt_VACF_5721_image001.png&amp;diff=541357"/>
		<updated>2016-02-25T12:26:30Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=541354</id>
		<title>Rep:Mod:hakunamatata</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=541354"/>
		<updated>2016-02-25T12:24:26Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: /* Dynamical Properties and the Diffusion Coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Introduction to Molecular Dynamics Simulations ==&lt;br /&gt;
===The Classical Particle Approximation and Numerical Integration===&lt;br /&gt;
The verit and verit-velocity algorithms are numerical methods to approximate the average position and velocity respectively of randomly moving atoms in a particular medium (solid, liquid, fliud etc.). This position and velocity can be applied to Newtonian mechanics to calculate such properties as the force and potential energy of the system. The algorithms work by splitting the function into discrete time steps, calculating the values of position and velocity at this particular time step, and then effectively &amp;quot;joining the dots&amp;quot; to create an approximate function. These simulations always use the answer from the previous timestep to compute the new timestep, so initial conditions must be given for the first step. Both of the algorithms are shown below and are derived from the Taylor expansion of the position or velocity of the atoms at the timestep &amp;quot;n+1&amp;quot; or &amp;lt;math&amp;gt;t+\delta t&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit Algorithum:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{x}_i\left(t + \delta t\right) \approx 2\mathbf{x}_i\left(t\right) - \mathbf{x}_i\left(t - \delta t\right) + \frac{\mathbf{F}_i\left(t\right)}{m_i}\delta t^2  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit-Velocity Algorithum:&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i\left(t\right)&amp;lt;/math&amp;gt; is the force acting on a particular atom as a function of time&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i&amp;lt;/math&amp;gt; is the acceleration &lt;br /&gt;
&lt;br /&gt;
The smaller the timestep, the closer the numerical approximation is to the true solution function, which can be modeled as a classical harmonic oscillator. &#039;&#039;Figure a.&#039;&#039; in the table below shows the comparison between the two methods in &#039;&#039;time&#039;&#039; space. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure a. &#039;&#039;Plots of position vs time comparing the verit algorithm and harmonic spring results&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure b. &#039;&#039;Plot of the total classical energy of the system (potential + kinetic)&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory xanalytical.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory energy.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The harmonic spring position values are modeled from the harmonic oscillator or particle on a spring. The equation of &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; was used to calculate these values, where &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; are 1 and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; is zero. As seen on the plot, the curves produced from the two different methods of calculating the position are in good agreement.&lt;br /&gt;
|The potential energy is calculated using the equation U = 1/2 kx^2, with a value of k given as 1. The kinetic energy is calculated using the velcity from the verit-velocity algorithm using the equation T = 1/2 mv^2, with a value of m given as 1. The total energy of the system, E, is equal to T + U. The values for x (potential energy) and v (kinetic energy) are taken from the verity algorithm and verit-velocity algorthim respectively. &lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;Figure c. &#039;&#039;Plot of the difference (error) between the harmonic spring and verit algorithm data&lt;br /&gt;
!&#039;&#039;Figure d. &#039;&#039;Plot of the peaks in the error plot in &#039;&#039;figure c.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory error.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory errorpeaks.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The peaks in the error between the harmonic spring and verit algorithm results are at the place where the position curve crosses the time axis. This is because the harmonic spring data (x(t)) has a slightly shorter wave period than that of the verit velocity algorithm, and therefore the difference will get larger with each period of the wave, shown by the error getting larger in &#039;&#039;figure c. &#039;&#039;The period of the plot of the two methods are different because the verit algorithm is much more approximate so does not give the correct solution.&lt;br /&gt;
|The change in the error/difference between the harmonic spring data and verit algorthm data increases linearly and so therefore period of each of the plots in &#039;&#039;figure 1&#039;&#039;. must be constant. &lt;br /&gt;
|}&lt;br /&gt;
The error can also be quantified on a &#039;&#039;phase space&#039;&#039; plot; phase space is momentum or velocity plotted as a function of position. The true solution for motion of an atom is a perfect ellipse, and the more elliptic the shape (less circular) the more momentum or velocity is in the system. A numerical solution, like the verit algorithms, will produce a set of points very close to this ellipse but not perfectly following the curve. A good numerical solution will remain in an elliptical shape, whereas a bad numerical solution, for example one with a large timestep, will spiral away from the true solution. Two examples of such systems using the data from &#039;&#039;figures a-d&#039;&#039; are shown below.  &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure e. &#039;&#039;Phase plot of the harmonic spring data with a good numerical solution (timestep = 0.1) &lt;br /&gt;
!&#039;&#039;Figure f. &#039;&#039;Phase plot of the harmonic spring data with a bad numerical solution (timestep = 0.3) &lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory phasegood.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory badphase.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The timestep at which this data is plotted is 0.1, which results in a very small change in the energy, as seen in &#039;&#039;figure b. &#039;&#039;Increasing the time step will increase the variation in the energy. To keep the variation in the total energy of the system under 1%, the time step must be no larger than approximately 0.28. The energy varies more with increasing time step because the jumps in the algorithm  are getting larger due to less data points. The algorithm assumes these points are joined by a straight line; that the halfway point in the jump is the average between the starting and finishing point of the jump. The phase space plot will become less elliptic and the jumps eventually become so larger that the plot is no longer a continuous shape.  &lt;br /&gt;
&lt;br /&gt;
It is essential to monitor the energy of a numerically modeled system because a good solution for the motion of an atom has a constant energy and a plot in phase space of a perfect ellipse.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance and Force at Zero Potential===&lt;br /&gt;
From classical mechanics, the force calculated from the Newtonian mechanics above can be used to calculate the potential experienced by an atom in the system. They are related by the equation: &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;
This potential gives the shape and dimension of the potential surface on which the system can be modeled. A simple 1D potential that is used to describe the inter atomic forces of a liquid is the Lennard-Jones potential. It has the characteristic features of a short range repulsion potential and harmonic character around the equilibrium bond distance. The value of &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the inter atomic separation when the potential, &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;, is equal to zero, can be calculated by equating the equation for the Lennard-Jones potential to zero and solving for &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The equation for the Lennard-Jones potential: &amp;lt;math&amp;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;
Equating this to zero: &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;
And rearranging in order to separate the variables: &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;
Rearranging this gives &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in terms of &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt; r^6 = \sigma^6&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r = r_0&amp;lt;/math&amp;gt; in this case.&lt;br /&gt;
&lt;br /&gt;
This, therefore, gives the result that interatomic distance at zero potential, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, is equal to &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; in the Lennard-Jones potential is effectively the diameter of one of the particles in the system being measured; in this case, the liquid we are simulating. This is the point where the potential curve crosses the x-axis on an Energy vs interatomic distance plot. The force, &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt;, at this point on the curve corresponds to the gradient; it is found by calculating the derivative of the curve at this point. &lt;br /&gt;
&lt;br /&gt;
To calculate the force, we must differentiate the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As force is equal to the negative differential of the potential energy, the value of the force is: &amp;lt;math&amp;gt;\mathbf{F}_i = 48\epsilon \sigma^{12} r^{-13} - 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting in the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at zero potential from the calculation before: &amp;lt;math&amp;gt;\mathbf{F}_i = \frac{48\epsilon}{\sigma} - \frac{24\epsilon}{\sigma} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The gradient where the Lennard-Jones plot crosses the axis is negative; &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; in the term obtained for &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is negative and therefore the overall value of the force will be negative.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance, Force and Well Depth of the Potential at Equilibrium===&lt;br /&gt;
To calculate the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at the equilibrium position, we need to use the derivative of the potential energy curve. The equilibrium value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is the value at the minimum of the Lennard-Jones curve; when &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Therefore, equating the derivative to zero gives: &amp;lt;math&amp;gt;0 = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rearranging this: &amp;lt;math&amp;gt;48\epsilon \sigma^{12} r^{-13} = 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And simplifying and cancelling gives: &amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6&amp;lt;/math&amp;gt;. Therefore the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at equilibrium is: &amp;lt;math&amp;gt;r_{eq} = \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Physically, this result means that the equilibrium distance is 1.12 times the diameter of one of the particles; the particles have a small gap between them so do not touch. A short range repulsion potential, as seen in the Lennard-Jones curve, is a result of the particles coming into contact. &lt;br /&gt;
&lt;br /&gt;
Again, the force can be calculated from the derivative of the potential curve at the equilibrium point. As the derivative at this point is zero (a minimum on the curve), the force will therefore also be zero.&lt;br /&gt;
&lt;br /&gt;
The well-depth of the potential curve is the difference between zero potential and the potential at the equilibrium bond length. This can be calculated by substituting the value for the equilibrium bond length into the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 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;
Cancelling and simplifying this equation gives: &amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \times \frac{1}{4}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the absolute value for the well depth is &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;. The actual value of this potential is &amp;lt;math&amp;gt;-\epsilon&amp;lt;/math&amp;gt;, as the equilibrium bond length gives the most stable configuration of the molecules and therefore suggests attractive interactions are involved in the arrangement of the molecules; this attractive potential means its negative. &lt;br /&gt;
&lt;br /&gt;
===Boundary Conditions and the Lennard-Jones Cutoff===&lt;br /&gt;
When simulating a liquid, it is computationally impractical to simulate a realistic liquid. Therefore a smaller &#039;box&#039; containing &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; particles is simulated and the computer program will use &#039;&#039;periodic boundary conditions&#039;&#039; to simulate infinite repetitions of this box; when the atom reaches one edge of the box, in periodic boundary conditions, it will reappear again at the opposite edge of the box as if they were connected. For example, an atom at the position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a box of size &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;. Without periodic boundary conditions, we would assume that the atom would end up at the position &amp;lt;math&amp;gt;(1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;. However, in this box, there is no such position and so the particle must reappear at the opposite edge to where it effectively &#039;left&#039; the box. Therefore, it&#039;s ending position will be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The number of particles, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; simulated by the computer is usually between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt;. Physically, this is a very small volume. Considering water, we can calculate the number of molecules in 1 mL or 1 cm^3, a volume that would be considered small in the lab. Taking the concentration of water at standard conditions, &amp;lt;math&amp;gt;55\ mol\ dm^{-3}&amp;lt;/math&amp;gt;, we can convert it to the number of moles per mL: &amp;lt;math&amp;gt;0.055\ mol\ mL^{-1}&amp;lt;/math&amp;gt;. Multiplying this value by Avagadro&#039;s constant (&amp;lt;math&amp;gt;N_A&amp;lt;/math&amp;gt;) gives the number of molcules of water per mL: &amp;lt;math&amp;gt;3.02 \times 10^{22}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The reverse procedure can be used to compare this to the volume of 10,000 molecules: 10,000 divided by Avagadro&#039;s constant gives the number of moles of water which 10,000 molecules makes up: &amp;lt;math&amp;gt;1.66 \times 10^{-20}\ moles&amp;lt;/math&amp;gt;. Dividing this value by the concentration (from &amp;lt;math&amp;gt;n=cV&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is the number of moles, &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; is the concentration and &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume), gives the volume: &amp;lt;math&amp;gt;3.02 \times 10^{-22}\ dm&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;3.02 \times 10^{-19}\ mL&amp;lt;/math&amp;gt;. Physically, of course, this is far too small a volume to be recorded in the lab.&lt;br /&gt;
 &lt;br /&gt;
Periodic boundary conditions simulate an infinite lattice and therefore, when computing the potential, will calculate an infinite amount of pair interactions. Therefore, it is only practical to calculate the energies up to a certain interatomic distance; the Lennard-Jones cutoff distance. Beyond this point, the potential energy and the integral of the curve beyond this point become insignificant and do not impact on the overall energy; removing interactions beyond this point from the calculations will not effect the accuracy. Multiplying the Lennard-Jones potential with the radial distribution function gives a plot of the probability of finding an atom at a particular interatomic distance. The larger the interatomic distance, the lower the probability and so the energy after the cutoff can be disregarded. &lt;br /&gt;
&lt;br /&gt;
Integrating over the Lennard-Jones curve and applying this cutoff as the lower limit can show how small the integral is:&lt;br /&gt;
&lt;br /&gt;
For a general cutoff of with value &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;I = \int_{x}^\infty \phi\left(r\right)\mathrm{d}r = \int_{x}^\infty \frac{4\epsilon\sigma^{12}}{r^{12}}\mathrm{d}r - \int_{x}^\infty \frac{4\epsilon\sigma^6}{r^6}\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving this: &amp;lt;math&amp;gt;I = 4\epsilon\sigma^{12} {\frac{-1}{11r^{11}}\,\Bigg\vert\,}_x^\infty - 4\epsilon\sigma^{6} {\frac{-1}{5r^{5}}\,\Bigg\vert\,}_x^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This gives the general solution: &amp;lt;math&amp;gt;I = \frac{4\epsilon\sigma^{12}}{11x^{11}} - \frac{4\epsilon\sigma^{6}}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating this for &amp;lt;math&amp;gt;\epsilon = \sigma = 1&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;I = \frac{4}{11x^{11}} - \frac{4}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt; (or 2 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.025&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt; (or 2.5 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0082&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt; (or 3 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0033&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All values are taken to 2 significant figures. As the cutoff value for the interatomic distance gets larger, the integral gets smaller, and therefore the energy excluded from the calculation becomes smaller, and the second term in the solved integral, &amp;lt;math&amp;gt;I&amp;lt;/math&amp;gt;, dominates the energy value.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
When using the Lennard-Jones potential, it is appropriate to use reduced units for intermolecular distance, energy and temperature. Reduced units can be calculated by the following relationships:&lt;br /&gt;
&lt;br /&gt;
Intermolecular 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;
&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; are scaling factors. For example, if the parameters for Argon are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\sigma = 0.34 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt; \epsilon\ /\ k_B = 120 K&amp;lt;/math&amp;gt;&lt;br /&gt;
* Lennard-Jones cutoff &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;. The well-depth, &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;, is &amp;lt;math&amp;gt;0.999 kJ mol^{-1} \approx 1 kJ mol^{-1}&amp;lt;/math&amp;gt;. The value of &amp;lt;math&amp;gt;T* = 1.5&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;180 K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
The first aim of the simulations is to determine the most appropriate timestep to use in the vert algorithm simulations. This timestep is a balance between the accuracy of the results (the smaller the timestep, the closer to the true functing the result will be) and the length of real time over which the simluation is run (the smaller the timestep, the less real time over which the simulation will give a result). The appropriateness of the timestep will be determined by plotting how the total free energy of the simulated lattice equilibrates over time.  &lt;br /&gt;
&lt;br /&gt;
Five different calculations, which simulated the melting of a crystal and subsequent equilibration of the energy of the melted crystal, were run at five different timesteps; 0.001, 0.0025, 0.0075, 0.01 and 0.015, and were described by the NVE or &#039;&#039;&amp;quot;microcanonical ensemble&amp;quot;&#039;&#039;. An ensemble is a collection of samples of a system which are under three thermodynamic constraints (three properties are kept constant); in the microcanonical ensemble, the number of particles, the volume and the total energy is kept constant (NVE). &lt;br /&gt;
&lt;br /&gt;
These calculations simulate a box of 1000 unit cells and use periodic boundary conditions to replicate the simulation to a larger scale. Because these simulations use the numerical methods defined in the previous section, the initial position and velocity of the atoms must be defined in the input file. The Brownian (uncorrelated, random) motion of the atoms in the simulation means that there is no long range order in the system and so the atoms in a real system would start in random positions. However, assigning random starting coordinates to the atoms in a simulated liquid is not a relative process; the coordinates are generate independently of each other. Therefore there is a probability that the coordinates simulated will cause the atoms to overlap, which would give a very large repulsion potential, as seen in the Lennard-Jones potential at very small interatomic distances. This short-range repulsion potential comes from the hard-sphere model of atomic simulation.&lt;br /&gt;
&lt;br /&gt;
The input file also defines the structure and density of the lattice. The number density of lattice points in any lattice is the number of lattice points per volume of the unit cell. In a simple cubic lattice, there is one lattice point in the unit cell. From an sc lattice with lattice spacing (length of one side of the unit cell) being &amp;lt;math&amp;gt;1.07722&amp;lt;/math&amp;gt;, the number density of the lattice points is calculated by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{1}{1.07722^3} = 0.7999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a face-centered cubic lattice (fcc), there are four lattice points in the unit cell. Rearranging the above relationship, the lattice spacing can be calculated from the number of lattice points in a unit cell and number density, &amp;lt;math&amp;gt;1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Lattice\ spacing = \sqrt[3]{\frac{number\ of\ lattice\ points\ per\ unit\ cell}{number\ density}} = \sqrt[3]{\frac{4}{1.2}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation creates a box which includes 1000 unit cells, which is 10 unit cells in each dimension. For a simple cubic lattice, because there is one lattice point per unit cell, there will be 1000 atoms created as seen in the input file. The &#039;&#039;create_atom&#039;&#039; command in the input file determines how many boxes are created in the simulation and therefore how many atoms will be created. If a face centered cubic lattice is simulated, because there are 4 lattice points per unit cell, 4000 atoms will be created in the &#039;&#039;create_atom&#039;&#039; command. &lt;br /&gt;
&lt;br /&gt;
The input script also contains the following commands which defines the potential surface which is used to model the intermolecular reactions:&lt;br /&gt;
 mass 1 1.0&lt;br /&gt;
This instruction sets the mass type for the atoms being simulated. It takes the general form of “mass I value”, where mass is the keyword which tells LAMMPS what the input is, I is the atom type and value is the mass of the atom. In this case, I is defined by a specific numerical value; 1 as there is only 1 type of atom in the simulation, but it can be defined with an asterisk (1*), which means “all atom types of 1 to n inclusive”. &lt;br /&gt;
 pair_style lj/cut 3.0&lt;br /&gt;
This instruction sets the type of potential which LAMMPS uses in its calculation of pairwise interactions. It takes the general form of “pair_style style args”, where pair_style is the keyword for LAMMPS, style defines the potential and any specifications it may have, and args are the arguments required for this particular potential. In this case, the Lennard-Jones potential has been used (lj) with a cutoff point (cut) of 3σ. The cutoff point is explained in the introduction section. &lt;br /&gt;
 pair_coeff * * 1.0 1.0&lt;br /&gt;
This instruction specifies the coefficients for the pairwise interactions of each pair of atoms, and it takes the general form “pair_coeff I J args”. Pair_coeff is the keyword, I and J are the atom types, and args are the coefficients which the different atoms types take. In this case, the asterisk in place of I and J refers to all atoms types from 1 to n. The coefficients are the pairwise interactions are 1 for each atom, meaning each atom has an equal contribution to the interaction.&lt;br /&gt;
&lt;br /&gt;
In these initial calculations, the initial conditions for the numerical methods, &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. For this experiment, the verit-velocity algorithm would be the most appropriate, as both the starting position and velocity is specified for this algorithm. &lt;br /&gt;
&lt;br /&gt;
To define the timestep for the algorithm the following code is used defining the timestep as a variable instead of just giving it a definite value&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;
It is much easier to use the variable version of defining the timestep because the length of time over which the simulation is run depends on the time step. By using a variable, you can keep the length of the simulation the same, no matter the size of the timestep. It also makes it easier if multiple properties depend on the timestep – only the variable needs to be changed, not all the parts of the script where timestep is defined. &lt;br /&gt;
&lt;br /&gt;
The calculations produce the values for the total energy of the system, temperature and pressure in the output files, which can be plotted against time. How well these values equilibrate determines the appropriateness of the timestep to use in further calculations in the experiment.   &lt;br /&gt;
[[File:Rmt totalenergy plot.png|none|thumb|800x800px|&#039;&#039;Figure h. &#039;&#039;Plot of the equilibration of total energy for five different timesteps]]&lt;br /&gt;
The largest time step to give an acceptable result is 0.01. However, for any simluation we would expect energy to be independent of the timestep, something which is not true at a timestep greater than 0.0025. Therefore, the most appropriate timestep to use for a balance between accuracy and length of time which the simulation covers is 0.0025.  &lt;br /&gt;
&lt;br /&gt;
0.015 is a particularly bad choice of timestep. This is because the verit-velocity algorithm gives an approximate result to the velocity (kinetic energy term) and position (potential energy term), and so when the timestep becomes too large with respect to the time, the algorithm no longer becomes a suitable way to calculate the energy. As seen in the graph of 0.015, the energy does not equilibrate and diverges.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions ==&lt;br /&gt;
The calculations in this section are run in the isobaric-isothermal ensemble, where the number of particles in the system, the pressure and the temperature are kept constant (NpT). This means that the temperature and the pressure are recalculated in every step, so are no longer constant like they were in the NVE ensemble. From the &#039;&#039;equipartition theorem&#039;&#039;, each degree of freedom will contribute &amp;lt;math&amp;gt;\frac{1}{2} k_B T&amp;lt;/math&amp;gt; of energy to the system. As the system is in three dimensions, there are three degrees of translational freedom and so the total internal energy is equal to &amp;lt;math&amp;gt;\frac{3}{2} k_B T&amp;lt;/math&amp;gt;. Equating this to the kinetic energy, &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt;, at the end of every step and rearranging will allow calculation of the temperature after every step. &lt;br /&gt;
&lt;br /&gt;
A target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, is defined in the input script and the system will equilibrate by multiplying the velocity by a factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, in order to accommodate for the fluctuation and keep the system at approximately the target temperature and therefore constant internal energy. If the temperature of the system is greater than the target temperature, the system&#039;s kinetic energy is too high, so &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is reduced to compensate for this. The same is true for is the temperature is lower than the target temperature; &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than one in the next step to increase the kinetic energy which is now too low. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; can be derived from equating the kinetic and internal energy of the system at an arbitrary time step:&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;
Expanding the brackets inside the sum and moving the term containing &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; out of the sum: &amp;lt;math&amp;gt;\frac{\gamma^2}{2}\sum_i m_i \left(v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;, we can replace &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt; on the left hand side of the equation with &amp;lt;math&amp;gt;\frac{3}{2} N k_B T&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;\frac{3\gamma^2}{2}N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Simplifying and rearranging for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, gives: &amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The principle is the same for controlling the pressure.&lt;br /&gt;
&lt;br /&gt;
As temperature and pressure are no longer constant, he input files require specification of the pressure and the temperature for each of the systems run. 10 simulations were run at two different pressures with five different temperatures at each. &lt;br /&gt;
* Temperatures: 1.6, 1.9, 2.2, 2.5, 2.8&lt;br /&gt;
* Pressures: 2.5, 3.0&lt;br /&gt;
These pressures were chosen because the data simulated when choosing an appropriate timestep gave a pressure between 2.5 and 3.0.  &lt;br /&gt;
&lt;br /&gt;
For the code which computes the thermodynamic potentials, this particular line defines how many steps contribute towards the average of the thermodynamic parameters computed in the calculation. &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;
&#039;&#039;fix&#039;&#039; is the keyword, &#039;&#039;aves&#039;&#039; is the name of the group of fixes which in this case is the average of the thermodynamic values, &#039;&#039;all&#039;&#039; specifies the atoms which the fix is applied to which in this case is all the atoms in the simulated system and &#039;&#039;ave/time&#039;&#039; means that compute global time averages are calculated. The following three numbers have the following meaning:&lt;br /&gt;
&lt;br /&gt;
*100 = use the input values every 100 timesteps&lt;br /&gt;
*1000 = use input values 1000 times for calculating the average&lt;br /&gt;
*100000 = calculate the average every 100000 timesteps&lt;br /&gt;
&lt;br /&gt;
Therefore for the total calculation which lasts for 100000 will only have the average calculated once. Assuming 1 value every timestep, there will be 100000/100 values = 1000. The amount of time simulated is 100,000 steps, read from the following line.&lt;br /&gt;
&lt;br /&gt;
The density data from all ten calculation were plotted on the same graph, along with the density for an &amp;quot;ideal&amp;quot; gas. This density can be derived from the ideal gas law:&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;
Rearranging in terms of density: &amp;lt;math&amp;gt;\frac{N}{V} = \frac{P}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As these simulations are being run under reduced units, we can take &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt;, and so the density of the ideal gas becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the density of the ideal gas is plotted as the pressure divided by the temperature in pressure-temperature phase space.&lt;br /&gt;
[[File:Rmt dvt plot.png|none|thumb|800x800px|&#039;&#039;Figure i. &#039;&#039;Plot of the variation in density with temperature at a defined pressure for the numerically simulated and ideal systems]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that calculated in the ideal gas law. This is because for an ideal gas, an assumption is made that there are no intermolecular interactions, and therefore forces such as electron repulsion forces are ignored; repulsion forces dominate over attractive ones, as all the atoms in this simulation are the same and so partial charges or dipoles are created. This will mean that the particles move closer together than a real gas and so the density will be larger. This discrepancy between the ideal and non-ideal systems becomes larger at a higher pressure because with a higher pressure, the atoms in the system are closer together and therefore the intermolecular repulsion will become larger. This greater repulsion will in turn have a larger effect on decreasing the density.&lt;br /&gt;
&lt;br /&gt;
== Statistical Physics Calculations of the Heat Capacity ==&lt;br /&gt;
The heat capacity of a system at constant volume can be calculated from the variance in the total energy of the system. The relationship used to calculate the heat capacity is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = 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;\left\langle E^2\right\rangle&amp;lt;/math&amp;gt; is the continuous average of the total square energy at each temperature as a function of temperature. &amp;lt;math&amp;gt;\left\langle E\right\rangle^2&amp;lt;/math&amp;gt; is the continuous average of the total energy at each temperature as a function of temperature squared. The heat capacity is multiplied by &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; in this case because the version of LAMMPS calculates every energy divided by the number of molecules in the system simulated.&lt;br /&gt;
&lt;br /&gt;
The calculations in this sections are run in density-temperature phase space and the ensemble has changed to the canonical ensemble (NVT). A set of input files were written for ten calculations for, like the previous section, two pressures and five different temperatures at each pressure:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 0.2, 0.8&lt;br /&gt;
*Temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{C_V}{V}&amp;lt;/math&amp;gt; was plotted against temperature to determine the relationship in density-temperature phase space. An example of an input file can be found [[Media:nvt_-_0220.in|here]]. The lines which have been changed from the previous input files are at the end of the script:&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 &lt;br /&gt;
 thermo_style custom step etotal temp&lt;br /&gt;
 variable energy equal etotal&lt;br /&gt;
 variable energy2 equal etotal*etotal&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_energy v_energy2 v_temp&lt;br /&gt;
 run 100000&lt;br /&gt;
 &lt;br /&gt;
 variable aveenergy equal f_aves[1]&lt;br /&gt;
 variable aveenergy2 equal f_aves[2]&lt;br /&gt;
 variable avetemp equal f_aves[3]&lt;br /&gt;
 variable heatcapacitydv equal atoms*atoms*(v_aveenergy2-v_aveenergy*v_aveenergy)/(v_avetemp*v_avetemp*vol)&lt;br /&gt;
 &lt;br /&gt;
 print &amp;quot;Averages&amp;quot;&lt;br /&gt;
 print &amp;quot;--------&amp;quot;&lt;br /&gt;
 print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Heat Capacity per Volume: ${heatcapacitydv}&amp;quot;&lt;br /&gt;
The line with the keyword &#039;fix&#039; determines which thermodynamic values are averaged and over how many steps they are averaged. The next section takes these averages as variables and uses them to define the heat capacity which is calculated from the equation at the beginning of this section. Only the energy and temperature are needed to define the heat capacity and so only these values are calculated by the simulation. [[File:Rmt heatcapacitybyv.png|none|thumb|800x800px|&#039;&#039;Figure j. &#039;&#039;C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V against temperature for the two different pressures 0.2 and 0.8]]As seen in the above figure, the heat capacity decreases with temperature for both pressures. It would be expected for an ideal system that as the temperature increases, the heat capacity at constant volume increases and tends to a constant volume at very high T of 3R; R = the universal gas constant. This means increasing the temperature increases the amount of energy being stored in the system and this energy is stored as vibrational energy. However, for a Lennard-Jones liquid, the system being simulated here, the heat capacity decreases with temperature. This is because the simulation has two components to the simulation; the atoms are vibrating in a quasi-harmonic fashion around the equilibrium position and also diffuse between neighbouring equilibrium positions in a gas like fashion. As the temperature increases, the amount of diffusion increases and the vibrations decreases, therefore decreasing the ability of the system to absorb vibrational energy, resulting in the decrease in heat capacity. &amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www.nature.com/ncomms/2013/130816/ncomms3331/full/ncomms3331.html?message-global=remove&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural Properties and the Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a single atom in a system is a plot of the probability that an atom can be found at a certain distance from the central atom. The peaks in this plot can give the distance of an atom from its nearest neighbours in the Lennard-Jones simulated system. &lt;br /&gt;
&lt;br /&gt;
The calculations in this section simulate a Lennard-Jones solid, liquid and gas and, using the output of the LAMMPS trajectory file, plots both the radial distribution function and its integral using DLV. The temperature and pressure parameters for these calculations were taken from the phase diagram or coexistence curve for a Lennard-Jones system.&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt; The parameters used are displayed in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! Temperature, &amp;lt;math&amp;gt;T^*&amp;lt;/math&amp;gt;&lt;br /&gt;
! Pressure, &amp;lt;math&amp;gt;p^*&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| LJ Solid&lt;br /&gt;
| 1.5&lt;br /&gt;
| 1.2&lt;br /&gt;
|-&lt;br /&gt;
| LJ Liquid&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.8&lt;br /&gt;
|-&lt;br /&gt;
| LJ Gas&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.01&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The data obtained from the plots and the radial distribution functions and their integrals were plotted and shown in the table below.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure k. &#039;&#039;The radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
!&#039;&#039;Figure l. &#039;&#039;The integrals of the radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt fullrdfs.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt allintegralsrdf.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
[[File:Rmt Nearest neighbours.png|left|thumb|300x300px|&#039;&#039;Figure m. &#039;&#039;Representation of a cross section of the first three shells of nearest neighbours in an fcc solid. The black atom is the central atom being considered, the blue atoms are the first shell, the orange atoms the second shell and the purple atoms are the third.]]&lt;br /&gt;
The RDF of the solid gives a very irregular curve because of the irregular structure of the lattice. For a simple cubic lattice, a regular structure of the RDF would be expected because of the equal number of atoms in each of the nearest neighbour shells of the atoms. However, for face-centered cubic, the solid in this simulation, the structure is much more irregular and as the atoms move from their equilibrium position in the lattice due to vibrations, the peaks in the radial distribution will broaden. The irregular heights of the peaks are due to the varying numbers of atoms in each of the nearest neighbour shells for the central atom. The first shell gives the highest peak as it contains the most atoms; in total, considering all four surrounding unit cells, this shell contains 12 atoms and ideally takes the geometry of an icosahedron. The second shell is smaller and contains only 6 atoms in an octahedral coordination shape. The following shell again contributes 12 atoms, 3 from each unit cell. This therefore explains why the heights of the peaks in the solid plot in &#039;&#039;figure k.&#039;&#039; vary. These values can be confirmed by the plot in &#039;&#039;figure o.&#039;&#039; which is the integral; it cumulatively adds the numbers in each shell. The size of the first &amp;quot;step&amp;quot; is 12; there are 12 atoms in the first shell. The size of the second step is approximately 18; there are 18-12=6 steps in the second shell. The same theory applies for the third shell which gives a value of 13. This is slightly different to the predicted value possibly due to error in the calculation of the radial distribution function and therefore its integral. &lt;br /&gt;
&lt;br /&gt;
The RDF of the liquid has a representation of far fewer shells, which means that there are less atoms in the space close to a &amp;quot;central&amp;quot; atom in the bulk solution. The particles have more energy and therefore do not keep to a regular lattice structure. As they move about, some regualrity is maintained around each atom, but only to the extend of two or three shells, meaning there is no long range order in a Lennard-Jones liquid. &lt;br /&gt;
&lt;br /&gt;
The RDF of the gas again omits more shells as there is almost no order in a Lennard-Jones gas. The single peak on this plot considers only the set of atoms closest to the central atom and all others are disregarded as they are too far apart. &lt;br /&gt;
&lt;br /&gt;
Considering &#039;&#039;figure l.&#039;&#039;, the size of the integral of the radial distribution function decreases from solid to liquid to gas. This makes sense as the number of atoms in the surrounding shells decreases with density of the system; the atoms become further apart. &lt;br /&gt;
&lt;br /&gt;
From the plot of the radial distribution function of the solid, the lattice spacing can be determined. For this, we can consider just the first three peaks of the RDF plot. The lattice spacing refers to the length of one unit cell, and so, using &#039;&#039;figure m&#039;&#039;, we can calculate this using two different methods; a) we can use the distance between the central atom and the first shell of nearest neighbours, and use trigonometry to calculate the lattice spacing. Or alternatively b) we can use the distance between the central atom and the second nearest neighbour shell to get the lattice spacing.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure n. &#039;&#039;The radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
!&#039;&#039;Figure o. &#039;&#039;The integral of the radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt solidgr3.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt solidint3.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
Using method a) (with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; as the distance between the central atom and the nearest neighbour: Lattice spacing = &amp;lt;math&amp;gt;\frac{r}{cos({\frac{\pi}{4}})} = \frac{1.02}{cos({\frac{\pi}{4}})} \approx 1.44&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using method b): Lattice spacing &amp;lt;math&amp;gt;\approx 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can take an average between the two get an approximate value for the lattice spacing: &amp;lt;math&amp;gt;1.46 \plusmn 0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These values for distance are all in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
The ability of atoms to move around in a solid liquid or gas can be characterised by the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. In this section, we will explore two different ways to calculate the diffusion coefficient and compare the results. &lt;br /&gt;
&lt;br /&gt;
=== The Mean Squared Displacement ===&lt;br /&gt;
The diffusion coefficient can be measured easily be calculating the mean squared displacement of atoms in the solution; the diffusion coefficient is proportional to the first derivative of the mean squared displacement. By plotting the mean squared displacement as a function of time, the gradient can be taken to calculate the diffusion coefficient when its has equilibrated and become linear.&lt;br /&gt;
&lt;br /&gt;
The temperature and density parameters used were the same as in the previous section:&lt;br /&gt;
* Solid: T=1.5, D=1.2&lt;br /&gt;
* Liquid: T=1.1, D=0.8&lt;br /&gt;
* Gas: T=1.1, D=0.01&lt;br /&gt;
&lt;br /&gt;
Mean density squared calculations were run for all three Lennard-Jones phases and the data plotted as function of timestep below. The data from a simulation containing 1,000,000 atoms was plotted for comparision.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!Plots for the 8,000 atom data&lt;br /&gt;
!Plots for the 1,000,000 atom data&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|[[File:Rmt MSDsolid.png|none|thumb|700x700px]]&lt;br /&gt;
|[[File:Rmt MAsolid.png|none|thumb|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|[[File:Rmt MSDliquid.png|none|thumb|700x700px]]&lt;br /&gt;
|[[File:Rmt MAliquid.png|none|thumb|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|[[File:Rmt MSDgas.png|none|thumb|700x700px]]&lt;br /&gt;
|[[File:Rmt dataplots 25894 image001.png|none|thumb|700x700px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The exact relationship between the mean squared displacement and the diffusion coefficient is:&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;
Taking the gradients of each of the curves at the point at which they become linear and dividing by six will give the diffusion coefficient for each set of data. The gradient also needs to be converted to a function of time; this is done by dividing by the timestep, which in this case is 0.002:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!8,000 atom data diffusion coefficients, &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
!1,000,000 atom data diffusion coefficients &amp;lt;math&amp;gt;D\ /s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient &amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D \approx \mathbf{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 0.9999&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Timestep corrected gradient = &amp;lt;math&amp;gt;0.0915&amp;lt;/math&amp;gt;&lt;br /&gt;
Amount of data used to calculate gradient: timestep 2500-5000, &amp;lt;math&amp;gt;R^2 = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{0.55}{6} = \mathbf{0.0915}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|Gradient = 0.0972&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{48.6}{6} = \mathbf{8.1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Gradient = 0.0386&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{19.6}{6} = \mathbf{3.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For both of the solid approximations, the diffusion coefficient can be approximated as zero. This is because, when equilibrated, the function has a constant value of around 0.2 for the mean squared displacement. A gradient with a value of zero means that the atoms take an infinite amount of time to change their mean squared displacement; to move away from their equilibrium position, and so this means that we can approximate in this system, there will be no diffusion. In real system, however, this is not the case; diffusion occurs but it is very slow. A plot for a real system will give a very shallow positive gradient.&lt;br /&gt;
&lt;br /&gt;
The liquid approximations are very well correlated. This is because in both cases, the mean squared displacement of particles in a liquid increases linearly with time and the gradient of both plots are almost identical. We can assume from this that identical starting conditions were used to calculate this data. Also, we can estimate that 8,000 atoms is a large enough simulation to give an accurate result for the diffusion coefficient for the Lennard-Jones liquid.&lt;br /&gt;
&lt;br /&gt;
The gas approximations are very different. This is most probably due to the fact that the density specified in calculations are different. The 8,000 data can be estimated to be a much lower density because the diffusion coefficient is faster and this means diffusion will happen faster; at a higher density a particle will take longer to diffuse over a given distance. Because of the difference in density, the two values of the diffusion coefficient cannot be qualitatively compared. The reason for the initial deviation for linearity in the gas plots is due to the momentum of the particles initially dominating over the diffusion and the diffusion coefficient is dependent on time. As the system equilibrates, the diffusion coefficient becomes constant and the plots become linear.&lt;br /&gt;
&lt;br /&gt;
=== The Velocity Autocorrelation Function ===&lt;br /&gt;
&lt;br /&gt;
Another way to calculate the diffusion coefficient is by using the velocity correlation function, which determines how the velocity of an atom changes with time. The function determines the difference in time (&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;) when the velocity becomes uncorrelated, i.e. the difference between the velocity at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; and at time &amp;lt;math&amp;gt;t+\tau&amp;lt;/math&amp;gt;. By integrating over this function, we can find the diffusion coefficient. &lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function: &amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can also be written as the integral: &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;
Using the function which defines the position of a classical harmonic oscillator, we can differentiate this to give the equation for the velocity which we can plug into the integral:&lt;br /&gt;
&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;
&amp;lt;math&amp;gt;dv{x(t)}{t} = v(t) = -A\omega sin(\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also needed for the integral:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t+\tau) = -A\omega sin(\omega(t+\tau)+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v^2(t) = A^2\omega^2 sin^2(\omega t +\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Putting all this into the integral to find the diffusion coefficient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega sin(\omega t + \phi) \times A\omega sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} A^2\omega^2 sin^2(\omega t +\tau)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A^2\omega^2&amp;lt;/math&amp;gt; can be take out of each of the integrals and cancelled. A substituion can then be made to make solving the integral much simpler:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = \omega t + \phi&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \omega\tau&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the integral becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a) \times sin(a+b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the compound angle rule &amp;lt;math&amp;gt;sin(a+b)=sin(a)cos(b)+cos(a)sin(b)&amp;lt;/math&amp;gt;, the integral can be simplified to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} sin(a)sin(a)cos(b) + sin(a)cos(a)sin(b)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Separating out into two integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)\frac{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} sin(a)cos(a)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the rule &amp;lt;math&amp;gt;sin(a)cos(a) = \frac{1}{2}sin(2a)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b)+sin(b)\frac{\int_{-\infty}^{\infty} \frac{1}{2}(sin(2a))\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(a)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because the function &amp;lt;math&amp;gt;\frac{1}{2}sin(2a)&amp;lt;/math&amp;gt; is symmetric over all space, the second term in this equation becomes zero. Therefore, the integral simplifies to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(b) = cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated from: &amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty C\left(\tau\right)\mathrm{d}\tau &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the approximate value for the diffusion coefficient using the velocity autocorrelation function is &amp;lt;math&amp;gt;D = \frac{1}{3}cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same calculations from the mean squared displacement section gave an output of the velocity autocorrelation function. The function for the Lennard-Jones solid, liquid and gas were plotted against the timestep along with the approximate function for the velocity autocorrelation function, &amp;lt;math&amp;gt;cos(\omega\tau)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=541261</id>
		<title>Rep:Mod:hakunamatata</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=541261"/>
		<updated>2016-02-25T10:25:11Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: /* Dynamical Properties and the Diffusion Coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Introduction to Molecular Dynamics Simulations ==&lt;br /&gt;
===The Classical Particle Approximation and Numerical Integration===&lt;br /&gt;
The verit and verit-velocity algorithms are numerical methods to approximate the average position and velocity respectively of randomly moving atoms in a particular medium (solid, liquid, fliud etc.). This position and velocity can be applied to Newtonian mechanics to calculate such properties as the force and potential energy of the system. The algorithms work by splitting the function into discrete time steps, calculating the values of position and velocity at this particular time step, and then effectively &amp;quot;joining the dots&amp;quot; to create an approximate function. These simulations always use the answer from the previous timestep to compute the new timestep, so initial conditions must be given for the first step. Both of the algorithms are shown below and are derived from the Taylor expansion of the position or velocity of the atoms at the timestep &amp;quot;n+1&amp;quot; or &amp;lt;math&amp;gt;t+\delta t&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit Algorithum:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{x}_i\left(t + \delta t\right) \approx 2\mathbf{x}_i\left(t\right) - \mathbf{x}_i\left(t - \delta t\right) + \frac{\mathbf{F}_i\left(t\right)}{m_i}\delta t^2  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit-Velocity Algorithum:&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i\left(t\right)&amp;lt;/math&amp;gt; is the force acting on a particular atom as a function of time&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i&amp;lt;/math&amp;gt; is the acceleration &lt;br /&gt;
&lt;br /&gt;
The smaller the timestep, the closer the numerical approximation is to the true solution function, which can be modeled as a classical harmonic oscillator. &#039;&#039;Figure a.&#039;&#039; in the table below shows the comparison between the two methods in &#039;&#039;time&#039;&#039; space. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure a. &#039;&#039;Plots of position vs time comparing the verit algorithm and harmonic spring results&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure b. &#039;&#039;Plot of the total classical energy of the system (potential + kinetic)&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory xanalytical.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory energy.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The harmonic spring position values are modeled from the harmonic oscillator or particle on a spring. The equation of &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; was used to calculate these values, where &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; are 1 and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; is zero. As seen on the plot, the curves produced from the two different methods of calculating the position are in good agreement.&lt;br /&gt;
|The potential energy is calculated using the equation U = 1/2 kx^2, with a value of k given as 1. The kinetic energy is calculated using the velcity from the verit-velocity algorithm using the equation T = 1/2 mv^2, with a value of m given as 1. The total energy of the system, E, is equal to T + U. The values for x (potential energy) and v (kinetic energy) are taken from the verity algorithm and verit-velocity algorthim respectively. &lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;Figure c. &#039;&#039;Plot of the difference (error) between the harmonic spring and verit algorithm data&lt;br /&gt;
!&#039;&#039;Figure d. &#039;&#039;Plot of the peaks in the error plot in &#039;&#039;figure c.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory error.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory errorpeaks.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The peaks in the error between the harmonic spring and verit algorithm results are at the place where the position curve crosses the time axis. This is because the harmonic spring data (x(t)) has a slightly shorter wave period than that of the verit velocity algorithm, and therefore the difference will get larger with each period of the wave, shown by the error getting larger in &#039;&#039;figure c. &#039;&#039;The period of the plot of the two methods are different because the verit algorithm is much more approximate so does not give the correct solution.&lt;br /&gt;
|The change in the error/difference between the harmonic spring data and verit algorthm data increases linearly and so therefore period of each of the plots in &#039;&#039;figure 1&#039;&#039;. must be constant. &lt;br /&gt;
|}&lt;br /&gt;
The error can also be quantified on a &#039;&#039;phase space&#039;&#039; plot; phase space is momentum or velocity plotted as a function of position. The true solution for motion of an atom is a perfect ellipse, and the more elliptic the shape (less circular) the more momentum or velocity is in the system. A numerical solution, like the verit algorithms, will produce a set of points very close to this ellipse but not perfectly following the curve. A good numerical solution will remain in an elliptical shape, whereas a bad numerical solution, for example one with a large timestep, will spiral away from the true solution. Two examples of such systems using the data from &#039;&#039;figures a-d&#039;&#039; are shown below.  &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure e. &#039;&#039;Phase plot of the harmonic spring data with a good numerical solution (timestep = 0.1) &lt;br /&gt;
!&#039;&#039;Figure f. &#039;&#039;Phase plot of the harmonic spring data with a bad numerical solution (timestep = 0.3) &lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory phasegood.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory badphase.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The timestep at which this data is plotted is 0.1, which results in a very small change in the energy, as seen in &#039;&#039;figure b. &#039;&#039;Increasing the time step will increase the variation in the energy. To keep the variation in the total energy of the system under 1%, the time step must be no larger than approximately 0.28. The energy varies more with increasing time step because the jumps in the algorithm  are getting larger due to less data points. The algorithm assumes these points are joined by a straight line; that the halfway point in the jump is the average between the starting and finishing point of the jump. The phase space plot will become less elliptic and the jumps eventually become so larger that the plot is no longer a continuous shape.  &lt;br /&gt;
&lt;br /&gt;
It is essential to monitor the energy of a numerically modeled system because a good solution for the motion of an atom has a constant energy and a plot in phase space of a perfect ellipse.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance and Force at Zero Potential===&lt;br /&gt;
From classical mechanics, the force calculated from the Newtonian mechanics above can be used to calculate the potential experienced by an atom in the system. They are related by the equation: &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;
This potential gives the shape and dimension of the potential surface on which the system can be modeled. A simple 1D potential that is used to describe the inter atomic forces of a liquid is the Lennard-Jones potential. It has the characteristic features of a short range repulsion potential and harmonic character around the equilibrium bond distance. The value of &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the inter atomic separation when the potential, &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;, is equal to zero, can be calculated by equating the equation for the Lennard-Jones potential to zero and solving for &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The equation for the Lennard-Jones potential: &amp;lt;math&amp;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;
Equating this to zero: &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;
And rearranging in order to separate the variables: &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;
Rearranging this gives &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in terms of &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt; r^6 = \sigma^6&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r = r_0&amp;lt;/math&amp;gt; in this case.&lt;br /&gt;
&lt;br /&gt;
This, therefore, gives the result that interatomic distance at zero potential, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, is equal to &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; in the Lennard-Jones potential is effectively the diameter of one of the particles in the system being measured; in this case, the liquid we are simulating. This is the point where the potential curve crosses the x-axis on an Energy vs interatomic distance plot. The force, &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt;, at this point on the curve corresponds to the gradient; it is found by calculating the derivative of the curve at this point. &lt;br /&gt;
&lt;br /&gt;
To calculate the force, we must differentiate the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As force is equal to the negative differential of the potential energy, the value of the force is: &amp;lt;math&amp;gt;\mathbf{F}_i = 48\epsilon \sigma^{12} r^{-13} - 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting in the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at zero potential from the calculation before: &amp;lt;math&amp;gt;\mathbf{F}_i = \frac{48\epsilon}{\sigma} - \frac{24\epsilon}{\sigma} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The gradient where the Lennard-Jones plot crosses the axis is negative; &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; in the term obtained for &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is negative and therefore the overall value of the force will be negative.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance, Force and Well Depth of the Potential at Equilibrium===&lt;br /&gt;
To calculate the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at the equilibrium position, we need to use the derivative of the potential energy curve. The equilibrium value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is the value at the minimum of the Lennard-Jones curve; when &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Therefore, equating the derivative to zero gives: &amp;lt;math&amp;gt;0 = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rearranging this: &amp;lt;math&amp;gt;48\epsilon \sigma^{12} r^{-13} = 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And simplifying and cancelling gives: &amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6&amp;lt;/math&amp;gt;. Therefore the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at equilibrium is: &amp;lt;math&amp;gt;r_{eq} = \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Physically, this result means that the equilibrium distance is 1.12 times the diameter of one of the particles; the particles have a small gap between them so do not touch. A short range repulsion potential, as seen in the Lennard-Jones curve, is a result of the particles coming into contact. &lt;br /&gt;
&lt;br /&gt;
Again, the force can be calculated from the derivative of the potential curve at the equilibrium point. As the derivative at this point is zero (a minimum on the curve), the force will therefore also be zero.&lt;br /&gt;
&lt;br /&gt;
The well-depth of the potential curve is the difference between zero potential and the potential at the equilibrium bond length. This can be calculated by substituting the value for the equilibrium bond length into the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 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;
Cancelling and simplifying this equation gives: &amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \times \frac{1}{4}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the absolute value for the well depth is &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;. The actual value of this potential is &amp;lt;math&amp;gt;-\epsilon&amp;lt;/math&amp;gt;, as the equilibrium bond length gives the most stable configuration of the molecules and therefore suggests attractive interactions are involved in the arrangement of the molecules; this attractive potential means its negative. &lt;br /&gt;
&lt;br /&gt;
===Boundary Conditions and the Lennard-Jones Cutoff===&lt;br /&gt;
When simulating a liquid, it is computationally impractical to simulate a realistic liquid. Therefore a smaller &#039;box&#039; containing &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; particles is simulated and the computer program will use &#039;&#039;periodic boundary conditions&#039;&#039; to simulate infinite repetitions of this box; when the atom reaches one edge of the box, in periodic boundary conditions, it will reappear again at the opposite edge of the box as if they were connected. For example, an atom at the position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a box of size &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;. Without periodic boundary conditions, we would assume that the atom would end up at the position &amp;lt;math&amp;gt;(1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;. However, in this box, there is no such position and so the particle must reappear at the opposite edge to where it effectively &#039;left&#039; the box. Therefore, it&#039;s ending position will be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The number of particles, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; simulated by the computer is usually between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt;. Physically, this is a very small volume. Considering water, we can calculate the number of molecules in 1 mL or 1 cm^3, a volume that would be considered small in the lab. Taking the concentration of water at standard conditions, &amp;lt;math&amp;gt;55\ mol\ dm^{-3}&amp;lt;/math&amp;gt;, we can convert it to the number of moles per mL: &amp;lt;math&amp;gt;0.055\ mol\ mL^{-1}&amp;lt;/math&amp;gt;. Multiplying this value by Avagadro&#039;s constant (&amp;lt;math&amp;gt;N_A&amp;lt;/math&amp;gt;) gives the number of molcules of water per mL: &amp;lt;math&amp;gt;3.02 \times 10^{22}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The reverse procedure can be used to compare this to the volume of 10,000 molecules: 10,000 divided by Avagadro&#039;s constant gives the number of moles of water which 10,000 molecules makes up: &amp;lt;math&amp;gt;1.66 \times 10^{-20}\ moles&amp;lt;/math&amp;gt;. Dividing this value by the concentration (from &amp;lt;math&amp;gt;n=cV&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is the number of moles, &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; is the concentration and &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume), gives the volume: &amp;lt;math&amp;gt;3.02 \times 10^{-22}\ dm&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;3.02 \times 10^{-19}\ mL&amp;lt;/math&amp;gt;. Physically, of course, this is far too small a volume to be recorded in the lab.&lt;br /&gt;
 &lt;br /&gt;
Periodic boundary conditions simulate an infinite lattice and therefore, when computing the potential, will calculate an infinite amount of pair interactions. Therefore, it is only practical to calculate the energies up to a certain interatomic distance; the Lennard-Jones cutoff distance. Beyond this point, the potential energy and the integral of the curve beyond this point become insignificant and do not impact on the overall energy; removing interactions beyond this point from the calculations will not effect the accuracy. Multiplying the Lennard-Jones potential with the radial distribution function gives a plot of the probability of finding an atom at a particular interatomic distance. The larger the interatomic distance, the lower the probability and so the energy after the cutoff can be disregarded. &lt;br /&gt;
&lt;br /&gt;
Integrating over the Lennard-Jones curve and applying this cutoff as the lower limit can show how small the integral is:&lt;br /&gt;
&lt;br /&gt;
For a general cutoff of with value &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;I = \int_{x}^\infty \phi\left(r\right)\mathrm{d}r = \int_{x}^\infty \frac{4\epsilon\sigma^{12}}{r^{12}}\mathrm{d}r - \int_{x}^\infty \frac{4\epsilon\sigma^6}{r^6}\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving this: &amp;lt;math&amp;gt;I = 4\epsilon\sigma^{12} {\frac{-1}{11r^{11}}\,\Bigg\vert\,}_x^\infty - 4\epsilon\sigma^{6} {\frac{-1}{5r^{5}}\,\Bigg\vert\,}_x^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This gives the general solution: &amp;lt;math&amp;gt;I = \frac{4\epsilon\sigma^{12}}{11x^{11}} - \frac{4\epsilon\sigma^{6}}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating this for &amp;lt;math&amp;gt;\epsilon = \sigma = 1&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;I = \frac{4}{11x^{11}} - \frac{4}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt; (or 2 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.025&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt; (or 2.5 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0082&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt; (or 3 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0033&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All values are taken to 2 significant figures. As the cutoff value for the interatomic distance gets larger, the integral gets smaller, and therefore the energy excluded from the calculation becomes smaller, and the second term in the solved integral, &amp;lt;math&amp;gt;I&amp;lt;/math&amp;gt;, dominates the energy value.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
When using the Lennard-Jones potential, it is appropriate to use reduced units for intermolecular distance, energy and temperature. Reduced units can be calculated by the following relationships:&lt;br /&gt;
&lt;br /&gt;
Intermolecular 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;
&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; are scaling factors. For example, if the parameters for Argon are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\sigma = 0.34 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt; \epsilon\ /\ k_B = 120 K&amp;lt;/math&amp;gt;&lt;br /&gt;
* Lennard-Jones cutoff &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;. The well-depth, &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;, is &amp;lt;math&amp;gt;0.999 kJ mol^{-1} \approx 1 kJ mol^{-1}&amp;lt;/math&amp;gt;. The value of &amp;lt;math&amp;gt;T* = 1.5&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;180 K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
The first aim of the simulations is to determine the most appropriate timestep to use in the vert algorithm simulations. This timestep is a balance between the accuracy of the results (the smaller the timestep, the closer to the true functing the result will be) and the length of real time over which the simluation is run (the smaller the timestep, the less real time over which the simulation will give a result). The appropriateness of the timestep will be determined by plotting how the total free energy of the simulated lattice equilibrates over time.  &lt;br /&gt;
&lt;br /&gt;
Five different calculations, which simulated the melting of a crystal and subsequent equilibration of the energy of the melted crystal, were run at five different timesteps; 0.001, 0.0025, 0.0075, 0.01 and 0.015, and were described by the NVE or &#039;&#039;&amp;quot;microcanonical ensemble&amp;quot;&#039;&#039;. An ensemble is a collection of samples of a system which are under three thermodynamic constraints (three properties are kept constant); in the microcanonical ensemble, the number of particles, the volume and the total energy is kept constant (NVE). &lt;br /&gt;
&lt;br /&gt;
These calculations simulate a box of 1000 unit cells and use periodic boundary conditions to replicate the simulation to a larger scale. Because these simulations use the numerical methods defined in the previous section, the initial position and velocity of the atoms must be defined in the input file. The Brownian (uncorrelated, random) motion of the atoms in the simulation means that there is no long range order in the system and so the atoms in a real system would start in random positions. However, assigning random starting coordinates to the atoms in a simulated liquid is not a relative process; the coordinates are generate independently of each other. Therefore there is a probability that the coordinates simulated will cause the atoms to overlap, which would give a very large repulsion potential, as seen in the Lennard-Jones potential at very small interatomic distances. This short-range repulsion potential comes from the hard-sphere model of atomic simulation.&lt;br /&gt;
&lt;br /&gt;
The input file also defines the structure and density of the lattice. The number density of lattice points in any lattice is the number of lattice points per volume of the unit cell. In a simple cubic lattice, there is one lattice point in the unit cell. From an sc lattice with lattice spacing (length of one side of the unit cell) being &amp;lt;math&amp;gt;1.07722&amp;lt;/math&amp;gt;, the number density of the lattice points is calculated by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{1}{1.07722^3} = 0.7999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a face-centered cubic lattice (fcc), there are four lattice points in the unit cell. Rearranging the above relationship, the lattice spacing can be calculated from the number of lattice points in a unit cell and number density, &amp;lt;math&amp;gt;1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Lattice\ spacing = \sqrt[3]{\frac{number\ of\ lattice\ points\ per\ unit\ cell}{number\ density}} = \sqrt[3]{\frac{4}{1.2}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation creates a box which includes 1000 unit cells, which is 10 unit cells in each dimension. For a simple cubic lattice, because there is one lattice point per unit cell, there will be 1000 atoms created as seen in the input file. The &#039;&#039;create_atom&#039;&#039; command in the input file determines how many boxes are created in the simulation and therefore how many atoms will be created. If a face centered cubic lattice is simulated, because there are 4 lattice points per unit cell, 4000 atoms will be created in the &#039;&#039;create_atom&#039;&#039; command. &lt;br /&gt;
&lt;br /&gt;
The input script also contains the following commands which defines the potential surface which is used to model the intermolecular reactions:&lt;br /&gt;
 mass 1 1.0&lt;br /&gt;
This instruction sets the mass type for the atoms being simulated. It takes the general form of “mass I value”, where mass is the keyword which tells LAMMPS what the input is, I is the atom type and value is the mass of the atom. In this case, I is defined by a specific numerical value; 1 as there is only 1 type of atom in the simulation, but it can be defined with an asterisk (1*), which means “all atom types of 1 to n inclusive”. &lt;br /&gt;
 pair_style lj/cut 3.0&lt;br /&gt;
This instruction sets the type of potential which LAMMPS uses in its calculation of pairwise interactions. It takes the general form of “pair_style style args”, where pair_style is the keyword for LAMMPS, style defines the potential and any specifications it may have, and args are the arguments required for this particular potential. In this case, the Lennard-Jones potential has been used (lj) with a cutoff point (cut) of 3σ. The cutoff point is explained in the introduction section. &lt;br /&gt;
 pair_coeff * * 1.0 1.0&lt;br /&gt;
This instruction specifies the coefficients for the pairwise interactions of each pair of atoms, and it takes the general form “pair_coeff I J args”. Pair_coeff is the keyword, I and J are the atom types, and args are the coefficients which the different atoms types take. In this case, the asterisk in place of I and J refers to all atoms types from 1 to n. The coefficients are the pairwise interactions are 1 for each atom, meaning each atom has an equal contribution to the interaction.&lt;br /&gt;
&lt;br /&gt;
In these initial calculations, the initial conditions for the numerical methods, &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. For this experiment, the verit-velocity algorithm would be the most appropriate, as both the starting position and velocity is specified for this algorithm. &lt;br /&gt;
&lt;br /&gt;
To define the timestep for the algorithm the following code is used defining the timestep as a variable instead of just giving it a definite value&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;
It is much easier to use the variable version of defining the timestep because the length of time over which the simulation is run depends on the time step. By using a variable, you can keep the length of the simulation the same, no matter the size of the timestep. It also makes it easier if multiple properties depend on the timestep – only the variable needs to be changed, not all the parts of the script where timestep is defined. &lt;br /&gt;
&lt;br /&gt;
The calculations produce the values for the total energy of the system, temperature and pressure in the output files, which can be plotted against time. How well these values equilibrate determines the appropriateness of the timestep to use in further calculations in the experiment.   &lt;br /&gt;
[[File:Rmt totalenergy plot.png|none|thumb|800x800px|&#039;&#039;Figure h. &#039;&#039;Plot of the equilibration of total energy for five different timesteps]]&lt;br /&gt;
The largest time step to give an acceptable result is 0.01. However, for any simluation we would expect energy to be independent of the timestep, something which is not true at a timestep greater than 0.0025. Therefore, the most appropriate timestep to use for a balance between accuracy and length of time which the simulation covers is 0.0025.  &lt;br /&gt;
&lt;br /&gt;
0.015 is a particularly bad choice of timestep. This is because the verit-velocity algorithm gives an approximate result to the velocity (kinetic energy term) and position (potential energy term), and so when the timestep becomes too large with respect to the time, the algorithm no longer becomes a suitable way to calculate the energy. As seen in the graph of 0.015, the energy does not equilibrate and diverges.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions ==&lt;br /&gt;
The calculations in this section are run in the isobaric-isothermal ensemble, where the number of particles in the system, the pressure and the temperature are kept constant (NpT). This means that the temperature and the pressure are recalculated in every step, so are no longer constant like they were in the NVE ensemble. From the &#039;&#039;equipartition theorem&#039;&#039;, each degree of freedom will contribute &amp;lt;math&amp;gt;\frac{1}{2} k_B T&amp;lt;/math&amp;gt; of energy to the system. As the system is in three dimensions, there are three degrees of translational freedom and so the total internal energy is equal to &amp;lt;math&amp;gt;\frac{3}{2} k_B T&amp;lt;/math&amp;gt;. Equating this to the kinetic energy, &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt;, at the end of every step and rearranging will allow calculation of the temperature after every step. &lt;br /&gt;
&lt;br /&gt;
A target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, is defined in the input script and the system will equilibrate by multiplying the velocity by a factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, in order to accommodate for the fluctuation and keep the system at approximately the target temperature and therefore constant internal energy. If the temperature of the system is greater than the target temperature, the system&#039;s kinetic energy is too high, so &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is reduced to compensate for this. The same is true for is the temperature is lower than the target temperature; &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than one in the next step to increase the kinetic energy which is now too low. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; can be derived from equating the kinetic and internal energy of the system at an arbitrary time step:&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;
Expanding the brackets inside the sum and moving the term containing &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; out of the sum: &amp;lt;math&amp;gt;\frac{\gamma^2}{2}\sum_i m_i \left(v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;, we can replace &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt; on the left hand side of the equation with &amp;lt;math&amp;gt;\frac{3}{2} N k_B T&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;\frac{3\gamma^2}{2}N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Simplifying and rearranging for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, gives: &amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The principle is the same for controlling the pressure.&lt;br /&gt;
&lt;br /&gt;
As temperature and pressure are no longer constant, he input files require specification of the pressure and the temperature for each of the systems run. 10 simulations were run at two different pressures with five different temperatures at each. &lt;br /&gt;
* Temperatures: 1.6, 1.9, 2.2, 2.5, 2.8&lt;br /&gt;
* Pressures: 2.5, 3.0&lt;br /&gt;
These pressures were chosen because the data simulated when choosing an appropriate timestep gave a pressure between 2.5 and 3.0.  &lt;br /&gt;
&lt;br /&gt;
For the code which computes the thermodynamic potentials, this particular line defines how many steps contribute towards the average of the thermodynamic parameters computed in the calculation. &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;
&#039;&#039;fix&#039;&#039; is the keyword, &#039;&#039;aves&#039;&#039; is the name of the group of fixes which in this case is the average of the thermodynamic values, &#039;&#039;all&#039;&#039; specifies the atoms which the fix is applied to which in this case is all the atoms in the simulated system and &#039;&#039;ave/time&#039;&#039; means that compute global time averages are calculated. The following three numbers have the following meaning:&lt;br /&gt;
&lt;br /&gt;
*100 = use the input values every 100 timesteps&lt;br /&gt;
*1000 = use input values 1000 times for calculating the average&lt;br /&gt;
*100000 = calculate the average every 100000 timesteps&lt;br /&gt;
&lt;br /&gt;
Therefore for the total calculation which lasts for 100000 will only have the average calculated once. Assuming 1 value every timestep, there will be 100000/100 values = 1000. The amount of time simulated is 100,000 steps, read from the following line.&lt;br /&gt;
&lt;br /&gt;
The density data from all ten calculation were plotted on the same graph, along with the density for an &amp;quot;ideal&amp;quot; gas. This density can be derived from the ideal gas law:&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;
Rearranging in terms of density: &amp;lt;math&amp;gt;\frac{N}{V} = \frac{P}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As these simulations are being run under reduced units, we can take &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt;, and so the density of the ideal gas becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the density of the ideal gas is plotted as the pressure divided by the temperature in pressure-temperature phase space.&lt;br /&gt;
[[File:Rmt dvt plot.png|none|thumb|800x800px|&#039;&#039;Figure i. &#039;&#039;Plot of the variation in density with temperature at a defined pressure for the numerically simulated and ideal systems]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that calculated in the ideal gas law. This is because for an ideal gas, an assumption is made that there are no intermolecular interactions, and therefore forces such as electron repulsion forces are ignored; repulsion forces dominate over attractive ones, as all the atoms in this simulation are the same and so partial charges or dipoles are created. This will mean that the particles move closer together than a real gas and so the density will be larger. This discrepancy between the ideal and non-ideal systems becomes larger at a higher pressure because with a higher pressure, the atoms in the system are closer together and therefore the intermolecular repulsion will become larger. This greater repulsion will in turn have a larger effect on decreasing the density.&lt;br /&gt;
&lt;br /&gt;
== Statistical Physics Calculations of the Heat Capacity ==&lt;br /&gt;
The heat capacity of a system at constant volume can be calculated from the variance in the total energy of the system. The relationship used to calculate the heat capacity is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = 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;\left\langle E^2\right\rangle&amp;lt;/math&amp;gt; is the continuous average of the total square energy at each temperature as a function of temperature. &amp;lt;math&amp;gt;\left\langle E\right\rangle^2&amp;lt;/math&amp;gt; is the continuous average of the total energy at each temperature as a function of temperature squared. The heat capacity is multiplied by &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; in this case because the version of LAMMPS calculates every energy divided by the number of molecules in the system simulated.&lt;br /&gt;
&lt;br /&gt;
The calculations in this sections are run in density-temperature phase space and the ensemble has changed to the canonical ensemble (NVT). A set of input files were written for ten calculations for, like the previous section, two pressures and five different temperatures at each pressure:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 0.2, 0.8&lt;br /&gt;
*Temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{C_V}{V}&amp;lt;/math&amp;gt; was plotted against temperature to determine the relationship in density-temperature phase space. An example of an input file can be found [[Media:nvt_-_0220.in|here]]. The lines which have been changed from the previous input files are at the end of the script:&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 &lt;br /&gt;
 thermo_style custom step etotal temp&lt;br /&gt;
 variable energy equal etotal&lt;br /&gt;
 variable energy2 equal etotal*etotal&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_energy v_energy2 v_temp&lt;br /&gt;
 run 100000&lt;br /&gt;
 &lt;br /&gt;
 variable aveenergy equal f_aves[1]&lt;br /&gt;
 variable aveenergy2 equal f_aves[2]&lt;br /&gt;
 variable avetemp equal f_aves[3]&lt;br /&gt;
 variable heatcapacitydv equal atoms*atoms*(v_aveenergy2-v_aveenergy*v_aveenergy)/(v_avetemp*v_avetemp*vol)&lt;br /&gt;
 &lt;br /&gt;
 print &amp;quot;Averages&amp;quot;&lt;br /&gt;
 print &amp;quot;--------&amp;quot;&lt;br /&gt;
 print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Heat Capacity per Volume: ${heatcapacitydv}&amp;quot;&lt;br /&gt;
The line with the keyword &#039;fix&#039; determines which thermodynamic values are averaged and over how many steps they are averaged. The next section takes these averages as variables and uses them to define the heat capacity which is calculated from the equation at the beginning of this section. Only the energy and temperature are needed to define the heat capacity and so only these values are calculated by the simulation. [[File:Rmt heatcapacitybyv.png|none|thumb|800x800px|&#039;&#039;Figure j. &#039;&#039;C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V against temperature for the two different pressures 0.2 and 0.8]]As seen in the above figure, the heat capacity decreases with temperature for both pressures. It would be expected for an ideal system that as the temperature increases, the heat capacity at constant volume increases and tends to a constant volume at very high T of 3R; R = the universal gas constant. This means increasing the temperature increases the amount of energy being stored in the system and this energy is stored as vibrational energy. However, for a Lennard-Jones liquid, the system being simulated here, the heat capacity decreases with temperature. This is because the simulation has two components to the simulation; the atoms are vibrating in a quasi-harmonic fashion around the equilibrium position and also diffuse between neighbouring equilibrium positions in a gas like fashion. As the temperature increases, the amount of diffusion increases and the vibrations decreases, therefore decreasing the ability of the system to absorb vibrational energy, resulting in the decrease in heat capacity. &amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www.nature.com/ncomms/2013/130816/ncomms3331/full/ncomms3331.html?message-global=remove&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural Properties and the Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a single atom in a system is a plot of the probability that an atom can be found at a certain distance from the central atom. The peaks in this plot can give the distance of an atom from its nearest neighbours in the Lennard-Jones simulated system. &lt;br /&gt;
&lt;br /&gt;
The calculations in this section simulate a Lennard-Jones solid, liquid and gas and, using the output of the LAMMPS trajectory file, plots both the radial distribution function and its integral using DLV. The temperature and pressure parameters for these calculations were taken from the phase diagram or coexistence curve for a Lennard-Jones system.&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt; The parameters used are displayed in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! Temperature, &amp;lt;math&amp;gt;T^*&amp;lt;/math&amp;gt;&lt;br /&gt;
! Pressure, &amp;lt;math&amp;gt;p^*&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| LJ Solid&lt;br /&gt;
| 1.5&lt;br /&gt;
| 1.2&lt;br /&gt;
|-&lt;br /&gt;
| LJ Liquid&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.8&lt;br /&gt;
|-&lt;br /&gt;
| LJ Gas&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.01&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The data obtained from the plots and the radial distribution functions and their integrals were plotted and shown in the table below.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure k. &#039;&#039;The radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
!&#039;&#039;Figure l. &#039;&#039;The integrals of the radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt fullrdfs.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt allintegralsrdf.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
[[File:Rmt Nearest neighbours.png|left|thumb|300x300px|&#039;&#039;Figure m. &#039;&#039;Representation of a cross section of the first three shells of nearest neighbours in an fcc solid. The black atom is the central atom being considered, the blue atoms are the first shell, the orange atoms the second shell and the purple atoms are the third.]]&lt;br /&gt;
The RDF of the solid gives a very irregular curve because of the irregular structure of the lattice. For a simple cubic lattice, a regular structure of the RDF would be expected because of the equal number of atoms in each of the nearest neighbour shells of the atoms. However, for face-centered cubic, the solid in this simulation, the structure is much more irregular and as the atoms move from their equilibrium position in the lattice due to vibrations, the peaks in the radial distribution will broaden. The irregular heights of the peaks are due to the varying numbers of atoms in each of the nearest neighbour shells for the central atom. The first shell gives the highest peak as it contains the most atoms; in total, considering all four surrounding unit cells, this shell contains 12 atoms and ideally takes the geometry of an icosahedron. The second shell is smaller and contains only 6 atoms in an octahedral coordination shape. The following shell again contributes 12 atoms, 3 from each unit cell. This therefore explains why the heights of the peaks in the solid plot in &#039;&#039;figure k.&#039;&#039; vary. These values can be confirmed by the plot in &#039;&#039;figure o.&#039;&#039; which is the integral; it cumulatively adds the numbers in each shell. The size of the first &amp;quot;step&amp;quot; is 12; there are 12 atoms in the first shell. The size of the second step is approximately 18; there are 18-12=6 steps in the second shell. The same theory applies for the third shell which gives a value of 13. This is slightly different to the predicted value possibly due to error in the calculation of the radial distribution function and therefore its integral. &lt;br /&gt;
&lt;br /&gt;
The RDF of the liquid has a representation of far fewer shells, which means that there are less atoms in the space close to a &amp;quot;central&amp;quot; atom in the bulk solution. The particles have more energy and therefore do not keep to a regular lattice structure. As they move about, some regualrity is maintained around each atom, but only to the extend of two or three shells, meaning there is no long range order in a Lennard-Jones liquid. &lt;br /&gt;
&lt;br /&gt;
The RDF of the gas again omits more shells as there is almost no order in a Lennard-Jones gas. The single peak on this plot considers only the set of atoms closest to the central atom and all others are disregarded as they are too far apart. &lt;br /&gt;
&lt;br /&gt;
Considering &#039;&#039;figure l.&#039;&#039;, the size of the integral of the radial distribution function decreases from solid to liquid to gas. This makes sense as the number of atoms in the surrounding shells decreases with density of the system; the atoms become further apart. &lt;br /&gt;
&lt;br /&gt;
From the plot of the radial distribution function of the solid, the lattice spacing can be determined. For this, we can consider just the first three peaks of the RDF plot. The lattice spacing refers to the length of one unit cell, and so, using &#039;&#039;figure m&#039;&#039;, we can calculate this using two different methods; a) we can use the distance between the central atom and the first shell of nearest neighbours, and use trigonometry to calculate the lattice spacing. Or alternatively b) we can use the distance between the central atom and the second nearest neighbour shell to get the lattice spacing.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure n. &#039;&#039;The radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
!&#039;&#039;Figure o. &#039;&#039;The integral of the radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt solidgr3.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt solidint3.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
Using method a) (with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; as the distance between the central atom and the nearest neighbour: Lattice spacing = &amp;lt;math&amp;gt;\frac{r}{cos({\frac{\pi}{4}})} = \frac{1.02}{cos({\frac{\pi}{4}})} \approx 1.44&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using method b): Lattice spacing &amp;lt;math&amp;gt;\approx 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can take an average between the two get an approximate value for the lattice spacing: &amp;lt;math&amp;gt;1.46 \plusmn 0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These values for distance are all in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
=== The Mean Squared Displacement ===&lt;br /&gt;
The ability of atoms to move around in a solid liquid or gas can be characterised by the diffusion coefficient,&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!Plots for the 8000 atom data&lt;br /&gt;
!Plots for the 1,000,000 atom data&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|[[File:Rmt MSDsolid.png|none|thumb|700x700px]]&lt;br /&gt;
|[[File:Rmt MAsolid.png|none|thumb|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|[[File:Rmt MSDliquid.png|none|thumb|700x700px]]&lt;br /&gt;
|[[File:Rmt MAliquid.png|none|thumb|700x700px]]&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|[[File:Rmt MSDgas.png|none|thumb|700x700px]]&lt;br /&gt;
|[[File:Rmt dataplots 25894 image001.png|none|thumb|700x700px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== The Velocity Autocorrelation Function ===&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Rmt_dataplots_25894_image001.png&amp;diff=541256</id>
		<title>File:Rmt dataplots 25894 image001.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Rmt_dataplots_25894_image001.png&amp;diff=541256"/>
		<updated>2016-02-25T10:19:57Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Rmt_MAgas.png&amp;diff=541253</id>
		<title>File:Rmt MAgas.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Rmt_MAgas.png&amp;diff=541253"/>
		<updated>2016-02-25T10:17:45Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Rmt_MSDgas.png&amp;diff=541252</id>
		<title>File:Rmt MSDgas.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Rmt_MSDgas.png&amp;diff=541252"/>
		<updated>2016-02-25T10:17:06Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Rmt_MSDsolid.png&amp;diff=541251</id>
		<title>File:Rmt MSDsolid.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Rmt_MSDsolid.png&amp;diff=541251"/>
		<updated>2016-02-25T10:16:53Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: Rmt13 uploaded a new version of File:Rmt MSDsolid.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Rmt_MAliquid.png&amp;diff=541250</id>
		<title>File:Rmt MAliquid.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Rmt_MAliquid.png&amp;diff=541250"/>
		<updated>2016-02-25T10:16:16Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Rmt_MSDliquid.png&amp;diff=541248</id>
		<title>File:Rmt MSDliquid.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Rmt_MSDliquid.png&amp;diff=541248"/>
		<updated>2016-02-25T10:14:39Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Rmt_MAsolid.png&amp;diff=541246</id>
		<title>File:Rmt MAsolid.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Rmt_MAsolid.png&amp;diff=541246"/>
		<updated>2016-02-25T10:13:59Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Rmt_MSDsolid.png&amp;diff=541245</id>
		<title>File:Rmt MSDsolid.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Rmt_MSDsolid.png&amp;diff=541245"/>
		<updated>2016-02-25T10:12:16Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=541244</id>
		<title>Rep:Mod:hakunamatata</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=541244"/>
		<updated>2016-02-25T10:06:48Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: /* Structural Properties and the Radial Distribution Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Introduction to Molecular Dynamics Simulations ==&lt;br /&gt;
===The Classical Particle Approximation and Numerical Integration===&lt;br /&gt;
The verit and verit-velocity algorithms are numerical methods to approximate the average position and velocity respectively of randomly moving atoms in a particular medium (solid, liquid, fliud etc.). This position and velocity can be applied to Newtonian mechanics to calculate such properties as the force and potential energy of the system. The algorithms work by splitting the function into discrete time steps, calculating the values of position and velocity at this particular time step, and then effectively &amp;quot;joining the dots&amp;quot; to create an approximate function. These simulations always use the answer from the previous timestep to compute the new timestep, so initial conditions must be given for the first step. Both of the algorithms are shown below and are derived from the Taylor expansion of the position or velocity of the atoms at the timestep &amp;quot;n+1&amp;quot; or &amp;lt;math&amp;gt;t+\delta t&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit Algorithum:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{x}_i\left(t + \delta t\right) \approx 2\mathbf{x}_i\left(t\right) - \mathbf{x}_i\left(t - \delta t\right) + \frac{\mathbf{F}_i\left(t\right)}{m_i}\delta t^2  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit-Velocity Algorithum:&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i\left(t\right)&amp;lt;/math&amp;gt; is the force acting on a particular atom as a function of time&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i&amp;lt;/math&amp;gt; is the acceleration &lt;br /&gt;
&lt;br /&gt;
The smaller the timestep, the closer the numerical approximation is to the true solution function, which can be modeled as a classical harmonic oscillator. &#039;&#039;Figure a.&#039;&#039; in the table below shows the comparison between the two methods in &#039;&#039;time&#039;&#039; space. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure a. &#039;&#039;Plots of position vs time comparing the verit algorithm and harmonic spring results&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure b. &#039;&#039;Plot of the total classical energy of the system (potential + kinetic)&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory xanalytical.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory energy.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The harmonic spring position values are modeled from the harmonic oscillator or particle on a spring. The equation of &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; was used to calculate these values, where &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; are 1 and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; is zero. As seen on the plot, the curves produced from the two different methods of calculating the position are in good agreement.&lt;br /&gt;
|The potential energy is calculated using the equation U = 1/2 kx^2, with a value of k given as 1. The kinetic energy is calculated using the velcity from the verit-velocity algorithm using the equation T = 1/2 mv^2, with a value of m given as 1. The total energy of the system, E, is equal to T + U. The values for x (potential energy) and v (kinetic energy) are taken from the verity algorithm and verit-velocity algorthim respectively. &lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;Figure c. &#039;&#039;Plot of the difference (error) between the harmonic spring and verit algorithm data&lt;br /&gt;
!&#039;&#039;Figure d. &#039;&#039;Plot of the peaks in the error plot in &#039;&#039;figure c.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory error.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory errorpeaks.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The peaks in the error between the harmonic spring and verit algorithm results are at the place where the position curve crosses the time axis. This is because the harmonic spring data (x(t)) has a slightly shorter wave period than that of the verit velocity algorithm, and therefore the difference will get larger with each period of the wave, shown by the error getting larger in &#039;&#039;figure c. &#039;&#039;The period of the plot of the two methods are different because the verit algorithm is much more approximate so does not give the correct solution.&lt;br /&gt;
|The change in the error/difference between the harmonic spring data and verit algorthm data increases linearly and so therefore period of each of the plots in &#039;&#039;figure 1&#039;&#039;. must be constant. &lt;br /&gt;
|}&lt;br /&gt;
The error can also be quantified on a &#039;&#039;phase space&#039;&#039; plot; phase space is momentum or velocity plotted as a function of position. The true solution for motion of an atom is a perfect ellipse, and the more elliptic the shape (less circular) the more momentum or velocity is in the system. A numerical solution, like the verit algorithms, will produce a set of points very close to this ellipse but not perfectly following the curve. A good numerical solution will remain in an elliptical shape, whereas a bad numerical solution, for example one with a large timestep, will spiral away from the true solution. Two examples of such systems using the data from &#039;&#039;figures a-d&#039;&#039; are shown below.  &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure e. &#039;&#039;Phase plot of the harmonic spring data with a good numerical solution (timestep = 0.1) &lt;br /&gt;
!&#039;&#039;Figure f. &#039;&#039;Phase plot of the harmonic spring data with a bad numerical solution (timestep = 0.3) &lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory phasegood.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory badphase.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The timestep at which this data is plotted is 0.1, which results in a very small change in the energy, as seen in &#039;&#039;figure b. &#039;&#039;Increasing the time step will increase the variation in the energy. To keep the variation in the total energy of the system under 1%, the time step must be no larger than approximately 0.28. The energy varies more with increasing time step because the jumps in the algorithm  are getting larger due to less data points. The algorithm assumes these points are joined by a straight line; that the halfway point in the jump is the average between the starting and finishing point of the jump. The phase space plot will become less elliptic and the jumps eventually become so larger that the plot is no longer a continuous shape.  &lt;br /&gt;
&lt;br /&gt;
It is essential to monitor the energy of a numerically modeled system because a good solution for the motion of an atom has a constant energy and a plot in phase space of a perfect ellipse.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance and Force at Zero Potential===&lt;br /&gt;
From classical mechanics, the force calculated from the Newtonian mechanics above can be used to calculate the potential experienced by an atom in the system. They are related by the equation: &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;
This potential gives the shape and dimension of the potential surface on which the system can be modeled. A simple 1D potential that is used to describe the inter atomic forces of a liquid is the Lennard-Jones potential. It has the characteristic features of a short range repulsion potential and harmonic character around the equilibrium bond distance. The value of &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the inter atomic separation when the potential, &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;, is equal to zero, can be calculated by equating the equation for the Lennard-Jones potential to zero and solving for &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The equation for the Lennard-Jones potential: &amp;lt;math&amp;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;
Equating this to zero: &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;
And rearranging in order to separate the variables: &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;
Rearranging this gives &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in terms of &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt; r^6 = \sigma^6&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r = r_0&amp;lt;/math&amp;gt; in this case.&lt;br /&gt;
&lt;br /&gt;
This, therefore, gives the result that interatomic distance at zero potential, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, is equal to &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; in the Lennard-Jones potential is effectively the diameter of one of the particles in the system being measured; in this case, the liquid we are simulating. This is the point where the potential curve crosses the x-axis on an Energy vs interatomic distance plot. The force, &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt;, at this point on the curve corresponds to the gradient; it is found by calculating the derivative of the curve at this point. &lt;br /&gt;
&lt;br /&gt;
To calculate the force, we must differentiate the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As force is equal to the negative differential of the potential energy, the value of the force is: &amp;lt;math&amp;gt;\mathbf{F}_i = 48\epsilon \sigma^{12} r^{-13} - 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting in the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at zero potential from the calculation before: &amp;lt;math&amp;gt;\mathbf{F}_i = \frac{48\epsilon}{\sigma} - \frac{24\epsilon}{\sigma} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The gradient where the Lennard-Jones plot crosses the axis is negative; &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; in the term obtained for &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is negative and therefore the overall value of the force will be negative.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance, Force and Well Depth of the Potential at Equilibrium===&lt;br /&gt;
To calculate the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at the equilibrium position, we need to use the derivative of the potential energy curve. The equilibrium value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is the value at the minimum of the Lennard-Jones curve; when &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Therefore, equating the derivative to zero gives: &amp;lt;math&amp;gt;0 = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rearranging this: &amp;lt;math&amp;gt;48\epsilon \sigma^{12} r^{-13} = 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And simplifying and cancelling gives: &amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6&amp;lt;/math&amp;gt;. Therefore the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at equilibrium is: &amp;lt;math&amp;gt;r_{eq} = \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Physically, this result means that the equilibrium distance is 1.12 times the diameter of one of the particles; the particles have a small gap between them so do not touch. A short range repulsion potential, as seen in the Lennard-Jones curve, is a result of the particles coming into contact. &lt;br /&gt;
&lt;br /&gt;
Again, the force can be calculated from the derivative of the potential curve at the equilibrium point. As the derivative at this point is zero (a minimum on the curve), the force will therefore also be zero.&lt;br /&gt;
&lt;br /&gt;
The well-depth of the potential curve is the difference between zero potential and the potential at the equilibrium bond length. This can be calculated by substituting the value for the equilibrium bond length into the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 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;
Cancelling and simplifying this equation gives: &amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \times \frac{1}{4}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the absolute value for the well depth is &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;. The actual value of this potential is &amp;lt;math&amp;gt;-\epsilon&amp;lt;/math&amp;gt;, as the equilibrium bond length gives the most stable configuration of the molecules and therefore suggests attractive interactions are involved in the arrangement of the molecules; this attractive potential means its negative. &lt;br /&gt;
&lt;br /&gt;
===Boundary Conditions and the Lennard-Jones Cutoff===&lt;br /&gt;
When simulating a liquid, it is computationally impractical to simulate a realistic liquid. Therefore a smaller &#039;box&#039; containing &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; particles is simulated and the computer program will use &#039;&#039;periodic boundary conditions&#039;&#039; to simulate infinite repetitions of this box; when the atom reaches one edge of the box, in periodic boundary conditions, it will reappear again at the opposite edge of the box as if they were connected. For example, an atom at the position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a box of size &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;. Without periodic boundary conditions, we would assume that the atom would end up at the position &amp;lt;math&amp;gt;(1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;. However, in this box, there is no such position and so the particle must reappear at the opposite edge to where it effectively &#039;left&#039; the box. Therefore, it&#039;s ending position will be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The number of particles, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; simulated by the computer is usually between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt;. Physically, this is a very small volume. Considering water, we can calculate the number of molecules in 1 mL or 1 cm^3, a volume that would be considered small in the lab. Taking the concentration of water at standard conditions, &amp;lt;math&amp;gt;55\ mol\ dm^{-3}&amp;lt;/math&amp;gt;, we can convert it to the number of moles per mL: &amp;lt;math&amp;gt;0.055\ mol\ mL^{-1}&amp;lt;/math&amp;gt;. Multiplying this value by Avagadro&#039;s constant (&amp;lt;math&amp;gt;N_A&amp;lt;/math&amp;gt;) gives the number of molcules of water per mL: &amp;lt;math&amp;gt;3.02 \times 10^{22}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The reverse procedure can be used to compare this to the volume of 10,000 molecules: 10,000 divided by Avagadro&#039;s constant gives the number of moles of water which 10,000 molecules makes up: &amp;lt;math&amp;gt;1.66 \times 10^{-20}\ moles&amp;lt;/math&amp;gt;. Dividing this value by the concentration (from &amp;lt;math&amp;gt;n=cV&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is the number of moles, &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; is the concentration and &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume), gives the volume: &amp;lt;math&amp;gt;3.02 \times 10^{-22}\ dm&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;3.02 \times 10^{-19}\ mL&amp;lt;/math&amp;gt;. Physically, of course, this is far too small a volume to be recorded in the lab.&lt;br /&gt;
 &lt;br /&gt;
Periodic boundary conditions simulate an infinite lattice and therefore, when computing the potential, will calculate an infinite amount of pair interactions. Therefore, it is only practical to calculate the energies up to a certain interatomic distance; the Lennard-Jones cutoff distance. Beyond this point, the potential energy and the integral of the curve beyond this point become insignificant and do not impact on the overall energy; removing interactions beyond this point from the calculations will not effect the accuracy. Multiplying the Lennard-Jones potential with the radial distribution function gives a plot of the probability of finding an atom at a particular interatomic distance. The larger the interatomic distance, the lower the probability and so the energy after the cutoff can be disregarded. &lt;br /&gt;
&lt;br /&gt;
Integrating over the Lennard-Jones curve and applying this cutoff as the lower limit can show how small the integral is:&lt;br /&gt;
&lt;br /&gt;
For a general cutoff of with value &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;I = \int_{x}^\infty \phi\left(r\right)\mathrm{d}r = \int_{x}^\infty \frac{4\epsilon\sigma^{12}}{r^{12}}\mathrm{d}r - \int_{x}^\infty \frac{4\epsilon\sigma^6}{r^6}\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving this: &amp;lt;math&amp;gt;I = 4\epsilon\sigma^{12} {\frac{-1}{11r^{11}}\,\Bigg\vert\,}_x^\infty - 4\epsilon\sigma^{6} {\frac{-1}{5r^{5}}\,\Bigg\vert\,}_x^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This gives the general solution: &amp;lt;math&amp;gt;I = \frac{4\epsilon\sigma^{12}}{11x^{11}} - \frac{4\epsilon\sigma^{6}}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating this for &amp;lt;math&amp;gt;\epsilon = \sigma = 1&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;I = \frac{4}{11x^{11}} - \frac{4}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt; (or 2 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.025&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt; (or 2.5 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0082&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt; (or 3 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0033&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All values are taken to 2 significant figures. As the cutoff value for the interatomic distance gets larger, the integral gets smaller, and therefore the energy excluded from the calculation becomes smaller, and the second term in the solved integral, &amp;lt;math&amp;gt;I&amp;lt;/math&amp;gt;, dominates the energy value.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
When using the Lennard-Jones potential, it is appropriate to use reduced units for intermolecular distance, energy and temperature. Reduced units can be calculated by the following relationships:&lt;br /&gt;
&lt;br /&gt;
Intermolecular 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;
&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; are scaling factors. For example, if the parameters for Argon are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\sigma = 0.34 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt; \epsilon\ /\ k_B = 120 K&amp;lt;/math&amp;gt;&lt;br /&gt;
* Lennard-Jones cutoff &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;. The well-depth, &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;, is &amp;lt;math&amp;gt;0.999 kJ mol^{-1} \approx 1 kJ mol^{-1}&amp;lt;/math&amp;gt;. The value of &amp;lt;math&amp;gt;T* = 1.5&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;180 K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
The first aim of the simulations is to determine the most appropriate timestep to use in the vert algorithm simulations. This timestep is a balance between the accuracy of the results (the smaller the timestep, the closer to the true functing the result will be) and the length of real time over which the simluation is run (the smaller the timestep, the less real time over which the simulation will give a result). The appropriateness of the timestep will be determined by plotting how the total free energy of the simulated lattice equilibrates over time.  &lt;br /&gt;
&lt;br /&gt;
Five different calculations, which simulated the melting of a crystal and subsequent equilibration of the energy of the melted crystal, were run at five different timesteps; 0.001, 0.0025, 0.0075, 0.01 and 0.015, and were described by the NVE or &#039;&#039;&amp;quot;microcanonical ensemble&amp;quot;&#039;&#039;. An ensemble is a collection of samples of a system which are under three thermodynamic constraints (three properties are kept constant); in the microcanonical ensemble, the number of particles, the volume and the total energy is kept constant (NVE). &lt;br /&gt;
&lt;br /&gt;
These calculations simulate a box of 1000 unit cells and use periodic boundary conditions to replicate the simulation to a larger scale. Because these simulations use the numerical methods defined in the previous section, the initial position and velocity of the atoms must be defined in the input file. The Brownian (uncorrelated, random) motion of the atoms in the simulation means that there is no long range order in the system and so the atoms in a real system would start in random positions. However, assigning random starting coordinates to the atoms in a simulated liquid is not a relative process; the coordinates are generate independently of each other. Therefore there is a probability that the coordinates simulated will cause the atoms to overlap, which would give a very large repulsion potential, as seen in the Lennard-Jones potential at very small interatomic distances. This short-range repulsion potential comes from the hard-sphere model of atomic simulation.&lt;br /&gt;
&lt;br /&gt;
The input file also defines the structure and density of the lattice. The number density of lattice points in any lattice is the number of lattice points per volume of the unit cell. In a simple cubic lattice, there is one lattice point in the unit cell. From an sc lattice with lattice spacing (length of one side of the unit cell) being &amp;lt;math&amp;gt;1.07722&amp;lt;/math&amp;gt;, the number density of the lattice points is calculated by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{1}{1.07722^3} = 0.7999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a face-centered cubic lattice (fcc), there are four lattice points in the unit cell. Rearranging the above relationship, the lattice spacing can be calculated from the number of lattice points in a unit cell and number density, &amp;lt;math&amp;gt;1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Lattice\ spacing = \sqrt[3]{\frac{number\ of\ lattice\ points\ per\ unit\ cell}{number\ density}} = \sqrt[3]{\frac{4}{1.2}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation creates a box which includes 1000 unit cells, which is 10 unit cells in each dimension. For a simple cubic lattice, because there is one lattice point per unit cell, there will be 1000 atoms created as seen in the input file. The &#039;&#039;create_atom&#039;&#039; command in the input file determines how many boxes are created in the simulation and therefore how many atoms will be created. If a face centered cubic lattice is simulated, because there are 4 lattice points per unit cell, 4000 atoms will be created in the &#039;&#039;create_atom&#039;&#039; command. &lt;br /&gt;
&lt;br /&gt;
The input script also contains the following commands which defines the potential surface which is used to model the intermolecular reactions:&lt;br /&gt;
 mass 1 1.0&lt;br /&gt;
This instruction sets the mass type for the atoms being simulated. It takes the general form of “mass I value”, where mass is the keyword which tells LAMMPS what the input is, I is the atom type and value is the mass of the atom. In this case, I is defined by a specific numerical value; 1 as there is only 1 type of atom in the simulation, but it can be defined with an asterisk (1*), which means “all atom types of 1 to n inclusive”. &lt;br /&gt;
 pair_style lj/cut 3.0&lt;br /&gt;
This instruction sets the type of potential which LAMMPS uses in its calculation of pairwise interactions. It takes the general form of “pair_style style args”, where pair_style is the keyword for LAMMPS, style defines the potential and any specifications it may have, and args are the arguments required for this particular potential. In this case, the Lennard-Jones potential has been used (lj) with a cutoff point (cut) of 3σ. The cutoff point is explained in the introduction section. &lt;br /&gt;
 pair_coeff * * 1.0 1.0&lt;br /&gt;
This instruction specifies the coefficients for the pairwise interactions of each pair of atoms, and it takes the general form “pair_coeff I J args”. Pair_coeff is the keyword, I and J are the atom types, and args are the coefficients which the different atoms types take. In this case, the asterisk in place of I and J refers to all atoms types from 1 to n. The coefficients are the pairwise interactions are 1 for each atom, meaning each atom has an equal contribution to the interaction.&lt;br /&gt;
&lt;br /&gt;
In these initial calculations, the initial conditions for the numerical methods, &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. For this experiment, the verit-velocity algorithm would be the most appropriate, as both the starting position and velocity is specified for this algorithm. &lt;br /&gt;
&lt;br /&gt;
To define the timestep for the algorithm the following code is used defining the timestep as a variable instead of just giving it a definite value&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;
It is much easier to use the variable version of defining the timestep because the length of time over which the simulation is run depends on the time step. By using a variable, you can keep the length of the simulation the same, no matter the size of the timestep. It also makes it easier if multiple properties depend on the timestep – only the variable needs to be changed, not all the parts of the script where timestep is defined. &lt;br /&gt;
&lt;br /&gt;
The calculations produce the values for the total energy of the system, temperature and pressure in the output files, which can be plotted against time. How well these values equilibrate determines the appropriateness of the timestep to use in further calculations in the experiment.   &lt;br /&gt;
[[File:Rmt totalenergy plot.png|none|thumb|800x800px|&#039;&#039;Figure h. &#039;&#039;Plot of the equilibration of total energy for five different timesteps]]&lt;br /&gt;
The largest time step to give an acceptable result is 0.01. However, for any simluation we would expect energy to be independent of the timestep, something which is not true at a timestep greater than 0.0025. Therefore, the most appropriate timestep to use for a balance between accuracy and length of time which the simulation covers is 0.0025.  &lt;br /&gt;
&lt;br /&gt;
0.015 is a particularly bad choice of timestep. This is because the verit-velocity algorithm gives an approximate result to the velocity (kinetic energy term) and position (potential energy term), and so when the timestep becomes too large with respect to the time, the algorithm no longer becomes a suitable way to calculate the energy. As seen in the graph of 0.015, the energy does not equilibrate and diverges.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions ==&lt;br /&gt;
The calculations in this section are run in the isobaric-isothermal ensemble, where the number of particles in the system, the pressure and the temperature are kept constant (NpT). This means that the temperature and the pressure are recalculated in every step, so are no longer constant like they were in the NVE ensemble. From the &#039;&#039;equipartition theorem&#039;&#039;, each degree of freedom will contribute &amp;lt;math&amp;gt;\frac{1}{2} k_B T&amp;lt;/math&amp;gt; of energy to the system. As the system is in three dimensions, there are three degrees of translational freedom and so the total internal energy is equal to &amp;lt;math&amp;gt;\frac{3}{2} k_B T&amp;lt;/math&amp;gt;. Equating this to the kinetic energy, &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt;, at the end of every step and rearranging will allow calculation of the temperature after every step. &lt;br /&gt;
&lt;br /&gt;
A target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, is defined in the input script and the system will equilibrate by multiplying the velocity by a factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, in order to accommodate for the fluctuation and keep the system at approximately the target temperature and therefore constant internal energy. If the temperature of the system is greater than the target temperature, the system&#039;s kinetic energy is too high, so &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is reduced to compensate for this. The same is true for is the temperature is lower than the target temperature; &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than one in the next step to increase the kinetic energy which is now too low. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; can be derived from equating the kinetic and internal energy of the system at an arbitrary time step:&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;
Expanding the brackets inside the sum and moving the term containing &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; out of the sum: &amp;lt;math&amp;gt;\frac{\gamma^2}{2}\sum_i m_i \left(v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;, we can replace &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt; on the left hand side of the equation with &amp;lt;math&amp;gt;\frac{3}{2} N k_B T&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;\frac{3\gamma^2}{2}N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Simplifying and rearranging for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, gives: &amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The principle is the same for controlling the pressure.&lt;br /&gt;
&lt;br /&gt;
As temperature and pressure are no longer constant, he input files require specification of the pressure and the temperature for each of the systems run. 10 simulations were run at two different pressures with five different temperatures at each. &lt;br /&gt;
* Temperatures: 1.6, 1.9, 2.2, 2.5, 2.8&lt;br /&gt;
* Pressures: 2.5, 3.0&lt;br /&gt;
These pressures were chosen because the data simulated when choosing an appropriate timestep gave a pressure between 2.5 and 3.0.  &lt;br /&gt;
&lt;br /&gt;
For the code which computes the thermodynamic potentials, this particular line defines how many steps contribute towards the average of the thermodynamic parameters computed in the calculation. &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;
&#039;&#039;fix&#039;&#039; is the keyword, &#039;&#039;aves&#039;&#039; is the name of the group of fixes which in this case is the average of the thermodynamic values, &#039;&#039;all&#039;&#039; specifies the atoms which the fix is applied to which in this case is all the atoms in the simulated system and &#039;&#039;ave/time&#039;&#039; means that compute global time averages are calculated. The following three numbers have the following meaning:&lt;br /&gt;
&lt;br /&gt;
*100 = use the input values every 100 timesteps&lt;br /&gt;
*1000 = use input values 1000 times for calculating the average&lt;br /&gt;
*100000 = calculate the average every 100000 timesteps&lt;br /&gt;
&lt;br /&gt;
Therefore for the total calculation which lasts for 100000 will only have the average calculated once. Assuming 1 value every timestep, there will be 100000/100 values = 1000. The amount of time simulated is 100,000 steps, read from the following line.&lt;br /&gt;
&lt;br /&gt;
The density data from all ten calculation were plotted on the same graph, along with the density for an &amp;quot;ideal&amp;quot; gas. This density can be derived from the ideal gas law:&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;
Rearranging in terms of density: &amp;lt;math&amp;gt;\frac{N}{V} = \frac{P}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As these simulations are being run under reduced units, we can take &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt;, and so the density of the ideal gas becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the density of the ideal gas is plotted as the pressure divided by the temperature in pressure-temperature phase space.&lt;br /&gt;
[[File:Rmt dvt plot.png|none|thumb|800x800px|&#039;&#039;Figure i. &#039;&#039;Plot of the variation in density with temperature at a defined pressure for the numerically simulated and ideal systems]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that calculated in the ideal gas law. This is because for an ideal gas, an assumption is made that there are no intermolecular interactions, and therefore forces such as electron repulsion forces are ignored; repulsion forces dominate over attractive ones, as all the atoms in this simulation are the same and so partial charges or dipoles are created. This will mean that the particles move closer together than a real gas and so the density will be larger. This discrepancy between the ideal and non-ideal systems becomes larger at a higher pressure because with a higher pressure, the atoms in the system are closer together and therefore the intermolecular repulsion will become larger. This greater repulsion will in turn have a larger effect on decreasing the density.&lt;br /&gt;
&lt;br /&gt;
== Statistical Physics Calculations of the Heat Capacity ==&lt;br /&gt;
The heat capacity of a system at constant volume can be calculated from the variance in the total energy of the system. The relationship used to calculate the heat capacity is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = 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;\left\langle E^2\right\rangle&amp;lt;/math&amp;gt; is the continuous average of the total square energy at each temperature as a function of temperature. &amp;lt;math&amp;gt;\left\langle E\right\rangle^2&amp;lt;/math&amp;gt; is the continuous average of the total energy at each temperature as a function of temperature squared. The heat capacity is multiplied by &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; in this case because the version of LAMMPS calculates every energy divided by the number of molecules in the system simulated.&lt;br /&gt;
&lt;br /&gt;
The calculations in this sections are run in density-temperature phase space and the ensemble has changed to the canonical ensemble (NVT). A set of input files were written for ten calculations for, like the previous section, two pressures and five different temperatures at each pressure:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 0.2, 0.8&lt;br /&gt;
*Temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{C_V}{V}&amp;lt;/math&amp;gt; was plotted against temperature to determine the relationship in density-temperature phase space. An example of an input file can be found [[Media:nvt_-_0220.in|here]]. The lines which have been changed from the previous input files are at the end of the script:&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 &lt;br /&gt;
 thermo_style custom step etotal temp&lt;br /&gt;
 variable energy equal etotal&lt;br /&gt;
 variable energy2 equal etotal*etotal&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_energy v_energy2 v_temp&lt;br /&gt;
 run 100000&lt;br /&gt;
 &lt;br /&gt;
 variable aveenergy equal f_aves[1]&lt;br /&gt;
 variable aveenergy2 equal f_aves[2]&lt;br /&gt;
 variable avetemp equal f_aves[3]&lt;br /&gt;
 variable heatcapacitydv equal atoms*atoms*(v_aveenergy2-v_aveenergy*v_aveenergy)/(v_avetemp*v_avetemp*vol)&lt;br /&gt;
 &lt;br /&gt;
 print &amp;quot;Averages&amp;quot;&lt;br /&gt;
 print &amp;quot;--------&amp;quot;&lt;br /&gt;
 print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Heat Capacity per Volume: ${heatcapacitydv}&amp;quot;&lt;br /&gt;
The line with the keyword &#039;fix&#039; determines which thermodynamic values are averaged and over how many steps they are averaged. The next section takes these averages as variables and uses them to define the heat capacity which is calculated from the equation at the beginning of this section. Only the energy and temperature are needed to define the heat capacity and so only these values are calculated by the simulation. [[File:Rmt heatcapacitybyv.png|none|thumb|800x800px|&#039;&#039;Figure j. &#039;&#039;C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V against temperature for the two different pressures 0.2 and 0.8]]As seen in the above figure, the heat capacity decreases with temperature for both pressures. It would be expected for an ideal system that as the temperature increases, the heat capacity at constant volume increases and tends to a constant volume at very high T of 3R; R = the universal gas constant. This means increasing the temperature increases the amount of energy being stored in the system and this energy is stored as vibrational energy. However, for a Lennard-Jones liquid, the system being simulated here, the heat capacity decreases with temperature. This is because the simulation has two components to the simulation; the atoms are vibrating in a quasi-harmonic fashion around the equilibrium position and also diffuse between neighbouring equilibrium positions in a gas like fashion. As the temperature increases, the amount of diffusion increases and the vibrations decreases, therefore decreasing the ability of the system to absorb vibrational energy, resulting in the decrease in heat capacity. &amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www.nature.com/ncomms/2013/130816/ncomms3331/full/ncomms3331.html?message-global=remove&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural Properties and the Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a single atom in a system is a plot of the probability that an atom can be found at a certain distance from the central atom. The peaks in this plot can give the distance of an atom from its nearest neighbours in the Lennard-Jones simulated system. &lt;br /&gt;
&lt;br /&gt;
The calculations in this section simulate a Lennard-Jones solid, liquid and gas and, using the output of the LAMMPS trajectory file, plots both the radial distribution function and its integral using DLV. The temperature and pressure parameters for these calculations were taken from the phase diagram or coexistence curve for a Lennard-Jones system.&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt; The parameters used are displayed in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! Temperature, &amp;lt;math&amp;gt;T^*&amp;lt;/math&amp;gt;&lt;br /&gt;
! Pressure, &amp;lt;math&amp;gt;p^*&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| LJ Solid&lt;br /&gt;
| 1.5&lt;br /&gt;
| 1.2&lt;br /&gt;
|-&lt;br /&gt;
| LJ Liquid&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.8&lt;br /&gt;
|-&lt;br /&gt;
| LJ Gas&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.01&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The data obtained from the plots and the radial distribution functions and their integrals were plotted and shown in the table below.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure k. &#039;&#039;The radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
!&#039;&#039;Figure l. &#039;&#039;The integrals of the radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt fullrdfs.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt allintegralsrdf.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
[[File:Rmt Nearest neighbours.png|left|thumb|300x300px|&#039;&#039;Figure m. &#039;&#039;Representation of a cross section of the first three shells of nearest neighbours in an fcc solid. The black atom is the central atom being considered, the blue atoms are the first shell, the orange atoms the second shell and the purple atoms are the third.]]&lt;br /&gt;
The RDF of the solid gives a very irregular curve because of the irregular structure of the lattice. For a simple cubic lattice, a regular structure of the RDF would be expected because of the equal number of atoms in each of the nearest neighbour shells of the atoms. However, for face-centered cubic, the solid in this simulation, the structure is much more irregular and as the atoms move from their equilibrium position in the lattice due to vibrations, the peaks in the radial distribution will broaden. The irregular heights of the peaks are due to the varying numbers of atoms in each of the nearest neighbour shells for the central atom. The first shell gives the highest peak as it contains the most atoms; in total, considering all four surrounding unit cells, this shell contains 12 atoms and ideally takes the geometry of an icosahedron. The second shell is smaller and contains only 6 atoms in an octahedral coordination shape. The following shell again contributes 12 atoms, 3 from each unit cell. This therefore explains why the heights of the peaks in the solid plot in &#039;&#039;figure k.&#039;&#039; vary. These values can be confirmed by the plot in &#039;&#039;figure o.&#039;&#039; which is the integral; it cumulatively adds the numbers in each shell. The size of the first &amp;quot;step&amp;quot; is 12; there are 12 atoms in the first shell. The size of the second step is approximately 18; there are 18-12=6 steps in the second shell. The same theory applies for the third shell which gives a value of 13. This is slightly different to the predicted value possibly due to error in the calculation of the radial distribution function and therefore its integral. &lt;br /&gt;
&lt;br /&gt;
The RDF of the liquid has a representation of far fewer shells, which means that there are less atoms in the space close to a &amp;quot;central&amp;quot; atom in the bulk solution. The particles have more energy and therefore do not keep to a regular lattice structure. As they move about, some regualrity is maintained around each atom, but only to the extend of two or three shells, meaning there is no long range order in a Lennard-Jones liquid. &lt;br /&gt;
&lt;br /&gt;
The RDF of the gas again omits more shells as there is almost no order in a Lennard-Jones gas. The single peak on this plot considers only the set of atoms closest to the central atom and all others are disregarded as they are too far apart. &lt;br /&gt;
&lt;br /&gt;
Considering &#039;&#039;figure l.&#039;&#039;, the size of the integral of the radial distribution function decreases from solid to liquid to gas. This makes sense as the number of atoms in the surrounding shells decreases with density of the system; the atoms become further apart. &lt;br /&gt;
&lt;br /&gt;
From the plot of the radial distribution function of the solid, the lattice spacing can be determined. For this, we can consider just the first three peaks of the RDF plot. The lattice spacing refers to the length of one unit cell, and so, using &#039;&#039;figure m&#039;&#039;, we can calculate this using two different methods; a) we can use the distance between the central atom and the first shell of nearest neighbours, and use trigonometry to calculate the lattice spacing. Or alternatively b) we can use the distance between the central atom and the second nearest neighbour shell to get the lattice spacing.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure n. &#039;&#039;The radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
!&#039;&#039;Figure o. &#039;&#039;The integral of the radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt solidgr3.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt solidint3.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
Using method a) (with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; as the distance between the central atom and the nearest neighbour: Lattice spacing = &amp;lt;math&amp;gt;\frac{r}{cos({\frac{\pi}{4}})} = \frac{1.02}{cos({\frac{\pi}{4}})} \approx 1.44&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using method b): Lattice spacing &amp;lt;math&amp;gt;\approx 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can take an average between the two get an approximate value for the lattice spacing: &amp;lt;math&amp;gt;1.46 \plusmn 0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These values for distance are all in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
=== The Mean Squared Displacement ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!Plots for the 8000 atom data&lt;br /&gt;
!Plots for the 1,000,000 atom data&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== The Velocity Autocorrelation Function ===&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=540919</id>
		<title>Rep:Mod:hakunamatata</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=540919"/>
		<updated>2016-02-24T16:18:35Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: /* Structural Properties and the Radial Distribution Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Introduction to Molecular Dynamics Simulations ==&lt;br /&gt;
===The Classical Particle Approximation and Numerical Integration===&lt;br /&gt;
The verit and verit-velocity algorithms are numerical methods to approximate the average position and velocity respectively of randomly moving atoms in a particular medium (solid, liquid, fliud etc.). This position and velocity can be applied to Newtonian mechanics to calculate such properties as the force and potential energy of the system. The algorithms work by splitting the function into discrete time steps, calculating the values of position and velocity at this particular time step, and then effectively &amp;quot;joining the dots&amp;quot; to create an approximate function. These simulations always use the answer from the previous timestep to compute the new timestep, so initial conditions must be given for the first step. Both of the algorithms are shown below and are derived from the Taylor expansion of the position or velocity of the atoms at the timestep &amp;quot;n+1&amp;quot; or &amp;lt;math&amp;gt;t+\delta t&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit Algorithum:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{x}_i\left(t + \delta t\right) \approx 2\mathbf{x}_i\left(t\right) - \mathbf{x}_i\left(t - \delta t\right) + \frac{\mathbf{F}_i\left(t\right)}{m_i}\delta t^2  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit-Velocity Algorithum:&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i\left(t\right)&amp;lt;/math&amp;gt; is the force acting on a particular atom as a function of time&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i&amp;lt;/math&amp;gt; is the acceleration &lt;br /&gt;
&lt;br /&gt;
The smaller the timestep, the closer the numerical approximation is to the true solution function, which can be modeled as a classical harmonic oscillator. &#039;&#039;Figure a.&#039;&#039; in the table below shows the comparison between the two methods in &#039;&#039;time&#039;&#039; space. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure a. &#039;&#039;Plots of position vs time comparing the verit algorithm and harmonic spring results&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure b. &#039;&#039;Plot of the total classical energy of the system (potential + kinetic)&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory xanalytical.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory energy.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The harmonic spring position values are modeled from the harmonic oscillator or particle on a spring. The equation of &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; was used to calculate these values, where &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; are 1 and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; is zero. As seen on the plot, the curves produced from the two different methods of calculating the position are in good agreement.&lt;br /&gt;
|The potential energy is calculated using the equation U = 1/2 kx^2, with a value of k given as 1. The kinetic energy is calculated using the velcity from the verit-velocity algorithm using the equation T = 1/2 mv^2, with a value of m given as 1. The total energy of the system, E, is equal to T + U. The values for x (potential energy) and v (kinetic energy) are taken from the verity algorithm and verit-velocity algorthim respectively. &lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;Figure c. &#039;&#039;Plot of the difference (error) between the harmonic spring and verit algorithm data&lt;br /&gt;
!&#039;&#039;Figure d. &#039;&#039;Plot of the peaks in the error plot in &#039;&#039;figure c.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory error.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory errorpeaks.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The peaks in the error between the harmonic spring and verit algorithm results are at the place where the position curve crosses the time axis. This is because the harmonic spring data (x(t)) has a slightly shorter wave period than that of the verit velocity algorithm, and therefore the difference will get larger with each period of the wave, shown by the error getting larger in &#039;&#039;figure c. &#039;&#039;The period of the plot of the two methods are different because the verit algorithm is much more approximate so does not give the correct solution.&lt;br /&gt;
|The change in the error/difference between the harmonic spring data and verit algorthm data increases linearly and so therefore period of each of the plots in &#039;&#039;figure 1&#039;&#039;. must be constant. &lt;br /&gt;
|}&lt;br /&gt;
The error can also be quantified on a &#039;&#039;phase space&#039;&#039; plot; phase space is momentum or velocity plotted as a function of position. The true solution for motion of an atom is a perfect ellipse, and the more elliptic the shape (less circular) the more momentum or velocity is in the system. A numerical solution, like the verit algorithms, will produce a set of points very close to this ellipse but not perfectly following the curve. A good numerical solution will remain in an elliptical shape, whereas a bad numerical solution, for example one with a large timestep, will spiral away from the true solution. Two examples of such systems using the data from &#039;&#039;figures a-d&#039;&#039; are shown below.  &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure e. &#039;&#039;Phase plot of the harmonic spring data with a good numerical solution (timestep = 0.1) &lt;br /&gt;
!&#039;&#039;Figure f. &#039;&#039;Phase plot of the harmonic spring data with a bad numerical solution (timestep = 0.3) &lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory phasegood.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory badphase.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The timestep at which this data is plotted is 0.1, which results in a very small change in the energy, as seen in &#039;&#039;figure b. &#039;&#039;Increasing the time step will increase the variation in the energy. To keep the variation in the total energy of the system under 1%, the time step must be no larger than approximately 0.28. The energy varies more with increasing time step because the jumps in the algorithm  are getting larger due to less data points. The algorithm assumes these points are joined by a straight line; that the halfway point in the jump is the average between the starting and finishing point of the jump. The phase space plot will become less elliptic and the jumps eventually become so larger that the plot is no longer a continuous shape.  &lt;br /&gt;
&lt;br /&gt;
It is essential to monitor the energy of a numerically modeled system because a good solution for the motion of an atom has a constant energy and a plot in phase space of a perfect ellipse.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance and Force at Zero Potential===&lt;br /&gt;
From classical mechanics, the force calculated from the Newtonian mechanics above can be used to calculate the potential experienced by an atom in the system. They are related by the equation: &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;
This potential gives the shape and dimension of the potential surface on which the system can be modeled. A simple 1D potential that is used to describe the inter atomic forces of a liquid is the Lennard-Jones potential. It has the characteristic features of a short range repulsion potential and harmonic character around the equilibrium bond distance. The value of &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the inter atomic separation when the potential, &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;, is equal to zero, can be calculated by equating the equation for the Lennard-Jones potential to zero and solving for &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The equation for the Lennard-Jones potential: &amp;lt;math&amp;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;
Equating this to zero: &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;
And rearranging in order to separate the variables: &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;
Rearranging this gives &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in terms of &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt; r^6 = \sigma^6&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r = r_0&amp;lt;/math&amp;gt; in this case.&lt;br /&gt;
&lt;br /&gt;
This, therefore, gives the result that interatomic distance at zero potential, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, is equal to &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; in the Lennard-Jones potential is effectively the diameter of one of the particles in the system being measured; in this case, the liquid we are simulating. This is the point where the potential curve crosses the x-axis on an Energy vs interatomic distance plot. The force, &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt;, at this point on the curve corresponds to the gradient; it is found by calculating the derivative of the curve at this point. &lt;br /&gt;
&lt;br /&gt;
To calculate the force, we must differentiate the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As force is equal to the negative differential of the potential energy, the value of the force is: &amp;lt;math&amp;gt;\mathbf{F}_i = 48\epsilon \sigma^{12} r^{-13} - 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting in the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at zero potential from the calculation before: &amp;lt;math&amp;gt;\mathbf{F}_i = \frac{48\epsilon}{\sigma} - \frac{24\epsilon}{\sigma} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The gradient where the Lennard-Jones plot crosses the axis is negative; &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; in the term obtained for &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is negative and therefore the overall value of the force will be negative.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance, Force and Well Depth of the Potential at Equilibrium===&lt;br /&gt;
To calculate the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at the equilibrium position, we need to use the derivative of the potential energy curve. The equilibrium value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is the value at the minimum of the Lennard-Jones curve; when &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Therefore, equating the derivative to zero gives: &amp;lt;math&amp;gt;0 = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rearranging this: &amp;lt;math&amp;gt;48\epsilon \sigma^{12} r^{-13} = 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And simplifying and cancelling gives: &amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6&amp;lt;/math&amp;gt;. Therefore the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at equilibrium is: &amp;lt;math&amp;gt;r_{eq} = \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Physically, this result means that the equilibrium distance is 1.12 times the diameter of one of the particles; the particles have a small gap between them so do not touch. A short range repulsion potential, as seen in the Lennard-Jones curve, is a result of the particles coming into contact. &lt;br /&gt;
&lt;br /&gt;
Again, the force can be calculated from the derivative of the potential curve at the equilibrium point. As the derivative at this point is zero (a minimum on the curve), the force will therefore also be zero.&lt;br /&gt;
&lt;br /&gt;
The well-depth of the potential curve is the difference between zero potential and the potential at the equilibrium bond length. This can be calculated by substituting the value for the equilibrium bond length into the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 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;
Cancelling and simplifying this equation gives: &amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \times \frac{1}{4}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the absolute value for the well depth is &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;. The actual value of this potential is &amp;lt;math&amp;gt;-\epsilon&amp;lt;/math&amp;gt;, as the equilibrium bond length gives the most stable configuration of the molecules and therefore suggests attractive interactions are involved in the arrangement of the molecules; this attractive potential means its negative. &lt;br /&gt;
&lt;br /&gt;
===Boundary Conditions and the Lennard-Jones Cutoff===&lt;br /&gt;
When simulating a liquid, it is computationally impractical to simulate a realistic liquid. Therefore a smaller &#039;box&#039; containing &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; particles is simulated and the computer program will use &#039;&#039;periodic boundary conditions&#039;&#039; to simulate infinite repetitions of this box; when the atom reaches one edge of the box, in periodic boundary conditions, it will reappear again at the opposite edge of the box as if they were connected. For example, an atom at the position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a box of size &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;. Without periodic boundary conditions, we would assume that the atom would end up at the position &amp;lt;math&amp;gt;(1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;. However, in this box, there is no such position and so the particle must reappear at the opposite edge to where it effectively &#039;left&#039; the box. Therefore, it&#039;s ending position will be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The number of particles, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; simulated by the computer is usually between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt;. Physically, this is a very small volume. Considering water, we can calculate the number of molecules in 1 mL or 1 cm^3, a volume that would be considered small in the lab. Taking the concentration of water at standard conditions, &amp;lt;math&amp;gt;55\ mol\ dm^{-3}&amp;lt;/math&amp;gt;, we can convert it to the number of moles per mL: &amp;lt;math&amp;gt;0.055\ mol\ mL^{-1}&amp;lt;/math&amp;gt;. Multiplying this value by Avagadro&#039;s constant (&amp;lt;math&amp;gt;N_A&amp;lt;/math&amp;gt;) gives the number of molcules of water per mL: &amp;lt;math&amp;gt;3.02 \times 10^{22}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The reverse procedure can be used to compare this to the volume of 10,000 molecules: 10,000 divided by Avagadro&#039;s constant gives the number of moles of water which 10,000 molecules makes up: &amp;lt;math&amp;gt;1.66 \times 10^{-20}\ moles&amp;lt;/math&amp;gt;. Dividing this value by the concentration (from &amp;lt;math&amp;gt;n=cV&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is the number of moles, &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; is the concentration and &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume), gives the volume: &amp;lt;math&amp;gt;3.02 \times 10^{-22}\ dm&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;3.02 \times 10^{-19}\ mL&amp;lt;/math&amp;gt;. Physically, of course, this is far too small a volume to be recorded in the lab.&lt;br /&gt;
 &lt;br /&gt;
Periodic boundary conditions simulate an infinite lattice and therefore, when computing the potential, will calculate an infinite amount of pair interactions. Therefore, it is only practical to calculate the energies up to a certain interatomic distance; the Lennard-Jones cutoff distance. Beyond this point, the potential energy and the integral of the curve beyond this point become insignificant and do not impact on the overall energy; removing interactions beyond this point from the calculations will not effect the accuracy. Multiplying the Lennard-Jones potential with the radial distribution function gives a plot of the probability of finding an atom at a particular interatomic distance. The larger the interatomic distance, the lower the probability and so the energy after the cutoff can be disregarded. &lt;br /&gt;
&lt;br /&gt;
Integrating over the Lennard-Jones curve and applying this cutoff as the lower limit can show how small the integral is:&lt;br /&gt;
&lt;br /&gt;
For a general cutoff of with value &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;I = \int_{x}^\infty \phi\left(r\right)\mathrm{d}r = \int_{x}^\infty \frac{4\epsilon\sigma^{12}}{r^{12}}\mathrm{d}r - \int_{x}^\infty \frac{4\epsilon\sigma^6}{r^6}\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving this: &amp;lt;math&amp;gt;I = 4\epsilon\sigma^{12} {\frac{-1}{11r^{11}}\,\Bigg\vert\,}_x^\infty - 4\epsilon\sigma^{6} {\frac{-1}{5r^{5}}\,\Bigg\vert\,}_x^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This gives the general solution: &amp;lt;math&amp;gt;I = \frac{4\epsilon\sigma^{12}}{11x^{11}} - \frac{4\epsilon\sigma^{6}}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating this for &amp;lt;math&amp;gt;\epsilon = \sigma = 1&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;I = \frac{4}{11x^{11}} - \frac{4}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt; (or 2 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.025&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt; (or 2.5 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0082&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt; (or 3 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0033&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All values are taken to 2 significant figures. As the cutoff value for the interatomic distance gets larger, the integral gets smaller, and therefore the energy excluded from the calculation becomes smaller, and the second term in the solved integral, &amp;lt;math&amp;gt;I&amp;lt;/math&amp;gt;, dominates the energy value.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
When using the Lennard-Jones potential, it is appropriate to use reduced units for intermolecular distance, energy and temperature. Reduced units can be calculated by the following relationships:&lt;br /&gt;
&lt;br /&gt;
Intermolecular 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;
&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; are scaling factors. For example, if the parameters for Argon are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\sigma = 0.34 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt; \epsilon\ /\ k_B = 120 K&amp;lt;/math&amp;gt;&lt;br /&gt;
* Lennard-Jones cutoff &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;. The well-depth, &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;, is &amp;lt;math&amp;gt;0.999 kJ mol^{-1} \approx 1 kJ mol^{-1}&amp;lt;/math&amp;gt;. The value of &amp;lt;math&amp;gt;T* = 1.5&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;180 K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
The first aim of the simulations is to determine the most appropriate timestep to use in the vert algorithm simulations. This timestep is a balance between the accuracy of the results (the smaller the timestep, the closer to the true functing the result will be) and the length of real time over which the simluation is run (the smaller the timestep, the less real time over which the simulation will give a result). The appropriateness of the timestep will be determined by plotting how the total free energy of the simulated lattice equilibrates over time.  &lt;br /&gt;
&lt;br /&gt;
Five different calculations, which simulated the melting of a crystal and subsequent equilibration of the energy of the melted crystal, were run at five different timesteps; 0.001, 0.0025, 0.0075, 0.01 and 0.015, and were described by the NVE or &#039;&#039;&amp;quot;microcanonical ensemble&amp;quot;&#039;&#039;. An ensemble is a collection of samples of a system which are under three thermodynamic constraints (three properties are kept constant); in the microcanonical ensemble, the number of particles, the volume and the total energy is kept constant (NVE). &lt;br /&gt;
&lt;br /&gt;
These calculations simulate a box of 1000 unit cells and use periodic boundary conditions to replicate the simulation to a larger scale. Because these simulations use the numerical methods defined in the previous section, the initial position and velocity of the atoms must be defined in the input file. The Brownian (uncorrelated, random) motion of the atoms in the simulation means that there is no long range order in the system and so the atoms in a real system would start in random positions. However, assigning random starting coordinates to the atoms in a simulated liquid is not a relative process; the coordinates are generate independently of each other. Therefore there is a probability that the coordinates simulated will cause the atoms to overlap, which would give a very large repulsion potential, as seen in the Lennard-Jones potential at very small interatomic distances. This short-range repulsion potential comes from the hard-sphere model of atomic simulation.&lt;br /&gt;
&lt;br /&gt;
The input file also defines the structure and density of the lattice. The number density of lattice points in any lattice is the number of lattice points per volume of the unit cell. In a simple cubic lattice, there is one lattice point in the unit cell. From an sc lattice with lattice spacing (length of one side of the unit cell) being &amp;lt;math&amp;gt;1.07722&amp;lt;/math&amp;gt;, the number density of the lattice points is calculated by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{1}{1.07722^3} = 0.7999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a face-centered cubic lattice (fcc), there are four lattice points in the unit cell. Rearranging the above relationship, the lattice spacing can be calculated from the number of lattice points in a unit cell and number density, &amp;lt;math&amp;gt;1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Lattice\ spacing = \sqrt[3]{\frac{number\ of\ lattice\ points\ per\ unit\ cell}{number\ density}} = \sqrt[3]{\frac{4}{1.2}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation creates a box which includes 1000 unit cells, which is 10 unit cells in each dimension. For a simple cubic lattice, because there is one lattice point per unit cell, there will be 1000 atoms created as seen in the input file. The &#039;&#039;create_atom&#039;&#039; command in the input file determines how many boxes are created in the simulation and therefore how many atoms will be created. If a face centered cubic lattice is simulated, because there are 4 lattice points per unit cell, 4000 atoms will be created in the &#039;&#039;create_atom&#039;&#039; command. &lt;br /&gt;
&lt;br /&gt;
The input script also contains the following commands which defines the potential surface which is used to model the intermolecular reactions:&lt;br /&gt;
 mass 1 1.0&lt;br /&gt;
This instruction sets the mass type for the atoms being simulated. It takes the general form of “mass I value”, where mass is the keyword which tells LAMMPS what the input is, I is the atom type and value is the mass of the atom. In this case, I is defined by a specific numerical value; 1 as there is only 1 type of atom in the simulation, but it can be defined with an asterisk (1*), which means “all atom types of 1 to n inclusive”. &lt;br /&gt;
 pair_style lj/cut 3.0&lt;br /&gt;
This instruction sets the type of potential which LAMMPS uses in its calculation of pairwise interactions. It takes the general form of “pair_style style args”, where pair_style is the keyword for LAMMPS, style defines the potential and any specifications it may have, and args are the arguments required for this particular potential. In this case, the Lennard-Jones potential has been used (lj) with a cutoff point (cut) of 3σ. The cutoff point is explained in the introduction section. &lt;br /&gt;
 pair_coeff * * 1.0 1.0&lt;br /&gt;
This instruction specifies the coefficients for the pairwise interactions of each pair of atoms, and it takes the general form “pair_coeff I J args”. Pair_coeff is the keyword, I and J are the atom types, and args are the coefficients which the different atoms types take. In this case, the asterisk in place of I and J refers to all atoms types from 1 to n. The coefficients are the pairwise interactions are 1 for each atom, meaning each atom has an equal contribution to the interaction.&lt;br /&gt;
&lt;br /&gt;
In these initial calculations, the initial conditions for the numerical methods, &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. For this experiment, the verit-velocity algorithm would be the most appropriate, as both the starting position and velocity is specified for this algorithm. &lt;br /&gt;
&lt;br /&gt;
To define the timestep for the algorithm the following code is used defining the timestep as a variable instead of just giving it a definite value&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;
It is much easier to use the variable version of defining the timestep because the length of time over which the simulation is run depends on the time step. By using a variable, you can keep the length of the simulation the same, no matter the size of the timestep. It also makes it easier if multiple properties depend on the timestep – only the variable needs to be changed, not all the parts of the script where timestep is defined. &lt;br /&gt;
&lt;br /&gt;
The calculations produce the values for the total energy of the system, temperature and pressure in the output files, which can be plotted against time. How well these values equilibrate determines the appropriateness of the timestep to use in further calculations in the experiment.   &lt;br /&gt;
[[File:Rmt totalenergy plot.png|none|thumb|800x800px|&#039;&#039;Figure h. &#039;&#039;Plot of the equilibration of total energy for five different timesteps]]&lt;br /&gt;
The largest time step to give an acceptable result is 0.01. However, for any simluation we would expect energy to be independent of the timestep, something which is not true at a timestep greater than 0.0025. Therefore, the most appropriate timestep to use for a balance between accuracy and length of time which the simulation covers is 0.0025.  &lt;br /&gt;
&lt;br /&gt;
0.015 is a particularly bad choice of timestep. This is because the verit-velocity algorithm gives an approximate result to the velocity (kinetic energy term) and position (potential energy term), and so when the timestep becomes too large with respect to the time, the algorithm no longer becomes a suitable way to calculate the energy. As seen in the graph of 0.015, the energy does not equilibrate and diverges.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions ==&lt;br /&gt;
The calculations in this section are run in the isobaric-isothermal ensemble, where the number of particles in the system, the pressure and the temperature are kept constant (NpT). This means that the temperature and the pressure are recalculated in every step, so are no longer constant like they were in the NVE ensemble. From the &#039;&#039;equipartition theorem&#039;&#039;, each degree of freedom will contribute &amp;lt;math&amp;gt;\frac{1}{2} k_B T&amp;lt;/math&amp;gt; of energy to the system. As the system is in three dimensions, there are three degrees of translational freedom and so the total internal energy is equal to &amp;lt;math&amp;gt;\frac{3}{2} k_B T&amp;lt;/math&amp;gt;. Equating this to the kinetic energy, &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt;, at the end of every step and rearranging will allow calculation of the temperature after every step. &lt;br /&gt;
&lt;br /&gt;
A target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, is defined in the input script and the system will equilibrate by multiplying the velocity by a factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, in order to accommodate for the fluctuation and keep the system at approximately the target temperature and therefore constant internal energy. If the temperature of the system is greater than the target temperature, the system&#039;s kinetic energy is too high, so &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is reduced to compensate for this. The same is true for is the temperature is lower than the target temperature; &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than one in the next step to increase the kinetic energy which is now too low. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; can be derived from equating the kinetic and internal energy of the system at an arbitrary time step:&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;
Expanding the brackets inside the sum and moving the term containing &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; out of the sum: &amp;lt;math&amp;gt;\frac{\gamma^2}{2}\sum_i m_i \left(v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;, we can replace &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt; on the left hand side of the equation with &amp;lt;math&amp;gt;\frac{3}{2} N k_B T&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;\frac{3\gamma^2}{2}N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Simplifying and rearranging for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, gives: &amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The principle is the same for controlling the pressure.&lt;br /&gt;
&lt;br /&gt;
As temperature and pressure are no longer constant, he input files require specification of the pressure and the temperature for each of the systems run. 10 simulations were run at two different pressures with five different temperatures at each. &lt;br /&gt;
* Temperatures: 1.6, 1.9, 2.2, 2.5, 2.8&lt;br /&gt;
* Pressures: 2.5, 3.0&lt;br /&gt;
These pressures were chosen because the data simulated when choosing an appropriate timestep gave a pressure between 2.5 and 3.0.  &lt;br /&gt;
&lt;br /&gt;
For the code which computes the thermodynamic potentials, this particular line defines how many steps contribute towards the average of the thermodynamic parameters computed in the calculation. &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;
&#039;&#039;fix&#039;&#039; is the keyword, &#039;&#039;aves&#039;&#039; is the name of the group of fixes which in this case is the average of the thermodynamic values, &#039;&#039;all&#039;&#039; specifies the atoms which the fix is applied to which in this case is all the atoms in the simulated system and &#039;&#039;ave/time&#039;&#039; means that compute global time averages are calculated. The following three numbers have the following meaning:&lt;br /&gt;
&lt;br /&gt;
*100 = use the input values every 100 timesteps&lt;br /&gt;
*1000 = use input values 1000 times for calculating the average&lt;br /&gt;
*100000 = calculate the average every 100000 timesteps&lt;br /&gt;
&lt;br /&gt;
Therefore for the total calculation which lasts for 100000 will only have the average calculated once. Assuming 1 value every timestep, there will be 100000/100 values = 1000. The amount of time simulated is 100,000 steps, read from the following line.&lt;br /&gt;
&lt;br /&gt;
The density data from all ten calculation were plotted on the same graph, along with the density for an &amp;quot;ideal&amp;quot; gas. This density can be derived from the ideal gas law:&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;
Rearranging in terms of density: &amp;lt;math&amp;gt;\frac{N}{V} = \frac{P}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As these simulations are being run under reduced units, we can take &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt;, and so the density of the ideal gas becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the density of the ideal gas is plotted as the pressure divided by the temperature in pressure-temperature phase space.&lt;br /&gt;
[[File:Rmt dvt plot.png|none|thumb|800x800px|&#039;&#039;Figure i. &#039;&#039;Plot of the variation in density with temperature at a defined pressure for the numerically simulated and ideal systems]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that calculated in the ideal gas law. This is because for an ideal gas, an assumption is made that there are no intermolecular interactions, and therefore forces such as electron repulsion forces are ignored; repulsion forces dominate over attractive ones, as all the atoms in this simulation are the same and so partial charges or dipoles are created. This will mean that the particles move closer together than a real gas and so the density will be larger. This discrepancy between the ideal and non-ideal systems becomes larger at a higher pressure because with a higher pressure, the atoms in the system are closer together and therefore the intermolecular repulsion will become larger. This greater repulsion will in turn have a larger effect on decreasing the density.&lt;br /&gt;
&lt;br /&gt;
== Statistical Physics Calculations of the Heat Capacity ==&lt;br /&gt;
The heat capacity of a system at constant volume can be calculated from the variance in the total energy of the system. The relationship used to calculate the heat capacity is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = 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;\left\langle E^2\right\rangle&amp;lt;/math&amp;gt; is the continuous average of the total square energy at each temperature as a function of temperature. &amp;lt;math&amp;gt;\left\langle E\right\rangle^2&amp;lt;/math&amp;gt; is the continuous average of the total energy at each temperature as a function of temperature squared. The heat capacity is multiplied by &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; in this case because the version of LAMMPS calculates every energy divided by the number of molecules in the system simulated.&lt;br /&gt;
&lt;br /&gt;
The calculations in this sections are run in density-temperature phase space and the ensemble has changed to the canonical ensemble (NVT). A set of input files were written for ten calculations for, like the previous section, two pressures and five different temperatures at each pressure:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 0.2, 0.8&lt;br /&gt;
*Temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{C_V}{V}&amp;lt;/math&amp;gt; was plotted against temperature to determine the relationship in density-temperature phase space. An example of an input file can be found [[Media:nvt_-_0220.in|here]]. The lines which have been changed from the previous input files are at the end of the script:&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 &lt;br /&gt;
 thermo_style custom step etotal temp&lt;br /&gt;
 variable energy equal etotal&lt;br /&gt;
 variable energy2 equal etotal*etotal&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_energy v_energy2 v_temp&lt;br /&gt;
 run 100000&lt;br /&gt;
 &lt;br /&gt;
 variable aveenergy equal f_aves[1]&lt;br /&gt;
 variable aveenergy2 equal f_aves[2]&lt;br /&gt;
 variable avetemp equal f_aves[3]&lt;br /&gt;
 variable heatcapacitydv equal atoms*atoms*(v_aveenergy2-v_aveenergy*v_aveenergy)/(v_avetemp*v_avetemp*vol)&lt;br /&gt;
 &lt;br /&gt;
 print &amp;quot;Averages&amp;quot;&lt;br /&gt;
 print &amp;quot;--------&amp;quot;&lt;br /&gt;
 print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Heat Capacity per Volume: ${heatcapacitydv}&amp;quot;&lt;br /&gt;
The line with the keyword &#039;fix&#039; determines which thermodynamic values are averaged and over how many steps they are averaged. The next section takes these averages as variables and uses them to define the heat capacity which is calculated from the equation at the beginning of this section. Only the energy and temperature are needed to define the heat capacity and so only these values are calculated by the simulation. [[File:Rmt heatcapacitybyv.png|none|thumb|800x800px|&#039;&#039;Figure j. &#039;&#039;C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V against temperature for the two different pressures 0.2 and 0.8]]As seen in the above figure, the heat capacity decreases with temperature for both pressures. It would be expected for an ideal system that as the temperature increases, the heat capacity at constant volume increases and tends to a constant volume at very high T of 3R; R = the universal gas constant. This means increasing the temperature increases the amount of energy being stored in the system and this energy is stored as vibrational energy. However, for a Lennard-Jones liquid, the system being simulated here, the heat capacity decreases with temperature. This is because the simulation has two components to the simulation; the atoms are vibrating in a quasi-harmonic fashion around the equilibrium position and also diffuse between neighbouring equilibrium positions in a gas like fashion. As the temperature increases, the amount of diffusion increases and the vibrations decreases, therefore decreasing the ability of the system to absorb vibrational energy, resulting in the decrease in heat capacity. &amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www.nature.com/ncomms/2013/130816/ncomms3331/full/ncomms3331.html?message-global=remove&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural Properties and the Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a single atom in a system is a plot of the probability that an atom can be found at a certain distance from the central atom. The peaks in this plot can give the distance of an atom from its nearest neighbours in the Lennard-Jones simulated system. &lt;br /&gt;
&lt;br /&gt;
The calculations in this section simulate a Lennard-Jones solid, liquid and gas and, using the output of the LAMMPS trajectory file, plots both the radial distribution function and its integral using DLV. The temperature and pressure parameters for these calculations were taken from the phase diagram or coexistence curve for a Lennard-Jones system.&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt; The parameters used are displayed in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! Temperature, &amp;lt;math&amp;gt;T^*&amp;lt;/math&amp;gt;&lt;br /&gt;
! Pressure, &amp;lt;math&amp;gt;p^*&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| LJ Solid&lt;br /&gt;
| 1.5&lt;br /&gt;
| 1.2&lt;br /&gt;
|-&lt;br /&gt;
| LJ Liquid&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.8&lt;br /&gt;
|-&lt;br /&gt;
| LJ Gas&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.01&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The data obtained from the plots and the radial distribution functions and their integrals were plotted and shown in the table below.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure k. &#039;&#039;The radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
!&#039;&#039;Figure l. &#039;&#039;The integrals of the radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt fullrdfs.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt allintegralsrdf.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
[[File:Rmt Nearest neighbours.png|left|thumb|300x300px|&#039;&#039;Figure m. &#039;&#039;Representation of a cross section of the first three shells of nearest neighbours in an fcc solid. The black atom is the central atom being considered, the blue atoms are the first shell, the orange atoms the second shell and the purple atoms are the third.]]&lt;br /&gt;
The RDF of the solid gives a very irregular curve because of the irregular structure of the lattice. For a simple cubic lattice, a regular structure of the RDF would be expected because of the equal number of atoms in each of the nearest neighbour shells of the atoms. However, for face-centered cubic, the solid in this simulation, the structure is much more irregular and as the atoms move from their equilibrium position in the lattice due to vibrations, the peaks in the radial distribution will broaden. The irregular heights of the peaks are due to the varying numbers of atoms in each of the nearest neighbour shells for the central atom. The first shell gives the highest peak as it contains the most atoms; in total, considering all four surrounding unit cells, this shell contains 12 atoms and ideally takes the geometry of an icosahedron. The second shell is smaller and contains only 6 atoms in an octahedral coordination shape. The following shell again contributes 12 atoms, 3 from each unit cell. This therefore explains why the heights of the peaks in the solid plot in &#039;&#039;figure k.&#039;&#039; vary. These values can be confirmed by the plot in &#039;&#039;figure o.&#039;&#039; which is the integral; it cumulatively adds the numbers in each shell. The size of the first &amp;quot;step&amp;quot; is 12; there are 12 atoms in the first shell. The size of the second step is approximately 18; there are 18-12=6 steps in the second shell. The same theory applies for the third shell which gives a value of 13. This is slightly different to the predicted value possibly due to error in the calculation of the radial distribution function and therefore its integral. &lt;br /&gt;
&lt;br /&gt;
The RDF of the liquid has a representation of far fewer shells, which means that there are less atoms in the space close to a &amp;quot;central&amp;quot; atom in the bulk solution. The particles have more energy and therefore do not keep to a regular lattice structure. As they move about, some regualrity is maintained around each atom, but only to the extend of two or three shells, meaning there is no long range order in a Lennard-Jones liquid. &lt;br /&gt;
&lt;br /&gt;
The RDF of the gas again omits more shells as there is almost no order in a Lennard-Jones gas. The single peak on this plot considers only the set of atoms closest to the central atom and all others are disregarded as they are too far apart. &lt;br /&gt;
&lt;br /&gt;
Considering &#039;&#039;figure l.&#039;&#039;, the size of the integral of the radial distribution function decreases from solid to liquid to gas. This makes sense as the number of atoms in the surrounding shells decreases with density of the system; the atoms become further apart. &lt;br /&gt;
&lt;br /&gt;
From the plot of the radial distribution function of the solid, the lattice spacing can be determined. For this, we can consider just the first three peaks of the RDF plot. The lattice spacing refers to the length of one unit cell, and so, using &#039;&#039;figure m&#039;&#039;, we can calculate this using two different methods; a) we can use the distance between the central atom and the first shell of nearest neighbours, and use trigonometry to calculate the lattice spacing. Or alternatively b) we can use the distance between the central atom and the second nearest neighbour shell to get the lattice spacing.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure n. &#039;&#039;The radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
!&#039;&#039;Figure o. &#039;&#039;The integral of the radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt solidgr3.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt solidint3.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
Using method a) (with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; as the distance between the central atom and the nearest neighbour: Lattice spacing = &amp;lt;math&amp;gt;\frac{r}{cos({\frac{\pi}{4}})} = \frac{1.02}{cos({\frac{\pi}{4}})} \approx 1.44&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using method b): Lattice spacing &amp;lt;math&amp;gt;\approx 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can take an average between the two get an approximate value for the lattice spacing: &amp;lt;math&amp;gt;1.46 plusmn 0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These values for distance are all in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
=== The Mean Squared Displacement ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!Plots for the 8000 atom data&lt;br /&gt;
!Plots for the 1,000,000 atom data&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones solid&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones liquid&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!Lennard-Jones gas&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== The Velocity Autocorrelation Function ===&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=540913</id>
		<title>Rep:Mod:hakunamatata</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:hakunamatata&amp;diff=540913"/>
		<updated>2016-02-24T16:12:43Z</updated>

		<summary type="html">&lt;p&gt;Rmt13: /* Structural Properties and the Radial Distribution Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Introduction to Molecular Dynamics Simulations ==&lt;br /&gt;
===The Classical Particle Approximation and Numerical Integration===&lt;br /&gt;
The verit and verit-velocity algorithms are numerical methods to approximate the average position and velocity respectively of randomly moving atoms in a particular medium (solid, liquid, fliud etc.). This position and velocity can be applied to Newtonian mechanics to calculate such properties as the force and potential energy of the system. The algorithms work by splitting the function into discrete time steps, calculating the values of position and velocity at this particular time step, and then effectively &amp;quot;joining the dots&amp;quot; to create an approximate function. These simulations always use the answer from the previous timestep to compute the new timestep, so initial conditions must be given for the first step. Both of the algorithms are shown below and are derived from the Taylor expansion of the position or velocity of the atoms at the timestep &amp;quot;n+1&amp;quot; or &amp;lt;math&amp;gt;t+\delta t&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit Algorithum:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{x}_i\left(t + \delta t\right) \approx 2\mathbf{x}_i\left(t\right) - \mathbf{x}_i\left(t - \delta t\right) + \frac{\mathbf{F}_i\left(t\right)}{m_i}\delta t^2  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Verit-Velocity Algorithum:&#039;&#039;&#039;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i\left(t\right)&amp;lt;/math&amp;gt; is the force acting on a particular atom as a function of time&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i&amp;lt;/math&amp;gt; is the acceleration &lt;br /&gt;
&lt;br /&gt;
The smaller the timestep, the closer the numerical approximation is to the true solution function, which can be modeled as a classical harmonic oscillator. &#039;&#039;Figure a.&#039;&#039; in the table below shows the comparison between the two methods in &#039;&#039;time&#039;&#039; space. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure a. &#039;&#039;Plots of position vs time comparing the verit algorithm and harmonic spring results&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; | &#039;&#039;Figure b. &#039;&#039;Plot of the total classical energy of the system (potential + kinetic)&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory xanalytical.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory energy.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The harmonic spring position values are modeled from the harmonic oscillator or particle on a spring. The equation of &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; was used to calculate these values, where &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; are 1 and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; is zero. As seen on the plot, the curves produced from the two different methods of calculating the position are in good agreement.&lt;br /&gt;
|The potential energy is calculated using the equation U = 1/2 kx^2, with a value of k given as 1. The kinetic energy is calculated using the velcity from the verit-velocity algorithm using the equation T = 1/2 mv^2, with a value of m given as 1. The total energy of the system, E, is equal to T + U. The values for x (potential energy) and v (kinetic energy) are taken from the verity algorithm and verit-velocity algorthim respectively. &lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;Figure c. &#039;&#039;Plot of the difference (error) between the harmonic spring and verit algorithm data&lt;br /&gt;
!&#039;&#039;Figure d. &#039;&#039;Plot of the peaks in the error plot in &#039;&#039;figure c.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory error.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory errorpeaks.png|frameless|800x800px]]&lt;br /&gt;
|-&lt;br /&gt;
|The peaks in the error between the harmonic spring and verit algorithm results are at the place where the position curve crosses the time axis. This is because the harmonic spring data (x(t)) has a slightly shorter wave period than that of the verit velocity algorithm, and therefore the difference will get larger with each period of the wave, shown by the error getting larger in &#039;&#039;figure c. &#039;&#039;The period of the plot of the two methods are different because the verit algorithm is much more approximate so does not give the correct solution.&lt;br /&gt;
|The change in the error/difference between the harmonic spring data and verit algorthm data increases linearly and so therefore period of each of the plots in &#039;&#039;figure 1&#039;&#039;. must be constant. &lt;br /&gt;
|}&lt;br /&gt;
The error can also be quantified on a &#039;&#039;phase space&#039;&#039; plot; phase space is momentum or velocity plotted as a function of position. The true solution for motion of an atom is a perfect ellipse, and the more elliptic the shape (less circular) the more momentum or velocity is in the system. A numerical solution, like the verit algorithms, will produce a set of points very close to this ellipse but not perfectly following the curve. A good numerical solution will remain in an elliptical shape, whereas a bad numerical solution, for example one with a large timestep, will spiral away from the true solution. Two examples of such systems using the data from &#039;&#039;figures a-d&#039;&#039; are shown below.  &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure e. &#039;&#039;Phase plot of the harmonic spring data with a good numerical solution (timestep = 0.1) &lt;br /&gt;
!&#039;&#039;Figure f. &#039;&#039;Phase plot of the harmonic spring data with a bad numerical solution (timestep = 0.3) &lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt theory phasegood.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt theory badphase.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The timestep at which this data is plotted is 0.1, which results in a very small change in the energy, as seen in &#039;&#039;figure b. &#039;&#039;Increasing the time step will increase the variation in the energy. To keep the variation in the total energy of the system under 1%, the time step must be no larger than approximately 0.28. The energy varies more with increasing time step because the jumps in the algorithm  are getting larger due to less data points. The algorithm assumes these points are joined by a straight line; that the halfway point in the jump is the average between the starting and finishing point of the jump. The phase space plot will become less elliptic and the jumps eventually become so larger that the plot is no longer a continuous shape.  &lt;br /&gt;
&lt;br /&gt;
It is essential to monitor the energy of a numerically modeled system because a good solution for the motion of an atom has a constant energy and a plot in phase space of a perfect ellipse.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance and Force at Zero Potential===&lt;br /&gt;
From classical mechanics, the force calculated from the Newtonian mechanics above can be used to calculate the potential experienced by an atom in the system. They are related by the equation: &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;
This potential gives the shape and dimension of the potential surface on which the system can be modeled. A simple 1D potential that is used to describe the inter atomic forces of a liquid is the Lennard-Jones potential. It has the characteristic features of a short range repulsion potential and harmonic character around the equilibrium bond distance. The value of &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the inter atomic separation when the potential, &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;, is equal to zero, can be calculated by equating the equation for the Lennard-Jones potential to zero and solving for &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The equation for the Lennard-Jones potential: &amp;lt;math&amp;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;
Equating this to zero: &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;
And rearranging in order to separate the variables: &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;
Rearranging this gives &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in terms of &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt; r^6 = \sigma^6&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r = r_0&amp;lt;/math&amp;gt; in this case.&lt;br /&gt;
&lt;br /&gt;
This, therefore, gives the result that interatomic distance at zero potential, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, is equal to &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; in the Lennard-Jones potential is effectively the diameter of one of the particles in the system being measured; in this case, the liquid we are simulating. This is the point where the potential curve crosses the x-axis on an Energy vs interatomic distance plot. The force, &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt;, at this point on the curve corresponds to the gradient; it is found by calculating the derivative of the curve at this point. &lt;br /&gt;
&lt;br /&gt;
To calculate the force, we must differentiate the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As force is equal to the negative differential of the potential energy, the value of the force is: &amp;lt;math&amp;gt;\mathbf{F}_i = 48\epsilon \sigma^{12} r^{-13} - 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting in the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at zero potential from the calculation before: &amp;lt;math&amp;gt;\mathbf{F}_i = \frac{48\epsilon}{\sigma} - \frac{24\epsilon}{\sigma} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The gradient where the Lennard-Jones plot crosses the axis is negative; &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; in the term obtained for &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is negative and therefore the overall value of the force will be negative.&lt;br /&gt;
&lt;br /&gt;
===Calculating the Interatomic Distance, Force and Well Depth of the Potential at Equilibrium===&lt;br /&gt;
To calculate the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at the equilibrium position, we need to use the derivative of the potential energy curve. The equilibrium value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is the value at the minimum of the Lennard-Jones curve; when &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Therefore, equating the derivative to zero gives: &amp;lt;math&amp;gt;0 = -48\epsilon \sigma^{12} r^{-13} + 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rearranging this: &amp;lt;math&amp;gt;48\epsilon \sigma^{12} r^{-13} = 24\epsilon \sigma^6 r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And simplifying and cancelling gives: &amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6&amp;lt;/math&amp;gt;. Therefore the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; at equilibrium is: &amp;lt;math&amp;gt;r_{eq} = \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Physically, this result means that the equilibrium distance is 1.12 times the diameter of one of the particles; the particles have a small gap between them so do not touch. A short range repulsion potential, as seen in the Lennard-Jones curve, is a result of the particles coming into contact. &lt;br /&gt;
&lt;br /&gt;
Again, the force can be calculated from the derivative of the potential curve at the equilibrium point. As the derivative at this point is zero (a minimum on the curve), the force will therefore also be zero.&lt;br /&gt;
&lt;br /&gt;
The well-depth of the potential curve is the difference between zero potential and the potential at the equilibrium bond length. This can be calculated by substituting the value for the equilibrium bond length into the equation for the Lennard-Jones potential.&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;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 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;
Cancelling and simplifying this equation gives: &amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \times \frac{1}{4}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the absolute value for the well depth is &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;. The actual value of this potential is &amp;lt;math&amp;gt;-\epsilon&amp;lt;/math&amp;gt;, as the equilibrium bond length gives the most stable configuration of the molecules and therefore suggests attractive interactions are involved in the arrangement of the molecules; this attractive potential means its negative. &lt;br /&gt;
&lt;br /&gt;
===Boundary Conditions and the Lennard-Jones Cutoff===&lt;br /&gt;
When simulating a liquid, it is computationally impractical to simulate a realistic liquid. Therefore a smaller &#039;box&#039; containing &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; particles is simulated and the computer program will use &#039;&#039;periodic boundary conditions&#039;&#039; to simulate infinite repetitions of this box; when the atom reaches one edge of the box, in periodic boundary conditions, it will reappear again at the opposite edge of the box as if they were connected. For example, an atom at the position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a box of size &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;. Without periodic boundary conditions, we would assume that the atom would end up at the position &amp;lt;math&amp;gt;(1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;. However, in this box, there is no such position and so the particle must reappear at the opposite edge to where it effectively &#039;left&#039; the box. Therefore, it&#039;s ending position will be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The number of particles, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; simulated by the computer is usually between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt;. Physically, this is a very small volume. Considering water, we can calculate the number of molecules in 1 mL or 1 cm^3, a volume that would be considered small in the lab. Taking the concentration of water at standard conditions, &amp;lt;math&amp;gt;55\ mol\ dm^{-3}&amp;lt;/math&amp;gt;, we can convert it to the number of moles per mL: &amp;lt;math&amp;gt;0.055\ mol\ mL^{-1}&amp;lt;/math&amp;gt;. Multiplying this value by Avagadro&#039;s constant (&amp;lt;math&amp;gt;N_A&amp;lt;/math&amp;gt;) gives the number of molcules of water per mL: &amp;lt;math&amp;gt;3.02 \times 10^{22}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The reverse procedure can be used to compare this to the volume of 10,000 molecules: 10,000 divided by Avagadro&#039;s constant gives the number of moles of water which 10,000 molecules makes up: &amp;lt;math&amp;gt;1.66 \times 10^{-20}\ moles&amp;lt;/math&amp;gt;. Dividing this value by the concentration (from &amp;lt;math&amp;gt;n=cV&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is the number of moles, &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; is the concentration and &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume), gives the volume: &amp;lt;math&amp;gt;3.02 \times 10^{-22}\ dm&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;3.02 \times 10^{-19}\ mL&amp;lt;/math&amp;gt;. Physically, of course, this is far too small a volume to be recorded in the lab.&lt;br /&gt;
 &lt;br /&gt;
Periodic boundary conditions simulate an infinite lattice and therefore, when computing the potential, will calculate an infinite amount of pair interactions. Therefore, it is only practical to calculate the energies up to a certain interatomic distance; the Lennard-Jones cutoff distance. Beyond this point, the potential energy and the integral of the curve beyond this point become insignificant and do not impact on the overall energy; removing interactions beyond this point from the calculations will not effect the accuracy. Multiplying the Lennard-Jones potential with the radial distribution function gives a plot of the probability of finding an atom at a particular interatomic distance. The larger the interatomic distance, the lower the probability and so the energy after the cutoff can be disregarded. &lt;br /&gt;
&lt;br /&gt;
Integrating over the Lennard-Jones curve and applying this cutoff as the lower limit can show how small the integral is:&lt;br /&gt;
&lt;br /&gt;
For a general cutoff of with value &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;I = \int_{x}^\infty \phi\left(r\right)\mathrm{d}r = \int_{x}^\infty \frac{4\epsilon\sigma^{12}}{r^{12}}\mathrm{d}r - \int_{x}^\infty \frac{4\epsilon\sigma^6}{r^6}\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving this: &amp;lt;math&amp;gt;I = 4\epsilon\sigma^{12} {\frac{-1}{11r^{11}}\,\Bigg\vert\,}_x^\infty - 4\epsilon\sigma^{6} {\frac{-1}{5r^{5}}\,\Bigg\vert\,}_x^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This gives the general solution: &amp;lt;math&amp;gt;I = \frac{4\epsilon\sigma^{12}}{11x^{11}} - \frac{4\epsilon\sigma^{6}}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating this for &amp;lt;math&amp;gt;\epsilon = \sigma = 1&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;I = \frac{4}{11x^{11}} - \frac{4}{5x^5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt; (or 2 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.025&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt; (or 2.5 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0082&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the cutoff point &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt; (or 3 considering &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt;): &amp;lt;math&amp;gt;I = -0.0033&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All values are taken to 2 significant figures. As the cutoff value for the interatomic distance gets larger, the integral gets smaller, and therefore the energy excluded from the calculation becomes smaller, and the second term in the solved integral, &amp;lt;math&amp;gt;I&amp;lt;/math&amp;gt;, dominates the energy value.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
When using the Lennard-Jones potential, it is appropriate to use reduced units for intermolecular distance, energy and temperature. Reduced units can be calculated by the following relationships:&lt;br /&gt;
&lt;br /&gt;
Intermolecular 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;
&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; are scaling factors. For example, if the parameters for Argon are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\sigma = 0.34 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt; \epsilon\ /\ k_B = 120 K&amp;lt;/math&amp;gt;&lt;br /&gt;
* Lennard-Jones cutoff &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;. The well-depth, &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;, is &amp;lt;math&amp;gt;0.999 kJ mol^{-1} \approx 1 kJ mol^{-1}&amp;lt;/math&amp;gt;. The value of &amp;lt;math&amp;gt;T* = 1.5&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;180 K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
The first aim of the simulations is to determine the most appropriate timestep to use in the vert algorithm simulations. This timestep is a balance between the accuracy of the results (the smaller the timestep, the closer to the true functing the result will be) and the length of real time over which the simluation is run (the smaller the timestep, the less real time over which the simulation will give a result). The appropriateness of the timestep will be determined by plotting how the total free energy of the simulated lattice equilibrates over time.  &lt;br /&gt;
&lt;br /&gt;
Five different calculations, which simulated the melting of a crystal and subsequent equilibration of the energy of the melted crystal, were run at five different timesteps; 0.001, 0.0025, 0.0075, 0.01 and 0.015, and were described by the NVE or &#039;&#039;&amp;quot;microcanonical ensemble&amp;quot;&#039;&#039;. An ensemble is a collection of samples of a system which are under three thermodynamic constraints (three properties are kept constant); in the microcanonical ensemble, the number of particles, the volume and the total energy is kept constant (NVE). &lt;br /&gt;
&lt;br /&gt;
These calculations simulate a box of 1000 unit cells and use periodic boundary conditions to replicate the simulation to a larger scale. Because these simulations use the numerical methods defined in the previous section, the initial position and velocity of the atoms must be defined in the input file. The Brownian (uncorrelated, random) motion of the atoms in the simulation means that there is no long range order in the system and so the atoms in a real system would start in random positions. However, assigning random starting coordinates to the atoms in a simulated liquid is not a relative process; the coordinates are generate independently of each other. Therefore there is a probability that the coordinates simulated will cause the atoms to overlap, which would give a very large repulsion potential, as seen in the Lennard-Jones potential at very small interatomic distances. This short-range repulsion potential comes from the hard-sphere model of atomic simulation.&lt;br /&gt;
&lt;br /&gt;
The input file also defines the structure and density of the lattice. The number density of lattice points in any lattice is the number of lattice points per volume of the unit cell. In a simple cubic lattice, there is one lattice point in the unit cell. From an sc lattice with lattice spacing (length of one side of the unit cell) being &amp;lt;math&amp;gt;1.07722&amp;lt;/math&amp;gt;, the number density of the lattice points is calculated by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{N}{V} = \frac{1}{1.07722^3} = 0.7999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a face-centered cubic lattice (fcc), there are four lattice points in the unit cell. Rearranging the above relationship, the lattice spacing can be calculated from the number of lattice points in a unit cell and number density, &amp;lt;math&amp;gt;1.2&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Lattice\ spacing = \sqrt[3]{\frac{number\ of\ lattice\ points\ per\ unit\ cell}{number\ density}} = \sqrt[3]{\frac{4}{1.2}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation creates a box which includes 1000 unit cells, which is 10 unit cells in each dimension. For a simple cubic lattice, because there is one lattice point per unit cell, there will be 1000 atoms created as seen in the input file. The &#039;&#039;create_atom&#039;&#039; command in the input file determines how many boxes are created in the simulation and therefore how many atoms will be created. If a face centered cubic lattice is simulated, because there are 4 lattice points per unit cell, 4000 atoms will be created in the &#039;&#039;create_atom&#039;&#039; command. &lt;br /&gt;
&lt;br /&gt;
The input script also contains the following commands which defines the potential surface which is used to model the intermolecular reactions:&lt;br /&gt;
 mass 1 1.0&lt;br /&gt;
This instruction sets the mass type for the atoms being simulated. It takes the general form of “mass I value”, where mass is the keyword which tells LAMMPS what the input is, I is the atom type and value is the mass of the atom. In this case, I is defined by a specific numerical value; 1 as there is only 1 type of atom in the simulation, but it can be defined with an asterisk (1*), which means “all atom types of 1 to n inclusive”. &lt;br /&gt;
 pair_style lj/cut 3.0&lt;br /&gt;
This instruction sets the type of potential which LAMMPS uses in its calculation of pairwise interactions. It takes the general form of “pair_style style args”, where pair_style is the keyword for LAMMPS, style defines the potential and any specifications it may have, and args are the arguments required for this particular potential. In this case, the Lennard-Jones potential has been used (lj) with a cutoff point (cut) of 3σ. The cutoff point is explained in the introduction section. &lt;br /&gt;
 pair_coeff * * 1.0 1.0&lt;br /&gt;
This instruction specifies the coefficients for the pairwise interactions of each pair of atoms, and it takes the general form “pair_coeff I J args”. Pair_coeff is the keyword, I and J are the atom types, and args are the coefficients which the different atoms types take. In this case, the asterisk in place of I and J refers to all atoms types from 1 to n. The coefficients are the pairwise interactions are 1 for each atom, meaning each atom has an equal contribution to the interaction.&lt;br /&gt;
&lt;br /&gt;
In these initial calculations, the initial conditions for the numerical methods, &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. For this experiment, the verit-velocity algorithm would be the most appropriate, as both the starting position and velocity is specified for this algorithm. &lt;br /&gt;
&lt;br /&gt;
To define the timestep for the algorithm the following code is used defining the timestep as a variable instead of just giving it a definite value&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;
It is much easier to use the variable version of defining the timestep because the length of time over which the simulation is run depends on the time step. By using a variable, you can keep the length of the simulation the same, no matter the size of the timestep. It also makes it easier if multiple properties depend on the timestep – only the variable needs to be changed, not all the parts of the script where timestep is defined. &lt;br /&gt;
&lt;br /&gt;
The calculations produce the values for the total energy of the system, temperature and pressure in the output files, which can be plotted against time. How well these values equilibrate determines the appropriateness of the timestep to use in further calculations in the experiment.   &lt;br /&gt;
[[File:Rmt totalenergy plot.png|none|thumb|800x800px|&#039;&#039;Figure h. &#039;&#039;Plot of the equilibration of total energy for five different timesteps]]&lt;br /&gt;
The largest time step to give an acceptable result is 0.01. However, for any simluation we would expect energy to be independent of the timestep, something which is not true at a timestep greater than 0.0025. Therefore, the most appropriate timestep to use for a balance between accuracy and length of time which the simulation covers is 0.0025.  &lt;br /&gt;
&lt;br /&gt;
0.015 is a particularly bad choice of timestep. This is because the verit-velocity algorithm gives an approximate result to the velocity (kinetic energy term) and position (potential energy term), and so when the timestep becomes too large with respect to the time, the algorithm no longer becomes a suitable way to calculate the energy. As seen in the graph of 0.015, the energy does not equilibrate and diverges.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions ==&lt;br /&gt;
The calculations in this section are run in the isobaric-isothermal ensemble, where the number of particles in the system, the pressure and the temperature are kept constant (NpT). This means that the temperature and the pressure are recalculated in every step, so are no longer constant like they were in the NVE ensemble. From the &#039;&#039;equipartition theorem&#039;&#039;, each degree of freedom will contribute &amp;lt;math&amp;gt;\frac{1}{2} k_B T&amp;lt;/math&amp;gt; of energy to the system. As the system is in three dimensions, there are three degrees of translational freedom and so the total internal energy is equal to &amp;lt;math&amp;gt;\frac{3}{2} k_B T&amp;lt;/math&amp;gt;. Equating this to the kinetic energy, &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt;, at the end of every step and rearranging will allow calculation of the temperature after every step. &lt;br /&gt;
&lt;br /&gt;
A target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, is defined in the input script and the system will equilibrate by multiplying the velocity by a factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, in order to accommodate for the fluctuation and keep the system at approximately the target temperature and therefore constant internal energy. If the temperature of the system is greater than the target temperature, the system&#039;s kinetic energy is too high, so &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is reduced to compensate for this. The same is true for is the temperature is lower than the target temperature; &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than one in the next step to increase the kinetic energy which is now too low. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; can be derived from equating the kinetic and internal energy of the system at an arbitrary time step:&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;
Expanding the brackets inside the sum and moving the term containing &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; out of the sum: &amp;lt;math&amp;gt;\frac{\gamma^2}{2}\sum_i m_i \left(v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;, we can replace &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt; on the left hand side of the equation with &amp;lt;math&amp;gt;\frac{3}{2} N k_B T&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;\frac{3\gamma^2}{2}N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Simplifying and rearranging for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, gives: &amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The principle is the same for controlling the pressure.&lt;br /&gt;
&lt;br /&gt;
As temperature and pressure are no longer constant, he input files require specification of the pressure and the temperature for each of the systems run. 10 simulations were run at two different pressures with five different temperatures at each. &lt;br /&gt;
* Temperatures: 1.6, 1.9, 2.2, 2.5, 2.8&lt;br /&gt;
* Pressures: 2.5, 3.0&lt;br /&gt;
These pressures were chosen because the data simulated when choosing an appropriate timestep gave a pressure between 2.5 and 3.0.  &lt;br /&gt;
&lt;br /&gt;
For the code which computes the thermodynamic potentials, this particular line defines how many steps contribute towards the average of the thermodynamic parameters computed in the calculation. &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;
&#039;&#039;fix&#039;&#039; is the keyword, &#039;&#039;aves&#039;&#039; is the name of the group of fixes which in this case is the average of the thermodynamic values, &#039;&#039;all&#039;&#039; specifies the atoms which the fix is applied to which in this case is all the atoms in the simulated system and &#039;&#039;ave/time&#039;&#039; means that compute global time averages are calculated. The following three numbers have the following meaning:&lt;br /&gt;
&lt;br /&gt;
*100 = use the input values every 100 timesteps&lt;br /&gt;
*1000 = use input values 1000 times for calculating the average&lt;br /&gt;
*100000 = calculate the average every 100000 timesteps&lt;br /&gt;
&lt;br /&gt;
Therefore for the total calculation which lasts for 100000 will only have the average calculated once. Assuming 1 value every timestep, there will be 100000/100 values = 1000. The amount of time simulated is 100,000 steps, read from the following line.&lt;br /&gt;
&lt;br /&gt;
The density data from all ten calculation were plotted on the same graph, along with the density for an &amp;quot;ideal&amp;quot; gas. This density can be derived from the ideal gas law:&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;
Rearranging in terms of density: &amp;lt;math&amp;gt;\frac{N}{V} = \frac{P}{k_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As these simulations are being run under reduced units, we can take &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt;, and so the density of the ideal gas becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the density of the ideal gas is plotted as the pressure divided by the temperature in pressure-temperature phase space.&lt;br /&gt;
[[File:Rmt dvt plot.png|none|thumb|800x800px|&#039;&#039;Figure i. &#039;&#039;Plot of the variation in density with temperature at a defined pressure for the numerically simulated and ideal systems]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that calculated in the ideal gas law. This is because for an ideal gas, an assumption is made that there are no intermolecular interactions, and therefore forces such as electron repulsion forces are ignored; repulsion forces dominate over attractive ones, as all the atoms in this simulation are the same and so partial charges or dipoles are created. This will mean that the particles move closer together than a real gas and so the density will be larger. This discrepancy between the ideal and non-ideal systems becomes larger at a higher pressure because with a higher pressure, the atoms in the system are closer together and therefore the intermolecular repulsion will become larger. This greater repulsion will in turn have a larger effect on decreasing the density.&lt;br /&gt;
&lt;br /&gt;
== Statistical Physics Calculations of the Heat Capacity ==&lt;br /&gt;
The heat capacity of a system at constant volume can be calculated from the variance in the total energy of the system. The relationship used to calculate the heat capacity is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = 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;\left\langle E^2\right\rangle&amp;lt;/math&amp;gt; is the continuous average of the total square energy at each temperature as a function of temperature. &amp;lt;math&amp;gt;\left\langle E\right\rangle^2&amp;lt;/math&amp;gt; is the continuous average of the total energy at each temperature as a function of temperature squared. The heat capacity is multiplied by &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; in this case because the version of LAMMPS calculates every energy divided by the number of molecules in the system simulated.&lt;br /&gt;
&lt;br /&gt;
The calculations in this sections are run in density-temperature phase space and the ensemble has changed to the canonical ensemble (NVT). A set of input files were written for ten calculations for, like the previous section, two pressures and five different temperatures at each pressure:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 0.2, 0.8&lt;br /&gt;
*Temperatures: 2.0, 2.2, 2.4, 2.6 and 2.8&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{C_V}{V}&amp;lt;/math&amp;gt; was plotted against temperature to determine the relationship in density-temperature phase space. An example of an input file can be found [[Media:nvt_-_0220.in|here]]. The lines which have been changed from the previous input files are at the end of the script:&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 &lt;br /&gt;
 thermo_style custom step etotal temp&lt;br /&gt;
 variable energy equal etotal&lt;br /&gt;
 variable energy2 equal etotal*etotal&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_energy v_energy2 v_temp&lt;br /&gt;
 run 100000&lt;br /&gt;
 &lt;br /&gt;
 variable aveenergy equal f_aves[1]&lt;br /&gt;
 variable aveenergy2 equal f_aves[2]&lt;br /&gt;
 variable avetemp equal f_aves[3]&lt;br /&gt;
 variable heatcapacitydv equal atoms*atoms*(v_aveenergy2-v_aveenergy*v_aveenergy)/(v_avetemp*v_avetemp*vol)&lt;br /&gt;
 &lt;br /&gt;
 print &amp;quot;Averages&amp;quot;&lt;br /&gt;
 print &amp;quot;--------&amp;quot;&lt;br /&gt;
 print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Heat Capacity per Volume: ${heatcapacitydv}&amp;quot;&lt;br /&gt;
The line with the keyword &#039;fix&#039; determines which thermodynamic values are averaged and over how many steps they are averaged. The next section takes these averages as variables and uses them to define the heat capacity which is calculated from the equation at the beginning of this section. Only the energy and temperature are needed to define the heat capacity and so only these values are calculated by the simulation. [[File:Rmt heatcapacitybyv.png|none|thumb|800x800px|&#039;&#039;Figure j. &#039;&#039;C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V against temperature for the two different pressures 0.2 and 0.8]]As seen in the above figure, the heat capacity decreases with temperature for both pressures. It would be expected for an ideal system that as the temperature increases, the heat capacity at constant volume increases and tends to a constant volume at very high T of 3R; R = the universal gas constant. This means increasing the temperature increases the amount of energy being stored in the system and this energy is stored as vibrational energy. However, for a Lennard-Jones liquid, the system being simulated here, the heat capacity decreases with temperature. This is because the simulation has two components to the simulation; the atoms are vibrating in a quasi-harmonic fashion around the equilibrium position and also diffuse between neighbouring equilibrium positions in a gas like fashion. As the temperature increases, the amount of diffusion increases and the vibrations decreases, therefore decreasing the ability of the system to absorb vibrational energy, resulting in the decrease in heat capacity. &amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www.nature.com/ncomms/2013/130816/ncomms3331/full/ncomms3331.html?message-global=remove&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural Properties and the Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a single atom in a system is a plot of the probability that an atom can be found at a certain distance from the central atom. The peaks in this plot can give the distance of an atom from its nearest neighbours in the Lennard-Jones simulated system. &lt;br /&gt;
&lt;br /&gt;
The calculations in this section simulate a Lennard-Jones solid, liquid and gas and, using the output of the LAMMPS trajectory file, plots both the radial distribution function and its integral using DLV. The temperature and pressure parameters for these calculations were taken from the phase diagram or coexistence curve for a Lennard-Jones system.&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt; The parameters used are displayed in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! Temperature, &amp;lt;math&amp;gt;T^*&amp;lt;/math&amp;gt;&lt;br /&gt;
! Pressure, &amp;lt;math&amp;gt;p^*&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| LJ Solid&lt;br /&gt;
| 1.5&lt;br /&gt;
| 1.2&lt;br /&gt;
|-&lt;br /&gt;
| LJ Liquid&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.8&lt;br /&gt;
|-&lt;br /&gt;
| LJ Gas&lt;br /&gt;
| 1.1&lt;br /&gt;
| 0.01&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The data obtained from the plots and the radial distribution functions and their integrals were plotted and shown in the table below.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure k. &#039;&#039;The radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
!&#039;&#039;Figure l. &#039;&#039;The integrals of the radial distribution function (g(r)) plots for a Lennard-Jones solid, liquid and gas&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt fullrdfs.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt allintegralsrdf.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
[[File:Rmt Nearest neighbours.png|left|thumb|300x300px|&#039;&#039;Figure m. &#039;&#039;Representation of a cross section of the first three shells of nearest neighbours in an fcc solid. The black atom is the central atom being considered, the blue atoms are the first shell, the orange atoms the second shell and the purple atoms are the third.]]&lt;br /&gt;
The RDF of the solid gives a very irregular curve because of the irregular structure of the lattice. For a simple cubic lattice, a regular structure of the RDF would be expected because of the equal number of atoms in each of the nearest neighbour shells of the atoms. However, for face-centered cubic, the solid in this simulation, the structure is much more irregular and as the atoms move from their equilibrium position in the lattice due to vibrations, the peaks in the radial distribution will broaden. The irregular heights of the peaks are due to the varying numbers of atoms in each of the nearest neighbour shells for the central atom. The first shell gives the highest peak as it contains the most atoms; in total, considering all four surrounding unit cells, this shell contains 12 atoms and ideally takes the geometry of an icosahedron. The second shell is smaller and contains only 6 atoms in an octahedral coordination shape. The following shell again contributes 12 atoms, 3 from each unit cell. This therefore explains why the heights of the peaks in the solid plot in &#039;&#039;figure k.&#039;&#039; vary. These values can be confirmed by the plot in &#039;&#039;figure o.&#039;&#039; which is the integral; it cumulatively adds the numbers in each shell. The size of the first &amp;quot;step&amp;quot; is 12; there are 12 atoms in the first shell. The size of the second step is approximately 18; there are 18-12=6 steps in the second shell. The same theory applies for the third shell which gives a value of 13. This is slightly different to the predicted value possibly due to error in the calculation of the radial distribution function and therefore its integral. &lt;br /&gt;
&lt;br /&gt;
The RDF of the liquid has a representation of far fewer shells, which means that there are less atoms in the space close to a &amp;quot;central&amp;quot; atom in the bulk solution. The particles have more energy and therefore do not keep to a regular lattice structure. As they move about, some regualrity is maintained around each atom, but only to the extend of two or three shells, meaning there is no long range order in a Lennard-Jones liquid. &lt;br /&gt;
&lt;br /&gt;
The RDF of the gas again omits more shells as there is almost no order in a Lennard-Jones gas. The single peak on this plot considers only the set of atoms closest to the central atom and all others are disregarded as they are too far apart. &lt;br /&gt;
&lt;br /&gt;
Considering &#039;&#039;figure l.&#039;&#039;, the size of the integral of the radial distribution function decreases from solid to liquid to gas. This makes sense as the number of atoms in the surrounding shells decreases with density of the system; the atoms become further apart. &lt;br /&gt;
&lt;br /&gt;
From the plot of the radial distribution function of the solid, the lattice spacing can be determined. For this, we can consider just the first three peaks of the RDF plot. The lattice spacing refers to the length of one unit cell, and so, using &#039;&#039;figure m&#039;&#039;, we can calculate this using two different methods; a) we can use the distance between the central atom and the first shell of nearest neighbours, and use trigonometry to calculate the lattice spacing. Or alternatively b) we can use the distance between the central atom and the second nearest neighbour shell to get the lattice spacing.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&#039;&#039;Figure n. &#039;&#039;The radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
!&#039;&#039;Figure o. &#039;&#039;The integral of the radial distribution function (g(r)) plots for the first three peaks of a Lennard-Jones solid&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Rmt solidgr3.png|frameless|800x800px]]&lt;br /&gt;
|[[File:Rmt solidint3.png|frameless|800x800px]]&lt;br /&gt;
|}&lt;br /&gt;
Using method a) (with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; as the distance between the central atom and the nearest neighbour: Lattice spacing = &amp;lt;math&amp;gt;\frac{r}{cos({\frac{\pi}{4}})} = \frac{1.02}{cos({\frac{\pi}{4}})} \approx 1.44&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using method b): Lattice spacing &amp;lt;math&amp;gt;\approx 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can take an average between the two get an approximate value for the lattice spacing: &amp;lt;math&amp;gt;1.46 plusmn 0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These values for distance are all in reduced units.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Rmt13</name></author>
	</entry>
</feed>