<?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=Mp4114</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=Mp4114"/>
	<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/wiki/Special:Contributions/Mp4114"/>
	<updated>2026-04-06T03:22:24Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=579802</id>
		<title>Rep:Thermomp4114</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=579802"/>
		<updated>2017-02-01T14:40:36Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: /* Calculating Heat Capacities Using Statistic Physics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Molecular Dynamics Simulations of Simple Liquids Introduction == &lt;br /&gt;
&lt;br /&gt;
Molecular dynamic simulations involved studying the motion of a system of particles. Several fundamental elements of a system need to be known in order to achieve this. This includes a knowledge of the interaction potential for the particles and the equations of motion which govern the dynamics of the particles.&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt; Once we know the positions, velocities, and forces, of the atoms (which are obtained using statistical) we can calculate various thermodynamic quantities of the system such as temperature and pressure. We must introduce a series of approximations in order for the caluculations to be feasible. Firstly we apply the &#039;&#039;&#039;The Classical Particle Approximation&#039;&#039;&#039;. The schoedinger equation is too complex to solve for a large system of atoms, however if the atoms are treated classically then the positions and and velocities of each can atom can be calculated using Newton&#039;s second law (equation 1): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = m_i \mathbf{a}_i = m_i \frac{\mathrm{d}\mathbf{v}_i}{\mathrm{d}t} = m_i \frac{\mathrm{d}^2 \mathbf{x}_i}{\mathrm{d}t^2} \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As there are N atoms and therefore N equations representing each atom a computer is a necessity. The &#039;&#039;&#039;Verlet algorithim&#039;&#039;&#039; is used to solve to Newton&#039;s law for all the atoms in the system. In this case time is not continuous but is made discrete, the simulation is thus broeken up into specific &#039;&#039;&#039;timesteps&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The position of atom &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;\mathbf{x}_i \left(t\right)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Positional Verlet algorithim (equation (2)): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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 \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Velocity Verlet algorithim (equation (3)):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{v}_i \left(t\right)&amp;lt;/math&amp;gt; represents the velocity of that atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;center&amp;gt;&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 \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Put in example of industrial applications&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Harmonic Oscillator ===&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator illustrates the the accuracy and discrepancies associated with using the velocity Verlet algorithim. Equation (4) is used to model the behavior of the harmonic oscillator in an analytical sense: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)\ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; = 1.00 &lt;br /&gt;
&lt;br /&gt;
Graph (1) illustrates the results the analytical solution gave for the relationship between position and time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Avrsxt2.png|x300px|thumb|Graph 1: Analytical solution of harmonic oscillator|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The difference in position between the velocity-verlet solution and analytical solution is represented by an error. Error plotted against time is illustrated by graph (2). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ErrorvrsT.png|x300px|thumb|Graph 2: Error vrs Time|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The orange line illustrates the positive trend between error and time. This shows that error is accumulative with time. Each timestep represents a calculation which has an associated error thus as the simulation proceeds the errors will be summed. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy of the system will consist of the sum of kinetic and potential energy. Equation (5) can be used to find kinetic energy of the system:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;E_\text{k} =\tfrac{1}{2} mv(t)^2 \ \ (5)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\mathbf{x} \left(t\right)&amp;lt;/math&amp;gt; is used in equation (5) the potential energy can be found. &lt;br /&gt;
&lt;br /&gt;
The following graphs represent the difference in change in energy with time when the timestep is varied. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EvrsTime.png|x200px|thumb|Energy change when a timestep of 0.1 is used|left]]&lt;br /&gt;
! [[File:Energy vrs time for 0.15 timestep.png|x200px|thumb|Energy change when a timestep of 0.15 is used|centre]]&lt;br /&gt;
! [[File:Energy vrs time for 0.2 timestep.png|x200px|thumb|Energy change when a timestep of 0.2 is used|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The maximum change in energy for each of the different timesteps is shown in table (1). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | Timestep&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.1&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.15&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.2&lt;br /&gt;
|-&lt;br /&gt;
| Max. change in Energy&lt;br /&gt;
| 0.2%&lt;br /&gt;
| 0.6%&lt;br /&gt;
| 1%&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results clearly indicate that a timestep greater than &#039;&#039;&#039;0.2&#039;&#039;&#039; will result in an energy change greater than 1%. As the timestep increases as does the maximum error. The timestep defines the number of calculations made in a given time, therefore the shorter the timestep the larger the number of calculations carried out and therefore a more accurate result is produced. The total energy of a real physical system should not change, when modeled numerically there can be fluctuations therefore it is important to monitor this change and ensure that the fluctuations are minimised.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces ===&lt;br /&gt;
&lt;br /&gt;
The forces an atom experiences is determined by the positions of all the atoms in the system, &amp;lt;math&amp;gt;\mathbf{r}^N&amp;lt;/math&amp;gt;. The Lennard-Jones function accurately sums all the key inter-atomic forces an atoms experiences (U). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ (10)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
For a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After division by 4 and rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_0^{6}} = \frac{\sigma^{6}}{r_0^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After further rearrangement and cancelling down: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;-\sigma &amp;lt;/math&amp;gt; is also a solution however this can be disregarded. &lt;br /&gt;
&lt;br /&gt;
In order to calculate the force the following equation is used: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\sigma\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After differentiation and simplification: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}(r_0) =  \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At equilibrium: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{12\sigma^{12}}{r_e^{13}} - \frac{6\sigma^6}{r_e^7} \right)&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
After rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_e = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This value of &amp;lt;math&amp;gt; r_e &amp;lt;/math&amp;gt; can now be used to find the well depth:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{\sigma^{12}}{4sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon\left(\frac{1}{5r^{5}} - \frac{1}{11r^11} \right)^\infty_2 \simeq -2.48 \sdot 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -8.18 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -3.29 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
* No. of moles in  1 mL of water = 0.056 &amp;lt;br&amp;gt; &lt;br /&gt;
* No. of molecules = moles x Avogadro&#039;s constant = 3.37 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*1000 molecules = 1.66 x 10&amp;lt;sup&amp;gt;21&amp;lt;/sup&amp;gt; moles&lt;br /&gt;
* Density = mass/vol. = 1 &lt;br /&gt;
*vol. = mass/density = 2.99 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Due to periodic boundary condition once the atom leaves the current box it will enter the beginning of an identical box. The atom is at &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; and thus once it breaches 0.5 in a particular direction it will be at the start of the next box. Using these principles after the atom moves &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will be at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units === &lt;br /&gt;
&lt;br /&gt;
Reduced units are applied to the Lennard-Jones equation to make the calculation more managable.&lt;br /&gt;
&lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For argon:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Distance in real units: r = 1.09 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Well depth = &amp;lt;math&amp;gt;{\epsilon}&amp;lt;/math&amp;gt; = 0.996 KJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* T = 180 K&lt;br /&gt;
&lt;br /&gt;
= Equilibriation = &lt;br /&gt;
&lt;br /&gt;
=== Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
As there is a large number of atoms in a discrete volume allowing random assignment of positions could result in atoms overlapping. This would cause an unrealistically high potential as potential is distance dependant (as observed in the Lennard - Jones equation).&lt;br /&gt;
&lt;br /&gt;
* Density is given by the following equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{n}{v} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 1 (as there is only 1 atom per unit cell) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = 1.07722^3 = 1.25 &amp;lt;/math&amp;gt; (lattice spacing = 1.07722) &lt;br /&gt;
&lt;br /&gt;
Thus: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length of a side of one fcc unit cell with number density 1.2 would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = \frac{n}{\rho} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 4 (as there is 4 atoms per unit cell in an fcc lattice) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; = 3.33&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; l = v^{-3} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The number of atoms that would be created by the create_atoms command for an fcc lattice would be: &lt;br /&gt;
&lt;br /&gt;
4 x 1000 = 4000 &lt;br /&gt;
&lt;br /&gt;
This is due to fact that there is 1 atom per unit cell that yeilds 1000 altogether in simple cubic. Fcc has 4 times the number of atoms per unit cell. &lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of Atoms === &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command above has the following purpose: &lt;br /&gt;
&lt;br /&gt;
* The first line sets the mass of all atoms of type &#039;1&#039; to 1.0. &lt;br /&gt;
*  Line 2 is used to control the Lennard-Jones potential. The value of 3.0 indicates the distance in reduced units upon which the potential is calculated. The potential is distance dependent and falls to 0 at large values of r thus only atoms within a distance of 3.0 are considered.  &#039;lj/cut&#039; defines the cut off point. &lt;br /&gt;
* The last line defines the force field constants as 1.0 for all sets of atoms. The * controls the fact that the command is set for all atoms. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet is the integration algorithm that can be used when &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; are defined. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The codes is in place to ensure that the timestep can be varied but the total time taken for the simulation to run will not change.&lt;br /&gt;
&lt;br /&gt;
=== Checking equilibration === &lt;br /&gt;
&lt;br /&gt;
The graphs below illustrate the time it takes for different thermodynamic properties to equilibriate at a timestep of 0.001. The plateau represents the point at which equilibration is achieved. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EnergyVRStime.png|x300px|thumb|Energy Vrs Time|left]]&lt;br /&gt;
! [[File:TEMPvrsTIME.png|x300px|thumb|Temp vrs Time|centre]]&lt;br /&gt;
! [[File:Press Vrs Time.png|x300px|thumb|Pressure Vrs Time|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The graph below illustrates the effect changing the timestep has on equilibration. As can be seen from the graph a from below 0.01 a shorter timestep results in a lower energy value for equilibration until 0.0025 where the value   of equilibration does not change with lower timestep. This trend is due to the fact that a smaller timestep results in a more accurate result however if it is too small this can over-complicate the calculation (especially when there is a large over-all time). Thus a timestep of 0.0025 is a good balance and therefore ideal. A timestep of 0.025 is too large and results in the system not reaching equilibrium.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EnergyVtimeFORVTS.png|x400px|thumb|Energy Vrs Time with different timesteps|centre]]&lt;br /&gt;
&lt;br /&gt;
= Running Simulations Under Specific Conditions =&lt;br /&gt;
&lt;br /&gt;
The following two equations can be used to define the energy of the system: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The instantaneous tempertaure &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will not remain constant throughout the simulation and will fluctuate, it will thus be different to out target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The value of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2} = \frac{\mathfrak{T}}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within the preceding code: &lt;br /&gt;
&lt;br /&gt;
100 - Nevery: This command results in a sample being taken every 100 steps and being incorporated into the average. 1000 - Nrepreat: Tells the computer how many samples should be used to calculate the average. Nfreq 10 000: At every 10000th timestep an average is calculated. &lt;br /&gt;
&lt;br /&gt;
All thermodynamic properties are calculated by averages that is the necessity for those commands.&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equation of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:DENSITYvrsT.png|x400px|thumb|Density Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
The densities produced from the simulation are lower than for the ideal gas. This is a result of the simulation creating a more realistic picture of how the atoms interact as it takes into account Lennard-Jones potential. In an ideal gas the motion of atoms will be random, chaotic and inter atomic interactions are ignored however in the simulation the atoms will want to minimize their potential and therefore this will drive them to occupy a greater volume thus reducing the density.&lt;br /&gt;
&lt;br /&gt;
= Calculating Heat Capacities Using Statistic Physics =&lt;br /&gt;
&lt;br /&gt;
Example of input code used: &lt;br /&gt;
&lt;br /&gt;
* Density 0.2&lt;br /&gt;
* Temperature 2.0 &lt;br /&gt;
&lt;br /&gt;
SPECIFY TIMESTEP &amp;lt;br&amp;gt;&lt;br /&gt;
 RUN SIMULATION TO MELT CRYSTAL &amp;lt;br&amp;gt;&lt;br /&gt;
run 10000&amp;lt;br&amp;gt;&lt;br /&gt;
unfix nve&amp;lt;br&amp;gt;&lt;br /&gt;
reset_timestep 0&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
BRING SYSTEM TO REQUIRED STATE&amp;lt;br&amp;gt; &lt;br /&gt;
variable tdamp equal ${timestep}*100&amp;lt;br&amp;gt;&lt;br /&gt;
variable ddamp equal ${timestep}*1000&amp;lt;br&amp;gt;&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&amp;lt;br&amp;gt;&lt;br /&gt;
run 10000&amp;lt;br&amp;gt;&lt;br /&gt;
reset_timestep 0&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
MEASURE SYSTEM STATE &amp;lt;br&amp;gt;&lt;br /&gt;
unfix nvt&amp;lt;br&amp;gt;&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&amp;lt;br&amp;gt;&lt;br /&gt;
thermo_style custom step etotal temp press density&amp;lt;br&amp;gt;&lt;br /&gt;
variable etot equal etotal&amp;lt;br&amp;gt;&lt;br /&gt;
variable etot2 equal etotal*etotal&amp;lt;br&amp;gt;&lt;br /&gt;
variable temp equal temp&amp;lt;br&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_etot v_temp v_etot2&amp;lt;br&amp;gt;&lt;br /&gt;
run 100000&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
variable aveetot equal f_aves[1]&amp;lt;br&amp;gt;&lt;br /&gt;
variable avetemp equal f_aves[2]&amp;lt;br&amp;gt;&lt;br /&gt;
variable aveetot2 equal f_aves[3]&amp;lt;br&amp;gt;&lt;br /&gt;
variable varetot equal f_aves[3]-f_aves[1]*f_aves[1]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
print &amp;quot;Energy Variance: ${varetot}&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following equation was then used to calculate heat capacity from the results:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C_V = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[File:Heat capacity with T.png|x400px|thumb|Heat Capacity Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a fixed number of particles, &amp;lt;math&amp;gt; N &amp;lt;/math&amp;gt;, a larger density is indicative of a smaller volume. That is why the plot Cv\V Vrs T generally lies at a higher values for a density of 0.8. &lt;br /&gt;
&lt;br /&gt;
From both plots it can been seen that heat capacity increases with temperature.  &amp;lt;math&amp;gt; Var[E] &amp;lt;/math&amp;gt; increases with temp as at higher temp there are a greater number of accessible rotational, vibration, electronic and kinetic energetic states therefore the system is able to to absorb more energy per rise in temperature.&lt;br /&gt;
&lt;br /&gt;
= Structural Properties and the Radial Distribution function =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:G(r).png|x300px|thumb|RDF at different phases|left]]&lt;br /&gt;
! [[File:Integral.png|x300px|thumb|Integral of g(r)|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To carry out the RDF calculations temperature was kept constant at 1.2 but density was varied. &lt;br /&gt;
&lt;br /&gt;
Density in reduced units used for each phase: &lt;br /&gt;
&lt;br /&gt;
* Gas = 0.05&lt;br /&gt;
* Liquid = 0.8 &lt;br /&gt;
* Solid = 1.2&lt;br /&gt;
&lt;br /&gt;
The number of peaks for each RDF plot decreases in the order gas&amp;lt;liquid&amp;lt;solid. This reflects the ordering of each phase. &lt;br /&gt;
A gas has a large degree of disorder and thus produces only peak.&lt;br /&gt;
The liquid has three peaks which gradually decrease in amplitude, this behavior is due to the fact that the liquid is modeled as central molecule surrounded by shells of other molecules, this initially creates some degree of order. As the simulation continues the molecules become more diffuse so the ordering decreases and thus the amplitude of peaks decrease.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Solid nearest coordination.png|x400px|centre]]&lt;br /&gt;
&lt;br /&gt;
The above plot indicates the positions of the first three peaks. These will correspond to the three closet atoms in the lattice. &lt;br /&gt;
&lt;br /&gt;
* 1.025 will correspond to one of the atoms at the corner of the unit cell neighboring the starting position.&lt;br /&gt;
* 1.525 will correspond to one of the atoms in the centre of the face of the cube. (The lattice is fcc) &lt;br /&gt;
* 1.825 will correspond to an atom on one of the faces adjacent to the starting point. It cannot be one of the adjacent corners as this would be too large thus it must fall in between the corners and therefore on a face.&lt;br /&gt;
&lt;br /&gt;
= Dynamical Properties and the diffusion coefficient = &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid.png|thumb|solid|x300px|left]]&lt;br /&gt;
! [[File:Liquid.png|thumb|liquid|x300px|centre]]&lt;br /&gt;
! [[File:Gas.png|thumb|gas|x300px|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plot give insight into the displacement of particles as they illustrate &#039;&#039;&#039;mean square displacement&#039;&#039;&#039; with time. There are variations in the shape of the lines for the large number of atoms and small number of atoms, this is due to the variations in positions being averaged for a large number of atoms and thus gives a better indication of the behavior of the system. The difference is very apparent for solid where one can see that the line is much more smooth in the region where the gradient becomes close to 0. &lt;br /&gt;
&lt;br /&gt;
The diffusion constant D was found by calculating the gradient of the line for each phase. The gradient after the line had leveled off was used for the solid.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 0.0304&lt;br /&gt;
| 0.0305&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| 0.001&lt;br /&gt;
| 0.0012 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| &amp;lt;math&amp;gt; 6 x 10^{-8} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 7 x 10^{-9} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There is a gradual decrease in D in the order solid&amp;lt;liquid&amp;lt;gas. This fits out chemical intuition; e.g. the motion of a solid would be much more restricted that the motion of a gas.  &lt;br /&gt;
&lt;br /&gt;
[[File:VACFvrsTS.png|x400px|thumb|VACF vrs Temperature|centre]]&lt;br /&gt;
&lt;br /&gt;
Minima in the VACF plot correspond to points where the atoms collide and change direction. The greater number of minima for a solid is due to the restricted mean square displacement in which the atoms can move, this therefore results in greater collisions as the atoms seek to minimize their potential energy. As a liquid has a greater diffusion coefficient it is able to diffuse away from an atom after a collision, this is why there are fewer minima, the line tends to 0 as the atoms eventually move in opposite directions resulting in velocities cancelling out and therefor the integration becomes 0. The harmonic oscillator is simply a mathematical function without physical meaning therefore it will continue to oscillate around 0 until infinity. &lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function for a 1D harmonic oscillator can be evaluated using the equation for a 1D harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiation of the displacement function will produce a velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx}{dt} = -A\omega\sin\left(\omega t + \phi\right) = v(t) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substitution into velocity autocorrelation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling -A\omega: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right)\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trigometric relation can simplify equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin\left(\omega t + \omega\tau + \phi\right) = cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integration of ansymmetical function results in 0:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} sin(x)cos(x)\mathrm{d}t = 0 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Thus after &amp;lt;math&amp;gt;cos(t\omega) &amp;lt;/math&amp;gt;is removed from top line the equation simplifies to: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(t\omega) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Vapourphse.png|thumb|Vapour Phase|x300px|left]]&lt;br /&gt;
! [[File:Vapour phase 1 million.png|thumb|Vapour Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid(small).png|thumb|Solid Phase|x300px|left]]&lt;br /&gt;
! [[File:Solid1million.png|thumb|Solid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Liquidsmallno..png|thumb|Liquid Phase|x300px|left]]&lt;br /&gt;
! [[File:Liquid1millionatoms.png|thumb|Liquid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 1.64&lt;br /&gt;
| 1.63&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| -0.2215&lt;br /&gt;
| 0.157 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| 0.254&lt;br /&gt;
| -0.123&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the trapezium rule to calculate D from a VACF plot yeilded a similar trend in diffusion coefficients however there was a discrepancy in one of my results. The value of D for a liquid of small number of atoms was smaller and more negative than the solid. This indictaes that using the MSD method is more accurate than VACF. This also indicates that it is more important to use the VACF plot for a large system when calculating D.&lt;br /&gt;
&lt;br /&gt;
= References = &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Mark Klarpus, Gregory A. Petsko, (1990) &#039;&#039;Molecular Reaction Dynamics in Biology&#039;&#039;, &#039;&#039;&#039;347&#039;&#039;&#039;, 631-9, doi:10.1038/347631a0&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=579801</id>
		<title>Rep:Thermomp4114</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=579801"/>
		<updated>2017-02-01T14:39:13Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: /* Calculating Heat Capacities Using Statistic Physics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Molecular Dynamics Simulations of Simple Liquids Introduction == &lt;br /&gt;
&lt;br /&gt;
Molecular dynamic simulations involved studying the motion of a system of particles. Several fundamental elements of a system need to be known in order to achieve this. This includes a knowledge of the interaction potential for the particles and the equations of motion which govern the dynamics of the particles.&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt; Once we know the positions, velocities, and forces, of the atoms (which are obtained using statistical) we can calculate various thermodynamic quantities of the system such as temperature and pressure. We must introduce a series of approximations in order for the caluculations to be feasible. Firstly we apply the &#039;&#039;&#039;The Classical Particle Approximation&#039;&#039;&#039;. The schoedinger equation is too complex to solve for a large system of atoms, however if the atoms are treated classically then the positions and and velocities of each can atom can be calculated using Newton&#039;s second law (equation 1): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = m_i \mathbf{a}_i = m_i \frac{\mathrm{d}\mathbf{v}_i}{\mathrm{d}t} = m_i \frac{\mathrm{d}^2 \mathbf{x}_i}{\mathrm{d}t^2} \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As there are N atoms and therefore N equations representing each atom a computer is a necessity. The &#039;&#039;&#039;Verlet algorithim&#039;&#039;&#039; is used to solve to Newton&#039;s law for all the atoms in the system. In this case time is not continuous but is made discrete, the simulation is thus broeken up into specific &#039;&#039;&#039;timesteps&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The position of atom &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;\mathbf{x}_i \left(t\right)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Positional Verlet algorithim (equation (2)): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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 \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Velocity Verlet algorithim (equation (3)):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{v}_i \left(t\right)&amp;lt;/math&amp;gt; represents the velocity of that atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;center&amp;gt;&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 \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Put in example of industrial applications&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Harmonic Oscillator ===&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator illustrates the the accuracy and discrepancies associated with using the velocity Verlet algorithim. Equation (4) is used to model the behavior of the harmonic oscillator in an analytical sense: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)\ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; = 1.00 &lt;br /&gt;
&lt;br /&gt;
Graph (1) illustrates the results the analytical solution gave for the relationship between position and time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Avrsxt2.png|x300px|thumb|Graph 1: Analytical solution of harmonic oscillator|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The difference in position between the velocity-verlet solution and analytical solution is represented by an error. Error plotted against time is illustrated by graph (2). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ErrorvrsT.png|x300px|thumb|Graph 2: Error vrs Time|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The orange line illustrates the positive trend between error and time. This shows that error is accumulative with time. Each timestep represents a calculation which has an associated error thus as the simulation proceeds the errors will be summed. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy of the system will consist of the sum of kinetic and potential energy. Equation (5) can be used to find kinetic energy of the system:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;E_\text{k} =\tfrac{1}{2} mv(t)^2 \ \ (5)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\mathbf{x} \left(t\right)&amp;lt;/math&amp;gt; is used in equation (5) the potential energy can be found. &lt;br /&gt;
&lt;br /&gt;
The following graphs represent the difference in change in energy with time when the timestep is varied. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EvrsTime.png|x200px|thumb|Energy change when a timestep of 0.1 is used|left]]&lt;br /&gt;
! [[File:Energy vrs time for 0.15 timestep.png|x200px|thumb|Energy change when a timestep of 0.15 is used|centre]]&lt;br /&gt;
! [[File:Energy vrs time for 0.2 timestep.png|x200px|thumb|Energy change when a timestep of 0.2 is used|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The maximum change in energy for each of the different timesteps is shown in table (1). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | Timestep&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.1&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.15&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.2&lt;br /&gt;
|-&lt;br /&gt;
| Max. change in Energy&lt;br /&gt;
| 0.2%&lt;br /&gt;
| 0.6%&lt;br /&gt;
| 1%&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results clearly indicate that a timestep greater than &#039;&#039;&#039;0.2&#039;&#039;&#039; will result in an energy change greater than 1%. As the timestep increases as does the maximum error. The timestep defines the number of calculations made in a given time, therefore the shorter the timestep the larger the number of calculations carried out and therefore a more accurate result is produced. The total energy of a real physical system should not change, when modeled numerically there can be fluctuations therefore it is important to monitor this change and ensure that the fluctuations are minimised.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces ===&lt;br /&gt;
&lt;br /&gt;
The forces an atom experiences is determined by the positions of all the atoms in the system, &amp;lt;math&amp;gt;\mathbf{r}^N&amp;lt;/math&amp;gt;. The Lennard-Jones function accurately sums all the key inter-atomic forces an atoms experiences (U). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ (10)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
For a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After division by 4 and rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_0^{6}} = \frac{\sigma^{6}}{r_0^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After further rearrangement and cancelling down: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;-\sigma &amp;lt;/math&amp;gt; is also a solution however this can be disregarded. &lt;br /&gt;
&lt;br /&gt;
In order to calculate the force the following equation is used: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\sigma\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After differentiation and simplification: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}(r_0) =  \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At equilibrium: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{12\sigma^{12}}{r_e^{13}} - \frac{6\sigma^6}{r_e^7} \right)&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
After rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_e = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This value of &amp;lt;math&amp;gt; r_e &amp;lt;/math&amp;gt; can now be used to find the well depth:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{\sigma^{12}}{4sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon\left(\frac{1}{5r^{5}} - \frac{1}{11r^11} \right)^\infty_2 \simeq -2.48 \sdot 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -8.18 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -3.29 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
* No. of moles in  1 mL of water = 0.056 &amp;lt;br&amp;gt; &lt;br /&gt;
* No. of molecules = moles x Avogadro&#039;s constant = 3.37 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*1000 molecules = 1.66 x 10&amp;lt;sup&amp;gt;21&amp;lt;/sup&amp;gt; moles&lt;br /&gt;
* Density = mass/vol. = 1 &lt;br /&gt;
*vol. = mass/density = 2.99 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Due to periodic boundary condition once the atom leaves the current box it will enter the beginning of an identical box. The atom is at &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; and thus once it breaches 0.5 in a particular direction it will be at the start of the next box. Using these principles after the atom moves &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will be at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units === &lt;br /&gt;
&lt;br /&gt;
Reduced units are applied to the Lennard-Jones equation to make the calculation more managable.&lt;br /&gt;
&lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For argon:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Distance in real units: r = 1.09 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Well depth = &amp;lt;math&amp;gt;{\epsilon}&amp;lt;/math&amp;gt; = 0.996 KJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* T = 180 K&lt;br /&gt;
&lt;br /&gt;
= Equilibriation = &lt;br /&gt;
&lt;br /&gt;
=== Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
As there is a large number of atoms in a discrete volume allowing random assignment of positions could result in atoms overlapping. This would cause an unrealistically high potential as potential is distance dependant (as observed in the Lennard - Jones equation).&lt;br /&gt;
&lt;br /&gt;
* Density is given by the following equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{n}{v} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 1 (as there is only 1 atom per unit cell) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = 1.07722^3 = 1.25 &amp;lt;/math&amp;gt; (lattice spacing = 1.07722) &lt;br /&gt;
&lt;br /&gt;
Thus: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length of a side of one fcc unit cell with number density 1.2 would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = \frac{n}{\rho} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 4 (as there is 4 atoms per unit cell in an fcc lattice) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; = 3.33&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; l = v^{-3} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The number of atoms that would be created by the create_atoms command for an fcc lattice would be: &lt;br /&gt;
&lt;br /&gt;
4 x 1000 = 4000 &lt;br /&gt;
&lt;br /&gt;
This is due to fact that there is 1 atom per unit cell that yeilds 1000 altogether in simple cubic. Fcc has 4 times the number of atoms per unit cell. &lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of Atoms === &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command above has the following purpose: &lt;br /&gt;
&lt;br /&gt;
* The first line sets the mass of all atoms of type &#039;1&#039; to 1.0. &lt;br /&gt;
*  Line 2 is used to control the Lennard-Jones potential. The value of 3.0 indicates the distance in reduced units upon which the potential is calculated. The potential is distance dependent and falls to 0 at large values of r thus only atoms within a distance of 3.0 are considered.  &#039;lj/cut&#039; defines the cut off point. &lt;br /&gt;
* The last line defines the force field constants as 1.0 for all sets of atoms. The * controls the fact that the command is set for all atoms. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet is the integration algorithm that can be used when &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; are defined. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The codes is in place to ensure that the timestep can be varied but the total time taken for the simulation to run will not change.&lt;br /&gt;
&lt;br /&gt;
=== Checking equilibration === &lt;br /&gt;
&lt;br /&gt;
The graphs below illustrate the time it takes for different thermodynamic properties to equilibriate at a timestep of 0.001. The plateau represents the point at which equilibration is achieved. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EnergyVRStime.png|x300px|thumb|Energy Vrs Time|left]]&lt;br /&gt;
! [[File:TEMPvrsTIME.png|x300px|thumb|Temp vrs Time|centre]]&lt;br /&gt;
! [[File:Press Vrs Time.png|x300px|thumb|Pressure Vrs Time|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The graph below illustrates the effect changing the timestep has on equilibration. As can be seen from the graph a from below 0.01 a shorter timestep results in a lower energy value for equilibration until 0.0025 where the value   of equilibration does not change with lower timestep. This trend is due to the fact that a smaller timestep results in a more accurate result however if it is too small this can over-complicate the calculation (especially when there is a large over-all time). Thus a timestep of 0.0025 is a good balance and therefore ideal. A timestep of 0.025 is too large and results in the system not reaching equilibrium.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EnergyVtimeFORVTS.png|x400px|thumb|Energy Vrs Time with different timesteps|centre]]&lt;br /&gt;
&lt;br /&gt;
= Running Simulations Under Specific Conditions =&lt;br /&gt;
&lt;br /&gt;
The following two equations can be used to define the energy of the system: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The instantaneous tempertaure &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will not remain constant throughout the simulation and will fluctuate, it will thus be different to out target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The value of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2} = \frac{\mathfrak{T}}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within the preceding code: &lt;br /&gt;
&lt;br /&gt;
100 - Nevery: This command results in a sample being taken every 100 steps and being incorporated into the average. 1000 - Nrepreat: Tells the computer how many samples should be used to calculate the average. Nfreq 10 000: At every 10000th timestep an average is calculated. &lt;br /&gt;
&lt;br /&gt;
All thermodynamic properties are calculated by averages that is the necessity for those commands.&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equation of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:DENSITYvrsT.png|x400px|thumb|Density Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
The densities produced from the simulation are lower than for the ideal gas. This is a result of the simulation creating a more realistic picture of how the atoms interact as it takes into account Lennard-Jones potential. In an ideal gas the motion of atoms will be random, chaotic and inter atomic interactions are ignored however in the simulation the atoms will want to minimize their potential and therefore this will drive them to occupy a greater volume thus reducing the density.&lt;br /&gt;
&lt;br /&gt;
= Calculating Heat Capacities Using Statistic Physics =&lt;br /&gt;
&lt;br /&gt;
Example of input code used: &lt;br /&gt;
&lt;br /&gt;
* Density 0.2&lt;br /&gt;
* Temperature 2.0 &lt;br /&gt;
&lt;br /&gt;
SPECIFY TIMESTEP &amp;lt;br&amp;gt;&lt;br /&gt;
 RUN SIMULATION TO MELT CRYSTAL &amp;lt;br&amp;gt;&lt;br /&gt;
run 10000&amp;lt;br&amp;gt;&lt;br /&gt;
unfix nve&amp;lt;br&amp;gt;&lt;br /&gt;
reset_timestep 0&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
BRING SYSTEM TO REQUIRED STATE&amp;lt;br&amp;gt; &lt;br /&gt;
variable tdamp equal ${timestep}*100&amp;lt;br&amp;gt;&lt;br /&gt;
variable ddamp equal ${timestep}*1000&amp;lt;br&amp;gt;&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&amp;lt;br&amp;gt;&lt;br /&gt;
run 10000&amp;lt;br&amp;gt;&lt;br /&gt;
reset_timestep 0&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
MEASURE SYSTEM STATE &amp;lt;br&amp;gt;&lt;br /&gt;
unfix nvt&amp;lt;br&amp;gt;&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&amp;lt;br&amp;gt;&lt;br /&gt;
thermo_style custom step etotal temp press density&amp;lt;br&amp;gt;&lt;br /&gt;
variable etot equal etotal&amp;lt;br&amp;gt;&lt;br /&gt;
variable etot2 equal etotal*etotal&amp;lt;br&amp;gt;&lt;br /&gt;
variable temp equal temp&amp;lt;br&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_etot v_temp v_etot2&amp;lt;br&amp;gt;&lt;br /&gt;
run 100000&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
variable aveetot equal f_aves[1]&amp;lt;br&amp;gt;&lt;br /&gt;
variable avetemp equal f_aves[2]&amp;lt;br&amp;gt;&lt;br /&gt;
variable aveetot2 equal f_aves[3]&amp;lt;br&amp;gt;&lt;br /&gt;
variable varetot equal f_aves[3]-f_aves[1]*f_aves[1]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
print &amp;quot;Energy Variance: ${varetot}&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following equation was then used to calculate heat capacity from the results:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C_V = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[File:Heat capacity with T.png|x400px|thumb|Heat Capacity Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a fixed number of particles, &amp;lt;math&amp;gt; N &amp;lt;/math&amp;gt;, a larger density is indicative of a smaller volume. That is why the plot of &amp;lt;math&amp;gt; \frac{{Cv}\{V} &amp;lt;/math&amp;gt; Vrs T generally lies at a higher values for a density of 0.8. &lt;br /&gt;
&lt;br /&gt;
From both plots it can been seen that heat capacity increases with temperature.  &amp;lt;math&amp;gt; Var[E] &amp;lt;/math&amp;gt; increases with temp as at higher temp there are a greater number of accessible rotational, vibration, electronic and kinetic energetic states therefore the system is able to to absorb more energy per rise in temperature.&lt;br /&gt;
&lt;br /&gt;
= Structural Properties and the Radial Distribution function =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:G(r).png|x300px|thumb|RDF at different phases|left]]&lt;br /&gt;
! [[File:Integral.png|x300px|thumb|Integral of g(r)|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To carry out the RDF calculations temperature was kept constant at 1.2 but density was varied. &lt;br /&gt;
&lt;br /&gt;
Density in reduced units used for each phase: &lt;br /&gt;
&lt;br /&gt;
* Gas = 0.05&lt;br /&gt;
* Liquid = 0.8 &lt;br /&gt;
* Solid = 1.2&lt;br /&gt;
&lt;br /&gt;
The number of peaks for each RDF plot decreases in the order gas&amp;lt;liquid&amp;lt;solid. This reflects the ordering of each phase. &lt;br /&gt;
A gas has a large degree of disorder and thus produces only peak.&lt;br /&gt;
The liquid has three peaks which gradually decrease in amplitude, this behavior is due to the fact that the liquid is modeled as central molecule surrounded by shells of other molecules, this initially creates some degree of order. As the simulation continues the molecules become more diffuse so the ordering decreases and thus the amplitude of peaks decrease.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Solid nearest coordination.png|x400px|centre]]&lt;br /&gt;
&lt;br /&gt;
The above plot indicates the positions of the first three peaks. These will correspond to the three closet atoms in the lattice. &lt;br /&gt;
&lt;br /&gt;
* 1.025 will correspond to one of the atoms at the corner of the unit cell neighboring the starting position.&lt;br /&gt;
* 1.525 will correspond to one of the atoms in the centre of the face of the cube. (The lattice is fcc) &lt;br /&gt;
* 1.825 will correspond to an atom on one of the faces adjacent to the starting point. It cannot be one of the adjacent corners as this would be too large thus it must fall in between the corners and therefore on a face.&lt;br /&gt;
&lt;br /&gt;
= Dynamical Properties and the diffusion coefficient = &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid.png|thumb|solid|x300px|left]]&lt;br /&gt;
! [[File:Liquid.png|thumb|liquid|x300px|centre]]&lt;br /&gt;
! [[File:Gas.png|thumb|gas|x300px|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plot give insight into the displacement of particles as they illustrate &#039;&#039;&#039;mean square displacement&#039;&#039;&#039; with time. There are variations in the shape of the lines for the large number of atoms and small number of atoms, this is due to the variations in positions being averaged for a large number of atoms and thus gives a better indication of the behavior of the system. The difference is very apparent for solid where one can see that the line is much more smooth in the region where the gradient becomes close to 0. &lt;br /&gt;
&lt;br /&gt;
The diffusion constant D was found by calculating the gradient of the line for each phase. The gradient after the line had leveled off was used for the solid.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 0.0304&lt;br /&gt;
| 0.0305&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| 0.001&lt;br /&gt;
| 0.0012 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| &amp;lt;math&amp;gt; 6 x 10^{-8} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 7 x 10^{-9} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There is a gradual decrease in D in the order solid&amp;lt;liquid&amp;lt;gas. This fits out chemical intuition; e.g. the motion of a solid would be much more restricted that the motion of a gas.  &lt;br /&gt;
&lt;br /&gt;
[[File:VACFvrsTS.png|x400px|thumb|VACF vrs Temperature|centre]]&lt;br /&gt;
&lt;br /&gt;
Minima in the VACF plot correspond to points where the atoms collide and change direction. The greater number of minima for a solid is due to the restricted mean square displacement in which the atoms can move, this therefore results in greater collisions as the atoms seek to minimize their potential energy. As a liquid has a greater diffusion coefficient it is able to diffuse away from an atom after a collision, this is why there are fewer minima, the line tends to 0 as the atoms eventually move in opposite directions resulting in velocities cancelling out and therefor the integration becomes 0. The harmonic oscillator is simply a mathematical function without physical meaning therefore it will continue to oscillate around 0 until infinity. &lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function for a 1D harmonic oscillator can be evaluated using the equation for a 1D harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiation of the displacement function will produce a velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx}{dt} = -A\omega\sin\left(\omega t + \phi\right) = v(t) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substitution into velocity autocorrelation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling -A\omega: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right)\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trigometric relation can simplify equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin\left(\omega t + \omega\tau + \phi\right) = cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integration of ansymmetical function results in 0:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} sin(x)cos(x)\mathrm{d}t = 0 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Thus after &amp;lt;math&amp;gt;cos(t\omega) &amp;lt;/math&amp;gt;is removed from top line the equation simplifies to: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(t\omega) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Vapourphse.png|thumb|Vapour Phase|x300px|left]]&lt;br /&gt;
! [[File:Vapour phase 1 million.png|thumb|Vapour Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid(small).png|thumb|Solid Phase|x300px|left]]&lt;br /&gt;
! [[File:Solid1million.png|thumb|Solid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Liquidsmallno..png|thumb|Liquid Phase|x300px|left]]&lt;br /&gt;
! [[File:Liquid1millionatoms.png|thumb|Liquid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 1.64&lt;br /&gt;
| 1.63&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| -0.2215&lt;br /&gt;
| 0.157 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| 0.254&lt;br /&gt;
| -0.123&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the trapezium rule to calculate D from a VACF plot yeilded a similar trend in diffusion coefficients however there was a discrepancy in one of my results. The value of D for a liquid of small number of atoms was smaller and more negative than the solid. This indictaes that using the MSD method is more accurate than VACF. This also indicates that it is more important to use the VACF plot for a large system when calculating D.&lt;br /&gt;
&lt;br /&gt;
= References = &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Mark Klarpus, Gregory A. Petsko, (1990) &#039;&#039;Molecular Reaction Dynamics in Biology&#039;&#039;, &#039;&#039;&#039;347&#039;&#039;&#039;, 631-9, doi:10.1038/347631a0&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=579800</id>
		<title>Rep:Thermomp4114</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=579800"/>
		<updated>2017-02-01T14:38:44Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: /* Calculating Heat Capacities Using Statistic Physics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Molecular Dynamics Simulations of Simple Liquids Introduction == &lt;br /&gt;
&lt;br /&gt;
Molecular dynamic simulations involved studying the motion of a system of particles. Several fundamental elements of a system need to be known in order to achieve this. This includes a knowledge of the interaction potential for the particles and the equations of motion which govern the dynamics of the particles.&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt; Once we know the positions, velocities, and forces, of the atoms (which are obtained using statistical) we can calculate various thermodynamic quantities of the system such as temperature and pressure. We must introduce a series of approximations in order for the caluculations to be feasible. Firstly we apply the &#039;&#039;&#039;The Classical Particle Approximation&#039;&#039;&#039;. The schoedinger equation is too complex to solve for a large system of atoms, however if the atoms are treated classically then the positions and and velocities of each can atom can be calculated using Newton&#039;s second law (equation 1): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = m_i \mathbf{a}_i = m_i \frac{\mathrm{d}\mathbf{v}_i}{\mathrm{d}t} = m_i \frac{\mathrm{d}^2 \mathbf{x}_i}{\mathrm{d}t^2} \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As there are N atoms and therefore N equations representing each atom a computer is a necessity. The &#039;&#039;&#039;Verlet algorithim&#039;&#039;&#039; is used to solve to Newton&#039;s law for all the atoms in the system. In this case time is not continuous but is made discrete, the simulation is thus broeken up into specific &#039;&#039;&#039;timesteps&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The position of atom &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;\mathbf{x}_i \left(t\right)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Positional Verlet algorithim (equation (2)): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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 \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Velocity Verlet algorithim (equation (3)):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{v}_i \left(t\right)&amp;lt;/math&amp;gt; represents the velocity of that atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;center&amp;gt;&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 \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Put in example of industrial applications&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Harmonic Oscillator ===&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator illustrates the the accuracy and discrepancies associated with using the velocity Verlet algorithim. Equation (4) is used to model the behavior of the harmonic oscillator in an analytical sense: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)\ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; = 1.00 &lt;br /&gt;
&lt;br /&gt;
Graph (1) illustrates the results the analytical solution gave for the relationship between position and time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Avrsxt2.png|x300px|thumb|Graph 1: Analytical solution of harmonic oscillator|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The difference in position between the velocity-verlet solution and analytical solution is represented by an error. Error plotted against time is illustrated by graph (2). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ErrorvrsT.png|x300px|thumb|Graph 2: Error vrs Time|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The orange line illustrates the positive trend between error and time. This shows that error is accumulative with time. Each timestep represents a calculation which has an associated error thus as the simulation proceeds the errors will be summed. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy of the system will consist of the sum of kinetic and potential energy. Equation (5) can be used to find kinetic energy of the system:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;E_\text{k} =\tfrac{1}{2} mv(t)^2 \ \ (5)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\mathbf{x} \left(t\right)&amp;lt;/math&amp;gt; is used in equation (5) the potential energy can be found. &lt;br /&gt;
&lt;br /&gt;
The following graphs represent the difference in change in energy with time when the timestep is varied. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EvrsTime.png|x200px|thumb|Energy change when a timestep of 0.1 is used|left]]&lt;br /&gt;
! [[File:Energy vrs time for 0.15 timestep.png|x200px|thumb|Energy change when a timestep of 0.15 is used|centre]]&lt;br /&gt;
! [[File:Energy vrs time for 0.2 timestep.png|x200px|thumb|Energy change when a timestep of 0.2 is used|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The maximum change in energy for each of the different timesteps is shown in table (1). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | Timestep&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.1&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.15&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.2&lt;br /&gt;
|-&lt;br /&gt;
| Max. change in Energy&lt;br /&gt;
| 0.2%&lt;br /&gt;
| 0.6%&lt;br /&gt;
| 1%&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results clearly indicate that a timestep greater than &#039;&#039;&#039;0.2&#039;&#039;&#039; will result in an energy change greater than 1%. As the timestep increases as does the maximum error. The timestep defines the number of calculations made in a given time, therefore the shorter the timestep the larger the number of calculations carried out and therefore a more accurate result is produced. The total energy of a real physical system should not change, when modeled numerically there can be fluctuations therefore it is important to monitor this change and ensure that the fluctuations are minimised.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces ===&lt;br /&gt;
&lt;br /&gt;
The forces an atom experiences is determined by the positions of all the atoms in the system, &amp;lt;math&amp;gt;\mathbf{r}^N&amp;lt;/math&amp;gt;. The Lennard-Jones function accurately sums all the key inter-atomic forces an atoms experiences (U). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ (10)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
For a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After division by 4 and rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_0^{6}} = \frac{\sigma^{6}}{r_0^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After further rearrangement and cancelling down: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;-\sigma &amp;lt;/math&amp;gt; is also a solution however this can be disregarded. &lt;br /&gt;
&lt;br /&gt;
In order to calculate the force the following equation is used: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\sigma\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After differentiation and simplification: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}(r_0) =  \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At equilibrium: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{12\sigma^{12}}{r_e^{13}} - \frac{6\sigma^6}{r_e^7} \right)&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
After rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_e = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This value of &amp;lt;math&amp;gt; r_e &amp;lt;/math&amp;gt; can now be used to find the well depth:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{\sigma^{12}}{4sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon\left(\frac{1}{5r^{5}} - \frac{1}{11r^11} \right)^\infty_2 \simeq -2.48 \sdot 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -8.18 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -3.29 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
* No. of moles in  1 mL of water = 0.056 &amp;lt;br&amp;gt; &lt;br /&gt;
* No. of molecules = moles x Avogadro&#039;s constant = 3.37 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*1000 molecules = 1.66 x 10&amp;lt;sup&amp;gt;21&amp;lt;/sup&amp;gt; moles&lt;br /&gt;
* Density = mass/vol. = 1 &lt;br /&gt;
*vol. = mass/density = 2.99 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Due to periodic boundary condition once the atom leaves the current box it will enter the beginning of an identical box. The atom is at &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; and thus once it breaches 0.5 in a particular direction it will be at the start of the next box. Using these principles after the atom moves &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will be at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units === &lt;br /&gt;
&lt;br /&gt;
Reduced units are applied to the Lennard-Jones equation to make the calculation more managable.&lt;br /&gt;
&lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For argon:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Distance in real units: r = 1.09 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Well depth = &amp;lt;math&amp;gt;{\epsilon}&amp;lt;/math&amp;gt; = 0.996 KJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* T = 180 K&lt;br /&gt;
&lt;br /&gt;
= Equilibriation = &lt;br /&gt;
&lt;br /&gt;
=== Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
As there is a large number of atoms in a discrete volume allowing random assignment of positions could result in atoms overlapping. This would cause an unrealistically high potential as potential is distance dependant (as observed in the Lennard - Jones equation).&lt;br /&gt;
&lt;br /&gt;
* Density is given by the following equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{n}{v} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 1 (as there is only 1 atom per unit cell) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = 1.07722^3 = 1.25 &amp;lt;/math&amp;gt; (lattice spacing = 1.07722) &lt;br /&gt;
&lt;br /&gt;
Thus: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length of a side of one fcc unit cell with number density 1.2 would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = \frac{n}{\rho} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 4 (as there is 4 atoms per unit cell in an fcc lattice) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; = 3.33&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; l = v^{-3} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The number of atoms that would be created by the create_atoms command for an fcc lattice would be: &lt;br /&gt;
&lt;br /&gt;
4 x 1000 = 4000 &lt;br /&gt;
&lt;br /&gt;
This is due to fact that there is 1 atom per unit cell that yeilds 1000 altogether in simple cubic. Fcc has 4 times the number of atoms per unit cell. &lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of Atoms === &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command above has the following purpose: &lt;br /&gt;
&lt;br /&gt;
* The first line sets the mass of all atoms of type &#039;1&#039; to 1.0. &lt;br /&gt;
*  Line 2 is used to control the Lennard-Jones potential. The value of 3.0 indicates the distance in reduced units upon which the potential is calculated. The potential is distance dependent and falls to 0 at large values of r thus only atoms within a distance of 3.0 are considered.  &#039;lj/cut&#039; defines the cut off point. &lt;br /&gt;
* The last line defines the force field constants as 1.0 for all sets of atoms. The * controls the fact that the command is set for all atoms. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet is the integration algorithm that can be used when &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; are defined. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The codes is in place to ensure that the timestep can be varied but the total time taken for the simulation to run will not change.&lt;br /&gt;
&lt;br /&gt;
=== Checking equilibration === &lt;br /&gt;
&lt;br /&gt;
The graphs below illustrate the time it takes for different thermodynamic properties to equilibriate at a timestep of 0.001. The plateau represents the point at which equilibration is achieved. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EnergyVRStime.png|x300px|thumb|Energy Vrs Time|left]]&lt;br /&gt;
! [[File:TEMPvrsTIME.png|x300px|thumb|Temp vrs Time|centre]]&lt;br /&gt;
! [[File:Press Vrs Time.png|x300px|thumb|Pressure Vrs Time|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The graph below illustrates the effect changing the timestep has on equilibration. As can be seen from the graph a from below 0.01 a shorter timestep results in a lower energy value for equilibration until 0.0025 where the value   of equilibration does not change with lower timestep. This trend is due to the fact that a smaller timestep results in a more accurate result however if it is too small this can over-complicate the calculation (especially when there is a large over-all time). Thus a timestep of 0.0025 is a good balance and therefore ideal. A timestep of 0.025 is too large and results in the system not reaching equilibrium.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EnergyVtimeFORVTS.png|x400px|thumb|Energy Vrs Time with different timesteps|centre]]&lt;br /&gt;
&lt;br /&gt;
= Running Simulations Under Specific Conditions =&lt;br /&gt;
&lt;br /&gt;
The following two equations can be used to define the energy of the system: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The instantaneous tempertaure &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will not remain constant throughout the simulation and will fluctuate, it will thus be different to out target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The value of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2} = \frac{\mathfrak{T}}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within the preceding code: &lt;br /&gt;
&lt;br /&gt;
100 - Nevery: This command results in a sample being taken every 100 steps and being incorporated into the average. 1000 - Nrepreat: Tells the computer how many samples should be used to calculate the average. Nfreq 10 000: At every 10000th timestep an average is calculated. &lt;br /&gt;
&lt;br /&gt;
All thermodynamic properties are calculated by averages that is the necessity for those commands.&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equation of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:DENSITYvrsT.png|x400px|thumb|Density Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
The densities produced from the simulation are lower than for the ideal gas. This is a result of the simulation creating a more realistic picture of how the atoms interact as it takes into account Lennard-Jones potential. In an ideal gas the motion of atoms will be random, chaotic and inter atomic interactions are ignored however in the simulation the atoms will want to minimize their potential and therefore this will drive them to occupy a greater volume thus reducing the density.&lt;br /&gt;
&lt;br /&gt;
= Calculating Heat Capacities Using Statistic Physics =&lt;br /&gt;
&lt;br /&gt;
Example of input code used: &lt;br /&gt;
&lt;br /&gt;
* Density 0.2&lt;br /&gt;
* Temperature 2.0 &lt;br /&gt;
&lt;br /&gt;
SPECIFY TIMESTEP &amp;lt;br&amp;gt;&lt;br /&gt;
 RUN SIMULATION TO MELT CRYSTAL &amp;lt;br&amp;gt;&lt;br /&gt;
run 10000&amp;lt;br&amp;gt;&lt;br /&gt;
unfix nve&amp;lt;br&amp;gt;&lt;br /&gt;
reset_timestep 0&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
BRING SYSTEM TO REQUIRED STATE&amp;lt;br&amp;gt; &lt;br /&gt;
variable tdamp equal ${timestep}*100&amp;lt;br&amp;gt;&lt;br /&gt;
variable ddamp equal ${timestep}*1000&amp;lt;br&amp;gt;&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&amp;lt;br&amp;gt;&lt;br /&gt;
run 10000&amp;lt;br&amp;gt;&lt;br /&gt;
reset_timestep 0&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
MEASURE SYSTEM STATE &amp;lt;br&amp;gt;&lt;br /&gt;
unfix nvt&amp;lt;br&amp;gt;&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&amp;lt;br&amp;gt;&lt;br /&gt;
thermo_style custom step etotal temp press density&amp;lt;br&amp;gt;&lt;br /&gt;
variable etot equal etotal&amp;lt;br&amp;gt;&lt;br /&gt;
variable etot2 equal etotal*etotal&amp;lt;br&amp;gt;&lt;br /&gt;
variable temp equal temp&amp;lt;br&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_etot v_temp v_etot2&amp;lt;br&amp;gt;&lt;br /&gt;
run 100000&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
variable aveetot equal f_aves[1]&amp;lt;br&amp;gt;&lt;br /&gt;
variable avetemp equal f_aves[2]&amp;lt;br&amp;gt;&lt;br /&gt;
variable aveetot2 equal f_aves[3]&amp;lt;br&amp;gt;&lt;br /&gt;
variable varetot equal f_aves[3]-f_aves[1]*f_aves[1]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
print &amp;quot;Energy Variance: ${varetot}&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following equation was then used to calculate heat capacity from the results:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C_V = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[File:Heat capacity with T.png|x400px|thumb|Heat Capacity Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a fixed number of particles, &amp;lt;math&amp;gt; N &amp;lt;/math&amp;gt;, a larger density is indicative of a smaller volume. That is why the plot of &amp;lt;math&amp;gt; Vrs T\frac{\mathrm{Cv}\{V} &amp;lt;/math&amp;gt; Vrs T generally lies at a higher values for a density of 0.8. &lt;br /&gt;
&lt;br /&gt;
From both plots it can been seen that heat capacity increases with temperature.  &amp;lt;math&amp;gt; Var[E] &amp;lt;/math&amp;gt; increases with temp as at higher temp there are a greater number of accessible rotational, vibration, electronic and kinetic energetic states therefore the system is able to to absorb more energy per rise in temperature.&lt;br /&gt;
&lt;br /&gt;
= Structural Properties and the Radial Distribution function =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:G(r).png|x300px|thumb|RDF at different phases|left]]&lt;br /&gt;
! [[File:Integral.png|x300px|thumb|Integral of g(r)|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To carry out the RDF calculations temperature was kept constant at 1.2 but density was varied. &lt;br /&gt;
&lt;br /&gt;
Density in reduced units used for each phase: &lt;br /&gt;
&lt;br /&gt;
* Gas = 0.05&lt;br /&gt;
* Liquid = 0.8 &lt;br /&gt;
* Solid = 1.2&lt;br /&gt;
&lt;br /&gt;
The number of peaks for each RDF plot decreases in the order gas&amp;lt;liquid&amp;lt;solid. This reflects the ordering of each phase. &lt;br /&gt;
A gas has a large degree of disorder and thus produces only peak.&lt;br /&gt;
The liquid has three peaks which gradually decrease in amplitude, this behavior is due to the fact that the liquid is modeled as central molecule surrounded by shells of other molecules, this initially creates some degree of order. As the simulation continues the molecules become more diffuse so the ordering decreases and thus the amplitude of peaks decrease.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Solid nearest coordination.png|x400px|centre]]&lt;br /&gt;
&lt;br /&gt;
The above plot indicates the positions of the first three peaks. These will correspond to the three closet atoms in the lattice. &lt;br /&gt;
&lt;br /&gt;
* 1.025 will correspond to one of the atoms at the corner of the unit cell neighboring the starting position.&lt;br /&gt;
* 1.525 will correspond to one of the atoms in the centre of the face of the cube. (The lattice is fcc) &lt;br /&gt;
* 1.825 will correspond to an atom on one of the faces adjacent to the starting point. It cannot be one of the adjacent corners as this would be too large thus it must fall in between the corners and therefore on a face.&lt;br /&gt;
&lt;br /&gt;
= Dynamical Properties and the diffusion coefficient = &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid.png|thumb|solid|x300px|left]]&lt;br /&gt;
! [[File:Liquid.png|thumb|liquid|x300px|centre]]&lt;br /&gt;
! [[File:Gas.png|thumb|gas|x300px|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plot give insight into the displacement of particles as they illustrate &#039;&#039;&#039;mean square displacement&#039;&#039;&#039; with time. There are variations in the shape of the lines for the large number of atoms and small number of atoms, this is due to the variations in positions being averaged for a large number of atoms and thus gives a better indication of the behavior of the system. The difference is very apparent for solid where one can see that the line is much more smooth in the region where the gradient becomes close to 0. &lt;br /&gt;
&lt;br /&gt;
The diffusion constant D was found by calculating the gradient of the line for each phase. The gradient after the line had leveled off was used for the solid.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 0.0304&lt;br /&gt;
| 0.0305&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| 0.001&lt;br /&gt;
| 0.0012 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| &amp;lt;math&amp;gt; 6 x 10^{-8} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 7 x 10^{-9} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There is a gradual decrease in D in the order solid&amp;lt;liquid&amp;lt;gas. This fits out chemical intuition; e.g. the motion of a solid would be much more restricted that the motion of a gas.  &lt;br /&gt;
&lt;br /&gt;
[[File:VACFvrsTS.png|x400px|thumb|VACF vrs Temperature|centre]]&lt;br /&gt;
&lt;br /&gt;
Minima in the VACF plot correspond to points where the atoms collide and change direction. The greater number of minima for a solid is due to the restricted mean square displacement in which the atoms can move, this therefore results in greater collisions as the atoms seek to minimize their potential energy. As a liquid has a greater diffusion coefficient it is able to diffuse away from an atom after a collision, this is why there are fewer minima, the line tends to 0 as the atoms eventually move in opposite directions resulting in velocities cancelling out and therefor the integration becomes 0. The harmonic oscillator is simply a mathematical function without physical meaning therefore it will continue to oscillate around 0 until infinity. &lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function for a 1D harmonic oscillator can be evaluated using the equation for a 1D harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiation of the displacement function will produce a velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx}{dt} = -A\omega\sin\left(\omega t + \phi\right) = v(t) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substitution into velocity autocorrelation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling -A\omega: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right)\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trigometric relation can simplify equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin\left(\omega t + \omega\tau + \phi\right) = cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integration of ansymmetical function results in 0:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} sin(x)cos(x)\mathrm{d}t = 0 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Thus after &amp;lt;math&amp;gt;cos(t\omega) &amp;lt;/math&amp;gt;is removed from top line the equation simplifies to: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(t\omega) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Vapourphse.png|thumb|Vapour Phase|x300px|left]]&lt;br /&gt;
! [[File:Vapour phase 1 million.png|thumb|Vapour Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid(small).png|thumb|Solid Phase|x300px|left]]&lt;br /&gt;
! [[File:Solid1million.png|thumb|Solid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Liquidsmallno..png|thumb|Liquid Phase|x300px|left]]&lt;br /&gt;
! [[File:Liquid1millionatoms.png|thumb|Liquid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 1.64&lt;br /&gt;
| 1.63&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| -0.2215&lt;br /&gt;
| 0.157 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| 0.254&lt;br /&gt;
| -0.123&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the trapezium rule to calculate D from a VACF plot yeilded a similar trend in diffusion coefficients however there was a discrepancy in one of my results. The value of D for a liquid of small number of atoms was smaller and more negative than the solid. This indictaes that using the MSD method is more accurate than VACF. This also indicates that it is more important to use the VACF plot for a large system when calculating D.&lt;br /&gt;
&lt;br /&gt;
= References = &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Mark Klarpus, Gregory A. Petsko, (1990) &#039;&#039;Molecular Reaction Dynamics in Biology&#039;&#039;, &#039;&#039;&#039;347&#039;&#039;&#039;, 631-9, doi:10.1038/347631a0&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=579799</id>
		<title>Rep:Thermomp4114</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=579799"/>
		<updated>2017-02-01T14:37:26Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: /* Calculating Heat Capacities Using Statistic Physics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Molecular Dynamics Simulations of Simple Liquids Introduction == &lt;br /&gt;
&lt;br /&gt;
Molecular dynamic simulations involved studying the motion of a system of particles. Several fundamental elements of a system need to be known in order to achieve this. This includes a knowledge of the interaction potential for the particles and the equations of motion which govern the dynamics of the particles.&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt; Once we know the positions, velocities, and forces, of the atoms (which are obtained using statistical) we can calculate various thermodynamic quantities of the system such as temperature and pressure. We must introduce a series of approximations in order for the caluculations to be feasible. Firstly we apply the &#039;&#039;&#039;The Classical Particle Approximation&#039;&#039;&#039;. The schoedinger equation is too complex to solve for a large system of atoms, however if the atoms are treated classically then the positions and and velocities of each can atom can be calculated using Newton&#039;s second law (equation 1): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = m_i \mathbf{a}_i = m_i \frac{\mathrm{d}\mathbf{v}_i}{\mathrm{d}t} = m_i \frac{\mathrm{d}^2 \mathbf{x}_i}{\mathrm{d}t^2} \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As there are N atoms and therefore N equations representing each atom a computer is a necessity. The &#039;&#039;&#039;Verlet algorithim&#039;&#039;&#039; is used to solve to Newton&#039;s law for all the atoms in the system. In this case time is not continuous but is made discrete, the simulation is thus broeken up into specific &#039;&#039;&#039;timesteps&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The position of atom &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;\mathbf{x}_i \left(t\right)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Positional Verlet algorithim (equation (2)): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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 \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Velocity Verlet algorithim (equation (3)):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{v}_i \left(t\right)&amp;lt;/math&amp;gt; represents the velocity of that atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;center&amp;gt;&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 \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Put in example of industrial applications&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Harmonic Oscillator ===&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator illustrates the the accuracy and discrepancies associated with using the velocity Verlet algorithim. Equation (4) is used to model the behavior of the harmonic oscillator in an analytical sense: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)\ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; = 1.00 &lt;br /&gt;
&lt;br /&gt;
Graph (1) illustrates the results the analytical solution gave for the relationship between position and time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Avrsxt2.png|x300px|thumb|Graph 1: Analytical solution of harmonic oscillator|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The difference in position between the velocity-verlet solution and analytical solution is represented by an error. Error plotted against time is illustrated by graph (2). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ErrorvrsT.png|x300px|thumb|Graph 2: Error vrs Time|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The orange line illustrates the positive trend between error and time. This shows that error is accumulative with time. Each timestep represents a calculation which has an associated error thus as the simulation proceeds the errors will be summed. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy of the system will consist of the sum of kinetic and potential energy. Equation (5) can be used to find kinetic energy of the system:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;E_\text{k} =\tfrac{1}{2} mv(t)^2 \ \ (5)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\mathbf{x} \left(t\right)&amp;lt;/math&amp;gt; is used in equation (5) the potential energy can be found. &lt;br /&gt;
&lt;br /&gt;
The following graphs represent the difference in change in energy with time when the timestep is varied. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EvrsTime.png|x200px|thumb|Energy change when a timestep of 0.1 is used|left]]&lt;br /&gt;
! [[File:Energy vrs time for 0.15 timestep.png|x200px|thumb|Energy change when a timestep of 0.15 is used|centre]]&lt;br /&gt;
! [[File:Energy vrs time for 0.2 timestep.png|x200px|thumb|Energy change when a timestep of 0.2 is used|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The maximum change in energy for each of the different timesteps is shown in table (1). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | Timestep&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.1&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.15&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.2&lt;br /&gt;
|-&lt;br /&gt;
| Max. change in Energy&lt;br /&gt;
| 0.2%&lt;br /&gt;
| 0.6%&lt;br /&gt;
| 1%&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results clearly indicate that a timestep greater than &#039;&#039;&#039;0.2&#039;&#039;&#039; will result in an energy change greater than 1%. As the timestep increases as does the maximum error. The timestep defines the number of calculations made in a given time, therefore the shorter the timestep the larger the number of calculations carried out and therefore a more accurate result is produced. The total energy of a real physical system should not change, when modeled numerically there can be fluctuations therefore it is important to monitor this change and ensure that the fluctuations are minimised.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces ===&lt;br /&gt;
&lt;br /&gt;
The forces an atom experiences is determined by the positions of all the atoms in the system, &amp;lt;math&amp;gt;\mathbf{r}^N&amp;lt;/math&amp;gt;. The Lennard-Jones function accurately sums all the key inter-atomic forces an atoms experiences (U). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ (10)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
For a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After division by 4 and rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_0^{6}} = \frac{\sigma^{6}}{r_0^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After further rearrangement and cancelling down: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;-\sigma &amp;lt;/math&amp;gt; is also a solution however this can be disregarded. &lt;br /&gt;
&lt;br /&gt;
In order to calculate the force the following equation is used: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\sigma\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After differentiation and simplification: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}(r_0) =  \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At equilibrium: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{12\sigma^{12}}{r_e^{13}} - \frac{6\sigma^6}{r_e^7} \right)&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
After rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_e = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This value of &amp;lt;math&amp;gt; r_e &amp;lt;/math&amp;gt; can now be used to find the well depth:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{\sigma^{12}}{4sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon\left(\frac{1}{5r^{5}} - \frac{1}{11r^11} \right)^\infty_2 \simeq -2.48 \sdot 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -8.18 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -3.29 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
* No. of moles in  1 mL of water = 0.056 &amp;lt;br&amp;gt; &lt;br /&gt;
* No. of molecules = moles x Avogadro&#039;s constant = 3.37 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*1000 molecules = 1.66 x 10&amp;lt;sup&amp;gt;21&amp;lt;/sup&amp;gt; moles&lt;br /&gt;
* Density = mass/vol. = 1 &lt;br /&gt;
*vol. = mass/density = 2.99 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Due to periodic boundary condition once the atom leaves the current box it will enter the beginning of an identical box. The atom is at &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; and thus once it breaches 0.5 in a particular direction it will be at the start of the next box. Using these principles after the atom moves &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will be at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units === &lt;br /&gt;
&lt;br /&gt;
Reduced units are applied to the Lennard-Jones equation to make the calculation more managable.&lt;br /&gt;
&lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For argon:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Distance in real units: r = 1.09 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Well depth = &amp;lt;math&amp;gt;{\epsilon}&amp;lt;/math&amp;gt; = 0.996 KJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* T = 180 K&lt;br /&gt;
&lt;br /&gt;
= Equilibriation = &lt;br /&gt;
&lt;br /&gt;
=== Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
As there is a large number of atoms in a discrete volume allowing random assignment of positions could result in atoms overlapping. This would cause an unrealistically high potential as potential is distance dependant (as observed in the Lennard - Jones equation).&lt;br /&gt;
&lt;br /&gt;
* Density is given by the following equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{n}{v} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 1 (as there is only 1 atom per unit cell) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = 1.07722^3 = 1.25 &amp;lt;/math&amp;gt; (lattice spacing = 1.07722) &lt;br /&gt;
&lt;br /&gt;
Thus: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length of a side of one fcc unit cell with number density 1.2 would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = \frac{n}{\rho} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 4 (as there is 4 atoms per unit cell in an fcc lattice) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; = 3.33&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; l = v^{-3} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The number of atoms that would be created by the create_atoms command for an fcc lattice would be: &lt;br /&gt;
&lt;br /&gt;
4 x 1000 = 4000 &lt;br /&gt;
&lt;br /&gt;
This is due to fact that there is 1 atom per unit cell that yeilds 1000 altogether in simple cubic. Fcc has 4 times the number of atoms per unit cell. &lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of Atoms === &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command above has the following purpose: &lt;br /&gt;
&lt;br /&gt;
* The first line sets the mass of all atoms of type &#039;1&#039; to 1.0. &lt;br /&gt;
*  Line 2 is used to control the Lennard-Jones potential. The value of 3.0 indicates the distance in reduced units upon which the potential is calculated. The potential is distance dependent and falls to 0 at large values of r thus only atoms within a distance of 3.0 are considered.  &#039;lj/cut&#039; defines the cut off point. &lt;br /&gt;
* The last line defines the force field constants as 1.0 for all sets of atoms. The * controls the fact that the command is set for all atoms. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet is the integration algorithm that can be used when &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; are defined. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The codes is in place to ensure that the timestep can be varied but the total time taken for the simulation to run will not change.&lt;br /&gt;
&lt;br /&gt;
=== Checking equilibration === &lt;br /&gt;
&lt;br /&gt;
The graphs below illustrate the time it takes for different thermodynamic properties to equilibriate at a timestep of 0.001. The plateau represents the point at which equilibration is achieved. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EnergyVRStime.png|x300px|thumb|Energy Vrs Time|left]]&lt;br /&gt;
! [[File:TEMPvrsTIME.png|x300px|thumb|Temp vrs Time|centre]]&lt;br /&gt;
! [[File:Press Vrs Time.png|x300px|thumb|Pressure Vrs Time|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The graph below illustrates the effect changing the timestep has on equilibration. As can be seen from the graph a from below 0.01 a shorter timestep results in a lower energy value for equilibration until 0.0025 where the value   of equilibration does not change with lower timestep. This trend is due to the fact that a smaller timestep results in a more accurate result however if it is too small this can over-complicate the calculation (especially when there is a large over-all time). Thus a timestep of 0.0025 is a good balance and therefore ideal. A timestep of 0.025 is too large and results in the system not reaching equilibrium.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EnergyVtimeFORVTS.png|x400px|thumb|Energy Vrs Time with different timesteps|centre]]&lt;br /&gt;
&lt;br /&gt;
= Running Simulations Under Specific Conditions =&lt;br /&gt;
&lt;br /&gt;
The following two equations can be used to define the energy of the system: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The instantaneous tempertaure &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will not remain constant throughout the simulation and will fluctuate, it will thus be different to out target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The value of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2} = \frac{\mathfrak{T}}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within the preceding code: &lt;br /&gt;
&lt;br /&gt;
100 - Nevery: This command results in a sample being taken every 100 steps and being incorporated into the average. 1000 - Nrepreat: Tells the computer how many samples should be used to calculate the average. Nfreq 10 000: At every 10000th timestep an average is calculated. &lt;br /&gt;
&lt;br /&gt;
All thermodynamic properties are calculated by averages that is the necessity for those commands.&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equation of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:DENSITYvrsT.png|x400px|thumb|Density Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
The densities produced from the simulation are lower than for the ideal gas. This is a result of the simulation creating a more realistic picture of how the atoms interact as it takes into account Lennard-Jones potential. In an ideal gas the motion of atoms will be random, chaotic and inter atomic interactions are ignored however in the simulation the atoms will want to minimize their potential and therefore this will drive them to occupy a greater volume thus reducing the density.&lt;br /&gt;
&lt;br /&gt;
= Calculating Heat Capacities Using Statistic Physics =&lt;br /&gt;
&lt;br /&gt;
Example of input code used: &lt;br /&gt;
&lt;br /&gt;
* Density 0.2&lt;br /&gt;
* Temperature 2.0 &lt;br /&gt;
&lt;br /&gt;
SPECIFY TIMESTEP &amp;lt;br&amp;gt;&lt;br /&gt;
 RUN SIMULATION TO MELT CRYSTAL &amp;lt;br&amp;gt;&lt;br /&gt;
run 10000&amp;lt;br&amp;gt;&lt;br /&gt;
unfix nve&amp;lt;br&amp;gt;&lt;br /&gt;
reset_timestep 0&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
BRING SYSTEM TO REQUIRED STATE&amp;lt;br&amp;gt; &lt;br /&gt;
variable tdamp equal ${timestep}*100&amp;lt;br&amp;gt;&lt;br /&gt;
variable ddamp equal ${timestep}*1000&amp;lt;br&amp;gt;&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&amp;lt;br&amp;gt;&lt;br /&gt;
run 10000&amp;lt;br&amp;gt;&lt;br /&gt;
reset_timestep 0&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
MEASURE SYSTEM STATE &amp;lt;br&amp;gt;&lt;br /&gt;
unfix nvt&amp;lt;br&amp;gt;&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&amp;lt;br&amp;gt;&lt;br /&gt;
thermo_style custom step etotal temp press density&amp;lt;br&amp;gt;&lt;br /&gt;
variable etot equal etotal&amp;lt;br&amp;gt;&lt;br /&gt;
variable etot2 equal etotal*etotal&amp;lt;br&amp;gt;&lt;br /&gt;
variable temp equal temp&amp;lt;br&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_etot v_temp v_etot2&amp;lt;br&amp;gt;&lt;br /&gt;
run 100000&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
variable aveetot equal f_aves[1]&amp;lt;br&amp;gt;&lt;br /&gt;
variable avetemp equal f_aves[2]&amp;lt;br&amp;gt;&lt;br /&gt;
variable aveetot2 equal f_aves[3]&amp;lt;br&amp;gt;&lt;br /&gt;
variable varetot equal f_aves[3]-f_aves[1]*f_aves[1]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
print &amp;quot;Energy Variance: ${varetot}&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following equation was then used to calculate heat capacity from the results:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C_V = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[File:Heat capacity with T.png|x400px|thumb|Heat Capacity Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a fixed number of particles, &amp;lt;math&amp;gt; N &amp;lt;/math&amp;gt;, a larger density is indicative of a smaller volume. That is why the plot of &amp;lt;math&amp;gt;Cv/V Vrs T&amp;lt;/math&amp;gt; generally lies at a higher values for a density of 0.8. &lt;br /&gt;
&lt;br /&gt;
From both plots it can been seen that heat capacity increases with temperature.  &amp;lt;math&amp;gt; Var[E] &amp;lt;/math&amp;gt; increases with temp as at higher temp there are a greater number of accessible rotational, vibration, electronic and kinetic energetic states therefore the system is able to to absorb more energy per rise in temperature.&lt;br /&gt;
&lt;br /&gt;
= Structural Properties and the Radial Distribution function =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:G(r).png|x300px|thumb|RDF at different phases|left]]&lt;br /&gt;
! [[File:Integral.png|x300px|thumb|Integral of g(r)|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To carry out the RDF calculations temperature was kept constant at 1.2 but density was varied. &lt;br /&gt;
&lt;br /&gt;
Density in reduced units used for each phase: &lt;br /&gt;
&lt;br /&gt;
* Gas = 0.05&lt;br /&gt;
* Liquid = 0.8 &lt;br /&gt;
* Solid = 1.2&lt;br /&gt;
&lt;br /&gt;
The number of peaks for each RDF plot decreases in the order gas&amp;lt;liquid&amp;lt;solid. This reflects the ordering of each phase. &lt;br /&gt;
A gas has a large degree of disorder and thus produces only peak.&lt;br /&gt;
The liquid has three peaks which gradually decrease in amplitude, this behavior is due to the fact that the liquid is modeled as central molecule surrounded by shells of other molecules, this initially creates some degree of order. As the simulation continues the molecules become more diffuse so the ordering decreases and thus the amplitude of peaks decrease.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Solid nearest coordination.png|x400px|centre]]&lt;br /&gt;
&lt;br /&gt;
The above plot indicates the positions of the first three peaks. These will correspond to the three closet atoms in the lattice. &lt;br /&gt;
&lt;br /&gt;
* 1.025 will correspond to one of the atoms at the corner of the unit cell neighboring the starting position.&lt;br /&gt;
* 1.525 will correspond to one of the atoms in the centre of the face of the cube. (The lattice is fcc) &lt;br /&gt;
* 1.825 will correspond to an atom on one of the faces adjacent to the starting point. It cannot be one of the adjacent corners as this would be too large thus it must fall in between the corners and therefore on a face.&lt;br /&gt;
&lt;br /&gt;
= Dynamical Properties and the diffusion coefficient = &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid.png|thumb|solid|x300px|left]]&lt;br /&gt;
! [[File:Liquid.png|thumb|liquid|x300px|centre]]&lt;br /&gt;
! [[File:Gas.png|thumb|gas|x300px|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plot give insight into the displacement of particles as they illustrate &#039;&#039;&#039;mean square displacement&#039;&#039;&#039; with time. There are variations in the shape of the lines for the large number of atoms and small number of atoms, this is due to the variations in positions being averaged for a large number of atoms and thus gives a better indication of the behavior of the system. The difference is very apparent for solid where one can see that the line is much more smooth in the region where the gradient becomes close to 0. &lt;br /&gt;
&lt;br /&gt;
The diffusion constant D was found by calculating the gradient of the line for each phase. The gradient after the line had leveled off was used for the solid.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 0.0304&lt;br /&gt;
| 0.0305&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| 0.001&lt;br /&gt;
| 0.0012 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| &amp;lt;math&amp;gt; 6 x 10^{-8} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 7 x 10^{-9} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There is a gradual decrease in D in the order solid&amp;lt;liquid&amp;lt;gas. This fits out chemical intuition; e.g. the motion of a solid would be much more restricted that the motion of a gas.  &lt;br /&gt;
&lt;br /&gt;
[[File:VACFvrsTS.png|x400px|thumb|VACF vrs Temperature|centre]]&lt;br /&gt;
&lt;br /&gt;
Minima in the VACF plot correspond to points where the atoms collide and change direction. The greater number of minima for a solid is due to the restricted mean square displacement in which the atoms can move, this therefore results in greater collisions as the atoms seek to minimize their potential energy. As a liquid has a greater diffusion coefficient it is able to diffuse away from an atom after a collision, this is why there are fewer minima, the line tends to 0 as the atoms eventually move in opposite directions resulting in velocities cancelling out and therefor the integration becomes 0. The harmonic oscillator is simply a mathematical function without physical meaning therefore it will continue to oscillate around 0 until infinity. &lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function for a 1D harmonic oscillator can be evaluated using the equation for a 1D harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiation of the displacement function will produce a velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx}{dt} = -A\omega\sin\left(\omega t + \phi\right) = v(t) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substitution into velocity autocorrelation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling -A\omega: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right)\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trigometric relation can simplify equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin\left(\omega t + \omega\tau + \phi\right) = cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integration of ansymmetical function results in 0:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} sin(x)cos(x)\mathrm{d}t = 0 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Thus after &amp;lt;math&amp;gt;cos(t\omega) &amp;lt;/math&amp;gt;is removed from top line the equation simplifies to: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(t\omega) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Vapourphse.png|thumb|Vapour Phase|x300px|left]]&lt;br /&gt;
! [[File:Vapour phase 1 million.png|thumb|Vapour Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid(small).png|thumb|Solid Phase|x300px|left]]&lt;br /&gt;
! [[File:Solid1million.png|thumb|Solid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Liquidsmallno..png|thumb|Liquid Phase|x300px|left]]&lt;br /&gt;
! [[File:Liquid1millionatoms.png|thumb|Liquid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 1.64&lt;br /&gt;
| 1.63&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| -0.2215&lt;br /&gt;
| 0.157 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| 0.254&lt;br /&gt;
| -0.123&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the trapezium rule to calculate D from a VACF plot yeilded a similar trend in diffusion coefficients however there was a discrepancy in one of my results. The value of D for a liquid of small number of atoms was smaller and more negative than the solid. This indictaes that using the MSD method is more accurate than VACF. This also indicates that it is more important to use the VACF plot for a large system when calculating D.&lt;br /&gt;
&lt;br /&gt;
= References = &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Mark Klarpus, Gregory A. Petsko, (1990) &#039;&#039;Molecular Reaction Dynamics in Biology&#039;&#039;, &#039;&#039;&#039;347&#039;&#039;&#039;, 631-9, doi:10.1038/347631a0&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=579798</id>
		<title>Rep:Thermomp4114</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=579798"/>
		<updated>2017-02-01T14:34:46Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: /* Calculating Heat Capacities Using Statistic Physics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Molecular Dynamics Simulations of Simple Liquids Introduction == &lt;br /&gt;
&lt;br /&gt;
Molecular dynamic simulations involved studying the motion of a system of particles. Several fundamental elements of a system need to be known in order to achieve this. This includes a knowledge of the interaction potential for the particles and the equations of motion which govern the dynamics of the particles.&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt; Once we know the positions, velocities, and forces, of the atoms (which are obtained using statistical) we can calculate various thermodynamic quantities of the system such as temperature and pressure. We must introduce a series of approximations in order for the caluculations to be feasible. Firstly we apply the &#039;&#039;&#039;The Classical Particle Approximation&#039;&#039;&#039;. The schoedinger equation is too complex to solve for a large system of atoms, however if the atoms are treated classically then the positions and and velocities of each can atom can be calculated using Newton&#039;s second law (equation 1): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = m_i \mathbf{a}_i = m_i \frac{\mathrm{d}\mathbf{v}_i}{\mathrm{d}t} = m_i \frac{\mathrm{d}^2 \mathbf{x}_i}{\mathrm{d}t^2} \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As there are N atoms and therefore N equations representing each atom a computer is a necessity. The &#039;&#039;&#039;Verlet algorithim&#039;&#039;&#039; is used to solve to Newton&#039;s law for all the atoms in the system. In this case time is not continuous but is made discrete, the simulation is thus broeken up into specific &#039;&#039;&#039;timesteps&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The position of atom &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;\mathbf{x}_i \left(t\right)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Positional Verlet algorithim (equation (2)): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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 \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Velocity Verlet algorithim (equation (3)):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{v}_i \left(t\right)&amp;lt;/math&amp;gt; represents the velocity of that atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;center&amp;gt;&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 \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Put in example of industrial applications&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Harmonic Oscillator ===&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator illustrates the the accuracy and discrepancies associated with using the velocity Verlet algorithim. Equation (4) is used to model the behavior of the harmonic oscillator in an analytical sense: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)\ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; = 1.00 &lt;br /&gt;
&lt;br /&gt;
Graph (1) illustrates the results the analytical solution gave for the relationship between position and time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Avrsxt2.png|x300px|thumb|Graph 1: Analytical solution of harmonic oscillator|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The difference in position between the velocity-verlet solution and analytical solution is represented by an error. Error plotted against time is illustrated by graph (2). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ErrorvrsT.png|x300px|thumb|Graph 2: Error vrs Time|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The orange line illustrates the positive trend between error and time. This shows that error is accumulative with time. Each timestep represents a calculation which has an associated error thus as the simulation proceeds the errors will be summed. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy of the system will consist of the sum of kinetic and potential energy. Equation (5) can be used to find kinetic energy of the system:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;E_\text{k} =\tfrac{1}{2} mv(t)^2 \ \ (5)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\mathbf{x} \left(t\right)&amp;lt;/math&amp;gt; is used in equation (5) the potential energy can be found. &lt;br /&gt;
&lt;br /&gt;
The following graphs represent the difference in change in energy with time when the timestep is varied. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EvrsTime.png|x200px|thumb|Energy change when a timestep of 0.1 is used|left]]&lt;br /&gt;
! [[File:Energy vrs time for 0.15 timestep.png|x200px|thumb|Energy change when a timestep of 0.15 is used|centre]]&lt;br /&gt;
! [[File:Energy vrs time for 0.2 timestep.png|x200px|thumb|Energy change when a timestep of 0.2 is used|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The maximum change in energy for each of the different timesteps is shown in table (1). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | Timestep&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.1&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.15&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.2&lt;br /&gt;
|-&lt;br /&gt;
| Max. change in Energy&lt;br /&gt;
| 0.2%&lt;br /&gt;
| 0.6%&lt;br /&gt;
| 1%&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results clearly indicate that a timestep greater than &#039;&#039;&#039;0.2&#039;&#039;&#039; will result in an energy change greater than 1%. As the timestep increases as does the maximum error. The timestep defines the number of calculations made in a given time, therefore the shorter the timestep the larger the number of calculations carried out and therefore a more accurate result is produced. The total energy of a real physical system should not change, when modeled numerically there can be fluctuations therefore it is important to monitor this change and ensure that the fluctuations are minimised.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces ===&lt;br /&gt;
&lt;br /&gt;
The forces an atom experiences is determined by the positions of all the atoms in the system, &amp;lt;math&amp;gt;\mathbf{r}^N&amp;lt;/math&amp;gt;. The Lennard-Jones function accurately sums all the key inter-atomic forces an atoms experiences (U). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ (10)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
For a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After division by 4 and rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_0^{6}} = \frac{\sigma^{6}}{r_0^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After further rearrangement and cancelling down: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;-\sigma &amp;lt;/math&amp;gt; is also a solution however this can be disregarded. &lt;br /&gt;
&lt;br /&gt;
In order to calculate the force the following equation is used: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\sigma\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After differentiation and simplification: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}(r_0) =  \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At equilibrium: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{12\sigma^{12}}{r_e^{13}} - \frac{6\sigma^6}{r_e^7} \right)&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
After rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_e = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This value of &amp;lt;math&amp;gt; r_e &amp;lt;/math&amp;gt; can now be used to find the well depth:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{\sigma^{12}}{4sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon\left(\frac{1}{5r^{5}} - \frac{1}{11r^11} \right)^\infty_2 \simeq -2.48 \sdot 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -8.18 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -3.29 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
* No. of moles in  1 mL of water = 0.056 &amp;lt;br&amp;gt; &lt;br /&gt;
* No. of molecules = moles x Avogadro&#039;s constant = 3.37 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*1000 molecules = 1.66 x 10&amp;lt;sup&amp;gt;21&amp;lt;/sup&amp;gt; moles&lt;br /&gt;
* Density = mass/vol. = 1 &lt;br /&gt;
*vol. = mass/density = 2.99 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Due to periodic boundary condition once the atom leaves the current box it will enter the beginning of an identical box. The atom is at &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; and thus once it breaches 0.5 in a particular direction it will be at the start of the next box. Using these principles after the atom moves &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will be at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units === &lt;br /&gt;
&lt;br /&gt;
Reduced units are applied to the Lennard-Jones equation to make the calculation more managable.&lt;br /&gt;
&lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For argon:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Distance in real units: r = 1.09 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Well depth = &amp;lt;math&amp;gt;{\epsilon}&amp;lt;/math&amp;gt; = 0.996 KJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* T = 180 K&lt;br /&gt;
&lt;br /&gt;
= Equilibriation = &lt;br /&gt;
&lt;br /&gt;
=== Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
As there is a large number of atoms in a discrete volume allowing random assignment of positions could result in atoms overlapping. This would cause an unrealistically high potential as potential is distance dependant (as observed in the Lennard - Jones equation).&lt;br /&gt;
&lt;br /&gt;
* Density is given by the following equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{n}{v} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 1 (as there is only 1 atom per unit cell) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = 1.07722^3 = 1.25 &amp;lt;/math&amp;gt; (lattice spacing = 1.07722) &lt;br /&gt;
&lt;br /&gt;
Thus: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length of a side of one fcc unit cell with number density 1.2 would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = \frac{n}{\rho} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 4 (as there is 4 atoms per unit cell in an fcc lattice) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; = 3.33&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; l = v^{-3} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The number of atoms that would be created by the create_atoms command for an fcc lattice would be: &lt;br /&gt;
&lt;br /&gt;
4 x 1000 = 4000 &lt;br /&gt;
&lt;br /&gt;
This is due to fact that there is 1 atom per unit cell that yeilds 1000 altogether in simple cubic. Fcc has 4 times the number of atoms per unit cell. &lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of Atoms === &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command above has the following purpose: &lt;br /&gt;
&lt;br /&gt;
* The first line sets the mass of all atoms of type &#039;1&#039; to 1.0. &lt;br /&gt;
*  Line 2 is used to control the Lennard-Jones potential. The value of 3.0 indicates the distance in reduced units upon which the potential is calculated. The potential is distance dependent and falls to 0 at large values of r thus only atoms within a distance of 3.0 are considered.  &#039;lj/cut&#039; defines the cut off point. &lt;br /&gt;
* The last line defines the force field constants as 1.0 for all sets of atoms. The * controls the fact that the command is set for all atoms. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet is the integration algorithm that can be used when &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; are defined. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The codes is in place to ensure that the timestep can be varied but the total time taken for the simulation to run will not change.&lt;br /&gt;
&lt;br /&gt;
=== Checking equilibration === &lt;br /&gt;
&lt;br /&gt;
The graphs below illustrate the time it takes for different thermodynamic properties to equilibriate at a timestep of 0.001. The plateau represents the point at which equilibration is achieved. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EnergyVRStime.png|x300px|thumb|Energy Vrs Time|left]]&lt;br /&gt;
! [[File:TEMPvrsTIME.png|x300px|thumb|Temp vrs Time|centre]]&lt;br /&gt;
! [[File:Press Vrs Time.png|x300px|thumb|Pressure Vrs Time|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The graph below illustrates the effect changing the timestep has on equilibration. As can be seen from the graph a from below 0.01 a shorter timestep results in a lower energy value for equilibration until 0.0025 where the value   of equilibration does not change with lower timestep. This trend is due to the fact that a smaller timestep results in a more accurate result however if it is too small this can over-complicate the calculation (especially when there is a large over-all time). Thus a timestep of 0.0025 is a good balance and therefore ideal. A timestep of 0.025 is too large and results in the system not reaching equilibrium.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EnergyVtimeFORVTS.png|x400px|thumb|Energy Vrs Time with different timesteps|centre]]&lt;br /&gt;
&lt;br /&gt;
= Running Simulations Under Specific Conditions =&lt;br /&gt;
&lt;br /&gt;
The following two equations can be used to define the energy of the system: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The instantaneous tempertaure &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will not remain constant throughout the simulation and will fluctuate, it will thus be different to out target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The value of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2} = \frac{\mathfrak{T}}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within the preceding code: &lt;br /&gt;
&lt;br /&gt;
100 - Nevery: This command results in a sample being taken every 100 steps and being incorporated into the average. 1000 - Nrepreat: Tells the computer how many samples should be used to calculate the average. Nfreq 10 000: At every 10000th timestep an average is calculated. &lt;br /&gt;
&lt;br /&gt;
All thermodynamic properties are calculated by averages that is the necessity for those commands.&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equation of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:DENSITYvrsT.png|x400px|thumb|Density Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
The densities produced from the simulation are lower than for the ideal gas. This is a result of the simulation creating a more realistic picture of how the atoms interact as it takes into account Lennard-Jones potential. In an ideal gas the motion of atoms will be random, chaotic and inter atomic interactions are ignored however in the simulation the atoms will want to minimize their potential and therefore this will drive them to occupy a greater volume thus reducing the density.&lt;br /&gt;
&lt;br /&gt;
= Calculating Heat Capacities Using Statistic Physics =&lt;br /&gt;
&lt;br /&gt;
Example of input code used: &lt;br /&gt;
&lt;br /&gt;
* Density 0.2&lt;br /&gt;
* Temperature 2.0 &lt;br /&gt;
&lt;br /&gt;
 variable density equal 0.2&lt;br /&gt;
 DEFINE SIMULATION BOX GEOMETRY &amp;lt;br&amp;gt; &lt;br /&gt;
lattice sc ${density} &amp;lt;br&amp;gt; &lt;br /&gt;
region box block 0 15 0 15 0 15 &amp;lt;br&amp;gt; &lt;br /&gt;
create_box 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
create_atoms 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
DEFINE PHYSICAL PROPERTIES OF ATOMS &amp;lt;br&amp;gt; &lt;br /&gt;
mass 1 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_style lj/cut/opt 3.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_coeff 1 1 1.0 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
neighbor 2.0 bin &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY THE REQUIRED THERMODYNAMIC STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable T equal 2.0 &amp;lt;br&amp;gt; &lt;br /&gt;
variable p equal 2.5 &amp;lt;br&amp;gt; &lt;br /&gt;
variable timestep equal 0.0025 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ASSIGN ATOMIC VELOCITIES &amp;lt;br&amp;gt; &lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
SPECIFY ENSEMBLE &amp;lt;br&amp;gt; &lt;br /&gt;
timestep ${timestep} &amp;lt;br&amp;gt; &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 THERMODYNAMIC OUTPUT CONTROL &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom time etotal temp press &amp;lt;br&amp;gt; &lt;br /&gt;
thermo 10 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RECORD TRAJECTORY &amp;lt;br&amp;gt; &lt;br /&gt;
dump traj all custom 1000 output-1 id x y z &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY TIMESTEP &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RUN SIMULATION TO MELT CRYSTAL &amp;lt;br&amp;gt; &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nve &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 BRING SYSTEM TO REQUIRED STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable tdamp equal ${timestep}*100 &amp;lt;br&amp;gt; &lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &amp;lt;br&amp;gt;  &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nvt &amp;lt;br&amp;gt;  &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 MEASURE SYSTEM STATE  &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom step atoms etotal temp press density vol &amp;lt;br&amp;gt; &lt;br /&gt;
variable atoms2 equal atoms*atoms &amp;lt;br&amp;gt;   &lt;br /&gt;
variable volume equal vol&lt;br /&gt;
variable E equal etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable E2 equal etotal*etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens equal density &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens2 equal density*density &amp;lt;br&amp;gt;  &lt;br /&gt;
variable temp equal temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable temp2 equal temp*temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable press equal press &amp;lt;br&amp;gt; &lt;br /&gt;
variable press2 equal press*press &amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_E2 v_E&lt;br /&gt;
run 100000 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
variable HC equal ${atoms2}*(f_aves[7] - f_aves[8]*f_aves[8])/f_aves[5] &amp;lt;br&amp;gt;  &lt;br /&gt;
variable avedens equal f_aves[1] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avetemp equal f_aves[2] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avepress equal f_aves[3] &amp;lt;br&amp;gt; &lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3]) &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;--------&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Temperature: ${temp}&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Heat capacity: ${HC}&amp;quot;  &amp;lt;br&amp;gt;  &lt;br /&gt;
print &amp;quot;atoms&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
print &amp;quot;volume: ${volume}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The following equation was then used to calculate heat capacity from the results:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C_V = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[File:Heat capacity with T.png|x400px|thumb|Heat Capacity Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a fixed number of particles, &amp;lt;math&amp;gt; N &amp;lt;/math&amp;gt;, a larger density is indicative of a smaller volume. That is why the plot of &amp;lt;math&amp;gt;Cv/V Vrs T&amp;lt;/math&amp;gt; generally lies at a higher values for a density of 0.8. &lt;br /&gt;
&lt;br /&gt;
From both plots it can been seen that heat capacity increases with temperature.  &amp;lt;math&amp;gt; Var[E] &amp;lt;/math&amp;gt; increases with temp as at higher temp there are a greater number of accessible rotational, vibration, electronic and kinetic energetic states therefore the system is able to to absorb more energy per rise in temperature.&lt;br /&gt;
&lt;br /&gt;
= Structural Properties and the Radial Distribution function =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:G(r).png|x300px|thumb|RDF at different phases|left]]&lt;br /&gt;
! [[File:Integral.png|x300px|thumb|Integral of g(r)|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To carry out the RDF calculations temperature was kept constant at 1.2 but density was varied. &lt;br /&gt;
&lt;br /&gt;
Density in reduced units used for each phase: &lt;br /&gt;
&lt;br /&gt;
* Gas = 0.05&lt;br /&gt;
* Liquid = 0.8 &lt;br /&gt;
* Solid = 1.2&lt;br /&gt;
&lt;br /&gt;
The number of peaks for each RDF plot decreases in the order gas&amp;lt;liquid&amp;lt;solid. This reflects the ordering of each phase. &lt;br /&gt;
A gas has a large degree of disorder and thus produces only peak.&lt;br /&gt;
The liquid has three peaks which gradually decrease in amplitude, this behavior is due to the fact that the liquid is modeled as central molecule surrounded by shells of other molecules, this initially creates some degree of order. As the simulation continues the molecules become more diffuse so the ordering decreases and thus the amplitude of peaks decrease.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Solid nearest coordination.png|x400px|centre]]&lt;br /&gt;
&lt;br /&gt;
The above plot indicates the positions of the first three peaks. These will correspond to the three closet atoms in the lattice. &lt;br /&gt;
&lt;br /&gt;
* 1.025 will correspond to one of the atoms at the corner of the unit cell neighboring the starting position.&lt;br /&gt;
* 1.525 will correspond to one of the atoms in the centre of the face of the cube. (The lattice is fcc) &lt;br /&gt;
* 1.825 will correspond to an atom on one of the faces adjacent to the starting point. It cannot be one of the adjacent corners as this would be too large thus it must fall in between the corners and therefore on a face.&lt;br /&gt;
&lt;br /&gt;
= Dynamical Properties and the diffusion coefficient = &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid.png|thumb|solid|x300px|left]]&lt;br /&gt;
! [[File:Liquid.png|thumb|liquid|x300px|centre]]&lt;br /&gt;
! [[File:Gas.png|thumb|gas|x300px|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plot give insight into the displacement of particles as they illustrate &#039;&#039;&#039;mean square displacement&#039;&#039;&#039; with time. There are variations in the shape of the lines for the large number of atoms and small number of atoms, this is due to the variations in positions being averaged for a large number of atoms and thus gives a better indication of the behavior of the system. The difference is very apparent for solid where one can see that the line is much more smooth in the region where the gradient becomes close to 0. &lt;br /&gt;
&lt;br /&gt;
The diffusion constant D was found by calculating the gradient of the line for each phase. The gradient after the line had leveled off was used for the solid.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 0.0304&lt;br /&gt;
| 0.0305&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| 0.001&lt;br /&gt;
| 0.0012 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| &amp;lt;math&amp;gt; 6 x 10^{-8} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 7 x 10^{-9} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There is a gradual decrease in D in the order solid&amp;lt;liquid&amp;lt;gas. This fits out chemical intuition; e.g. the motion of a solid would be much more restricted that the motion of a gas.  &lt;br /&gt;
&lt;br /&gt;
[[File:VACFvrsTS.png|x400px|thumb|VACF vrs Temperature|centre]]&lt;br /&gt;
&lt;br /&gt;
Minima in the VACF plot correspond to points where the atoms collide and change direction. The greater number of minima for a solid is due to the restricted mean square displacement in which the atoms can move, this therefore results in greater collisions as the atoms seek to minimize their potential energy. As a liquid has a greater diffusion coefficient it is able to diffuse away from an atom after a collision, this is why there are fewer minima, the line tends to 0 as the atoms eventually move in opposite directions resulting in velocities cancelling out and therefor the integration becomes 0. The harmonic oscillator is simply a mathematical function without physical meaning therefore it will continue to oscillate around 0 until infinity. &lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function for a 1D harmonic oscillator can be evaluated using the equation for a 1D harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiation of the displacement function will produce a velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx}{dt} = -A\omega\sin\left(\omega t + \phi\right) = v(t) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substitution into velocity autocorrelation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling -A\omega: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right)\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trigometric relation can simplify equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin\left(\omega t + \omega\tau + \phi\right) = cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integration of ansymmetical function results in 0:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} sin(x)cos(x)\mathrm{d}t = 0 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Thus after &amp;lt;math&amp;gt;cos(t\omega) &amp;lt;/math&amp;gt;is removed from top line the equation simplifies to: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(t\omega) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Vapourphse.png|thumb|Vapour Phase|x300px|left]]&lt;br /&gt;
! [[File:Vapour phase 1 million.png|thumb|Vapour Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid(small).png|thumb|Solid Phase|x300px|left]]&lt;br /&gt;
! [[File:Solid1million.png|thumb|Solid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Liquidsmallno..png|thumb|Liquid Phase|x300px|left]]&lt;br /&gt;
! [[File:Liquid1millionatoms.png|thumb|Liquid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 1.64&lt;br /&gt;
| 1.63&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| -0.2215&lt;br /&gt;
| 0.157 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| 0.254&lt;br /&gt;
| -0.123&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the trapezium rule to calculate D from a VACF plot yeilded a similar trend in diffusion coefficients however there was a discrepancy in one of my results. The value of D for a liquid of small number of atoms was smaller and more negative than the solid. This indictaes that using the MSD method is more accurate than VACF. This also indicates that it is more important to use the VACF plot for a large system when calculating D.&lt;br /&gt;
&lt;br /&gt;
= References = &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Mark Klarpus, Gregory A. Petsko, (1990) &#039;&#039;Molecular Reaction Dynamics in Biology&#039;&#039;, &#039;&#039;&#039;347&#039;&#039;&#039;, 631-9, doi:10.1038/347631a0&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=579797</id>
		<title>Rep:Thermomp4114</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=579797"/>
		<updated>2017-02-01T14:34:02Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: /* Calculating Heat Capacities Using Statistic Physics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Molecular Dynamics Simulations of Simple Liquids Introduction == &lt;br /&gt;
&lt;br /&gt;
Molecular dynamic simulations involved studying the motion of a system of particles. Several fundamental elements of a system need to be known in order to achieve this. This includes a knowledge of the interaction potential for the particles and the equations of motion which govern the dynamics of the particles.&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt; Once we know the positions, velocities, and forces, of the atoms (which are obtained using statistical) we can calculate various thermodynamic quantities of the system such as temperature and pressure. We must introduce a series of approximations in order for the caluculations to be feasible. Firstly we apply the &#039;&#039;&#039;The Classical Particle Approximation&#039;&#039;&#039;. The schoedinger equation is too complex to solve for a large system of atoms, however if the atoms are treated classically then the positions and and velocities of each can atom can be calculated using Newton&#039;s second law (equation 1): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = m_i \mathbf{a}_i = m_i \frac{\mathrm{d}\mathbf{v}_i}{\mathrm{d}t} = m_i \frac{\mathrm{d}^2 \mathbf{x}_i}{\mathrm{d}t^2} \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As there are N atoms and therefore N equations representing each atom a computer is a necessity. The &#039;&#039;&#039;Verlet algorithim&#039;&#039;&#039; is used to solve to Newton&#039;s law for all the atoms in the system. In this case time is not continuous but is made discrete, the simulation is thus broeken up into specific &#039;&#039;&#039;timesteps&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The position of atom &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;\mathbf{x}_i \left(t\right)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Positional Verlet algorithim (equation (2)): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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 \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Velocity Verlet algorithim (equation (3)):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{v}_i \left(t\right)&amp;lt;/math&amp;gt; represents the velocity of that atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;center&amp;gt;&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 \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Put in example of industrial applications&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Harmonic Oscillator ===&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator illustrates the the accuracy and discrepancies associated with using the velocity Verlet algorithim. Equation (4) is used to model the behavior of the harmonic oscillator in an analytical sense: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)\ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; = 1.00 &lt;br /&gt;
&lt;br /&gt;
Graph (1) illustrates the results the analytical solution gave for the relationship between position and time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Avrsxt2.png|x300px|thumb|Graph 1: Analytical solution of harmonic oscillator|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The difference in position between the velocity-verlet solution and analytical solution is represented by an error. Error plotted against time is illustrated by graph (2). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ErrorvrsT.png|x300px|thumb|Graph 2: Error vrs Time|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The orange line illustrates the positive trend between error and time. This shows that error is accumulative with time. Each timestep represents a calculation which has an associated error thus as the simulation proceeds the errors will be summed. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy of the system will consist of the sum of kinetic and potential energy. Equation (5) can be used to find kinetic energy of the system:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;E_\text{k} =\tfrac{1}{2} mv(t)^2 \ \ (5)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\mathbf{x} \left(t\right)&amp;lt;/math&amp;gt; is used in equation (5) the potential energy can be found. &lt;br /&gt;
&lt;br /&gt;
The following graphs represent the difference in change in energy with time when the timestep is varied. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EvrsTime.png|x200px|thumb|Energy change when a timestep of 0.1 is used|left]]&lt;br /&gt;
! [[File:Energy vrs time for 0.15 timestep.png|x200px|thumb|Energy change when a timestep of 0.15 is used|centre]]&lt;br /&gt;
! [[File:Energy vrs time for 0.2 timestep.png|x200px|thumb|Energy change when a timestep of 0.2 is used|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The maximum change in energy for each of the different timesteps is shown in table (1). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | Timestep&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.1&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.15&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.2&lt;br /&gt;
|-&lt;br /&gt;
| Max. change in Energy&lt;br /&gt;
| 0.2%&lt;br /&gt;
| 0.6%&lt;br /&gt;
| 1%&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results clearly indicate that a timestep greater than &#039;&#039;&#039;0.2&#039;&#039;&#039; will result in an energy change greater than 1%. As the timestep increases as does the maximum error. The timestep defines the number of calculations made in a given time, therefore the shorter the timestep the larger the number of calculations carried out and therefore a more accurate result is produced. The total energy of a real physical system should not change, when modeled numerically there can be fluctuations therefore it is important to monitor this change and ensure that the fluctuations are minimised.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces ===&lt;br /&gt;
&lt;br /&gt;
The forces an atom experiences is determined by the positions of all the atoms in the system, &amp;lt;math&amp;gt;\mathbf{r}^N&amp;lt;/math&amp;gt;. The Lennard-Jones function accurately sums all the key inter-atomic forces an atoms experiences (U). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ (10)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
For a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After division by 4 and rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_0^{6}} = \frac{\sigma^{6}}{r_0^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After further rearrangement and cancelling down: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;-\sigma &amp;lt;/math&amp;gt; is also a solution however this can be disregarded. &lt;br /&gt;
&lt;br /&gt;
In order to calculate the force the following equation is used: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\sigma\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After differentiation and simplification: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}(r_0) =  \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At equilibrium: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{12\sigma^{12}}{r_e^{13}} - \frac{6\sigma^6}{r_e^7} \right)&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
After rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_e = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This value of &amp;lt;math&amp;gt; r_e &amp;lt;/math&amp;gt; can now be used to find the well depth:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{\sigma^{12}}{4sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon\left(\frac{1}{5r^{5}} - \frac{1}{11r^11} \right)^\infty_2 \simeq -2.48 \sdot 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -8.18 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -3.29 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
* No. of moles in  1 mL of water = 0.056 &amp;lt;br&amp;gt; &lt;br /&gt;
* No. of molecules = moles x Avogadro&#039;s constant = 3.37 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*1000 molecules = 1.66 x 10&amp;lt;sup&amp;gt;21&amp;lt;/sup&amp;gt; moles&lt;br /&gt;
* Density = mass/vol. = 1 &lt;br /&gt;
*vol. = mass/density = 2.99 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Due to periodic boundary condition once the atom leaves the current box it will enter the beginning of an identical box. The atom is at &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; and thus once it breaches 0.5 in a particular direction it will be at the start of the next box. Using these principles after the atom moves &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will be at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units === &lt;br /&gt;
&lt;br /&gt;
Reduced units are applied to the Lennard-Jones equation to make the calculation more managable.&lt;br /&gt;
&lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For argon:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Distance in real units: r = 1.09 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Well depth = &amp;lt;math&amp;gt;{\epsilon}&amp;lt;/math&amp;gt; = 0.996 KJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* T = 180 K&lt;br /&gt;
&lt;br /&gt;
= Equilibriation = &lt;br /&gt;
&lt;br /&gt;
=== Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
As there is a large number of atoms in a discrete volume allowing random assignment of positions could result in atoms overlapping. This would cause an unrealistically high potential as potential is distance dependant (as observed in the Lennard - Jones equation).&lt;br /&gt;
&lt;br /&gt;
* Density is given by the following equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{n}{v} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 1 (as there is only 1 atom per unit cell) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = 1.07722^3 = 1.25 &amp;lt;/math&amp;gt; (lattice spacing = 1.07722) &lt;br /&gt;
&lt;br /&gt;
Thus: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length of a side of one fcc unit cell with number density 1.2 would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = \frac{n}{\rho} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 4 (as there is 4 atoms per unit cell in an fcc lattice) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; = 3.33&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; l = v^{-3} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The number of atoms that would be created by the create_atoms command for an fcc lattice would be: &lt;br /&gt;
&lt;br /&gt;
4 x 1000 = 4000 &lt;br /&gt;
&lt;br /&gt;
This is due to fact that there is 1 atom per unit cell that yeilds 1000 altogether in simple cubic. Fcc has 4 times the number of atoms per unit cell. &lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of Atoms === &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command above has the following purpose: &lt;br /&gt;
&lt;br /&gt;
* The first line sets the mass of all atoms of type &#039;1&#039; to 1.0. &lt;br /&gt;
*  Line 2 is used to control the Lennard-Jones potential. The value of 3.0 indicates the distance in reduced units upon which the potential is calculated. The potential is distance dependent and falls to 0 at large values of r thus only atoms within a distance of 3.0 are considered.  &#039;lj/cut&#039; defines the cut off point. &lt;br /&gt;
* The last line defines the force field constants as 1.0 for all sets of atoms. The * controls the fact that the command is set for all atoms. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet is the integration algorithm that can be used when &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; are defined. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The codes is in place to ensure that the timestep can be varied but the total time taken for the simulation to run will not change.&lt;br /&gt;
&lt;br /&gt;
=== Checking equilibration === &lt;br /&gt;
&lt;br /&gt;
The graphs below illustrate the time it takes for different thermodynamic properties to equilibriate at a timestep of 0.001. The plateau represents the point at which equilibration is achieved. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EnergyVRStime.png|x300px|thumb|Energy Vrs Time|left]]&lt;br /&gt;
! [[File:TEMPvrsTIME.png|x300px|thumb|Temp vrs Time|centre]]&lt;br /&gt;
! [[File:Press Vrs Time.png|x300px|thumb|Pressure Vrs Time|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The graph below illustrates the effect changing the timestep has on equilibration. As can be seen from the graph a from below 0.01 a shorter timestep results in a lower energy value for equilibration until 0.0025 where the value   of equilibration does not change with lower timestep. This trend is due to the fact that a smaller timestep results in a more accurate result however if it is too small this can over-complicate the calculation (especially when there is a large over-all time). Thus a timestep of 0.0025 is a good balance and therefore ideal. A timestep of 0.025 is too large and results in the system not reaching equilibrium.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EnergyVtimeFORVTS.png|x400px|thumb|Energy Vrs Time with different timesteps|centre]]&lt;br /&gt;
&lt;br /&gt;
= Running Simulations Under Specific Conditions =&lt;br /&gt;
&lt;br /&gt;
The following two equations can be used to define the energy of the system: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The instantaneous tempertaure &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will not remain constant throughout the simulation and will fluctuate, it will thus be different to out target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The value of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2} = \frac{\mathfrak{T}}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within the preceding code: &lt;br /&gt;
&lt;br /&gt;
100 - Nevery: This command results in a sample being taken every 100 steps and being incorporated into the average. 1000 - Nrepreat: Tells the computer how many samples should be used to calculate the average. Nfreq 10 000: At every 10000th timestep an average is calculated. &lt;br /&gt;
&lt;br /&gt;
All thermodynamic properties are calculated by averages that is the necessity for those commands.&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equation of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:DENSITYvrsT.png|x400px|thumb|Density Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
The densities produced from the simulation are lower than for the ideal gas. This is a result of the simulation creating a more realistic picture of how the atoms interact as it takes into account Lennard-Jones potential. In an ideal gas the motion of atoms will be random, chaotic and inter atomic interactions are ignored however in the simulation the atoms will want to minimize their potential and therefore this will drive them to occupy a greater volume thus reducing the density.&lt;br /&gt;
&lt;br /&gt;
= Calculating Heat Capacities Using Statistic Physics =&lt;br /&gt;
&lt;br /&gt;
Example of input code used: &lt;br /&gt;
&lt;br /&gt;
* Density 0.2&lt;br /&gt;
* Temperature 2.0 &lt;br /&gt;
&lt;br /&gt;
 variable density equal 0.2&lt;br /&gt;
 DEFINE SIMULATION BOX GEOMETRY &amp;lt;br&amp;gt; &lt;br /&gt;
lattice sc ${density} &amp;lt;br&amp;gt; &lt;br /&gt;
region box block 0 15 0 15 0 15 &amp;lt;br&amp;gt; &lt;br /&gt;
create_box 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
create_atoms 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
DEFINE PHYSICAL PROPERTIES OF ATOMS &amp;lt;br&amp;gt; &lt;br /&gt;
mass 1 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_style lj/cut/opt 3.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_coeff 1 1 1.0 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
neighbor 2.0 bin &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY THE REQUIRED THERMODYNAMIC STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable T equal 2.0 &amp;lt;br&amp;gt; &lt;br /&gt;
variable p equal 2.5 &amp;lt;br&amp;gt; &lt;br /&gt;
variable timestep equal 0.0025 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ASSIGN ATOMIC VELOCITIES &amp;lt;br&amp;gt; &lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
SPECIFY ENSEMBLE &amp;lt;br&amp;gt; &lt;br /&gt;
timestep ${timestep} &amp;lt;br&amp;gt; &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 THERMODYNAMIC OUTPUT CONTROL &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom time etotal temp press &amp;lt;br&amp;gt; &lt;br /&gt;
thermo 10 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RECORD TRAJECTORY &amp;lt;br&amp;gt; &lt;br /&gt;
dump traj all custom 1000 output-1 id x y z &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY TIMESTEP &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RUN SIMULATION TO MELT CRYSTAL &amp;lt;br&amp;gt; &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nve &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 BRING SYSTEM TO REQUIRED STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable tdamp equal ${timestep}*100 &amp;lt;br&amp;gt; &lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &amp;lt;br&amp;gt;  &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nvt &amp;lt;br&amp;gt;  &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 MEASURE SYSTEM STATE  &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom step atoms etotal temp press density vol &amp;lt;br&amp;gt; &lt;br /&gt;
variable atoms2 equal atoms*atoms &amp;lt;br&amp;gt;   &lt;br /&gt;
variable volume equal vol&lt;br /&gt;
variable E equal etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable E2 equal etotal*etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens equal density &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens2 equal density*density &amp;lt;br&amp;gt;  &lt;br /&gt;
variable temp equal temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable temp2 equal temp*temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable press equal press &amp;lt;br&amp;gt; &lt;br /&gt;
variable press2 equal press*press &amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_E2 v_E&lt;br /&gt;
run 100000 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
variable HC equal ${atoms2}*(f_aves[7] - f_aves[8]*f_aves[8])/f_aves[5] &amp;lt;br&amp;gt;  &lt;br /&gt;
variable avedens equal f_aves[1] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avetemp equal f_aves[2] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avepress equal f_aves[3] &amp;lt;br&amp;gt; &lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3]) &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;--------&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Temperature: ${temp}&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Heat capacity: ${HC}&amp;quot;  &amp;lt;br&amp;gt;  &lt;br /&gt;
print &amp;quot;atoms&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
print &amp;quot;volume: ${volume}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The following equation was then used to calculate heat capacity from the results:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C_V = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[File:Heat capacity with T.png|x400px|thumb|Heat Capacity Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a fixed number of particles, &amp;lt;math&amp;gt; N &amp;lt;/math&amp;gt;, a larger density is indicative of a smaller volume (the particles occupy a large space). That is why the plot of &amp;lt;math&amp;gt;Cv/V Vrs T&amp;lt;/math&amp;gt; generally lies at a higher values for a density of 0.8. &lt;br /&gt;
&lt;br /&gt;
From both plots it can been seen that heat capacity increases with temperature.  &amp;lt;math&amp;gt; Var[E] &amp;lt;/math&amp;gt; increases with temp as at higher temp there are a greater number of accessible rotational, vibration, electronic and kinetic energetic states therefore the system is able to to absorb more energy per rise in temperature.&lt;br /&gt;
&lt;br /&gt;
= Structural Properties and the Radial Distribution function =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:G(r).png|x300px|thumb|RDF at different phases|left]]&lt;br /&gt;
! [[File:Integral.png|x300px|thumb|Integral of g(r)|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To carry out the RDF calculations temperature was kept constant at 1.2 but density was varied. &lt;br /&gt;
&lt;br /&gt;
Density in reduced units used for each phase: &lt;br /&gt;
&lt;br /&gt;
* Gas = 0.05&lt;br /&gt;
* Liquid = 0.8 &lt;br /&gt;
* Solid = 1.2&lt;br /&gt;
&lt;br /&gt;
The number of peaks for each RDF plot decreases in the order gas&amp;lt;liquid&amp;lt;solid. This reflects the ordering of each phase. &lt;br /&gt;
A gas has a large degree of disorder and thus produces only peak.&lt;br /&gt;
The liquid has three peaks which gradually decrease in amplitude, this behavior is due to the fact that the liquid is modeled as central molecule surrounded by shells of other molecules, this initially creates some degree of order. As the simulation continues the molecules become more diffuse so the ordering decreases and thus the amplitude of peaks decrease.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Solid nearest coordination.png|x400px|centre]]&lt;br /&gt;
&lt;br /&gt;
The above plot indicates the positions of the first three peaks. These will correspond to the three closet atoms in the lattice. &lt;br /&gt;
&lt;br /&gt;
* 1.025 will correspond to one of the atoms at the corner of the unit cell neighboring the starting position.&lt;br /&gt;
* 1.525 will correspond to one of the atoms in the centre of the face of the cube. (The lattice is fcc) &lt;br /&gt;
* 1.825 will correspond to an atom on one of the faces adjacent to the starting point. It cannot be one of the adjacent corners as this would be too large thus it must fall in between the corners and therefore on a face.&lt;br /&gt;
&lt;br /&gt;
= Dynamical Properties and the diffusion coefficient = &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid.png|thumb|solid|x300px|left]]&lt;br /&gt;
! [[File:Liquid.png|thumb|liquid|x300px|centre]]&lt;br /&gt;
! [[File:Gas.png|thumb|gas|x300px|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plot give insight into the displacement of particles as they illustrate &#039;&#039;&#039;mean square displacement&#039;&#039;&#039; with time. There are variations in the shape of the lines for the large number of atoms and small number of atoms, this is due to the variations in positions being averaged for a large number of atoms and thus gives a better indication of the behavior of the system. The difference is very apparent for solid where one can see that the line is much more smooth in the region where the gradient becomes close to 0. &lt;br /&gt;
&lt;br /&gt;
The diffusion constant D was found by calculating the gradient of the line for each phase. The gradient after the line had leveled off was used for the solid.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 0.0304&lt;br /&gt;
| 0.0305&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| 0.001&lt;br /&gt;
| 0.0012 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| &amp;lt;math&amp;gt; 6 x 10^{-8} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 7 x 10^{-9} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There is a gradual decrease in D in the order solid&amp;lt;liquid&amp;lt;gas. This fits out chemical intuition; e.g. the motion of a solid would be much more restricted that the motion of a gas.  &lt;br /&gt;
&lt;br /&gt;
[[File:VACFvrsTS.png|x400px|thumb|VACF vrs Temperature|centre]]&lt;br /&gt;
&lt;br /&gt;
Minima in the VACF plot correspond to points where the atoms collide and change direction. The greater number of minima for a solid is due to the restricted mean square displacement in which the atoms can move, this therefore results in greater collisions as the atoms seek to minimize their potential energy. As a liquid has a greater diffusion coefficient it is able to diffuse away from an atom after a collision, this is why there are fewer minima, the line tends to 0 as the atoms eventually move in opposite directions resulting in velocities cancelling out and therefor the integration becomes 0. The harmonic oscillator is simply a mathematical function without physical meaning therefore it will continue to oscillate around 0 until infinity. &lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function for a 1D harmonic oscillator can be evaluated using the equation for a 1D harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiation of the displacement function will produce a velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx}{dt} = -A\omega\sin\left(\omega t + \phi\right) = v(t) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substitution into velocity autocorrelation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling -A\omega: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right)\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trigometric relation can simplify equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin\left(\omega t + \omega\tau + \phi\right) = cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integration of ansymmetical function results in 0:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} sin(x)cos(x)\mathrm{d}t = 0 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Thus after &amp;lt;math&amp;gt;cos(t\omega) &amp;lt;/math&amp;gt;is removed from top line the equation simplifies to: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(t\omega) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Vapourphse.png|thumb|Vapour Phase|x300px|left]]&lt;br /&gt;
! [[File:Vapour phase 1 million.png|thumb|Vapour Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid(small).png|thumb|Solid Phase|x300px|left]]&lt;br /&gt;
! [[File:Solid1million.png|thumb|Solid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Liquidsmallno..png|thumb|Liquid Phase|x300px|left]]&lt;br /&gt;
! [[File:Liquid1millionatoms.png|thumb|Liquid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 1.64&lt;br /&gt;
| 1.63&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| -0.2215&lt;br /&gt;
| 0.157 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| 0.254&lt;br /&gt;
| -0.123&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the trapezium rule to calculate D from a VACF plot yeilded a similar trend in diffusion coefficients however there was a discrepancy in one of my results. The value of D for a liquid of small number of atoms was smaller and more negative than the solid. This indictaes that using the MSD method is more accurate than VACF. This also indicates that it is more important to use the VACF plot for a large system when calculating D.&lt;br /&gt;
&lt;br /&gt;
= References = &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Mark Klarpus, Gregory A. Petsko, (1990) &#039;&#039;Molecular Reaction Dynamics in Biology&#039;&#039;, &#039;&#039;&#039;347&#039;&#039;&#039;, 631-9, doi:10.1038/347631a0&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=579796</id>
		<title>Rep:Thermomp4114</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=579796"/>
		<updated>2017-02-01T14:33:32Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: /* Calculating Heat Capacities Using Statistic Physics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Molecular Dynamics Simulations of Simple Liquids Introduction == &lt;br /&gt;
&lt;br /&gt;
Molecular dynamic simulations involved studying the motion of a system of particles. Several fundamental elements of a system need to be known in order to achieve this. This includes a knowledge of the interaction potential for the particles and the equations of motion which govern the dynamics of the particles.&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt; Once we know the positions, velocities, and forces, of the atoms (which are obtained using statistical) we can calculate various thermodynamic quantities of the system such as temperature and pressure. We must introduce a series of approximations in order for the caluculations to be feasible. Firstly we apply the &#039;&#039;&#039;The Classical Particle Approximation&#039;&#039;&#039;. The schoedinger equation is too complex to solve for a large system of atoms, however if the atoms are treated classically then the positions and and velocities of each can atom can be calculated using Newton&#039;s second law (equation 1): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = m_i \mathbf{a}_i = m_i \frac{\mathrm{d}\mathbf{v}_i}{\mathrm{d}t} = m_i \frac{\mathrm{d}^2 \mathbf{x}_i}{\mathrm{d}t^2} \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As there are N atoms and therefore N equations representing each atom a computer is a necessity. The &#039;&#039;&#039;Verlet algorithim&#039;&#039;&#039; is used to solve to Newton&#039;s law for all the atoms in the system. In this case time is not continuous but is made discrete, the simulation is thus broeken up into specific &#039;&#039;&#039;timesteps&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The position of atom &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;\mathbf{x}_i \left(t\right)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Positional Verlet algorithim (equation (2)): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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 \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Velocity Verlet algorithim (equation (3)):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{v}_i \left(t\right)&amp;lt;/math&amp;gt; represents the velocity of that atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;center&amp;gt;&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 \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Put in example of industrial applications&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Harmonic Oscillator ===&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator illustrates the the accuracy and discrepancies associated with using the velocity Verlet algorithim. Equation (4) is used to model the behavior of the harmonic oscillator in an analytical sense: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)\ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; = 1.00 &lt;br /&gt;
&lt;br /&gt;
Graph (1) illustrates the results the analytical solution gave for the relationship between position and time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Avrsxt2.png|x300px|thumb|Graph 1: Analytical solution of harmonic oscillator|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The difference in position between the velocity-verlet solution and analytical solution is represented by an error. Error plotted against time is illustrated by graph (2). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ErrorvrsT.png|x300px|thumb|Graph 2: Error vrs Time|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The orange line illustrates the positive trend between error and time. This shows that error is accumulative with time. Each timestep represents a calculation which has an associated error thus as the simulation proceeds the errors will be summed. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy of the system will consist of the sum of kinetic and potential energy. Equation (5) can be used to find kinetic energy of the system:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;E_\text{k} =\tfrac{1}{2} mv(t)^2 \ \ (5)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\mathbf{x} \left(t\right)&amp;lt;/math&amp;gt; is used in equation (5) the potential energy can be found. &lt;br /&gt;
&lt;br /&gt;
The following graphs represent the difference in change in energy with time when the timestep is varied. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EvrsTime.png|x200px|thumb|Energy change when a timestep of 0.1 is used|left]]&lt;br /&gt;
! [[File:Energy vrs time for 0.15 timestep.png|x200px|thumb|Energy change when a timestep of 0.15 is used|centre]]&lt;br /&gt;
! [[File:Energy vrs time for 0.2 timestep.png|x200px|thumb|Energy change when a timestep of 0.2 is used|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The maximum change in energy for each of the different timesteps is shown in table (1). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | Timestep&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.1&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.15&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.2&lt;br /&gt;
|-&lt;br /&gt;
| Max. change in Energy&lt;br /&gt;
| 0.2%&lt;br /&gt;
| 0.6%&lt;br /&gt;
| 1%&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results clearly indicate that a timestep greater than &#039;&#039;&#039;0.2&#039;&#039;&#039; will result in an energy change greater than 1%. As the timestep increases as does the maximum error. The timestep defines the number of calculations made in a given time, therefore the shorter the timestep the larger the number of calculations carried out and therefore a more accurate result is produced. The total energy of a real physical system should not change, when modeled numerically there can be fluctuations therefore it is important to monitor this change and ensure that the fluctuations are minimised.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces ===&lt;br /&gt;
&lt;br /&gt;
The forces an atom experiences is determined by the positions of all the atoms in the system, &amp;lt;math&amp;gt;\mathbf{r}^N&amp;lt;/math&amp;gt;. The Lennard-Jones function accurately sums all the key inter-atomic forces an atoms experiences (U). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ (10)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
For a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After division by 4 and rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_0^{6}} = \frac{\sigma^{6}}{r_0^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After further rearrangement and cancelling down: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;-\sigma &amp;lt;/math&amp;gt; is also a solution however this can be disregarded. &lt;br /&gt;
&lt;br /&gt;
In order to calculate the force the following equation is used: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\sigma\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After differentiation and simplification: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}(r_0) =  \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At equilibrium: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{12\sigma^{12}}{r_e^{13}} - \frac{6\sigma^6}{r_e^7} \right)&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
After rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_e = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This value of &amp;lt;math&amp;gt; r_e &amp;lt;/math&amp;gt; can now be used to find the well depth:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{\sigma^{12}}{4sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon\left(\frac{1}{5r^{5}} - \frac{1}{11r^11} \right)^\infty_2 \simeq -2.48 \sdot 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -8.18 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -3.29 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
* No. of moles in  1 mL of water = 0.056 &amp;lt;br&amp;gt; &lt;br /&gt;
* No. of molecules = moles x Avogadro&#039;s constant = 3.37 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*1000 molecules = 1.66 x 10&amp;lt;sup&amp;gt;21&amp;lt;/sup&amp;gt; moles&lt;br /&gt;
* Density = mass/vol. = 1 &lt;br /&gt;
*vol. = mass/density = 2.99 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Due to periodic boundary condition once the atom leaves the current box it will enter the beginning of an identical box. The atom is at &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; and thus once it breaches 0.5 in a particular direction it will be at the start of the next box. Using these principles after the atom moves &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will be at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units === &lt;br /&gt;
&lt;br /&gt;
Reduced units are applied to the Lennard-Jones equation to make the calculation more managable.&lt;br /&gt;
&lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For argon:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Distance in real units: r = 1.09 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Well depth = &amp;lt;math&amp;gt;{\epsilon}&amp;lt;/math&amp;gt; = 0.996 KJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* T = 180 K&lt;br /&gt;
&lt;br /&gt;
= Equilibriation = &lt;br /&gt;
&lt;br /&gt;
=== Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
As there is a large number of atoms in a discrete volume allowing random assignment of positions could result in atoms overlapping. This would cause an unrealistically high potential as potential is distance dependant (as observed in the Lennard - Jones equation).&lt;br /&gt;
&lt;br /&gt;
* Density is given by the following equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{n}{v} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 1 (as there is only 1 atom per unit cell) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = 1.07722^3 = 1.25 &amp;lt;/math&amp;gt; (lattice spacing = 1.07722) &lt;br /&gt;
&lt;br /&gt;
Thus: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length of a side of one fcc unit cell with number density 1.2 would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = \frac{n}{\rho} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 4 (as there is 4 atoms per unit cell in an fcc lattice) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; = 3.33&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; l = v^{-3} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The number of atoms that would be created by the create_atoms command for an fcc lattice would be: &lt;br /&gt;
&lt;br /&gt;
4 x 1000 = 4000 &lt;br /&gt;
&lt;br /&gt;
This is due to fact that there is 1 atom per unit cell that yeilds 1000 altogether in simple cubic. Fcc has 4 times the number of atoms per unit cell. &lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of Atoms === &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command above has the following purpose: &lt;br /&gt;
&lt;br /&gt;
* The first line sets the mass of all atoms of type &#039;1&#039; to 1.0. &lt;br /&gt;
*  Line 2 is used to control the Lennard-Jones potential. The value of 3.0 indicates the distance in reduced units upon which the potential is calculated. The potential is distance dependent and falls to 0 at large values of r thus only atoms within a distance of 3.0 are considered.  &#039;lj/cut&#039; defines the cut off point. &lt;br /&gt;
* The last line defines the force field constants as 1.0 for all sets of atoms. The * controls the fact that the command is set for all atoms. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet is the integration algorithm that can be used when &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; are defined. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The codes is in place to ensure that the timestep can be varied but the total time taken for the simulation to run will not change.&lt;br /&gt;
&lt;br /&gt;
=== Checking equilibration === &lt;br /&gt;
&lt;br /&gt;
The graphs below illustrate the time it takes for different thermodynamic properties to equilibriate at a timestep of 0.001. The plateau represents the point at which equilibration is achieved. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EnergyVRStime.png|x300px|thumb|Energy Vrs Time|left]]&lt;br /&gt;
! [[File:TEMPvrsTIME.png|x300px|thumb|Temp vrs Time|centre]]&lt;br /&gt;
! [[File:Press Vrs Time.png|x300px|thumb|Pressure Vrs Time|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The graph below illustrates the effect changing the timestep has on equilibration. As can be seen from the graph a from below 0.01 a shorter timestep results in a lower energy value for equilibration until 0.0025 where the value   of equilibration does not change with lower timestep. This trend is due to the fact that a smaller timestep results in a more accurate result however if it is too small this can over-complicate the calculation (especially when there is a large over-all time). Thus a timestep of 0.0025 is a good balance and therefore ideal. A timestep of 0.025 is too large and results in the system not reaching equilibrium.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EnergyVtimeFORVTS.png|x400px|thumb|Energy Vrs Time with different timesteps|centre]]&lt;br /&gt;
&lt;br /&gt;
= Running Simulations Under Specific Conditions =&lt;br /&gt;
&lt;br /&gt;
The following two equations can be used to define the energy of the system: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The instantaneous tempertaure &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will not remain constant throughout the simulation and will fluctuate, it will thus be different to out target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The value of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2} = \frac{\mathfrak{T}}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within the preceding code: &lt;br /&gt;
&lt;br /&gt;
100 - Nevery: This command results in a sample being taken every 100 steps and being incorporated into the average. 1000 - Nrepreat: Tells the computer how many samples should be used to calculate the average. Nfreq 10 000: At every 10000th timestep an average is calculated. &lt;br /&gt;
&lt;br /&gt;
All thermodynamic properties are calculated by averages that is the necessity for those commands.&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equation of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:DENSITYvrsT.png|x400px|thumb|Density Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
The densities produced from the simulation are lower than for the ideal gas. This is a result of the simulation creating a more realistic picture of how the atoms interact as it takes into account Lennard-Jones potential. In an ideal gas the motion of atoms will be random, chaotic and inter atomic interactions are ignored however in the simulation the atoms will want to minimize their potential and therefore this will drive them to occupy a greater volume thus reducing the density.&lt;br /&gt;
&lt;br /&gt;
= Calculating Heat Capacities Using Statistic Physics =&lt;br /&gt;
&lt;br /&gt;
Example of input code used: &lt;br /&gt;
&lt;br /&gt;
* Density 0.2&lt;br /&gt;
* Temperature 2.0 &lt;br /&gt;
&lt;br /&gt;
 variable density equal 0.2&lt;br /&gt;
 DEFINE SIMULATION BOX GEOMETRY &amp;lt;br&amp;gt; &lt;br /&gt;
lattice sc ${density} &amp;lt;br&amp;gt; &lt;br /&gt;
region box block 0 15 0 15 0 15 &amp;lt;br&amp;gt; &lt;br /&gt;
create_box 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
create_atoms 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
DEFINE PHYSICAL PROPERTIES OF ATOMS &amp;lt;br&amp;gt; &lt;br /&gt;
mass 1 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_style lj/cut/opt 3.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_coeff 1 1 1.0 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
neighbor 2.0 bin &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY THE REQUIRED THERMODYNAMIC STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable T equal 2.0 &amp;lt;br&amp;gt; &lt;br /&gt;
variable p equal 2.5 &amp;lt;br&amp;gt; &lt;br /&gt;
variable timestep equal 0.0025 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ASSIGN ATOMIC VELOCITIES &amp;lt;br&amp;gt; &lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
SPECIFY ENSEMBLE &amp;lt;br&amp;gt; &lt;br /&gt;
timestep ${timestep} &amp;lt;br&amp;gt; &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 THERMODYNAMIC OUTPUT CONTROL &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom time etotal temp press &amp;lt;br&amp;gt; &lt;br /&gt;
thermo 10 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RECORD TRAJECTORY &amp;lt;br&amp;gt; &lt;br /&gt;
dump traj all custom 1000 output-1 id x y z &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY TIMESTEP &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RUN SIMULATION TO MELT CRYSTAL &amp;lt;br&amp;gt; &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nve &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 BRING SYSTEM TO REQUIRED STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable tdamp equal ${timestep}*100 &amp;lt;br&amp;gt; &lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &amp;lt;br&amp;gt;  &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nvt &amp;lt;br&amp;gt;  &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 MEASURE SYSTEM STATE  &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom step atoms etotal temp press density vol &amp;lt;br&amp;gt; &lt;br /&gt;
variable atoms2 equal atoms*atoms &amp;lt;br&amp;gt;   &lt;br /&gt;
variable volume equal vol&lt;br /&gt;
variable E equal etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable E2 equal etotal*etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens equal density &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens2 equal density*density &amp;lt;br&amp;gt;  &lt;br /&gt;
variable temp equal temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable temp2 equal temp*temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable press equal press &amp;lt;br&amp;gt; &lt;br /&gt;
variable press2 equal press*press &amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_E2 v_E&lt;br /&gt;
run 100000 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
variable HC equal ${atoms2}*(f_aves[7] - f_aves[8]*f_aves[8])/f_aves[5] &amp;lt;br&amp;gt;  &lt;br /&gt;
variable avedens equal f_aves[1] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avetemp equal f_aves[2] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avepress equal f_aves[3] &amp;lt;br&amp;gt; &lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3]) &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;--------&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Temperature: ${temp}&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Heat capacity: ${HC}&amp;quot;  &amp;lt;br&amp;gt;  &lt;br /&gt;
print &amp;quot;atoms&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
print &amp;quot;volume: ${volume}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The following equation was then used to calculate heat capacity from the results:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{Var}\left[E\right]}{k_B T^2} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[File:Heat capacity with T.png|x400px|thumb|Heat Capacity Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a fixed number of particles, &amp;lt;math&amp;gt; N &amp;lt;/math&amp;gt;, a larger density is indicative of a smaller volume (the particles occupy a large space). That is why the plot of &amp;lt;math&amp;gt;Cv/V Vrs T&amp;lt;/math&amp;gt; generally lies at a higher values for a density of 0.8. &lt;br /&gt;
&lt;br /&gt;
From both plots it can been seen that heat capacity increases with temperature.  &amp;lt;math&amp;gt; Var[E] &amp;lt;/math&amp;gt; increases with temp as at higher temp there are a greater number of accessible rotational, vibration, electronic and kinetic energetic states therefore the system is able to to absorb more energy per rise in temperature.&lt;br /&gt;
&lt;br /&gt;
= Structural Properties and the Radial Distribution function =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:G(r).png|x300px|thumb|RDF at different phases|left]]&lt;br /&gt;
! [[File:Integral.png|x300px|thumb|Integral of g(r)|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To carry out the RDF calculations temperature was kept constant at 1.2 but density was varied. &lt;br /&gt;
&lt;br /&gt;
Density in reduced units used for each phase: &lt;br /&gt;
&lt;br /&gt;
* Gas = 0.05&lt;br /&gt;
* Liquid = 0.8 &lt;br /&gt;
* Solid = 1.2&lt;br /&gt;
&lt;br /&gt;
The number of peaks for each RDF plot decreases in the order gas&amp;lt;liquid&amp;lt;solid. This reflects the ordering of each phase. &lt;br /&gt;
A gas has a large degree of disorder and thus produces only peak.&lt;br /&gt;
The liquid has three peaks which gradually decrease in amplitude, this behavior is due to the fact that the liquid is modeled as central molecule surrounded by shells of other molecules, this initially creates some degree of order. As the simulation continues the molecules become more diffuse so the ordering decreases and thus the amplitude of peaks decrease.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Solid nearest coordination.png|x400px|centre]]&lt;br /&gt;
&lt;br /&gt;
The above plot indicates the positions of the first three peaks. These will correspond to the three closet atoms in the lattice. &lt;br /&gt;
&lt;br /&gt;
* 1.025 will correspond to one of the atoms at the corner of the unit cell neighboring the starting position.&lt;br /&gt;
* 1.525 will correspond to one of the atoms in the centre of the face of the cube. (The lattice is fcc) &lt;br /&gt;
* 1.825 will correspond to an atom on one of the faces adjacent to the starting point. It cannot be one of the adjacent corners as this would be too large thus it must fall in between the corners and therefore on a face.&lt;br /&gt;
&lt;br /&gt;
= Dynamical Properties and the diffusion coefficient = &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid.png|thumb|solid|x300px|left]]&lt;br /&gt;
! [[File:Liquid.png|thumb|liquid|x300px|centre]]&lt;br /&gt;
! [[File:Gas.png|thumb|gas|x300px|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plot give insight into the displacement of particles as they illustrate &#039;&#039;&#039;mean square displacement&#039;&#039;&#039; with time. There are variations in the shape of the lines for the large number of atoms and small number of atoms, this is due to the variations in positions being averaged for a large number of atoms and thus gives a better indication of the behavior of the system. The difference is very apparent for solid where one can see that the line is much more smooth in the region where the gradient becomes close to 0. &lt;br /&gt;
&lt;br /&gt;
The diffusion constant D was found by calculating the gradient of the line for each phase. The gradient after the line had leveled off was used for the solid.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 0.0304&lt;br /&gt;
| 0.0305&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| 0.001&lt;br /&gt;
| 0.0012 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| &amp;lt;math&amp;gt; 6 x 10^{-8} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 7 x 10^{-9} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There is a gradual decrease in D in the order solid&amp;lt;liquid&amp;lt;gas. This fits out chemical intuition; e.g. the motion of a solid would be much more restricted that the motion of a gas.  &lt;br /&gt;
&lt;br /&gt;
[[File:VACFvrsTS.png|x400px|thumb|VACF vrs Temperature|centre]]&lt;br /&gt;
&lt;br /&gt;
Minima in the VACF plot correspond to points where the atoms collide and change direction. The greater number of minima for a solid is due to the restricted mean square displacement in which the atoms can move, this therefore results in greater collisions as the atoms seek to minimize their potential energy. As a liquid has a greater diffusion coefficient it is able to diffuse away from an atom after a collision, this is why there are fewer minima, the line tends to 0 as the atoms eventually move in opposite directions resulting in velocities cancelling out and therefor the integration becomes 0. The harmonic oscillator is simply a mathematical function without physical meaning therefore it will continue to oscillate around 0 until infinity. &lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function for a 1D harmonic oscillator can be evaluated using the equation for a 1D harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiation of the displacement function will produce a velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx}{dt} = -A\omega\sin\left(\omega t + \phi\right) = v(t) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substitution into velocity autocorrelation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling -A\omega: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right)\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trigometric relation can simplify equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin\left(\omega t + \omega\tau + \phi\right) = cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integration of ansymmetical function results in 0:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} sin(x)cos(x)\mathrm{d}t = 0 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Thus after &amp;lt;math&amp;gt;cos(t\omega) &amp;lt;/math&amp;gt;is removed from top line the equation simplifies to: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(t\omega) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Vapourphse.png|thumb|Vapour Phase|x300px|left]]&lt;br /&gt;
! [[File:Vapour phase 1 million.png|thumb|Vapour Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid(small).png|thumb|Solid Phase|x300px|left]]&lt;br /&gt;
! [[File:Solid1million.png|thumb|Solid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Liquidsmallno..png|thumb|Liquid Phase|x300px|left]]&lt;br /&gt;
! [[File:Liquid1millionatoms.png|thumb|Liquid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 1.64&lt;br /&gt;
| 1.63&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| -0.2215&lt;br /&gt;
| 0.157 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| 0.254&lt;br /&gt;
| -0.123&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the trapezium rule to calculate D from a VACF plot yeilded a similar trend in diffusion coefficients however there was a discrepancy in one of my results. The value of D for a liquid of small number of atoms was smaller and more negative than the solid. This indictaes that using the MSD method is more accurate than VACF. This also indicates that it is more important to use the VACF plot for a large system when calculating D.&lt;br /&gt;
&lt;br /&gt;
= References = &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Mark Klarpus, Gregory A. Petsko, (1990) &#039;&#039;Molecular Reaction Dynamics in Biology&#039;&#039;, &#039;&#039;&#039;347&#039;&#039;&#039;, 631-9, doi:10.1038/347631a0&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=579795</id>
		<title>Rep:Thermomp4114</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=579795"/>
		<updated>2017-02-01T14:19:59Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: /* Calculating Heat Capacities Using Statistic Physics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Molecular Dynamics Simulations of Simple Liquids Introduction == &lt;br /&gt;
&lt;br /&gt;
Molecular dynamic simulations involved studying the motion of a system of particles. Several fundamental elements of a system need to be known in order to achieve this. This includes a knowledge of the interaction potential for the particles and the equations of motion which govern the dynamics of the particles.&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt; Once we know the positions, velocities, and forces, of the atoms (which are obtained using statistical) we can calculate various thermodynamic quantities of the system such as temperature and pressure. We must introduce a series of approximations in order for the caluculations to be feasible. Firstly we apply the &#039;&#039;&#039;The Classical Particle Approximation&#039;&#039;&#039;. The schoedinger equation is too complex to solve for a large system of atoms, however if the atoms are treated classically then the positions and and velocities of each can atom can be calculated using Newton&#039;s second law (equation 1): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = m_i \mathbf{a}_i = m_i \frac{\mathrm{d}\mathbf{v}_i}{\mathrm{d}t} = m_i \frac{\mathrm{d}^2 \mathbf{x}_i}{\mathrm{d}t^2} \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As there are N atoms and therefore N equations representing each atom a computer is a necessity. The &#039;&#039;&#039;Verlet algorithim&#039;&#039;&#039; is used to solve to Newton&#039;s law for all the atoms in the system. In this case time is not continuous but is made discrete, the simulation is thus broeken up into specific &#039;&#039;&#039;timesteps&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The position of atom &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;\mathbf{x}_i \left(t\right)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Positional Verlet algorithim (equation (2)): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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 \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Velocity Verlet algorithim (equation (3)):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{v}_i \left(t\right)&amp;lt;/math&amp;gt; represents the velocity of that atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;center&amp;gt;&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 \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Put in example of industrial applications&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Harmonic Oscillator ===&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator illustrates the the accuracy and discrepancies associated with using the velocity Verlet algorithim. Equation (4) is used to model the behavior of the harmonic oscillator in an analytical sense: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)\ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; = 1.00 &lt;br /&gt;
&lt;br /&gt;
Graph (1) illustrates the results the analytical solution gave for the relationship between position and time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Avrsxt2.png|x300px|thumb|Graph 1: Analytical solution of harmonic oscillator|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The difference in position between the velocity-verlet solution and analytical solution is represented by an error. Error plotted against time is illustrated by graph (2). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ErrorvrsT.png|x300px|thumb|Graph 2: Error vrs Time|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The orange line illustrates the positive trend between error and time. This shows that error is accumulative with time. Each timestep represents a calculation which has an associated error thus as the simulation proceeds the errors will be summed. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy of the system will consist of the sum of kinetic and potential energy. Equation (5) can be used to find kinetic energy of the system:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;E_\text{k} =\tfrac{1}{2} mv(t)^2 \ \ (5)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\mathbf{x} \left(t\right)&amp;lt;/math&amp;gt; is used in equation (5) the potential energy can be found. &lt;br /&gt;
&lt;br /&gt;
The following graphs represent the difference in change in energy with time when the timestep is varied. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EvrsTime.png|x200px|thumb|Energy change when a timestep of 0.1 is used|left]]&lt;br /&gt;
! [[File:Energy vrs time for 0.15 timestep.png|x200px|thumb|Energy change when a timestep of 0.15 is used|centre]]&lt;br /&gt;
! [[File:Energy vrs time for 0.2 timestep.png|x200px|thumb|Energy change when a timestep of 0.2 is used|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The maximum change in energy for each of the different timesteps is shown in table (1). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | Timestep&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.1&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.15&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.2&lt;br /&gt;
|-&lt;br /&gt;
| Max. change in Energy&lt;br /&gt;
| 0.2%&lt;br /&gt;
| 0.6%&lt;br /&gt;
| 1%&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results clearly indicate that a timestep greater than &#039;&#039;&#039;0.2&#039;&#039;&#039; will result in an energy change greater than 1%. As the timestep increases as does the maximum error. The timestep defines the number of calculations made in a given time, therefore the shorter the timestep the larger the number of calculations carried out and therefore a more accurate result is produced. The total energy of a real physical system should not change, when modeled numerically there can be fluctuations therefore it is important to monitor this change and ensure that the fluctuations are minimised.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces ===&lt;br /&gt;
&lt;br /&gt;
The forces an atom experiences is determined by the positions of all the atoms in the system, &amp;lt;math&amp;gt;\mathbf{r}^N&amp;lt;/math&amp;gt;. The Lennard-Jones function accurately sums all the key inter-atomic forces an atoms experiences (U). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ (10)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
For a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After division by 4 and rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_0^{6}} = \frac{\sigma^{6}}{r_0^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After further rearrangement and cancelling down: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;-\sigma &amp;lt;/math&amp;gt; is also a solution however this can be disregarded. &lt;br /&gt;
&lt;br /&gt;
In order to calculate the force the following equation is used: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\sigma\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After differentiation and simplification: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}(r_0) =  \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At equilibrium: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{12\sigma^{12}}{r_e^{13}} - \frac{6\sigma^6}{r_e^7} \right)&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
After rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_e = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This value of &amp;lt;math&amp;gt; r_e &amp;lt;/math&amp;gt; can now be used to find the well depth:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{\sigma^{12}}{4sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon\left(\frac{1}{5r^{5}} - \frac{1}{11r^11} \right)^\infty_2 \simeq -2.48 \sdot 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -8.18 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -3.29 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
* No. of moles in  1 mL of water = 0.056 &amp;lt;br&amp;gt; &lt;br /&gt;
* No. of molecules = moles x Avogadro&#039;s constant = 3.37 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*1000 molecules = 1.66 x 10&amp;lt;sup&amp;gt;21&amp;lt;/sup&amp;gt; moles&lt;br /&gt;
* Density = mass/vol. = 1 &lt;br /&gt;
*vol. = mass/density = 2.99 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Due to periodic boundary condition once the atom leaves the current box it will enter the beginning of an identical box. The atom is at &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; and thus once it breaches 0.5 in a particular direction it will be at the start of the next box. Using these principles after the atom moves &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will be at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units === &lt;br /&gt;
&lt;br /&gt;
Reduced units are applied to the Lennard-Jones equation to make the calculation more managable.&lt;br /&gt;
&lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For argon:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Distance in real units: r = 1.09 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Well depth = &amp;lt;math&amp;gt;{\epsilon}&amp;lt;/math&amp;gt; = 0.996 KJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* T = 180 K&lt;br /&gt;
&lt;br /&gt;
= Equilibriation = &lt;br /&gt;
&lt;br /&gt;
=== Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
As there is a large number of atoms in a discrete volume allowing random assignment of positions could result in atoms overlapping. This would cause an unrealistically high potential as potential is distance dependant (as observed in the Lennard - Jones equation).&lt;br /&gt;
&lt;br /&gt;
* Density is given by the following equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{n}{v} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 1 (as there is only 1 atom per unit cell) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = 1.07722^3 = 1.25 &amp;lt;/math&amp;gt; (lattice spacing = 1.07722) &lt;br /&gt;
&lt;br /&gt;
Thus: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length of a side of one fcc unit cell with number density 1.2 would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = \frac{n}{\rho} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 4 (as there is 4 atoms per unit cell in an fcc lattice) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; = 3.33&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; l = v^{-3} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The number of atoms that would be created by the create_atoms command for an fcc lattice would be: &lt;br /&gt;
&lt;br /&gt;
4 x 1000 = 4000 &lt;br /&gt;
&lt;br /&gt;
This is due to fact that there is 1 atom per unit cell that yeilds 1000 altogether in simple cubic. Fcc has 4 times the number of atoms per unit cell. &lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of Atoms === &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command above has the following purpose: &lt;br /&gt;
&lt;br /&gt;
* The first line sets the mass of all atoms of type &#039;1&#039; to 1.0. &lt;br /&gt;
*  Line 2 is used to control the Lennard-Jones potential. The value of 3.0 indicates the distance in reduced units upon which the potential is calculated. The potential is distance dependent and falls to 0 at large values of r thus only atoms within a distance of 3.0 are considered.  &#039;lj/cut&#039; defines the cut off point. &lt;br /&gt;
* The last line defines the force field constants as 1.0 for all sets of atoms. The * controls the fact that the command is set for all atoms. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet is the integration algorithm that can be used when &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; are defined. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The codes is in place to ensure that the timestep can be varied but the total time taken for the simulation to run will not change.&lt;br /&gt;
&lt;br /&gt;
=== Checking equilibration === &lt;br /&gt;
&lt;br /&gt;
The graphs below illustrate the time it takes for different thermodynamic properties to equilibriate at a timestep of 0.001. The plateau represents the point at which equilibration is achieved. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EnergyVRStime.png|x300px|thumb|Energy Vrs Time|left]]&lt;br /&gt;
! [[File:TEMPvrsTIME.png|x300px|thumb|Temp vrs Time|centre]]&lt;br /&gt;
! [[File:Press Vrs Time.png|x300px|thumb|Pressure Vrs Time|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The graph below illustrates the effect changing the timestep has on equilibration. As can be seen from the graph a from below 0.01 a shorter timestep results in a lower energy value for equilibration until 0.0025 where the value   of equilibration does not change with lower timestep. This trend is due to the fact that a smaller timestep results in a more accurate result however if it is too small this can over-complicate the calculation (especially when there is a large over-all time). Thus a timestep of 0.0025 is a good balance and therefore ideal. A timestep of 0.025 is too large and results in the system not reaching equilibrium.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EnergyVtimeFORVTS.png|x400px|thumb|Energy Vrs Time with different timesteps|centre]]&lt;br /&gt;
&lt;br /&gt;
= Running Simulations Under Specific Conditions =&lt;br /&gt;
&lt;br /&gt;
The following two equations can be used to define the energy of the system: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The instantaneous tempertaure &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will not remain constant throughout the simulation and will fluctuate, it will thus be different to out target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The value of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2} = \frac{\mathfrak{T}}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within the preceding code: &lt;br /&gt;
&lt;br /&gt;
100 - Nevery: This command results in a sample being taken every 100 steps and being incorporated into the average. 1000 - Nrepreat: Tells the computer how many samples should be used to calculate the average. Nfreq 10 000: At every 10000th timestep an average is calculated. &lt;br /&gt;
&lt;br /&gt;
All thermodynamic properties are calculated by averages that is the necessity for those commands.&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equation of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:DENSITYvrsT.png|x400px|thumb|Density Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
The densities produced from the simulation are lower than for the ideal gas. This is a result of the simulation creating a more realistic picture of how the atoms interact as it takes into account Lennard-Jones potential. In an ideal gas the motion of atoms will be random, chaotic and inter atomic interactions are ignored however in the simulation the atoms will want to minimize their potential and therefore this will drive them to occupy a greater volume thus reducing the density.&lt;br /&gt;
&lt;br /&gt;
= Calculating Heat Capacities Using Statistic Physics =&lt;br /&gt;
&lt;br /&gt;
Example of input code used: &lt;br /&gt;
&lt;br /&gt;
* Density 0.2&lt;br /&gt;
* Temperature 2.0 &lt;br /&gt;
&lt;br /&gt;
 variable density equal 0.2&lt;br /&gt;
 DEFINE SIMULATION BOX GEOMETRY &amp;lt;br&amp;gt; &lt;br /&gt;
lattice sc ${density} &amp;lt;br&amp;gt; &lt;br /&gt;
region box block 0 15 0 15 0 15 &amp;lt;br&amp;gt; &lt;br /&gt;
create_box 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
create_atoms 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
DEFINE PHYSICAL PROPERTIES OF ATOMS &amp;lt;br&amp;gt; &lt;br /&gt;
mass 1 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_style lj/cut/opt 3.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_coeff 1 1 1.0 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
neighbor 2.0 bin &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY THE REQUIRED THERMODYNAMIC STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable T equal 2.0 &amp;lt;br&amp;gt; &lt;br /&gt;
variable p equal 2.5 &amp;lt;br&amp;gt; &lt;br /&gt;
variable timestep equal 0.0025 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ASSIGN ATOMIC VELOCITIES &amp;lt;br&amp;gt; &lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
SPECIFY ENSEMBLE &amp;lt;br&amp;gt; &lt;br /&gt;
timestep ${timestep} &amp;lt;br&amp;gt; &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 THERMODYNAMIC OUTPUT CONTROL &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom time etotal temp press &amp;lt;br&amp;gt; &lt;br /&gt;
thermo 10 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RECORD TRAJECTORY &amp;lt;br&amp;gt; &lt;br /&gt;
dump traj all custom 1000 output-1 id x y z &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY TIMESTEP &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RUN SIMULATION TO MELT CRYSTAL &amp;lt;br&amp;gt; &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nve &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 BRING SYSTEM TO REQUIRED STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable tdamp equal ${timestep}*100 &amp;lt;br&amp;gt; &lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &amp;lt;br&amp;gt;  &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nvt &amp;lt;br&amp;gt;  &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 MEASURE SYSTEM STATE  &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom step atoms etotal temp press density vol &amp;lt;br&amp;gt; &lt;br /&gt;
variable atoms2 equal atoms*atoms &amp;lt;br&amp;gt;   &lt;br /&gt;
variable volume equal vol&lt;br /&gt;
variable E equal etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable E2 equal etotal*etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens equal density &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens2 equal density*density &amp;lt;br&amp;gt;  &lt;br /&gt;
variable temp equal temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable temp2 equal temp*temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable press equal press &amp;lt;br&amp;gt; &lt;br /&gt;
variable press2 equal press*press &amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_E2 v_E&lt;br /&gt;
run 100000 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
variable HC equal ${atoms2}*(f_aves[7] - f_aves[8]*f_aves[8])/f_aves[5] &amp;lt;br&amp;gt;  &lt;br /&gt;
variable avedens equal f_aves[1] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avetemp equal f_aves[2] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avepress equal f_aves[3] &amp;lt;br&amp;gt; &lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3]) &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;--------&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Temperature: ${temp}&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Heat capacity: ${HC}&amp;quot;  &amp;lt;br&amp;gt;  &lt;br /&gt;
print &amp;quot;atoms&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
print &amp;quot;volume: ${volume}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The supercomputer was nonfunctional during part of the lab and I continually received an error message whenever trying to run the code after it was working.  &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[File:Heat capacity with T.png|x400px|thumb|Heat Capacity Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the above equation I can predict the behavior of the system. It can be seem that &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; is directly proportional to &amp;lt;math&amp;gt; N^2 &amp;lt;/math&amp;gt;/. This informs us that for a system with a fixed volume (isochoric) as the number of particles increase as the will the heat capacity. Therefore at a given temperature I believe the heat capacity will be greater for the system with a density of 0.8 than for a system with density of 0.2.&lt;br /&gt;
&lt;br /&gt;
= Structural Properties and the Radial Distribution function =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:G(r).png|x300px|thumb|RDF at different phases|left]]&lt;br /&gt;
! [[File:Integral.png|x300px|thumb|Integral of g(r)|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To carry out the RDF calculations temperature was kept constant at 1.2 but density was varied. &lt;br /&gt;
&lt;br /&gt;
Density in reduced units used for each phase: &lt;br /&gt;
&lt;br /&gt;
* Gas = 0.05&lt;br /&gt;
* Liquid = 0.8 &lt;br /&gt;
* Solid = 1.2&lt;br /&gt;
&lt;br /&gt;
The number of peaks for each RDF plot decreases in the order gas&amp;lt;liquid&amp;lt;solid. This reflects the ordering of each phase. &lt;br /&gt;
A gas has a large degree of disorder and thus produces only peak.&lt;br /&gt;
The liquid has three peaks which gradually decrease in amplitude, this behavior is due to the fact that the liquid is modeled as central molecule surrounded by shells of other molecules, this initially creates some degree of order. As the simulation continues the molecules become more diffuse so the ordering decreases and thus the amplitude of peaks decrease.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Solid nearest coordination.png|x400px|centre]]&lt;br /&gt;
&lt;br /&gt;
The above plot indicates the positions of the first three peaks. These will correspond to the three closet atoms in the lattice. &lt;br /&gt;
&lt;br /&gt;
* 1.025 will correspond to one of the atoms at the corner of the unit cell neighboring the starting position.&lt;br /&gt;
* 1.525 will correspond to one of the atoms in the centre of the face of the cube. (The lattice is fcc) &lt;br /&gt;
* 1.825 will correspond to an atom on one of the faces adjacent to the starting point. It cannot be one of the adjacent corners as this would be too large thus it must fall in between the corners and therefore on a face.&lt;br /&gt;
&lt;br /&gt;
= Dynamical Properties and the diffusion coefficient = &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid.png|thumb|solid|x300px|left]]&lt;br /&gt;
! [[File:Liquid.png|thumb|liquid|x300px|centre]]&lt;br /&gt;
! [[File:Gas.png|thumb|gas|x300px|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plot give insight into the displacement of particles as they illustrate &#039;&#039;&#039;mean square displacement&#039;&#039;&#039; with time. There are variations in the shape of the lines for the large number of atoms and small number of atoms, this is due to the variations in positions being averaged for a large number of atoms and thus gives a better indication of the behavior of the system. The difference is very apparent for solid where one can see that the line is much more smooth in the region where the gradient becomes close to 0. &lt;br /&gt;
&lt;br /&gt;
The diffusion constant D was found by calculating the gradient of the line for each phase. The gradient after the line had leveled off was used for the solid.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 0.0304&lt;br /&gt;
| 0.0305&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| 0.001&lt;br /&gt;
| 0.0012 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| &amp;lt;math&amp;gt; 6 x 10^{-8} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 7 x 10^{-9} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There is a gradual decrease in D in the order solid&amp;lt;liquid&amp;lt;gas. This fits out chemical intuition; e.g. the motion of a solid would be much more restricted that the motion of a gas.  &lt;br /&gt;
&lt;br /&gt;
[[File:VACFvrsTS.png|x400px|thumb|VACF vrs Temperature|centre]]&lt;br /&gt;
&lt;br /&gt;
Minima in the VACF plot correspond to points where the atoms collide and change direction. The greater number of minima for a solid is due to the restricted mean square displacement in which the atoms can move, this therefore results in greater collisions as the atoms seek to minimize their potential energy. As a liquid has a greater diffusion coefficient it is able to diffuse away from an atom after a collision, this is why there are fewer minima, the line tends to 0 as the atoms eventually move in opposite directions resulting in velocities cancelling out and therefor the integration becomes 0. The harmonic oscillator is simply a mathematical function without physical meaning therefore it will continue to oscillate around 0 until infinity. &lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function for a 1D harmonic oscillator can be evaluated using the equation for a 1D harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiation of the displacement function will produce a velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx}{dt} = -A\omega\sin\left(\omega t + \phi\right) = v(t) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substitution into velocity autocorrelation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling -A\omega: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right)\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trigometric relation can simplify equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin\left(\omega t + \omega\tau + \phi\right) = cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integration of ansymmetical function results in 0:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} sin(x)cos(x)\mathrm{d}t = 0 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Thus after &amp;lt;math&amp;gt;cos(t\omega) &amp;lt;/math&amp;gt;is removed from top line the equation simplifies to: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(t\omega) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Vapourphse.png|thumb|Vapour Phase|x300px|left]]&lt;br /&gt;
! [[File:Vapour phase 1 million.png|thumb|Vapour Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid(small).png|thumb|Solid Phase|x300px|left]]&lt;br /&gt;
! [[File:Solid1million.png|thumb|Solid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Liquidsmallno..png|thumb|Liquid Phase|x300px|left]]&lt;br /&gt;
! [[File:Liquid1millionatoms.png|thumb|Liquid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 1.64&lt;br /&gt;
| 1.63&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| -0.2215&lt;br /&gt;
| 0.157 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| 0.254&lt;br /&gt;
| -0.123&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the trapezium rule to calculate D from a VACF plot yeilded a similar trend in diffusion coefficients however there was a discrepancy in one of my results. The value of D for a liquid of small number of atoms was smaller and more negative than the solid. This indictaes that using the MSD method is more accurate than VACF. This also indicates that it is more important to use the VACF plot for a large system when calculating D.&lt;br /&gt;
&lt;br /&gt;
= References = &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Mark Klarpus, Gregory A. Petsko, (1990) &#039;&#039;Molecular Reaction Dynamics in Biology&#039;&#039;, &#039;&#039;&#039;347&#039;&#039;&#039;, 631-9, doi:10.1038/347631a0&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=579794</id>
		<title>Rep:Thermomp4114</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=579794"/>
		<updated>2017-02-01T14:19:02Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: /* Calculating Heat Capacities Using Statistic Physics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Molecular Dynamics Simulations of Simple Liquids Introduction == &lt;br /&gt;
&lt;br /&gt;
Molecular dynamic simulations involved studying the motion of a system of particles. Several fundamental elements of a system need to be known in order to achieve this. This includes a knowledge of the interaction potential for the particles and the equations of motion which govern the dynamics of the particles.&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt; Once we know the positions, velocities, and forces, of the atoms (which are obtained using statistical) we can calculate various thermodynamic quantities of the system such as temperature and pressure. We must introduce a series of approximations in order for the caluculations to be feasible. Firstly we apply the &#039;&#039;&#039;The Classical Particle Approximation&#039;&#039;&#039;. The schoedinger equation is too complex to solve for a large system of atoms, however if the atoms are treated classically then the positions and and velocities of each can atom can be calculated using Newton&#039;s second law (equation 1): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = m_i \mathbf{a}_i = m_i \frac{\mathrm{d}\mathbf{v}_i}{\mathrm{d}t} = m_i \frac{\mathrm{d}^2 \mathbf{x}_i}{\mathrm{d}t^2} \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As there are N atoms and therefore N equations representing each atom a computer is a necessity. The &#039;&#039;&#039;Verlet algorithim&#039;&#039;&#039; is used to solve to Newton&#039;s law for all the atoms in the system. In this case time is not continuous but is made discrete, the simulation is thus broeken up into specific &#039;&#039;&#039;timesteps&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The position of atom &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;\mathbf{x}_i \left(t\right)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Positional Verlet algorithim (equation (2)): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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 \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Velocity Verlet algorithim (equation (3)):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{v}_i \left(t\right)&amp;lt;/math&amp;gt; represents the velocity of that atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;center&amp;gt;&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 \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Put in example of industrial applications&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Harmonic Oscillator ===&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator illustrates the the accuracy and discrepancies associated with using the velocity Verlet algorithim. Equation (4) is used to model the behavior of the harmonic oscillator in an analytical sense: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)\ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; = 1.00 &lt;br /&gt;
&lt;br /&gt;
Graph (1) illustrates the results the analytical solution gave for the relationship between position and time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Avrsxt2.png|x300px|thumb|Graph 1: Analytical solution of harmonic oscillator|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The difference in position between the velocity-verlet solution and analytical solution is represented by an error. Error plotted against time is illustrated by graph (2). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ErrorvrsT.png|x300px|thumb|Graph 2: Error vrs Time|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The orange line illustrates the positive trend between error and time. This shows that error is accumulative with time. Each timestep represents a calculation which has an associated error thus as the simulation proceeds the errors will be summed. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy of the system will consist of the sum of kinetic and potential energy. Equation (5) can be used to find kinetic energy of the system:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;E_\text{k} =\tfrac{1}{2} mv(t)^2 \ \ (5)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\mathbf{x} \left(t\right)&amp;lt;/math&amp;gt; is used in equation (5) the potential energy can be found. &lt;br /&gt;
&lt;br /&gt;
The following graphs represent the difference in change in energy with time when the timestep is varied. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EvrsTime.png|x200px|thumb|Energy change when a timestep of 0.1 is used|left]]&lt;br /&gt;
! [[File:Energy vrs time for 0.15 timestep.png|x200px|thumb|Energy change when a timestep of 0.15 is used|centre]]&lt;br /&gt;
! [[File:Energy vrs time for 0.2 timestep.png|x200px|thumb|Energy change when a timestep of 0.2 is used|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The maximum change in energy for each of the different timesteps is shown in table (1). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | Timestep&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.1&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.15&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.2&lt;br /&gt;
|-&lt;br /&gt;
| Max. change in Energy&lt;br /&gt;
| 0.2%&lt;br /&gt;
| 0.6%&lt;br /&gt;
| 1%&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results clearly indicate that a timestep greater than &#039;&#039;&#039;0.2&#039;&#039;&#039; will result in an energy change greater than 1%. As the timestep increases as does the maximum error. The timestep defines the number of calculations made in a given time, therefore the shorter the timestep the larger the number of calculations carried out and therefore a more accurate result is produced. The total energy of a real physical system should not change, when modeled numerically there can be fluctuations therefore it is important to monitor this change and ensure that the fluctuations are minimised.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces ===&lt;br /&gt;
&lt;br /&gt;
The forces an atom experiences is determined by the positions of all the atoms in the system, &amp;lt;math&amp;gt;\mathbf{r}^N&amp;lt;/math&amp;gt;. The Lennard-Jones function accurately sums all the key inter-atomic forces an atoms experiences (U). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ (10)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
For a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After division by 4 and rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_0^{6}} = \frac{\sigma^{6}}{r_0^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After further rearrangement and cancelling down: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;-\sigma &amp;lt;/math&amp;gt; is also a solution however this can be disregarded. &lt;br /&gt;
&lt;br /&gt;
In order to calculate the force the following equation is used: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\sigma\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After differentiation and simplification: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}(r_0) =  \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At equilibrium: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{12\sigma^{12}}{r_e^{13}} - \frac{6\sigma^6}{r_e^7} \right)&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
After rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_e = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This value of &amp;lt;math&amp;gt; r_e &amp;lt;/math&amp;gt; can now be used to find the well depth:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{\sigma^{12}}{4sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon\left(\frac{1}{5r^{5}} - \frac{1}{11r^11} \right)^\infty_2 \simeq -2.48 \sdot 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -8.18 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -3.29 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
* No. of moles in  1 mL of water = 0.056 &amp;lt;br&amp;gt; &lt;br /&gt;
* No. of molecules = moles x Avogadro&#039;s constant = 3.37 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*1000 molecules = 1.66 x 10&amp;lt;sup&amp;gt;21&amp;lt;/sup&amp;gt; moles&lt;br /&gt;
* Density = mass/vol. = 1 &lt;br /&gt;
*vol. = mass/density = 2.99 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Due to periodic boundary condition once the atom leaves the current box it will enter the beginning of an identical box. The atom is at &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; and thus once it breaches 0.5 in a particular direction it will be at the start of the next box. Using these principles after the atom moves &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will be at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units === &lt;br /&gt;
&lt;br /&gt;
Reduced units are applied to the Lennard-Jones equation to make the calculation more managable.&lt;br /&gt;
&lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For argon:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Distance in real units: r = 1.09 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Well depth = &amp;lt;math&amp;gt;{\epsilon}&amp;lt;/math&amp;gt; = 0.996 KJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* T = 180 K&lt;br /&gt;
&lt;br /&gt;
= Equilibriation = &lt;br /&gt;
&lt;br /&gt;
=== Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
As there is a large number of atoms in a discrete volume allowing random assignment of positions could result in atoms overlapping. This would cause an unrealistically high potential as potential is distance dependant (as observed in the Lennard - Jones equation).&lt;br /&gt;
&lt;br /&gt;
* Density is given by the following equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{n}{v} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 1 (as there is only 1 atom per unit cell) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = 1.07722^3 = 1.25 &amp;lt;/math&amp;gt; (lattice spacing = 1.07722) &lt;br /&gt;
&lt;br /&gt;
Thus: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length of a side of one fcc unit cell with number density 1.2 would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = \frac{n}{\rho} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 4 (as there is 4 atoms per unit cell in an fcc lattice) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; = 3.33&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; l = v^{-3} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The number of atoms that would be created by the create_atoms command for an fcc lattice would be: &lt;br /&gt;
&lt;br /&gt;
4 x 1000 = 4000 &lt;br /&gt;
&lt;br /&gt;
This is due to fact that there is 1 atom per unit cell that yeilds 1000 altogether in simple cubic. Fcc has 4 times the number of atoms per unit cell. &lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of Atoms === &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command above has the following purpose: &lt;br /&gt;
&lt;br /&gt;
* The first line sets the mass of all atoms of type &#039;1&#039; to 1.0. &lt;br /&gt;
*  Line 2 is used to control the Lennard-Jones potential. The value of 3.0 indicates the distance in reduced units upon which the potential is calculated. The potential is distance dependent and falls to 0 at large values of r thus only atoms within a distance of 3.0 are considered.  &#039;lj/cut&#039; defines the cut off point. &lt;br /&gt;
* The last line defines the force field constants as 1.0 for all sets of atoms. The * controls the fact that the command is set for all atoms. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet is the integration algorithm that can be used when &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; are defined. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The codes is in place to ensure that the timestep can be varied but the total time taken for the simulation to run will not change.&lt;br /&gt;
&lt;br /&gt;
=== Checking equilibration === &lt;br /&gt;
&lt;br /&gt;
The graphs below illustrate the time it takes for different thermodynamic properties to equilibriate at a timestep of 0.001. The plateau represents the point at which equilibration is achieved. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EnergyVRStime.png|x300px|thumb|Energy Vrs Time|left]]&lt;br /&gt;
! [[File:TEMPvrsTIME.png|x300px|thumb|Temp vrs Time|centre]]&lt;br /&gt;
! [[File:Press Vrs Time.png|x300px|thumb|Pressure Vrs Time|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The graph below illustrates the effect changing the timestep has on equilibration. As can be seen from the graph a from below 0.01 a shorter timestep results in a lower energy value for equilibration until 0.0025 where the value   of equilibration does not change with lower timestep. This trend is due to the fact that a smaller timestep results in a more accurate result however if it is too small this can over-complicate the calculation (especially when there is a large over-all time). Thus a timestep of 0.0025 is a good balance and therefore ideal. A timestep of 0.025 is too large and results in the system not reaching equilibrium.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EnergyVtimeFORVTS.png|x400px|thumb|Energy Vrs Time with different timesteps|centre]]&lt;br /&gt;
&lt;br /&gt;
= Running Simulations Under Specific Conditions =&lt;br /&gt;
&lt;br /&gt;
The following two equations can be used to define the energy of the system: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The instantaneous tempertaure &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will not remain constant throughout the simulation and will fluctuate, it will thus be different to out target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The value of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2} = \frac{\mathfrak{T}}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within the preceding code: &lt;br /&gt;
&lt;br /&gt;
100 - Nevery: This command results in a sample being taken every 100 steps and being incorporated into the average. 1000 - Nrepreat: Tells the computer how many samples should be used to calculate the average. Nfreq 10 000: At every 10000th timestep an average is calculated. &lt;br /&gt;
&lt;br /&gt;
All thermodynamic properties are calculated by averages that is the necessity for those commands.&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equation of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:DENSITYvrsT.png|x400px|thumb|Density Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
The densities produced from the simulation are lower than for the ideal gas. This is a result of the simulation creating a more realistic picture of how the atoms interact as it takes into account Lennard-Jones potential. In an ideal gas the motion of atoms will be random, chaotic and inter atomic interactions are ignored however in the simulation the atoms will want to minimize their potential and therefore this will drive them to occupy a greater volume thus reducing the density.&lt;br /&gt;
&lt;br /&gt;
= Calculating Heat Capacities Using Statistic Physics =&lt;br /&gt;
&lt;br /&gt;
Example of input code used: &lt;br /&gt;
&lt;br /&gt;
* Density 0.2&lt;br /&gt;
* Temperature 2.0 &lt;br /&gt;
&lt;br /&gt;
 variable density equal 0.2&lt;br /&gt;
 DEFINE SIMULATION BOX GEOMETRY &amp;lt;br&amp;gt; &lt;br /&gt;
lattice sc ${density} &amp;lt;br&amp;gt; &lt;br /&gt;
region box block 0 15 0 15 0 15 &amp;lt;br&amp;gt; &lt;br /&gt;
create_box 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
create_atoms 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
DEFINE PHYSICAL PROPERTIES OF ATOMS &amp;lt;br&amp;gt; &lt;br /&gt;
mass 1 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_style lj/cut/opt 3.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_coeff 1 1 1.0 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
neighbor 2.0 bin &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY THE REQUIRED THERMODYNAMIC STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable T equal 2.0 &amp;lt;br&amp;gt; &lt;br /&gt;
variable p equal 2.5 &amp;lt;br&amp;gt; &lt;br /&gt;
variable timestep equal 0.0025 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ASSIGN ATOMIC VELOCITIES &amp;lt;br&amp;gt; &lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
SPECIFY ENSEMBLE &amp;lt;br&amp;gt; &lt;br /&gt;
timestep ${timestep} &amp;lt;br&amp;gt; &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 THERMODYNAMIC OUTPUT CONTROL &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom time etotal temp press &amp;lt;br&amp;gt; &lt;br /&gt;
thermo 10 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RECORD TRAJECTORY &amp;lt;br&amp;gt; &lt;br /&gt;
dump traj all custom 1000 output-1 id x y z &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY TIMESTEP &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RUN SIMULATION TO MELT CRYSTAL &amp;lt;br&amp;gt; &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nve &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 BRING SYSTEM TO REQUIRED STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable tdamp equal ${timestep}*100 &amp;lt;br&amp;gt; &lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &amp;lt;br&amp;gt;  &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nvt &amp;lt;br&amp;gt;  &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 MEASURE SYSTEM STATE  &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom step atoms etotal temp press density vol &amp;lt;br&amp;gt; &lt;br /&gt;
variable atoms2 equal atoms*atoms &amp;lt;br&amp;gt;   &lt;br /&gt;
variable volume equal vol&lt;br /&gt;
variable E equal etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable E2 equal etotal*etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens equal density &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens2 equal density*density &amp;lt;br&amp;gt;  &lt;br /&gt;
variable temp equal temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable temp2 equal temp*temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable press equal press &amp;lt;br&amp;gt; &lt;br /&gt;
variable press2 equal press*press &amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_E2 v_E&lt;br /&gt;
run 100000 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
variable HC equal ${atoms2}*(f_aves[7] - f_aves[8]*f_aves[8])/f_aves[5] &amp;lt;br&amp;gt;  &lt;br /&gt;
variable avedens equal f_aves[1] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avetemp equal f_aves[2] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avepress equal f_aves[3] &amp;lt;br&amp;gt; &lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3]) &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;--------&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Temperature: ${temp}&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Heat capacity: ${HC}&amp;quot;  &amp;lt;br&amp;gt;  &lt;br /&gt;
print &amp;quot;atoms&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
print &amp;quot;volume: ${volume}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The supercomputer was nonfunctional during part of the lab and I continually received an error message whenever trying to run the code after it was working.  &lt;br /&gt;
&lt;br /&gt;
File:Heat capacity with T.png&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the above equation I can predict the behavior of the system. It can be seem that &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; is directly proportional to &amp;lt;math&amp;gt; N^2 &amp;lt;/math&amp;gt;/. This informs us that for a system with a fixed volume (isochoric) as the number of particles increase as the will the heat capacity. Therefore at a given temperature I believe the heat capacity will be greater for the system with a density of 0.8 than for a system with density of 0.2.&lt;br /&gt;
&lt;br /&gt;
= Structural Properties and the Radial Distribution function =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:G(r).png|x300px|thumb|RDF at different phases|left]]&lt;br /&gt;
! [[File:Integral.png|x300px|thumb|Integral of g(r)|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To carry out the RDF calculations temperature was kept constant at 1.2 but density was varied. &lt;br /&gt;
&lt;br /&gt;
Density in reduced units used for each phase: &lt;br /&gt;
&lt;br /&gt;
* Gas = 0.05&lt;br /&gt;
* Liquid = 0.8 &lt;br /&gt;
* Solid = 1.2&lt;br /&gt;
&lt;br /&gt;
The number of peaks for each RDF plot decreases in the order gas&amp;lt;liquid&amp;lt;solid. This reflects the ordering of each phase. &lt;br /&gt;
A gas has a large degree of disorder and thus produces only peak.&lt;br /&gt;
The liquid has three peaks which gradually decrease in amplitude, this behavior is due to the fact that the liquid is modeled as central molecule surrounded by shells of other molecules, this initially creates some degree of order. As the simulation continues the molecules become more diffuse so the ordering decreases and thus the amplitude of peaks decrease.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Solid nearest coordination.png|x400px|centre]]&lt;br /&gt;
&lt;br /&gt;
The above plot indicates the positions of the first three peaks. These will correspond to the three closet atoms in the lattice. &lt;br /&gt;
&lt;br /&gt;
* 1.025 will correspond to one of the atoms at the corner of the unit cell neighboring the starting position.&lt;br /&gt;
* 1.525 will correspond to one of the atoms in the centre of the face of the cube. (The lattice is fcc) &lt;br /&gt;
* 1.825 will correspond to an atom on one of the faces adjacent to the starting point. It cannot be one of the adjacent corners as this would be too large thus it must fall in between the corners and therefore on a face.&lt;br /&gt;
&lt;br /&gt;
= Dynamical Properties and the diffusion coefficient = &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid.png|thumb|solid|x300px|left]]&lt;br /&gt;
! [[File:Liquid.png|thumb|liquid|x300px|centre]]&lt;br /&gt;
! [[File:Gas.png|thumb|gas|x300px|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plot give insight into the displacement of particles as they illustrate &#039;&#039;&#039;mean square displacement&#039;&#039;&#039; with time. There are variations in the shape of the lines for the large number of atoms and small number of atoms, this is due to the variations in positions being averaged for a large number of atoms and thus gives a better indication of the behavior of the system. The difference is very apparent for solid where one can see that the line is much more smooth in the region where the gradient becomes close to 0. &lt;br /&gt;
&lt;br /&gt;
The diffusion constant D was found by calculating the gradient of the line for each phase. The gradient after the line had leveled off was used for the solid.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 0.0304&lt;br /&gt;
| 0.0305&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| 0.001&lt;br /&gt;
| 0.0012 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| &amp;lt;math&amp;gt; 6 x 10^{-8} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 7 x 10^{-9} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There is a gradual decrease in D in the order solid&amp;lt;liquid&amp;lt;gas. This fits out chemical intuition; e.g. the motion of a solid would be much more restricted that the motion of a gas.  &lt;br /&gt;
&lt;br /&gt;
[[File:VACFvrsTS.png|x400px|thumb|VACF vrs Temperature|centre]]&lt;br /&gt;
&lt;br /&gt;
Minima in the VACF plot correspond to points where the atoms collide and change direction. The greater number of minima for a solid is due to the restricted mean square displacement in which the atoms can move, this therefore results in greater collisions as the atoms seek to minimize their potential energy. As a liquid has a greater diffusion coefficient it is able to diffuse away from an atom after a collision, this is why there are fewer minima, the line tends to 0 as the atoms eventually move in opposite directions resulting in velocities cancelling out and therefor the integration becomes 0. The harmonic oscillator is simply a mathematical function without physical meaning therefore it will continue to oscillate around 0 until infinity. &lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function for a 1D harmonic oscillator can be evaluated using the equation for a 1D harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiation of the displacement function will produce a velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx}{dt} = -A\omega\sin\left(\omega t + \phi\right) = v(t) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substitution into velocity autocorrelation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling -A\omega: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right)\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trigometric relation can simplify equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin\left(\omega t + \omega\tau + \phi\right) = cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integration of ansymmetical function results in 0:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} sin(x)cos(x)\mathrm{d}t = 0 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Thus after &amp;lt;math&amp;gt;cos(t\omega) &amp;lt;/math&amp;gt;is removed from top line the equation simplifies to: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(t\omega) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Vapourphse.png|thumb|Vapour Phase|x300px|left]]&lt;br /&gt;
! [[File:Vapour phase 1 million.png|thumb|Vapour Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid(small).png|thumb|Solid Phase|x300px|left]]&lt;br /&gt;
! [[File:Solid1million.png|thumb|Solid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Liquidsmallno..png|thumb|Liquid Phase|x300px|left]]&lt;br /&gt;
! [[File:Liquid1millionatoms.png|thumb|Liquid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 1.64&lt;br /&gt;
| 1.63&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| -0.2215&lt;br /&gt;
| 0.157 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| 0.254&lt;br /&gt;
| -0.123&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the trapezium rule to calculate D from a VACF plot yeilded a similar trend in diffusion coefficients however there was a discrepancy in one of my results. The value of D for a liquid of small number of atoms was smaller and more negative than the solid. This indictaes that using the MSD method is more accurate than VACF. This also indicates that it is more important to use the VACF plot for a large system when calculating D.&lt;br /&gt;
&lt;br /&gt;
= References = &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Mark Klarpus, Gregory A. Petsko, (1990) &#039;&#039;Molecular Reaction Dynamics in Biology&#039;&#039;, &#039;&#039;&#039;347&#039;&#039;&#039;, 631-9, doi:10.1038/347631a0&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Heat_capacity_with_T.png&amp;diff=579793</id>
		<title>File:Heat capacity with T.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Heat_capacity_with_T.png&amp;diff=579793"/>
		<updated>2017-02-01T14:16:40Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=579760</id>
		<title>Rep:Thermomp4114</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=579760"/>
		<updated>2017-02-01T10:00:20Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: /* Checking equilibration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Molecular Dynamics Simulations of Simple Liquids Introduction == &lt;br /&gt;
&lt;br /&gt;
Molecular dynamic simulations involved studying the motion of a system of particles. Several fundamental elements of a system need to be known in order to achieve this. This includes a knowledge of the interaction potential for the particles and the equations of motion which govern the dynamics of the particles.&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt; Once we know the positions, velocities, and forces, of the atoms (which are obtained using statistical) we can calculate various thermodynamic quantities of the system such as temperature and pressure. We must introduce a series of approximations in order for the caluculations to be feasible. Firstly we apply the &#039;&#039;&#039;The Classical Particle Approximation&#039;&#039;&#039;. The schoedinger equation is too complex to solve for a large system of atoms, however if the atoms are treated classically then the positions and and velocities of each can atom can be calculated using Newton&#039;s second law (equation 1): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = m_i \mathbf{a}_i = m_i \frac{\mathrm{d}\mathbf{v}_i}{\mathrm{d}t} = m_i \frac{\mathrm{d}^2 \mathbf{x}_i}{\mathrm{d}t^2} \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As there are N atoms and therefore N equations representing each atom a computer is a necessity. The &#039;&#039;&#039;Verlet algorithim&#039;&#039;&#039; is used to solve to Newton&#039;s law for all the atoms in the system. In this case time is not continuous but is made discrete, the simulation is thus broeken up into specific &#039;&#039;&#039;timesteps&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The position of atom &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;\mathbf{x}_i \left(t\right)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Positional Verlet algorithim (equation (2)): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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 \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Velocity Verlet algorithim (equation (3)):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{v}_i \left(t\right)&amp;lt;/math&amp;gt; represents the velocity of that atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;center&amp;gt;&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 \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Put in example of industrial applications&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Harmonic Oscillator ===&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator illustrates the the accuracy and discrepancies associated with using the velocity Verlet algorithim. Equation (4) is used to model the behavior of the harmonic oscillator in an analytical sense: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)\ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; = 1.00 &lt;br /&gt;
&lt;br /&gt;
Graph (1) illustrates the results the analytical solution gave for the relationship between position and time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Avrsxt2.png|x300px|thumb|Graph 1: Analytical solution of harmonic oscillator|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The difference in position between the velocity-verlet solution and analytical solution is represented by an error. Error plotted against time is illustrated by graph (2). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ErrorvrsT.png|x300px|thumb|Graph 2: Error vrs Time|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The orange line illustrates the positive trend between error and time. This shows that error is accumulative with time. Each timestep represents a calculation which has an associated error thus as the simulation proceeds the errors will be summed. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy of the system will consist of the sum of kinetic and potential energy. Equation (5) can be used to find kinetic energy of the system:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;E_\text{k} =\tfrac{1}{2} mv(t)^2 \ \ (5)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\mathbf{x} \left(t\right)&amp;lt;/math&amp;gt; is used in equation (5) the potential energy can be found. &lt;br /&gt;
&lt;br /&gt;
The following graphs represent the difference in change in energy with time when the timestep is varied. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EvrsTime.png|x200px|thumb|Energy change when a timestep of 0.1 is used|left]]&lt;br /&gt;
! [[File:Energy vrs time for 0.15 timestep.png|x200px|thumb|Energy change when a timestep of 0.15 is used|centre]]&lt;br /&gt;
! [[File:Energy vrs time for 0.2 timestep.png|x200px|thumb|Energy change when a timestep of 0.2 is used|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The maximum change in energy for each of the different timesteps is shown in table (1). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | Timestep&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.1&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.15&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.2&lt;br /&gt;
|-&lt;br /&gt;
| Max. change in Energy&lt;br /&gt;
| 0.2%&lt;br /&gt;
| 0.6%&lt;br /&gt;
| 1%&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results clearly indicate that a timestep greater than &#039;&#039;&#039;0.2&#039;&#039;&#039; will result in an energy change greater than 1%. As the timestep increases as does the maximum error. The timestep defines the number of calculations made in a given time, therefore the shorter the timestep the larger the number of calculations carried out and therefore a more accurate result is produced. The total energy of a real physical system should not change, when modeled numerically there can be fluctuations therefore it is important to monitor this change and ensure that the fluctuations are minimised.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces ===&lt;br /&gt;
&lt;br /&gt;
The forces an atom experiences is determined by the positions of all the atoms in the system, &amp;lt;math&amp;gt;\mathbf{r}^N&amp;lt;/math&amp;gt;. The Lennard-Jones function accurately sums all the key inter-atomic forces an atoms experiences (U). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ (10)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
For a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After division by 4 and rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_0^{6}} = \frac{\sigma^{6}}{r_0^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After further rearrangement and cancelling down: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;-\sigma &amp;lt;/math&amp;gt; is also a solution however this can be disregarded. &lt;br /&gt;
&lt;br /&gt;
In order to calculate the force the following equation is used: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\sigma\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After differentiation and simplification: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}(r_0) =  \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At equilibrium: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{12\sigma^{12}}{r_e^{13}} - \frac{6\sigma^6}{r_e^7} \right)&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
After rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_e = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This value of &amp;lt;math&amp;gt; r_e &amp;lt;/math&amp;gt; can now be used to find the well depth:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{\sigma^{12}}{4sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon\left(\frac{1}{5r^{5}} - \frac{1}{11r^11} \right)^\infty_2 \simeq -2.48 \sdot 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -8.18 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -3.29 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
* No. of moles in  1 mL of water = 0.056 &amp;lt;br&amp;gt; &lt;br /&gt;
* No. of molecules = moles x Avogadro&#039;s constant = 3.37 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*1000 molecules = 1.66 x 10&amp;lt;sup&amp;gt;21&amp;lt;/sup&amp;gt; moles&lt;br /&gt;
* Density = mass/vol. = 1 &lt;br /&gt;
*vol. = mass/density = 2.99 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Due to periodic boundary condition once the atom leaves the current box it will enter the beginning of an identical box. The atom is at &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; and thus once it breaches 0.5 in a particular direction it will be at the start of the next box. Using these principles after the atom moves &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will be at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units === &lt;br /&gt;
&lt;br /&gt;
Reduced units are applied to the Lennard-Jones equation to make the calculation more managable.&lt;br /&gt;
&lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For argon:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Distance in real units: r = 1.09 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Well depth = &amp;lt;math&amp;gt;{\epsilon}&amp;lt;/math&amp;gt; = 0.996 KJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* T = 180 K&lt;br /&gt;
&lt;br /&gt;
= Equilibriation = &lt;br /&gt;
&lt;br /&gt;
=== Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
As there is a large number of atoms in a discrete volume allowing random assignment of positions could result in atoms overlapping. This would cause an unrealistically high potential as potential is distance dependant (as observed in the Lennard - Jones equation).&lt;br /&gt;
&lt;br /&gt;
* Density is given by the following equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{n}{v} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 1 (as there is only 1 atom per unit cell) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = 1.07722^3 = 1.25 &amp;lt;/math&amp;gt; (lattice spacing = 1.07722) &lt;br /&gt;
&lt;br /&gt;
Thus: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length of a side of one fcc unit cell with number density 1.2 would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = \frac{n}{\rho} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 4 (as there is 4 atoms per unit cell in an fcc lattice) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; = 3.33&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; l = v^{-3} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The number of atoms that would be created by the create_atoms command for an fcc lattice would be: &lt;br /&gt;
&lt;br /&gt;
4 x 1000 = 4000 &lt;br /&gt;
&lt;br /&gt;
This is due to fact that there is 1 atom per unit cell that yeilds 1000 altogether in simple cubic. Fcc has 4 times the number of atoms per unit cell. &lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of Atoms === &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command above has the following purpose: &lt;br /&gt;
&lt;br /&gt;
* The first line sets the mass of all atoms of type &#039;1&#039; to 1.0. &lt;br /&gt;
*  Line 2 is used to control the Lennard-Jones potential. The value of 3.0 indicates the distance in reduced units upon which the potential is calculated. The potential is distance dependent and falls to 0 at large values of r thus only atoms within a distance of 3.0 are considered.  &#039;lj/cut&#039; defines the cut off point. &lt;br /&gt;
* The last line defines the force field constants as 1.0 for all sets of atoms. The * controls the fact that the command is set for all atoms. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet is the integration algorithm that can be used when &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; are defined. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The codes is in place to ensure that the timestep can be varied but the total time taken for the simulation to run will not change.&lt;br /&gt;
&lt;br /&gt;
=== Checking equilibration === &lt;br /&gt;
&lt;br /&gt;
The graphs below illustrate the time it takes for different thermodynamic properties to equilibriate at a timestep of 0.001. The plateau represents the point at which equilibration is achieved. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EnergyVRStime.png|x300px|thumb|Energy Vrs Time|left]]&lt;br /&gt;
! [[File:TEMPvrsTIME.png|x300px|thumb|Temp vrs Time|centre]]&lt;br /&gt;
! [[File:Press Vrs Time.png|x300px|thumb|Pressure Vrs Time|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The graph below illustrates the effect changing the timestep has on equilibration. As can be seen from the graph a from below 0.01 a shorter timestep results in a lower energy value for equilibration until 0.0025 where the value   of equilibration does not change with lower timestep. This trend is due to the fact that a smaller timestep results in a more accurate result however if it is too small this can over-complicate the calculation (especially when there is a large over-all time). Thus a timestep of 0.0025 is a good balance and therefore ideal. A timestep of 0.025 is too large and results in the system not reaching equilibrium.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EnergyVtimeFORVTS.png|x400px|thumb|Energy Vrs Time with different timesteps|centre]]&lt;br /&gt;
&lt;br /&gt;
= Running Simulations Under Specific Conditions =&lt;br /&gt;
&lt;br /&gt;
The following two equations can be used to define the energy of the system: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The instantaneous tempertaure &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will not remain constant throughout the simulation and will fluctuate, it will thus be different to out target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The value of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2} = \frac{\mathfrak{T}}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within the preceding code: &lt;br /&gt;
&lt;br /&gt;
100 - Nevery: This command results in a sample being taken every 100 steps and being incorporated into the average. 1000 - Nrepreat: Tells the computer how many samples should be used to calculate the average. Nfreq 10 000: At every 10000th timestep an average is calculated. &lt;br /&gt;
&lt;br /&gt;
All thermodynamic properties are calculated by averages that is the necessity for those commands.&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equation of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:DENSITYvrsT.png|x400px|thumb|Density Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
The densities produced from the simulation are lower than for the ideal gas. This is a result of the simulation creating a more realistic picture of how the atoms interact as it takes into account Lennard-Jones potential. In an ideal gas the motion of atoms will be random, chaotic and inter atomic interactions are ignored however in the simulation the atoms will want to minimize their potential and therefore this will drive them to occupy a greater volume thus reducing the density.&lt;br /&gt;
&lt;br /&gt;
= Calculating Heat Capacities Using Statistic Physics =&lt;br /&gt;
&lt;br /&gt;
Example of input code used: &lt;br /&gt;
&lt;br /&gt;
* Density 0.2&lt;br /&gt;
* Temperature 2.0 &lt;br /&gt;
&lt;br /&gt;
 variable density equal 0.2&lt;br /&gt;
 DEFINE SIMULATION BOX GEOMETRY &amp;lt;br&amp;gt; &lt;br /&gt;
lattice sc ${density} &amp;lt;br&amp;gt; &lt;br /&gt;
region box block 0 15 0 15 0 15 &amp;lt;br&amp;gt; &lt;br /&gt;
create_box 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
create_atoms 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
DEFINE PHYSICAL PROPERTIES OF ATOMS &amp;lt;br&amp;gt; &lt;br /&gt;
mass 1 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_style lj/cut/opt 3.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_coeff 1 1 1.0 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
neighbor 2.0 bin &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY THE REQUIRED THERMODYNAMIC STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable T equal 2.0 &amp;lt;br&amp;gt; &lt;br /&gt;
variable p equal 2.5 &amp;lt;br&amp;gt; &lt;br /&gt;
variable timestep equal 0.0025 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ASSIGN ATOMIC VELOCITIES &amp;lt;br&amp;gt; &lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
SPECIFY ENSEMBLE &amp;lt;br&amp;gt; &lt;br /&gt;
timestep ${timestep} &amp;lt;br&amp;gt; &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 THERMODYNAMIC OUTPUT CONTROL &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom time etotal temp press &amp;lt;br&amp;gt; &lt;br /&gt;
thermo 10 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RECORD TRAJECTORY &amp;lt;br&amp;gt; &lt;br /&gt;
dump traj all custom 1000 output-1 id x y z &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY TIMESTEP &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RUN SIMULATION TO MELT CRYSTAL &amp;lt;br&amp;gt; &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nve &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 BRING SYSTEM TO REQUIRED STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable tdamp equal ${timestep}*100 &amp;lt;br&amp;gt; &lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &amp;lt;br&amp;gt;  &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nvt &amp;lt;br&amp;gt;  &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 MEASURE SYSTEM STATE  &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom step atoms etotal temp press density vol &amp;lt;br&amp;gt; &lt;br /&gt;
variable atoms2 equal atoms*atoms &amp;lt;br&amp;gt;   &lt;br /&gt;
variable volume equal vol&lt;br /&gt;
variable E equal etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable E2 equal etotal*etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens equal density &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens2 equal density*density &amp;lt;br&amp;gt;  &lt;br /&gt;
variable temp equal temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable temp2 equal temp*temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable press equal press &amp;lt;br&amp;gt; &lt;br /&gt;
variable press2 equal press*press &amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_E2 v_E&lt;br /&gt;
run 100000 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
variable HC equal ${atoms2}*(f_aves[7] - f_aves[8]*f_aves[8])/f_aves[5] &amp;lt;br&amp;gt;  &lt;br /&gt;
variable avedens equal f_aves[1] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avetemp equal f_aves[2] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avepress equal f_aves[3] &amp;lt;br&amp;gt; &lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3]) &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;--------&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Temperature: ${temp}&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Heat capacity: ${HC}&amp;quot;  &amp;lt;br&amp;gt;  &lt;br /&gt;
print &amp;quot;atoms&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
print &amp;quot;volume: ${volume}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The supercomputer was nonfunctional during part of the lab and I continually received an error message whenever trying to run the code after it was working.   &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the above equation I can predict the behavior of the system. It can be seem that &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; is directly proportional to &amp;lt;math&amp;gt; N^2 &amp;lt;/math&amp;gt;/. This informs us that for a system with a fixed volume (isochoric) as the number of particles increase as the will the heat capacity. Therefore at a given temperature I believe the heat capacity will be greater for the system with a density of 0.8 than for a system with density of 0.2.&lt;br /&gt;
&lt;br /&gt;
= Structural Properties and the Radial Distribution function =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:G(r).png|x300px|thumb|RDF at different phases|left]]&lt;br /&gt;
! [[File:Integral.png|x300px|thumb|Integral of g(r)|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To carry out the RDF calculations temperature was kept constant at 1.2 but density was varied. &lt;br /&gt;
&lt;br /&gt;
Density in reduced units used for each phase: &lt;br /&gt;
&lt;br /&gt;
* Gas = 0.05&lt;br /&gt;
* Liquid = 0.8 &lt;br /&gt;
* Solid = 1.2&lt;br /&gt;
&lt;br /&gt;
The number of peaks for each RDF plot decreases in the order gas&amp;lt;liquid&amp;lt;solid. This reflects the ordering of each phase. &lt;br /&gt;
A gas has a large degree of disorder and thus produces only peak.&lt;br /&gt;
The liquid has three peaks which gradually decrease in amplitude, this behavior is due to the fact that the liquid is modeled as central molecule surrounded by shells of other molecules, this initially creates some degree of order. As the simulation continues the molecules become more diffuse so the ordering decreases and thus the amplitude of peaks decrease.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Solid nearest coordination.png|x400px|centre]]&lt;br /&gt;
&lt;br /&gt;
The above plot indicates the positions of the first three peaks. These will correspond to the three closet atoms in the lattice. &lt;br /&gt;
&lt;br /&gt;
* 1.025 will correspond to one of the atoms at the corner of the unit cell neighboring the starting position.&lt;br /&gt;
* 1.525 will correspond to one of the atoms in the centre of the face of the cube. (The lattice is fcc) &lt;br /&gt;
* 1.825 will correspond to an atom on one of the faces adjacent to the starting point. It cannot be one of the adjacent corners as this would be too large thus it must fall in between the corners and therefore on a face.&lt;br /&gt;
&lt;br /&gt;
= Dynamical Properties and the diffusion coefficient = &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid.png|thumb|solid|x300px|left]]&lt;br /&gt;
! [[File:Liquid.png|thumb|liquid|x300px|centre]]&lt;br /&gt;
! [[File:Gas.png|thumb|gas|x300px|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plot give insight into the displacement of particles as they illustrate &#039;&#039;&#039;mean square displacement&#039;&#039;&#039; with time. There are variations in the shape of the lines for the large number of atoms and small number of atoms, this is due to the variations in positions being averaged for a large number of atoms and thus gives a better indication of the behavior of the system. The difference is very apparent for solid where one can see that the line is much more smooth in the region where the gradient becomes close to 0. &lt;br /&gt;
&lt;br /&gt;
The diffusion constant D was found by calculating the gradient of the line for each phase. The gradient after the line had leveled off was used for the solid.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 0.0304&lt;br /&gt;
| 0.0305&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| 0.001&lt;br /&gt;
| 0.0012 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| &amp;lt;math&amp;gt; 6 x 10^{-8} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 7 x 10^{-9} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There is a gradual decrease in D in the order solid&amp;lt;liquid&amp;lt;gas. This fits out chemical intuition; e.g. the motion of a solid would be much more restricted that the motion of a gas.  &lt;br /&gt;
&lt;br /&gt;
[[File:VACFvrsTS.png|x400px|thumb|VACF vrs Temperature|centre]]&lt;br /&gt;
&lt;br /&gt;
Minima in the VACF plot correspond to points where the atoms collide and change direction. The greater number of minima for a solid is due to the restricted mean square displacement in which the atoms can move, this therefore results in greater collisions as the atoms seek to minimize their potential energy. As a liquid has a greater diffusion coefficient it is able to diffuse away from an atom after a collision, this is why there are fewer minima, the line tends to 0 as the atoms eventually move in opposite directions resulting in velocities cancelling out and therefor the integration becomes 0. The harmonic oscillator is simply a mathematical function without physical meaning therefore it will continue to oscillate around 0 until infinity. &lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function for a 1D harmonic oscillator can be evaluated using the equation for a 1D harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiation of the displacement function will produce a velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx}{dt} = -A\omega\sin\left(\omega t + \phi\right) = v(t) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substitution into velocity autocorrelation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling -A\omega: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right)\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trigometric relation can simplify equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin\left(\omega t + \omega\tau + \phi\right) = cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integration of ansymmetical function results in 0:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} sin(x)cos(x)\mathrm{d}t = 0 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Thus after &amp;lt;math&amp;gt;cos(t\omega) &amp;lt;/math&amp;gt;is removed from top line the equation simplifies to: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(t\omega) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Vapourphse.png|thumb|Vapour Phase|x300px|left]]&lt;br /&gt;
! [[File:Vapour phase 1 million.png|thumb|Vapour Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid(small).png|thumb|Solid Phase|x300px|left]]&lt;br /&gt;
! [[File:Solid1million.png|thumb|Solid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Liquidsmallno..png|thumb|Liquid Phase|x300px|left]]&lt;br /&gt;
! [[File:Liquid1millionatoms.png|thumb|Liquid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 1.64&lt;br /&gt;
| 1.63&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| -0.2215&lt;br /&gt;
| 0.157 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| 0.254&lt;br /&gt;
| -0.123&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the trapezium rule to calculate D from a VACF plot yeilded a similar trend in diffusion coefficients however there was a discrepancy in one of my results. The value of D for a liquid of small number of atoms was smaller and more negative than the solid. This indictaes that using the MSD method is more accurate than VACF. This also indicates that it is more important to use the VACF plot for a large system when calculating D.&lt;br /&gt;
&lt;br /&gt;
= References = &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Mark Klarpus, Gregory A. Petsko, (1990) &#039;&#039;Molecular Reaction Dynamics in Biology&#039;&#039;, &#039;&#039;&#039;347&#039;&#039;&#039;, 631-9, doi:10.1038/347631a0&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=579759</id>
		<title>Rep:Thermomp4114</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=579759"/>
		<updated>2017-02-01T09:53:46Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: /* Dynamical Properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Molecular Dynamics Simulations of Simple Liquids Introduction == &lt;br /&gt;
&lt;br /&gt;
Molecular dynamic simulations involved studying the motion of a system of particles. Several fundamental elements of a system need to be known in order to achieve this. This includes a knowledge of the interaction potential for the particles and the equations of motion which govern the dynamics of the particles.&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt; Once we know the positions, velocities, and forces, of the atoms (which are obtained using statistical) we can calculate various thermodynamic quantities of the system such as temperature and pressure. We must introduce a series of approximations in order for the caluculations to be feasible. Firstly we apply the &#039;&#039;&#039;The Classical Particle Approximation&#039;&#039;&#039;. The schoedinger equation is too complex to solve for a large system of atoms, however if the atoms are treated classically then the positions and and velocities of each can atom can be calculated using Newton&#039;s second law (equation 1): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = m_i \mathbf{a}_i = m_i \frac{\mathrm{d}\mathbf{v}_i}{\mathrm{d}t} = m_i \frac{\mathrm{d}^2 \mathbf{x}_i}{\mathrm{d}t^2} \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As there are N atoms and therefore N equations representing each atom a computer is a necessity. The &#039;&#039;&#039;Verlet algorithim&#039;&#039;&#039; is used to solve to Newton&#039;s law for all the atoms in the system. In this case time is not continuous but is made discrete, the simulation is thus broeken up into specific &#039;&#039;&#039;timesteps&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The position of atom &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;\mathbf{x}_i \left(t\right)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Positional Verlet algorithim (equation (2)): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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 \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Velocity Verlet algorithim (equation (3)):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{v}_i \left(t\right)&amp;lt;/math&amp;gt; represents the velocity of that atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;center&amp;gt;&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 \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Put in example of industrial applications&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Harmonic Oscillator ===&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator illustrates the the accuracy and discrepancies associated with using the velocity Verlet algorithim. Equation (4) is used to model the behavior of the harmonic oscillator in an analytical sense: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)\ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; = 1.00 &lt;br /&gt;
&lt;br /&gt;
Graph (1) illustrates the results the analytical solution gave for the relationship between position and time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Avrsxt2.png|x300px|thumb|Graph 1: Analytical solution of harmonic oscillator|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The difference in position between the velocity-verlet solution and analytical solution is represented by an error. Error plotted against time is illustrated by graph (2). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ErrorvrsT.png|x300px|thumb|Graph 2: Error vrs Time|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The orange line illustrates the positive trend between error and time. This shows that error is accumulative with time. Each timestep represents a calculation which has an associated error thus as the simulation proceeds the errors will be summed. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy of the system will consist of the sum of kinetic and potential energy. Equation (5) can be used to find kinetic energy of the system:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;E_\text{k} =\tfrac{1}{2} mv(t)^2 \ \ (5)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\mathbf{x} \left(t\right)&amp;lt;/math&amp;gt; is used in equation (5) the potential energy can be found. &lt;br /&gt;
&lt;br /&gt;
The following graphs represent the difference in change in energy with time when the timestep is varied. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EvrsTime.png|x200px|thumb|Energy change when a timestep of 0.1 is used|left]]&lt;br /&gt;
! [[File:Energy vrs time for 0.15 timestep.png|x200px|thumb|Energy change when a timestep of 0.15 is used|centre]]&lt;br /&gt;
! [[File:Energy vrs time for 0.2 timestep.png|x200px|thumb|Energy change when a timestep of 0.2 is used|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The maximum change in energy for each of the different timesteps is shown in table (1). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | Timestep&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.1&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.15&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.2&lt;br /&gt;
|-&lt;br /&gt;
| Max. change in Energy&lt;br /&gt;
| 0.2%&lt;br /&gt;
| 0.6%&lt;br /&gt;
| 1%&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results clearly indicate that a timestep greater than &#039;&#039;&#039;0.2&#039;&#039;&#039; will result in an energy change greater than 1%. As the timestep increases as does the maximum error. The timestep defines the number of calculations made in a given time, therefore the shorter the timestep the larger the number of calculations carried out and therefore a more accurate result is produced. The total energy of a real physical system should not change, when modeled numerically there can be fluctuations therefore it is important to monitor this change and ensure that the fluctuations are minimised.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces ===&lt;br /&gt;
&lt;br /&gt;
The forces an atom experiences is determined by the positions of all the atoms in the system, &amp;lt;math&amp;gt;\mathbf{r}^N&amp;lt;/math&amp;gt;. The Lennard-Jones function accurately sums all the key inter-atomic forces an atoms experiences (U). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ (10)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
For a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After division by 4 and rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_0^{6}} = \frac{\sigma^{6}}{r_0^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After further rearrangement and cancelling down: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;-\sigma &amp;lt;/math&amp;gt; is also a solution however this can be disregarded. &lt;br /&gt;
&lt;br /&gt;
In order to calculate the force the following equation is used: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\sigma\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After differentiation and simplification: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}(r_0) =  \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At equilibrium: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{12\sigma^{12}}{r_e^{13}} - \frac{6\sigma^6}{r_e^7} \right)&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
After rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_e = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This value of &amp;lt;math&amp;gt; r_e &amp;lt;/math&amp;gt; can now be used to find the well depth:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{\sigma^{12}}{4sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon\left(\frac{1}{5r^{5}} - \frac{1}{11r^11} \right)^\infty_2 \simeq -2.48 \sdot 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -8.18 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -3.29 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
* No. of moles in  1 mL of water = 0.056 &amp;lt;br&amp;gt; &lt;br /&gt;
* No. of molecules = moles x Avogadro&#039;s constant = 3.37 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*1000 molecules = 1.66 x 10&amp;lt;sup&amp;gt;21&amp;lt;/sup&amp;gt; moles&lt;br /&gt;
* Density = mass/vol. = 1 &lt;br /&gt;
*vol. = mass/density = 2.99 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Due to periodic boundary condition once the atom leaves the current box it will enter the beginning of an identical box. The atom is at &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; and thus once it breaches 0.5 in a particular direction it will be at the start of the next box. Using these principles after the atom moves &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will be at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units === &lt;br /&gt;
&lt;br /&gt;
Reduced units are applied to the Lennard-Jones equation to make the calculation more managable.&lt;br /&gt;
&lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For argon:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Distance in real units: r = 1.09 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Well depth = &amp;lt;math&amp;gt;{\epsilon}&amp;lt;/math&amp;gt; = 0.996 KJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* T = 180 K&lt;br /&gt;
&lt;br /&gt;
= Equilibriation = &lt;br /&gt;
&lt;br /&gt;
=== Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
As there is a large number of atoms in a discrete volume allowing random assignment of positions could result in atoms overlapping. This would cause an unrealistically high potential as potential is distance dependant (as observed in the Lennard - Jones equation).&lt;br /&gt;
&lt;br /&gt;
* Density is given by the following equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{n}{v} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 1 (as there is only 1 atom per unit cell) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = 1.07722^3 = 1.25 &amp;lt;/math&amp;gt; (lattice spacing = 1.07722) &lt;br /&gt;
&lt;br /&gt;
Thus: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length of a side of one fcc unit cell with number density 1.2 would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = \frac{n}{\rho} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 4 (as there is 4 atoms per unit cell in an fcc lattice) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; = 3.33&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; l = v^{-3} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The number of atoms that would be created by the create_atoms command for an fcc lattice would be: &lt;br /&gt;
&lt;br /&gt;
4 x 1000 = 4000 &lt;br /&gt;
&lt;br /&gt;
This is due to fact that there is 1 atom per unit cell that yeilds 1000 altogether in simple cubic. Fcc has 4 times the number of atoms per unit cell. &lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of Atoms === &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command above has the following purpose: &lt;br /&gt;
&lt;br /&gt;
* The first line sets the mass of all atoms of type &#039;1&#039; to 1.0. &lt;br /&gt;
*  Line 2 is used to control the Lennard-Jones potential. The value of 3.0 indicates the distance in reduced units upon which the potential is calculated. The potential is distance dependent and falls to 0 at large values of r thus only atoms within a distance of 3.0 are considered.  &#039;lj/cut&#039; defines the cut off point. &lt;br /&gt;
* The last line defines the force field constants as 1.0 for all sets of atoms. The * controls the fact that the command is set for all atoms. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet is the integration algorithm that can be used when &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; are defined. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The codes is in place to ensure that the timestep can be varied but the total time taken for the simulation to run will not change.&lt;br /&gt;
&lt;br /&gt;
=== Checking equilibration === &lt;br /&gt;
&lt;br /&gt;
The graphs below illustrate the time it takes for different thermodynamic properties to equilibriate at a timestep of 0.001. The plateau represents the point at which equilibration is achieved. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EnergyVRStime.png|x300px|thumb|Energy Vrs Time|left]]&lt;br /&gt;
! [[File:TEMPvrsTIME.png|x300px|thumb|Temp vrs Time|centre]]&lt;br /&gt;
! [[File:Press Vrs Time.png|x300px|thumb|Pressure Vrs Time|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The graph below illustrates the effect changing the timestep has on equilibration. As can be seen from the graph a from below 0.01 a shorter timestep results in a lower energy value for equilibration until 0.0025 where the value   of equilibration does not change with lower timestep. This trend is due to the fact that a smaller timestep results in a more accurate result however if it is too small this can over-complicate the calculation (especially when there is a large over-all time). Thus a timestep of 0.0025 is ideal. A timestep of 0.025 is too large and results in the system not reaching equilibrium.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EnergyVtimeFORVTS.png|x400px|thumb|Energy Vrs Time with different timesteps|centre]]&lt;br /&gt;
&lt;br /&gt;
= Running Simulations Under Specific Conditions =&lt;br /&gt;
&lt;br /&gt;
The following two equations can be used to define the energy of the system: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The instantaneous tempertaure &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will not remain constant throughout the simulation and will fluctuate, it will thus be different to out target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The value of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2} = \frac{\mathfrak{T}}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within the preceding code: &lt;br /&gt;
&lt;br /&gt;
100 - Nevery: This command results in a sample being taken every 100 steps and being incorporated into the average. 1000 - Nrepreat: Tells the computer how many samples should be used to calculate the average. Nfreq 10 000: At every 10000th timestep an average is calculated. &lt;br /&gt;
&lt;br /&gt;
All thermodynamic properties are calculated by averages that is the necessity for those commands.&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equation of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:DENSITYvrsT.png|x400px|thumb|Density Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
The densities produced from the simulation are lower than for the ideal gas. This is a result of the simulation creating a more realistic picture of how the atoms interact as it takes into account Lennard-Jones potential. In an ideal gas the motion of atoms will be random, chaotic and inter atomic interactions are ignored however in the simulation the atoms will want to minimize their potential and therefore this will drive them to occupy a greater volume thus reducing the density.&lt;br /&gt;
&lt;br /&gt;
= Calculating Heat Capacities Using Statistic Physics =&lt;br /&gt;
&lt;br /&gt;
Example of input code used: &lt;br /&gt;
&lt;br /&gt;
* Density 0.2&lt;br /&gt;
* Temperature 2.0 &lt;br /&gt;
&lt;br /&gt;
 variable density equal 0.2&lt;br /&gt;
 DEFINE SIMULATION BOX GEOMETRY &amp;lt;br&amp;gt; &lt;br /&gt;
lattice sc ${density} &amp;lt;br&amp;gt; &lt;br /&gt;
region box block 0 15 0 15 0 15 &amp;lt;br&amp;gt; &lt;br /&gt;
create_box 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
create_atoms 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
DEFINE PHYSICAL PROPERTIES OF ATOMS &amp;lt;br&amp;gt; &lt;br /&gt;
mass 1 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_style lj/cut/opt 3.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_coeff 1 1 1.0 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
neighbor 2.0 bin &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY THE REQUIRED THERMODYNAMIC STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable T equal 2.0 &amp;lt;br&amp;gt; &lt;br /&gt;
variable p equal 2.5 &amp;lt;br&amp;gt; &lt;br /&gt;
variable timestep equal 0.0025 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ASSIGN ATOMIC VELOCITIES &amp;lt;br&amp;gt; &lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
SPECIFY ENSEMBLE &amp;lt;br&amp;gt; &lt;br /&gt;
timestep ${timestep} &amp;lt;br&amp;gt; &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 THERMODYNAMIC OUTPUT CONTROL &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom time etotal temp press &amp;lt;br&amp;gt; &lt;br /&gt;
thermo 10 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RECORD TRAJECTORY &amp;lt;br&amp;gt; &lt;br /&gt;
dump traj all custom 1000 output-1 id x y z &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY TIMESTEP &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RUN SIMULATION TO MELT CRYSTAL &amp;lt;br&amp;gt; &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nve &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 BRING SYSTEM TO REQUIRED STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable tdamp equal ${timestep}*100 &amp;lt;br&amp;gt; &lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &amp;lt;br&amp;gt;  &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nvt &amp;lt;br&amp;gt;  &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 MEASURE SYSTEM STATE  &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom step atoms etotal temp press density vol &amp;lt;br&amp;gt; &lt;br /&gt;
variable atoms2 equal atoms*atoms &amp;lt;br&amp;gt;   &lt;br /&gt;
variable volume equal vol&lt;br /&gt;
variable E equal etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable E2 equal etotal*etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens equal density &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens2 equal density*density &amp;lt;br&amp;gt;  &lt;br /&gt;
variable temp equal temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable temp2 equal temp*temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable press equal press &amp;lt;br&amp;gt; &lt;br /&gt;
variable press2 equal press*press &amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_E2 v_E&lt;br /&gt;
run 100000 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
variable HC equal ${atoms2}*(f_aves[7] - f_aves[8]*f_aves[8])/f_aves[5] &amp;lt;br&amp;gt;  &lt;br /&gt;
variable avedens equal f_aves[1] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avetemp equal f_aves[2] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avepress equal f_aves[3] &amp;lt;br&amp;gt; &lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3]) &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;--------&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Temperature: ${temp}&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Heat capacity: ${HC}&amp;quot;  &amp;lt;br&amp;gt;  &lt;br /&gt;
print &amp;quot;atoms&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
print &amp;quot;volume: ${volume}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The supercomputer was nonfunctional during part of the lab and I continually received an error message whenever trying to run the code after it was working.   &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the above equation I can predict the behavior of the system. It can be seem that &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; is directly proportional to &amp;lt;math&amp;gt; N^2 &amp;lt;/math&amp;gt;/. This informs us that for a system with a fixed volume (isochoric) as the number of particles increase as the will the heat capacity. Therefore at a given temperature I believe the heat capacity will be greater for the system with a density of 0.8 than for a system with density of 0.2.&lt;br /&gt;
&lt;br /&gt;
= Structural Properties and the Radial Distribution function =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:G(r).png|x300px|thumb|RDF at different phases|left]]&lt;br /&gt;
! [[File:Integral.png|x300px|thumb|Integral of g(r)|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To carry out the RDF calculations temperature was kept constant at 1.2 but density was varied. &lt;br /&gt;
&lt;br /&gt;
Density in reduced units used for each phase: &lt;br /&gt;
&lt;br /&gt;
* Gas = 0.05&lt;br /&gt;
* Liquid = 0.8 &lt;br /&gt;
* Solid = 1.2&lt;br /&gt;
&lt;br /&gt;
The number of peaks for each RDF plot decreases in the order gas&amp;lt;liquid&amp;lt;solid. This reflects the ordering of each phase. &lt;br /&gt;
A gas has a large degree of disorder and thus produces only peak.&lt;br /&gt;
The liquid has three peaks which gradually decrease in amplitude, this behavior is due to the fact that the liquid is modeled as central molecule surrounded by shells of other molecules, this initially creates some degree of order. As the simulation continues the molecules become more diffuse so the ordering decreases and thus the amplitude of peaks decrease.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Solid nearest coordination.png|x400px|centre]]&lt;br /&gt;
&lt;br /&gt;
The above plot indicates the positions of the first three peaks. These will correspond to the three closet atoms in the lattice. &lt;br /&gt;
&lt;br /&gt;
* 1.025 will correspond to one of the atoms at the corner of the unit cell neighboring the starting position.&lt;br /&gt;
* 1.525 will correspond to one of the atoms in the centre of the face of the cube. (The lattice is fcc) &lt;br /&gt;
* 1.825 will correspond to an atom on one of the faces adjacent to the starting point. It cannot be one of the adjacent corners as this would be too large thus it must fall in between the corners and therefore on a face.&lt;br /&gt;
&lt;br /&gt;
= Dynamical Properties and the diffusion coefficient = &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid.png|thumb|solid|x300px|left]]&lt;br /&gt;
! [[File:Liquid.png|thumb|liquid|x300px|centre]]&lt;br /&gt;
! [[File:Gas.png|thumb|gas|x300px|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plot give insight into the displacement of particles as they illustrate &#039;&#039;&#039;mean square displacement&#039;&#039;&#039; with time. There are variations in the shape of the lines for the large number of atoms and small number of atoms, this is due to the variations in positions being averaged for a large number of atoms and thus gives a better indication of the behavior of the system. The difference is very apparent for solid where one can see that the line is much more smooth in the region where the gradient becomes close to 0. &lt;br /&gt;
&lt;br /&gt;
The diffusion constant D was found by calculating the gradient of the line for each phase. The gradient after the line had leveled off was used for the solid.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 0.0304&lt;br /&gt;
| 0.0305&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| 0.001&lt;br /&gt;
| 0.0012 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| &amp;lt;math&amp;gt; 6 x 10^{-8} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 7 x 10^{-9} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There is a gradual decrease in D in the order solid&amp;lt;liquid&amp;lt;gas. This fits out chemical intuition; e.g. the motion of a solid would be much more restricted that the motion of a gas.  &lt;br /&gt;
&lt;br /&gt;
[[File:VACFvrsTS.png|x400px|thumb|VACF vrs Temperature|centre]]&lt;br /&gt;
&lt;br /&gt;
Minima in the VACF plot correspond to points where the atoms collide and change direction. The greater number of minima for a solid is due to the restricted mean square displacement in which the atoms can move, this therefore results in greater collisions as the atoms seek to minimize their potential energy. As a liquid has a greater diffusion coefficient it is able to diffuse away from an atom after a collision, this is why there are fewer minima, the line tends to 0 as the atoms eventually move in opposite directions resulting in velocities cancelling out and therefor the integration becomes 0. The harmonic oscillator is simply a mathematical function without physical meaning therefore it will continue to oscillate around 0 until infinity. &lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function for a 1D harmonic oscillator can be evaluated using the equation for a 1D harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiation of the displacement function will produce a velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx}{dt} = -A\omega\sin\left(\omega t + \phi\right) = v(t) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substitution into velocity autocorrelation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling -A\omega: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right)\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trigometric relation can simplify equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin\left(\omega t + \omega\tau + \phi\right) = cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integration of ansymmetical function results in 0:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} sin(x)cos(x)\mathrm{d}t = 0 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Thus after &amp;lt;math&amp;gt;cos(t\omega) &amp;lt;/math&amp;gt;is removed from top line the equation simplifies to: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(t\omega) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Vapourphse.png|thumb|Vapour Phase|x300px|left]]&lt;br /&gt;
! [[File:Vapour phase 1 million.png|thumb|Vapour Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid(small).png|thumb|Solid Phase|x300px|left]]&lt;br /&gt;
! [[File:Solid1million.png|thumb|Solid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Liquidsmallno..png|thumb|Liquid Phase|x300px|left]]&lt;br /&gt;
! [[File:Liquid1millionatoms.png|thumb|Liquid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 1.64&lt;br /&gt;
| 1.63&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| -0.2215&lt;br /&gt;
| 0.157 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| 0.254&lt;br /&gt;
| -0.123&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the trapezium rule to calculate D from a VACF plot yeilded a similar trend in diffusion coefficients however there was a discrepancy in one of my results. The value of D for a liquid of small number of atoms was smaller and more negative than the solid. This indictaes that using the MSD method is more accurate than VACF. This also indicates that it is more important to use the VACF plot for a large system when calculating D.&lt;br /&gt;
&lt;br /&gt;
= References = &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Mark Klarpus, Gregory A. Petsko, (1990) &#039;&#039;Molecular Reaction Dynamics in Biology&#039;&#039;, &#039;&#039;&#039;347&#039;&#039;&#039;, 631-9, doi:10.1038/347631a0&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=579758</id>
		<title>Rep:Thermomp4114</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=579758"/>
		<updated>2017-02-01T09:52:19Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: /* Dynamical Properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Molecular Dynamics Simulations of Simple Liquids Introduction == &lt;br /&gt;
&lt;br /&gt;
Molecular dynamic simulations involved studying the motion of a system of particles. Several fundamental elements of a system need to be known in order to achieve this. This includes a knowledge of the interaction potential for the particles and the equations of motion which govern the dynamics of the particles.&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt; Once we know the positions, velocities, and forces, of the atoms (which are obtained using statistical) we can calculate various thermodynamic quantities of the system such as temperature and pressure. We must introduce a series of approximations in order for the caluculations to be feasible. Firstly we apply the &#039;&#039;&#039;The Classical Particle Approximation&#039;&#039;&#039;. The schoedinger equation is too complex to solve for a large system of atoms, however if the atoms are treated classically then the positions and and velocities of each can atom can be calculated using Newton&#039;s second law (equation 1): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = m_i \mathbf{a}_i = m_i \frac{\mathrm{d}\mathbf{v}_i}{\mathrm{d}t} = m_i \frac{\mathrm{d}^2 \mathbf{x}_i}{\mathrm{d}t^2} \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As there are N atoms and therefore N equations representing each atom a computer is a necessity. The &#039;&#039;&#039;Verlet algorithim&#039;&#039;&#039; is used to solve to Newton&#039;s law for all the atoms in the system. In this case time is not continuous but is made discrete, the simulation is thus broeken up into specific &#039;&#039;&#039;timesteps&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The position of atom &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;\mathbf{x}_i \left(t\right)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Positional Verlet algorithim (equation (2)): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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 \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Velocity Verlet algorithim (equation (3)):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{v}_i \left(t\right)&amp;lt;/math&amp;gt; represents the velocity of that atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;center&amp;gt;&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 \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Put in example of industrial applications&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Harmonic Oscillator ===&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator illustrates the the accuracy and discrepancies associated with using the velocity Verlet algorithim. Equation (4) is used to model the behavior of the harmonic oscillator in an analytical sense: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)\ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; = 1.00 &lt;br /&gt;
&lt;br /&gt;
Graph (1) illustrates the results the analytical solution gave for the relationship between position and time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Avrsxt2.png|x300px|thumb|Graph 1: Analytical solution of harmonic oscillator|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The difference in position between the velocity-verlet solution and analytical solution is represented by an error. Error plotted against time is illustrated by graph (2). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ErrorvrsT.png|x300px|thumb|Graph 2: Error vrs Time|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The orange line illustrates the positive trend between error and time. This shows that error is accumulative with time. Each timestep represents a calculation which has an associated error thus as the simulation proceeds the errors will be summed. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy of the system will consist of the sum of kinetic and potential energy. Equation (5) can be used to find kinetic energy of the system:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;E_\text{k} =\tfrac{1}{2} mv(t)^2 \ \ (5)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\mathbf{x} \left(t\right)&amp;lt;/math&amp;gt; is used in equation (5) the potential energy can be found. &lt;br /&gt;
&lt;br /&gt;
The following graphs represent the difference in change in energy with time when the timestep is varied. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EvrsTime.png|x200px|thumb|Energy change when a timestep of 0.1 is used|left]]&lt;br /&gt;
! [[File:Energy vrs time for 0.15 timestep.png|x200px|thumb|Energy change when a timestep of 0.15 is used|centre]]&lt;br /&gt;
! [[File:Energy vrs time for 0.2 timestep.png|x200px|thumb|Energy change when a timestep of 0.2 is used|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The maximum change in energy for each of the different timesteps is shown in table (1). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | Timestep&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.1&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.15&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.2&lt;br /&gt;
|-&lt;br /&gt;
| Max. change in Energy&lt;br /&gt;
| 0.2%&lt;br /&gt;
| 0.6%&lt;br /&gt;
| 1%&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results clearly indicate that a timestep greater than &#039;&#039;&#039;0.2&#039;&#039;&#039; will result in an energy change greater than 1%. As the timestep increases as does the maximum error. The timestep defines the number of calculations made in a given time, therefore the shorter the timestep the larger the number of calculations carried out and therefore a more accurate result is produced. The total energy of a real physical system should not change, when modeled numerically there can be fluctuations therefore it is important to monitor this change and ensure that the fluctuations are minimised.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces ===&lt;br /&gt;
&lt;br /&gt;
The forces an atom experiences is determined by the positions of all the atoms in the system, &amp;lt;math&amp;gt;\mathbf{r}^N&amp;lt;/math&amp;gt;. The Lennard-Jones function accurately sums all the key inter-atomic forces an atoms experiences (U). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ (10)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
For a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After division by 4 and rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_0^{6}} = \frac{\sigma^{6}}{r_0^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After further rearrangement and cancelling down: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;-\sigma &amp;lt;/math&amp;gt; is also a solution however this can be disregarded. &lt;br /&gt;
&lt;br /&gt;
In order to calculate the force the following equation is used: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\sigma\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After differentiation and simplification: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}(r_0) =  \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At equilibrium: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{12\sigma^{12}}{r_e^{13}} - \frac{6\sigma^6}{r_e^7} \right)&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
After rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_e = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This value of &amp;lt;math&amp;gt; r_e &amp;lt;/math&amp;gt; can now be used to find the well depth:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{\sigma^{12}}{4sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon\left(\frac{1}{5r^{5}} - \frac{1}{11r^11} \right)^\infty_2 \simeq -2.48 \sdot 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -8.18 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -3.29 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
* No. of moles in  1 mL of water = 0.056 &amp;lt;br&amp;gt; &lt;br /&gt;
* No. of molecules = moles x Avogadro&#039;s constant = 3.37 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*1000 molecules = 1.66 x 10&amp;lt;sup&amp;gt;21&amp;lt;/sup&amp;gt; moles&lt;br /&gt;
* Density = mass/vol. = 1 &lt;br /&gt;
*vol. = mass/density = 2.99 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Due to periodic boundary condition once the atom leaves the current box it will enter the beginning of an identical box. The atom is at &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; and thus once it breaches 0.5 in a particular direction it will be at the start of the next box. Using these principles after the atom moves &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will be at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units === &lt;br /&gt;
&lt;br /&gt;
Reduced units are applied to the Lennard-Jones equation to make the calculation more managable.&lt;br /&gt;
&lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For argon:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Distance in real units: r = 1.09 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Well depth = &amp;lt;math&amp;gt;{\epsilon}&amp;lt;/math&amp;gt; = 0.996 KJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* T = 180 K&lt;br /&gt;
&lt;br /&gt;
= Equilibriation = &lt;br /&gt;
&lt;br /&gt;
=== Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
As there is a large number of atoms in a discrete volume allowing random assignment of positions could result in atoms overlapping. This would cause an unrealistically high potential as potential is distance dependant (as observed in the Lennard - Jones equation).&lt;br /&gt;
&lt;br /&gt;
* Density is given by the following equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{n}{v} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 1 (as there is only 1 atom per unit cell) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = 1.07722^3 = 1.25 &amp;lt;/math&amp;gt; (lattice spacing = 1.07722) &lt;br /&gt;
&lt;br /&gt;
Thus: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length of a side of one fcc unit cell with number density 1.2 would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = \frac{n}{\rho} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 4 (as there is 4 atoms per unit cell in an fcc lattice) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; = 3.33&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; l = v^{-3} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The number of atoms that would be created by the create_atoms command for an fcc lattice would be: &lt;br /&gt;
&lt;br /&gt;
4 x 1000 = 4000 &lt;br /&gt;
&lt;br /&gt;
This is due to fact that there is 1 atom per unit cell that yeilds 1000 altogether in simple cubic. Fcc has 4 times the number of atoms per unit cell. &lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of Atoms === &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command above has the following purpose: &lt;br /&gt;
&lt;br /&gt;
* The first line sets the mass of all atoms of type &#039;1&#039; to 1.0. &lt;br /&gt;
*  Line 2 is used to control the Lennard-Jones potential. The value of 3.0 indicates the distance in reduced units upon which the potential is calculated. The potential is distance dependent and falls to 0 at large values of r thus only atoms within a distance of 3.0 are considered.  &#039;lj/cut&#039; defines the cut off point. &lt;br /&gt;
* The last line defines the force field constants as 1.0 for all sets of atoms. The * controls the fact that the command is set for all atoms. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet is the integration algorithm that can be used when &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; are defined. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The codes is in place to ensure that the timestep can be varied but the total time taken for the simulation to run will not change.&lt;br /&gt;
&lt;br /&gt;
=== Checking equilibration === &lt;br /&gt;
&lt;br /&gt;
The graphs below illustrate the time it takes for different thermodynamic properties to equilibriate at a timestep of 0.001. The plateau represents the point at which equilibration is achieved. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EnergyVRStime.png|x300px|thumb|Energy Vrs Time|left]]&lt;br /&gt;
! [[File:TEMPvrsTIME.png|x300px|thumb|Temp vrs Time|centre]]&lt;br /&gt;
! [[File:Press Vrs Time.png|x300px|thumb|Pressure Vrs Time|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The graph below illustrates the effect changing the timestep has on equilibration. As can be seen from the graph a from below 0.01 a shorter timestep results in a lower energy value for equilibration until 0.0025 where the value   of equilibration does not change with lower timestep. This trend is due to the fact that a smaller timestep results in a more accurate result however if it is too small this can over-complicate the calculation (especially when there is a large over-all time). Thus a timestep of 0.0025 is ideal. A timestep of 0.025 is too large and results in the system not reaching equilibrium.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EnergyVtimeFORVTS.png|x400px|thumb|Energy Vrs Time with different timesteps|centre]]&lt;br /&gt;
&lt;br /&gt;
= Running Simulations Under Specific Conditions =&lt;br /&gt;
&lt;br /&gt;
The following two equations can be used to define the energy of the system: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The instantaneous tempertaure &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will not remain constant throughout the simulation and will fluctuate, it will thus be different to out target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The value of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2} = \frac{\mathfrak{T}}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within the preceding code: &lt;br /&gt;
&lt;br /&gt;
100 - Nevery: This command results in a sample being taken every 100 steps and being incorporated into the average. 1000 - Nrepreat: Tells the computer how many samples should be used to calculate the average. Nfreq 10 000: At every 10000th timestep an average is calculated. &lt;br /&gt;
&lt;br /&gt;
All thermodynamic properties are calculated by averages that is the necessity for those commands.&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equation of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:DENSITYvrsT.png|x400px|thumb|Density Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
The densities produced from the simulation are lower than for the ideal gas. This is a result of the simulation creating a more realistic picture of how the atoms interact as it takes into account Lennard-Jones potential. In an ideal gas the motion of atoms will be random, chaotic and inter atomic interactions are ignored however in the simulation the atoms will want to minimize their potential and therefore this will drive them to occupy a greater volume thus reducing the density.&lt;br /&gt;
&lt;br /&gt;
= Calculating Heat Capacities Using Statistic Physics =&lt;br /&gt;
&lt;br /&gt;
Example of input code used: &lt;br /&gt;
&lt;br /&gt;
* Density 0.2&lt;br /&gt;
* Temperature 2.0 &lt;br /&gt;
&lt;br /&gt;
 variable density equal 0.2&lt;br /&gt;
 DEFINE SIMULATION BOX GEOMETRY &amp;lt;br&amp;gt; &lt;br /&gt;
lattice sc ${density} &amp;lt;br&amp;gt; &lt;br /&gt;
region box block 0 15 0 15 0 15 &amp;lt;br&amp;gt; &lt;br /&gt;
create_box 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
create_atoms 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
DEFINE PHYSICAL PROPERTIES OF ATOMS &amp;lt;br&amp;gt; &lt;br /&gt;
mass 1 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_style lj/cut/opt 3.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_coeff 1 1 1.0 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
neighbor 2.0 bin &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY THE REQUIRED THERMODYNAMIC STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable T equal 2.0 &amp;lt;br&amp;gt; &lt;br /&gt;
variable p equal 2.5 &amp;lt;br&amp;gt; &lt;br /&gt;
variable timestep equal 0.0025 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ASSIGN ATOMIC VELOCITIES &amp;lt;br&amp;gt; &lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
SPECIFY ENSEMBLE &amp;lt;br&amp;gt; &lt;br /&gt;
timestep ${timestep} &amp;lt;br&amp;gt; &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 THERMODYNAMIC OUTPUT CONTROL &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom time etotal temp press &amp;lt;br&amp;gt; &lt;br /&gt;
thermo 10 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RECORD TRAJECTORY &amp;lt;br&amp;gt; &lt;br /&gt;
dump traj all custom 1000 output-1 id x y z &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY TIMESTEP &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RUN SIMULATION TO MELT CRYSTAL &amp;lt;br&amp;gt; &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nve &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 BRING SYSTEM TO REQUIRED STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable tdamp equal ${timestep}*100 &amp;lt;br&amp;gt; &lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &amp;lt;br&amp;gt;  &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nvt &amp;lt;br&amp;gt;  &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 MEASURE SYSTEM STATE  &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom step atoms etotal temp press density vol &amp;lt;br&amp;gt; &lt;br /&gt;
variable atoms2 equal atoms*atoms &amp;lt;br&amp;gt;   &lt;br /&gt;
variable volume equal vol&lt;br /&gt;
variable E equal etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable E2 equal etotal*etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens equal density &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens2 equal density*density &amp;lt;br&amp;gt;  &lt;br /&gt;
variable temp equal temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable temp2 equal temp*temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable press equal press &amp;lt;br&amp;gt; &lt;br /&gt;
variable press2 equal press*press &amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_E2 v_E&lt;br /&gt;
run 100000 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
variable HC equal ${atoms2}*(f_aves[7] - f_aves[8]*f_aves[8])/f_aves[5] &amp;lt;br&amp;gt;  &lt;br /&gt;
variable avedens equal f_aves[1] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avetemp equal f_aves[2] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avepress equal f_aves[3] &amp;lt;br&amp;gt; &lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3]) &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;--------&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Temperature: ${temp}&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Heat capacity: ${HC}&amp;quot;  &amp;lt;br&amp;gt;  &lt;br /&gt;
print &amp;quot;atoms&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
print &amp;quot;volume: ${volume}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The supercomputer was nonfunctional during part of the lab and I continually received an error message whenever trying to run the code after it was working.   &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the above equation I can predict the behavior of the system. It can be seem that &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; is directly proportional to &amp;lt;math&amp;gt; N^2 &amp;lt;/math&amp;gt;/. This informs us that for a system with a fixed volume (isochoric) as the number of particles increase as the will the heat capacity. Therefore at a given temperature I believe the heat capacity will be greater for the system with a density of 0.8 than for a system with density of 0.2.&lt;br /&gt;
&lt;br /&gt;
= Structural Properties and the Radial Distribution function =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:G(r).png|x300px|thumb|RDF at different phases|left]]&lt;br /&gt;
! [[File:Integral.png|x300px|thumb|Integral of g(r)|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To carry out the RDF calculations temperature was kept constant at 1.2 but density was varied. &lt;br /&gt;
&lt;br /&gt;
Density in reduced units used for each phase: &lt;br /&gt;
&lt;br /&gt;
* Gas = 0.05&lt;br /&gt;
* Liquid = 0.8 &lt;br /&gt;
* Solid = 1.2&lt;br /&gt;
&lt;br /&gt;
The number of peaks for each RDF plot decreases in the order gas&amp;lt;liquid&amp;lt;solid. This reflects the ordering of each phase. &lt;br /&gt;
A gas has a large degree of disorder and thus produces only peak.&lt;br /&gt;
The liquid has three peaks which gradually decrease in amplitude, this behavior is due to the fact that the liquid is modeled as central molecule surrounded by shells of other molecules, this initially creates some degree of order. As the simulation continues the molecules become more diffuse so the ordering decreases and thus the amplitude of peaks decrease.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Solid nearest coordination.png|x400px|centre]]&lt;br /&gt;
&lt;br /&gt;
The above plot indicates the positions of the first three peaks. These will correspond to the three closet atoms in the lattice. &lt;br /&gt;
&lt;br /&gt;
* 1.025 will correspond to one of the atoms at the corner of the unit cell neighboring the starting position.&lt;br /&gt;
* 1.525 will correspond to one of the atoms in the centre of the face of the cube. (The lattice is fcc) &lt;br /&gt;
* 1.825 will correspond to an atom on one of the faces adjacent to the starting point. It cannot be one of the adjacent corners as this would be too large thus it must fall in between the corners and therefore on a face.&lt;br /&gt;
&lt;br /&gt;
= Dynamical Properties and the diffusion coefficient = &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid.png|thumb|solid|x300px|left]]&lt;br /&gt;
! [[File:Liquid.png|thumb|liquid|x300px|centre]]&lt;br /&gt;
! [[File:Gas.png|thumb|gas|x300px|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plot give insight into the displacement of particles. There are variations in the shape of the lines for the large number of atoms and small number of atoms, this is due to the variations in positions being averaged for a large number of atoms and thus gives a better indication of the behavior of the system. The difference is very apparent for solid where one can see that the line is much more smooth in the region where the gradient becomes close to 0. &lt;br /&gt;
&lt;br /&gt;
The diffusion constant D was found by calculating the gradient of the line for each phase. The gradient after the line had leveled off was used for the solid.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 0.0304&lt;br /&gt;
| 0.0305&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| 0.001&lt;br /&gt;
| 0.0012 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| &amp;lt;math&amp;gt; 6 x 10^{-8} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 7 x 10^{-9} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There is a gradual decrease in D in the order solid&amp;lt;liquid&amp;lt;gas. This fits out chemical intuition; e.g. the motion of a solid would be much more restricted that the motion of a gas.  &lt;br /&gt;
&lt;br /&gt;
[[File:VACFvrsTS.png|x400px|thumb|VACF vrs Temperature|centre]]&lt;br /&gt;
&lt;br /&gt;
Minima in the VACF plot correspond to points where the atoms collide and change direction. The greater number of minima for a solid is due to the restricted mean square displacement in which the atoms can move, this therefore results in greater collisions as the atoms seek to minimize their potential energy. As a liquid has a greater diffusion coefficient it is able to diffuse away from an atom after a collision, this is why there are fewer minima, the line tends to 0 as the atoms eventually move in opposite directions resulting in velocities cancelling out and therefor the integration becomes 0. The harmonic oscillator is simply a mathematical function without physical meaning therefore it will continue to oscillate around 0 until infinity. &lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function for a 1D harmonic oscillator can be evaluated using the equation for a 1D harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiation of the displacement function will produce a velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx}{dt} = -A\omega\sin\left(\omega t + \phi\right) = v(t) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substitution into velocity autocorrelation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling -A\omega: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right)\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trigometric relation can simplify equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin\left(\omega t + \omega\tau + \phi\right) = cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integration of ansymmetical function results in 0:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} sin(x)cos(x)\mathrm{d}t = 0 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Thus after &amp;lt;math&amp;gt;cos(t\omega) &amp;lt;/math&amp;gt;is removed from top line the equation simplifies to: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(t\omega) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Vapourphse.png|thumb|Vapour Phase|x300px|left]]&lt;br /&gt;
! [[File:Vapour phase 1 million.png|thumb|Vapour Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid(small).png|thumb|Solid Phase|x300px|left]]&lt;br /&gt;
! [[File:Solid1million.png|thumb|Solid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Liquidsmallno..png|thumb|Liquid Phase|x300px|left]]&lt;br /&gt;
! [[File:Liquid1millionatoms.png|thumb|Liquid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 1.64&lt;br /&gt;
| 1.63&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| -0.2215&lt;br /&gt;
| 0.157 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| 0.254&lt;br /&gt;
| -0.123&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the trapezium rule to calculate D from a VACF plot yeilded a similar trend in diffusion coefficients however there was a discrepancy in one of my results. The value of D for a liquid of small number of atoms was smaller and more negative than the solid. This indictaes that using the MSD method is more accurate than VACF. This also indicates that it is more important to use the VACF plot for a large system when calculating D.&lt;br /&gt;
&lt;br /&gt;
= References = &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Mark Klarpus, Gregory A. Petsko, (1990) &#039;&#039;Molecular Reaction Dynamics in Biology&#039;&#039;, &#039;&#039;&#039;347&#039;&#039;&#039;, 631-9, doi:10.1038/347631a0&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=579757</id>
		<title>Rep:Thermomp4114</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=579757"/>
		<updated>2017-02-01T09:51:10Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: /* Calculating Heat Capacities Using Statistic Physics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Molecular Dynamics Simulations of Simple Liquids Introduction == &lt;br /&gt;
&lt;br /&gt;
Molecular dynamic simulations involved studying the motion of a system of particles. Several fundamental elements of a system need to be known in order to achieve this. This includes a knowledge of the interaction potential for the particles and the equations of motion which govern the dynamics of the particles.&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt; Once we know the positions, velocities, and forces, of the atoms (which are obtained using statistical) we can calculate various thermodynamic quantities of the system such as temperature and pressure. We must introduce a series of approximations in order for the caluculations to be feasible. Firstly we apply the &#039;&#039;&#039;The Classical Particle Approximation&#039;&#039;&#039;. The schoedinger equation is too complex to solve for a large system of atoms, however if the atoms are treated classically then the positions and and velocities of each can atom can be calculated using Newton&#039;s second law (equation 1): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = m_i \mathbf{a}_i = m_i \frac{\mathrm{d}\mathbf{v}_i}{\mathrm{d}t} = m_i \frac{\mathrm{d}^2 \mathbf{x}_i}{\mathrm{d}t^2} \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As there are N atoms and therefore N equations representing each atom a computer is a necessity. The &#039;&#039;&#039;Verlet algorithim&#039;&#039;&#039; is used to solve to Newton&#039;s law for all the atoms in the system. In this case time is not continuous but is made discrete, the simulation is thus broeken up into specific &#039;&#039;&#039;timesteps&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The position of atom &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;\mathbf{x}_i \left(t\right)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Positional Verlet algorithim (equation (2)): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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 \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Velocity Verlet algorithim (equation (3)):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{v}_i \left(t\right)&amp;lt;/math&amp;gt; represents the velocity of that atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;center&amp;gt;&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 \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Put in example of industrial applications&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Harmonic Oscillator ===&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator illustrates the the accuracy and discrepancies associated with using the velocity Verlet algorithim. Equation (4) is used to model the behavior of the harmonic oscillator in an analytical sense: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)\ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; = 1.00 &lt;br /&gt;
&lt;br /&gt;
Graph (1) illustrates the results the analytical solution gave for the relationship between position and time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Avrsxt2.png|x300px|thumb|Graph 1: Analytical solution of harmonic oscillator|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The difference in position between the velocity-verlet solution and analytical solution is represented by an error. Error plotted against time is illustrated by graph (2). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ErrorvrsT.png|x300px|thumb|Graph 2: Error vrs Time|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The orange line illustrates the positive trend between error and time. This shows that error is accumulative with time. Each timestep represents a calculation which has an associated error thus as the simulation proceeds the errors will be summed. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy of the system will consist of the sum of kinetic and potential energy. Equation (5) can be used to find kinetic energy of the system:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;E_\text{k} =\tfrac{1}{2} mv(t)^2 \ \ (5)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\mathbf{x} \left(t\right)&amp;lt;/math&amp;gt; is used in equation (5) the potential energy can be found. &lt;br /&gt;
&lt;br /&gt;
The following graphs represent the difference in change in energy with time when the timestep is varied. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EvrsTime.png|x200px|thumb|Energy change when a timestep of 0.1 is used|left]]&lt;br /&gt;
! [[File:Energy vrs time for 0.15 timestep.png|x200px|thumb|Energy change when a timestep of 0.15 is used|centre]]&lt;br /&gt;
! [[File:Energy vrs time for 0.2 timestep.png|x200px|thumb|Energy change when a timestep of 0.2 is used|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The maximum change in energy for each of the different timesteps is shown in table (1). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | Timestep&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.1&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.15&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.2&lt;br /&gt;
|-&lt;br /&gt;
| Max. change in Energy&lt;br /&gt;
| 0.2%&lt;br /&gt;
| 0.6%&lt;br /&gt;
| 1%&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results clearly indicate that a timestep greater than &#039;&#039;&#039;0.2&#039;&#039;&#039; will result in an energy change greater than 1%. As the timestep increases as does the maximum error. The timestep defines the number of calculations made in a given time, therefore the shorter the timestep the larger the number of calculations carried out and therefore a more accurate result is produced. The total energy of a real physical system should not change, when modeled numerically there can be fluctuations therefore it is important to monitor this change and ensure that the fluctuations are minimised.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces ===&lt;br /&gt;
&lt;br /&gt;
The forces an atom experiences is determined by the positions of all the atoms in the system, &amp;lt;math&amp;gt;\mathbf{r}^N&amp;lt;/math&amp;gt;. The Lennard-Jones function accurately sums all the key inter-atomic forces an atoms experiences (U). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ (10)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
For a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After division by 4 and rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_0^{6}} = \frac{\sigma^{6}}{r_0^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After further rearrangement and cancelling down: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;-\sigma &amp;lt;/math&amp;gt; is also a solution however this can be disregarded. &lt;br /&gt;
&lt;br /&gt;
In order to calculate the force the following equation is used: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\sigma\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After differentiation and simplification: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}(r_0) =  \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At equilibrium: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{12\sigma^{12}}{r_e^{13}} - \frac{6\sigma^6}{r_e^7} \right)&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
After rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_e = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This value of &amp;lt;math&amp;gt; r_e &amp;lt;/math&amp;gt; can now be used to find the well depth:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{\sigma^{12}}{4sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon\left(\frac{1}{5r^{5}} - \frac{1}{11r^11} \right)^\infty_2 \simeq -2.48 \sdot 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -8.18 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -3.29 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
* No. of moles in  1 mL of water = 0.056 &amp;lt;br&amp;gt; &lt;br /&gt;
* No. of molecules = moles x Avogadro&#039;s constant = 3.37 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*1000 molecules = 1.66 x 10&amp;lt;sup&amp;gt;21&amp;lt;/sup&amp;gt; moles&lt;br /&gt;
* Density = mass/vol. = 1 &lt;br /&gt;
*vol. = mass/density = 2.99 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Due to periodic boundary condition once the atom leaves the current box it will enter the beginning of an identical box. The atom is at &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; and thus once it breaches 0.5 in a particular direction it will be at the start of the next box. Using these principles after the atom moves &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will be at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units === &lt;br /&gt;
&lt;br /&gt;
Reduced units are applied to the Lennard-Jones equation to make the calculation more managable.&lt;br /&gt;
&lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For argon:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Distance in real units: r = 1.09 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Well depth = &amp;lt;math&amp;gt;{\epsilon}&amp;lt;/math&amp;gt; = 0.996 KJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* T = 180 K&lt;br /&gt;
&lt;br /&gt;
= Equilibriation = &lt;br /&gt;
&lt;br /&gt;
=== Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
As there is a large number of atoms in a discrete volume allowing random assignment of positions could result in atoms overlapping. This would cause an unrealistically high potential as potential is distance dependant (as observed in the Lennard - Jones equation).&lt;br /&gt;
&lt;br /&gt;
* Density is given by the following equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{n}{v} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 1 (as there is only 1 atom per unit cell) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = 1.07722^3 = 1.25 &amp;lt;/math&amp;gt; (lattice spacing = 1.07722) &lt;br /&gt;
&lt;br /&gt;
Thus: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length of a side of one fcc unit cell with number density 1.2 would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = \frac{n}{\rho} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 4 (as there is 4 atoms per unit cell in an fcc lattice) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; = 3.33&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; l = v^{-3} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The number of atoms that would be created by the create_atoms command for an fcc lattice would be: &lt;br /&gt;
&lt;br /&gt;
4 x 1000 = 4000 &lt;br /&gt;
&lt;br /&gt;
This is due to fact that there is 1 atom per unit cell that yeilds 1000 altogether in simple cubic. Fcc has 4 times the number of atoms per unit cell. &lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of Atoms === &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command above has the following purpose: &lt;br /&gt;
&lt;br /&gt;
* The first line sets the mass of all atoms of type &#039;1&#039; to 1.0. &lt;br /&gt;
*  Line 2 is used to control the Lennard-Jones potential. The value of 3.0 indicates the distance in reduced units upon which the potential is calculated. The potential is distance dependent and falls to 0 at large values of r thus only atoms within a distance of 3.0 are considered.  &#039;lj/cut&#039; defines the cut off point. &lt;br /&gt;
* The last line defines the force field constants as 1.0 for all sets of atoms. The * controls the fact that the command is set for all atoms. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet is the integration algorithm that can be used when &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; are defined. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The codes is in place to ensure that the timestep can be varied but the total time taken for the simulation to run will not change.&lt;br /&gt;
&lt;br /&gt;
=== Checking equilibration === &lt;br /&gt;
&lt;br /&gt;
The graphs below illustrate the time it takes for different thermodynamic properties to equilibriate at a timestep of 0.001. The plateau represents the point at which equilibration is achieved. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EnergyVRStime.png|x300px|thumb|Energy Vrs Time|left]]&lt;br /&gt;
! [[File:TEMPvrsTIME.png|x300px|thumb|Temp vrs Time|centre]]&lt;br /&gt;
! [[File:Press Vrs Time.png|x300px|thumb|Pressure Vrs Time|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The graph below illustrates the effect changing the timestep has on equilibration. As can be seen from the graph a from below 0.01 a shorter timestep results in a lower energy value for equilibration until 0.0025 where the value   of equilibration does not change with lower timestep. This trend is due to the fact that a smaller timestep results in a more accurate result however if it is too small this can over-complicate the calculation (especially when there is a large over-all time). Thus a timestep of 0.0025 is ideal. A timestep of 0.025 is too large and results in the system not reaching equilibrium.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EnergyVtimeFORVTS.png|x400px|thumb|Energy Vrs Time with different timesteps|centre]]&lt;br /&gt;
&lt;br /&gt;
= Running Simulations Under Specific Conditions =&lt;br /&gt;
&lt;br /&gt;
The following two equations can be used to define the energy of the system: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The instantaneous tempertaure &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will not remain constant throughout the simulation and will fluctuate, it will thus be different to out target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The value of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2} = \frac{\mathfrak{T}}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within the preceding code: &lt;br /&gt;
&lt;br /&gt;
100 - Nevery: This command results in a sample being taken every 100 steps and being incorporated into the average. 1000 - Nrepreat: Tells the computer how many samples should be used to calculate the average. Nfreq 10 000: At every 10000th timestep an average is calculated. &lt;br /&gt;
&lt;br /&gt;
All thermodynamic properties are calculated by averages that is the necessity for those commands.&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equation of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:DENSITYvrsT.png|x400px|thumb|Density Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
The densities produced from the simulation are lower than for the ideal gas. This is a result of the simulation creating a more realistic picture of how the atoms interact as it takes into account Lennard-Jones potential. In an ideal gas the motion of atoms will be random, chaotic and inter atomic interactions are ignored however in the simulation the atoms will want to minimize their potential and therefore this will drive them to occupy a greater volume thus reducing the density.&lt;br /&gt;
&lt;br /&gt;
= Calculating Heat Capacities Using Statistic Physics =&lt;br /&gt;
&lt;br /&gt;
Example of input code used: &lt;br /&gt;
&lt;br /&gt;
* Density 0.2&lt;br /&gt;
* Temperature 2.0 &lt;br /&gt;
&lt;br /&gt;
 variable density equal 0.2&lt;br /&gt;
 DEFINE SIMULATION BOX GEOMETRY &amp;lt;br&amp;gt; &lt;br /&gt;
lattice sc ${density} &amp;lt;br&amp;gt; &lt;br /&gt;
region box block 0 15 0 15 0 15 &amp;lt;br&amp;gt; &lt;br /&gt;
create_box 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
create_atoms 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
DEFINE PHYSICAL PROPERTIES OF ATOMS &amp;lt;br&amp;gt; &lt;br /&gt;
mass 1 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_style lj/cut/opt 3.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_coeff 1 1 1.0 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
neighbor 2.0 bin &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY THE REQUIRED THERMODYNAMIC STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable T equal 2.0 &amp;lt;br&amp;gt; &lt;br /&gt;
variable p equal 2.5 &amp;lt;br&amp;gt; &lt;br /&gt;
variable timestep equal 0.0025 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ASSIGN ATOMIC VELOCITIES &amp;lt;br&amp;gt; &lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
SPECIFY ENSEMBLE &amp;lt;br&amp;gt; &lt;br /&gt;
timestep ${timestep} &amp;lt;br&amp;gt; &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 THERMODYNAMIC OUTPUT CONTROL &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom time etotal temp press &amp;lt;br&amp;gt; &lt;br /&gt;
thermo 10 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RECORD TRAJECTORY &amp;lt;br&amp;gt; &lt;br /&gt;
dump traj all custom 1000 output-1 id x y z &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY TIMESTEP &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RUN SIMULATION TO MELT CRYSTAL &amp;lt;br&amp;gt; &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nve &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 BRING SYSTEM TO REQUIRED STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable tdamp equal ${timestep}*100 &amp;lt;br&amp;gt; &lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &amp;lt;br&amp;gt;  &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nvt &amp;lt;br&amp;gt;  &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 MEASURE SYSTEM STATE  &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom step atoms etotal temp press density vol &amp;lt;br&amp;gt; &lt;br /&gt;
variable atoms2 equal atoms*atoms &amp;lt;br&amp;gt;   &lt;br /&gt;
variable volume equal vol&lt;br /&gt;
variable E equal etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable E2 equal etotal*etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens equal density &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens2 equal density*density &amp;lt;br&amp;gt;  &lt;br /&gt;
variable temp equal temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable temp2 equal temp*temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable press equal press &amp;lt;br&amp;gt; &lt;br /&gt;
variable press2 equal press*press &amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_E2 v_E&lt;br /&gt;
run 100000 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
variable HC equal ${atoms2}*(f_aves[7] - f_aves[8]*f_aves[8])/f_aves[5] &amp;lt;br&amp;gt;  &lt;br /&gt;
variable avedens equal f_aves[1] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avetemp equal f_aves[2] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avepress equal f_aves[3] &amp;lt;br&amp;gt; &lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3]) &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;--------&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Temperature: ${temp}&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Heat capacity: ${HC}&amp;quot;  &amp;lt;br&amp;gt;  &lt;br /&gt;
print &amp;quot;atoms&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
print &amp;quot;volume: ${volume}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The supercomputer was nonfunctional during part of the lab and I continually received an error message whenever trying to run the code after it was working.   &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the above equation I can predict the behavior of the system. It can be seem that &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; is directly proportional to &amp;lt;math&amp;gt; N^2 &amp;lt;/math&amp;gt;/. This informs us that for a system with a fixed volume (isochoric) as the number of particles increase as the will the heat capacity. Therefore at a given temperature I believe the heat capacity will be greater for the system with a density of 0.8 than for a system with density of 0.2.&lt;br /&gt;
&lt;br /&gt;
= Structural Properties and the Radial Distribution function =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:G(r).png|x300px|thumb|RDF at different phases|left]]&lt;br /&gt;
! [[File:Integral.png|x300px|thumb|Integral of g(r)|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To carry out the RDF calculations temperature was kept constant at 1.2 but density was varied. &lt;br /&gt;
&lt;br /&gt;
Density in reduced units used for each phase: &lt;br /&gt;
&lt;br /&gt;
* Gas = 0.05&lt;br /&gt;
* Liquid = 0.8 &lt;br /&gt;
* Solid = 1.2&lt;br /&gt;
&lt;br /&gt;
The number of peaks for each RDF plot decreases in the order gas&amp;lt;liquid&amp;lt;solid. This reflects the ordering of each phase. &lt;br /&gt;
A gas has a large degree of disorder and thus produces only peak.&lt;br /&gt;
The liquid has three peaks which gradually decrease in amplitude, this behavior is due to the fact that the liquid is modeled as central molecule surrounded by shells of other molecules, this initially creates some degree of order. As the simulation continues the molecules become more diffuse so the ordering decreases and thus the amplitude of peaks decrease.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Solid nearest coordination.png|x400px|centre]]&lt;br /&gt;
&lt;br /&gt;
The above plot indicates the positions of the first three peaks. These will correspond to the three closet atoms in the lattice. &lt;br /&gt;
&lt;br /&gt;
* 1.025 will correspond to one of the atoms at the corner of the unit cell neighboring the starting position.&lt;br /&gt;
* 1.525 will correspond to one of the atoms in the centre of the face of the cube. (The lattice is fcc) &lt;br /&gt;
* 1.825 will correspond to an atom on one of the faces adjacent to the starting point. It cannot be one of the adjacent corners as this would be too large thus it must fall in between the corners and therefore on a face.&lt;br /&gt;
&lt;br /&gt;
= Dynamical Properties and the diffusion coefficient = &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid.png|thumb|solid|x300px|left]]&lt;br /&gt;
! [[File:Liquid.png|thumb|liquid|x300px|centre]]&lt;br /&gt;
! [[File:Gas.png|thumb|gas|x300px|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plot give insight into the displacement of particles. There are variations in the shape of the lines for the large number of atoms and small number of atoms, this is due to the variations in positions being averaged for a large number of atoms and thus gives a better indication of the behavior of the system. The different is very apparent for solid where one can see that the line is much more smooth in the region where the gradient becomes close to 0. &lt;br /&gt;
&lt;br /&gt;
The diffusion constant D was found by calculating the gradient of the line for each phase. The gradient after the line had leveled off was used for the solid.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 0.0304&lt;br /&gt;
| 0.0305&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| 0.001&lt;br /&gt;
| 0.0012 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| &amp;lt;math&amp;gt; 6 x 10^{-8} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 7 x 10^{-9} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There is a gradual decrease in D in the order solid&amp;lt;liquid&amp;lt;gas. This fits out chemical intuition; e.g. the motion of a solid would be much more restricted that the motion of a gas.  &lt;br /&gt;
&lt;br /&gt;
[[File:VACFvrsTS.png|x400px|thumb|VACF vrs Temperature|centre]]&lt;br /&gt;
&lt;br /&gt;
Minima in the VACF plot correspond to points where the atoms collide and change direction. The greater number of minima for a solid is due to the restricted mean square displacement in which the atoms can move, this therefore results in greater collisions as the atoms seek to minimize their potential energy. As a liquid has a greater diffusion coefficient it is able to diffuse away from an atom after a collision, this is why there are fewer minima, the line tends to 0 as the atoms eventually move in opposite directions resulting in velocities cancelling out and therefor the integration becomes 0. The harmonic oscillator is simply a mathematical function without physical meaning therefore it will continue to oscillate around 0 until infinity. &lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function for a 1D harmonic oscillator can be evaluated using the equation for a 1D harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiation of the displacement function will produce a velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx}{dt} = -A\omega\sin\left(\omega t + \phi\right) = v(t) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substitution into velocity autocorrelation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling -A\omega: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right)\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trigometric relation can simplify equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin\left(\omega t + \omega\tau + \phi\right) = cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integration of ansymmetical function results in 0:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} sin(x)cos(x)\mathrm{d}t = 0 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Thus after &amp;lt;math&amp;gt;cos(t\omega) &amp;lt;/math&amp;gt;is removed from top line the equation simplifies to: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(t\omega) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Vapourphse.png|thumb|Vapour Phase|x300px|left]]&lt;br /&gt;
! [[File:Vapour phase 1 million.png|thumb|Vapour Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid(small).png|thumb|Solid Phase|x300px|left]]&lt;br /&gt;
! [[File:Solid1million.png|thumb|Solid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Liquidsmallno..png|thumb|Liquid Phase|x300px|left]]&lt;br /&gt;
! [[File:Liquid1millionatoms.png|thumb|Liquid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 1.64&lt;br /&gt;
| 1.63&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| -0.2215&lt;br /&gt;
| 0.157 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| 0.254&lt;br /&gt;
| -0.123&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the trapezium rule to calculate D from a VACF plot yeilded a similar trend in diffusion coefficients however there was a discrepancy in one of my results. The value of D for a liquid of small number of atoms was smaller and more negative than the solid. This indictaes that using the MSD method is more accurate than VACF. This also indicates that it is more important to use the VACF plot for a large system when calculating D. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= References = &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Mark Klarpus, Gregory A. Petsko, (1990) &#039;&#039;Molecular Reaction Dynamics in Biology&#039;&#039;, &#039;&#039;&#039;347&#039;&#039;&#039;, 631-9, doi:10.1038/347631a0&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=579756</id>
		<title>Rep:Thermomp4114</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=579756"/>
		<updated>2017-02-01T09:43:04Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: /* Reduced Units */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Molecular Dynamics Simulations of Simple Liquids Introduction == &lt;br /&gt;
&lt;br /&gt;
Molecular dynamic simulations involved studying the motion of a system of particles. Several fundamental elements of a system need to be known in order to achieve this. This includes a knowledge of the interaction potential for the particles and the equations of motion which govern the dynamics of the particles.&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt; Once we know the positions, velocities, and forces, of the atoms (which are obtained using statistical) we can calculate various thermodynamic quantities of the system such as temperature and pressure. We must introduce a series of approximations in order for the caluculations to be feasible. Firstly we apply the &#039;&#039;&#039;The Classical Particle Approximation&#039;&#039;&#039;. The schoedinger equation is too complex to solve for a large system of atoms, however if the atoms are treated classically then the positions and and velocities of each can atom can be calculated using Newton&#039;s second law (equation 1): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = m_i \mathbf{a}_i = m_i \frac{\mathrm{d}\mathbf{v}_i}{\mathrm{d}t} = m_i \frac{\mathrm{d}^2 \mathbf{x}_i}{\mathrm{d}t^2} \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As there are N atoms and therefore N equations representing each atom a computer is a necessity. The &#039;&#039;&#039;Verlet algorithim&#039;&#039;&#039; is used to solve to Newton&#039;s law for all the atoms in the system. In this case time is not continuous but is made discrete, the simulation is thus broeken up into specific &#039;&#039;&#039;timesteps&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The position of atom &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;\mathbf{x}_i \left(t\right)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Positional Verlet algorithim (equation (2)): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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 \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Velocity Verlet algorithim (equation (3)):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{v}_i \left(t\right)&amp;lt;/math&amp;gt; represents the velocity of that atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;center&amp;gt;&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 \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Put in example of industrial applications&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Harmonic Oscillator ===&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator illustrates the the accuracy and discrepancies associated with using the velocity Verlet algorithim. Equation (4) is used to model the behavior of the harmonic oscillator in an analytical sense: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)\ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; = 1.00 &lt;br /&gt;
&lt;br /&gt;
Graph (1) illustrates the results the analytical solution gave for the relationship between position and time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Avrsxt2.png|x300px|thumb|Graph 1: Analytical solution of harmonic oscillator|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The difference in position between the velocity-verlet solution and analytical solution is represented by an error. Error plotted against time is illustrated by graph (2). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ErrorvrsT.png|x300px|thumb|Graph 2: Error vrs Time|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The orange line illustrates the positive trend between error and time. This shows that error is accumulative with time. Each timestep represents a calculation which has an associated error thus as the simulation proceeds the errors will be summed. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy of the system will consist of the sum of kinetic and potential energy. Equation (5) can be used to find kinetic energy of the system:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;E_\text{k} =\tfrac{1}{2} mv(t)^2 \ \ (5)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\mathbf{x} \left(t\right)&amp;lt;/math&amp;gt; is used in equation (5) the potential energy can be found. &lt;br /&gt;
&lt;br /&gt;
The following graphs represent the difference in change in energy with time when the timestep is varied. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EvrsTime.png|x200px|thumb|Energy change when a timestep of 0.1 is used|left]]&lt;br /&gt;
! [[File:Energy vrs time for 0.15 timestep.png|x200px|thumb|Energy change when a timestep of 0.15 is used|centre]]&lt;br /&gt;
! [[File:Energy vrs time for 0.2 timestep.png|x200px|thumb|Energy change when a timestep of 0.2 is used|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The maximum change in energy for each of the different timesteps is shown in table (1). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | Timestep&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.1&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.15&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.2&lt;br /&gt;
|-&lt;br /&gt;
| Max. change in Energy&lt;br /&gt;
| 0.2%&lt;br /&gt;
| 0.6%&lt;br /&gt;
| 1%&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results clearly indicate that a timestep greater than &#039;&#039;&#039;0.2&#039;&#039;&#039; will result in an energy change greater than 1%. As the timestep increases as does the maximum error. The timestep defines the number of calculations made in a given time, therefore the shorter the timestep the larger the number of calculations carried out and therefore a more accurate result is produced. The total energy of a real physical system should not change, when modeled numerically there can be fluctuations therefore it is important to monitor this change and ensure that the fluctuations are minimised.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces ===&lt;br /&gt;
&lt;br /&gt;
The forces an atom experiences is determined by the positions of all the atoms in the system, &amp;lt;math&amp;gt;\mathbf{r}^N&amp;lt;/math&amp;gt;. The Lennard-Jones function accurately sums all the key inter-atomic forces an atoms experiences (U). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ (10)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
For a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After division by 4 and rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_0^{6}} = \frac{\sigma^{6}}{r_0^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After further rearrangement and cancelling down: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;-\sigma &amp;lt;/math&amp;gt; is also a solution however this can be disregarded. &lt;br /&gt;
&lt;br /&gt;
In order to calculate the force the following equation is used: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\sigma\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After differentiation and simplification: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}(r_0) =  \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At equilibrium: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{12\sigma^{12}}{r_e^{13}} - \frac{6\sigma^6}{r_e^7} \right)&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
After rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_e = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This value of &amp;lt;math&amp;gt; r_e &amp;lt;/math&amp;gt; can now be used to find the well depth:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{\sigma^{12}}{4sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon\left(\frac{1}{5r^{5}} - \frac{1}{11r^11} \right)^\infty_2 \simeq -2.48 \sdot 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -8.18 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -3.29 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
* No. of moles in  1 mL of water = 0.056 &amp;lt;br&amp;gt; &lt;br /&gt;
* No. of molecules = moles x Avogadro&#039;s constant = 3.37 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*1000 molecules = 1.66 x 10&amp;lt;sup&amp;gt;21&amp;lt;/sup&amp;gt; moles&lt;br /&gt;
* Density = mass/vol. = 1 &lt;br /&gt;
*vol. = mass/density = 2.99 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Due to periodic boundary condition once the atom leaves the current box it will enter the beginning of an identical box. The atom is at &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; and thus once it breaches 0.5 in a particular direction it will be at the start of the next box. Using these principles after the atom moves &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will be at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units === &lt;br /&gt;
&lt;br /&gt;
Reduced units are applied to the Lennard-Jones equation to make the calculation more managable.&lt;br /&gt;
&lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For argon:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Distance in real units: r = 1.09 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Well depth = &amp;lt;math&amp;gt;{\epsilon}&amp;lt;/math&amp;gt; = 0.996 KJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* T = 180 K&lt;br /&gt;
&lt;br /&gt;
= Equilibriation = &lt;br /&gt;
&lt;br /&gt;
=== Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
As there is a large number of atoms in a discrete volume allowing random assignment of positions could result in atoms overlapping. This would cause an unrealistically high potential as potential is distance dependant (as observed in the Lennard - Jones equation).&lt;br /&gt;
&lt;br /&gt;
* Density is given by the following equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{n}{v} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 1 (as there is only 1 atom per unit cell) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = 1.07722^3 = 1.25 &amp;lt;/math&amp;gt; (lattice spacing = 1.07722) &lt;br /&gt;
&lt;br /&gt;
Thus: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length of a side of one fcc unit cell with number density 1.2 would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = \frac{n}{\rho} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 4 (as there is 4 atoms per unit cell in an fcc lattice) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; = 3.33&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; l = v^{-3} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The number of atoms that would be created by the create_atoms command for an fcc lattice would be: &lt;br /&gt;
&lt;br /&gt;
4 x 1000 = 4000 &lt;br /&gt;
&lt;br /&gt;
This is due to fact that there is 1 atom per unit cell that yeilds 1000 altogether in simple cubic. Fcc has 4 times the number of atoms per unit cell. &lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of Atoms === &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command above has the following purpose: &lt;br /&gt;
&lt;br /&gt;
* The first line sets the mass of all atoms of type &#039;1&#039; to 1.0. &lt;br /&gt;
*  Line 2 is used to control the Lennard-Jones potential. The value of 3.0 indicates the distance in reduced units upon which the potential is calculated. The potential is distance dependent and falls to 0 at large values of r thus only atoms within a distance of 3.0 are considered.  &#039;lj/cut&#039; defines the cut off point. &lt;br /&gt;
* The last line defines the force field constants as 1.0 for all sets of atoms. The * controls the fact that the command is set for all atoms. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet is the integration algorithm that can be used when &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; are defined. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The codes is in place to ensure that the timestep can be varied but the total time taken for the simulation to run will not change.&lt;br /&gt;
&lt;br /&gt;
=== Checking equilibration === &lt;br /&gt;
&lt;br /&gt;
The graphs below illustrate the time it takes for different thermodynamic properties to equilibriate at a timestep of 0.001. The plateau represents the point at which equilibration is achieved. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EnergyVRStime.png|x300px|thumb|Energy Vrs Time|left]]&lt;br /&gt;
! [[File:TEMPvrsTIME.png|x300px|thumb|Temp vrs Time|centre]]&lt;br /&gt;
! [[File:Press Vrs Time.png|x300px|thumb|Pressure Vrs Time|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The graph below illustrates the effect changing the timestep has on equilibration. As can be seen from the graph a from below 0.01 a shorter timestep results in a lower energy value for equilibration until 0.0025 where the value   of equilibration does not change with lower timestep. This trend is due to the fact that a smaller timestep results in a more accurate result however if it is too small this can over-complicate the calculation (especially when there is a large over-all time). Thus a timestep of 0.0025 is ideal. A timestep of 0.025 is too large and results in the system not reaching equilibrium.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EnergyVtimeFORVTS.png|x400px|thumb|Energy Vrs Time with different timesteps|centre]]&lt;br /&gt;
&lt;br /&gt;
= Running Simulations Under Specific Conditions =&lt;br /&gt;
&lt;br /&gt;
The following two equations can be used to define the energy of the system: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The instantaneous tempertaure &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will not remain constant throughout the simulation and will fluctuate, it will thus be different to out target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The value of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2} = \frac{\mathfrak{T}}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within the preceding code: &lt;br /&gt;
&lt;br /&gt;
100 - Nevery: This command results in a sample being taken every 100 steps and being incorporated into the average. 1000 - Nrepreat: Tells the computer how many samples should be used to calculate the average. Nfreq 10 000: At every 10000th timestep an average is calculated. &lt;br /&gt;
&lt;br /&gt;
All thermodynamic properties are calculated by averages that is the necessity for those commands.&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equation of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:DENSITYvrsT.png|x400px|thumb|Density Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
The densities produced from the simulation are lower than for the ideal gas. This is a result of the simulation creating a more realistic picture of how the atoms interact as it takes into account Lennard-Jones potential. In an ideal gas the motion of atoms will be random, chaotic and inter atomic interactions are ignored however in the simulation the atoms will want to minimize their potential and therefore this will drive them to occupy a greater volume thus reducing the density.&lt;br /&gt;
&lt;br /&gt;
= Calculating Heat Capacities Using Statistic Physics =&lt;br /&gt;
&lt;br /&gt;
Example of input code used: &lt;br /&gt;
&lt;br /&gt;
* Density 0.2&lt;br /&gt;
* Temperature 2.0 &lt;br /&gt;
&lt;br /&gt;
 variable density equal 0.2&lt;br /&gt;
 DEFINE SIMULATION BOX GEOMETRY &amp;lt;br&amp;gt; &lt;br /&gt;
lattice sc ${density} &amp;lt;br&amp;gt; &lt;br /&gt;
region box block 0 15 0 15 0 15 &amp;lt;br&amp;gt; &lt;br /&gt;
create_box 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
create_atoms 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
DEFINE PHYSICAL PROPERTIES OF ATOMS &amp;lt;br&amp;gt; &lt;br /&gt;
mass 1 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_style lj/cut/opt 3.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_coeff 1 1 1.0 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
neighbor 2.0 bin &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY THE REQUIRED THERMODYNAMIC STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable T equal 2.0 &amp;lt;br&amp;gt; &lt;br /&gt;
variable p equal 2.5 &amp;lt;br&amp;gt; &lt;br /&gt;
variable timestep equal 0.0025 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ASSIGN ATOMIC VELOCITIES &amp;lt;br&amp;gt; &lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
SPECIFY ENSEMBLE &amp;lt;br&amp;gt; &lt;br /&gt;
timestep ${timestep} &amp;lt;br&amp;gt; &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 THERMODYNAMIC OUTPUT CONTROL &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom time etotal temp press &amp;lt;br&amp;gt; &lt;br /&gt;
thermo 10 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RECORD TRAJECTORY &amp;lt;br&amp;gt; &lt;br /&gt;
dump traj all custom 1000 output-1 id x y z &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY TIMESTEP &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RUN SIMULATION TO MELT CRYSTAL &amp;lt;br&amp;gt; &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nve &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 BRING SYSTEM TO REQUIRED STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable tdamp equal ${timestep}*100 &amp;lt;br&amp;gt; &lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &amp;lt;br&amp;gt;  &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nvt &amp;lt;br&amp;gt;  &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 MEASURE SYSTEM STATE  &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom step atoms etotal temp press density &amp;lt;br&amp;gt; &lt;br /&gt;
variable atoms2 equal atoms*atoms &amp;lt;br&amp;gt;   &lt;br /&gt;
variable E equal etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable E2 equal etotal*etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens equal density &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens2 equal density*density &amp;lt;br&amp;gt;  &lt;br /&gt;
variable temp equal temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable temp2 equal temp*temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable press equal press &amp;lt;br&amp;gt; &lt;br /&gt;
variable press2 equal press*press &amp;lt;br&amp;gt; &lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_E2 v_E&lt;br /&gt;
run 100000 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
variable HC equal ${atoms2}*(f_aves[7] - f_aves[8]*f_aves[8])/f_aves[5] &amp;lt;br&amp;gt;  &lt;br /&gt;
variable avedens equal f_aves[1] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avetemp equal f_aves[2] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avepress equal f_aves[3] &amp;lt;br&amp;gt; &lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3]) &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;--------&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Temperature: ${temp}&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Heat capacity: ${HC}&amp;quot;  &amp;lt;br&amp;gt;  &lt;br /&gt;
print &amp;quot;atoms&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The super computer was not functional during the lab at the end and thus no output files were produced. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the above equation I can predict the behavior of the system. It can be seem that &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; is directly proportional to &amp;lt;math&amp;gt; N^2 &amp;lt;/math&amp;gt;/. This informs us that for a system with a fixed volume (isochoric) as the number of particles increase as the will the heat capacity. Therefore at a given temperature I believe the heat capacity will be greater for the system with a density of 0.8 than for a system with density of 0.2.&lt;br /&gt;
&lt;br /&gt;
= Structural Properties and the Radial Distribution function =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:G(r).png|x300px|thumb|RDF at different phases|left]]&lt;br /&gt;
! [[File:Integral.png|x300px|thumb|Integral of g(r)|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To carry out the RDF calculations temperature was kept constant at 1.2 but density was varied. &lt;br /&gt;
&lt;br /&gt;
Density in reduced units used for each phase: &lt;br /&gt;
&lt;br /&gt;
* Gas = 0.05&lt;br /&gt;
* Liquid = 0.8 &lt;br /&gt;
* Solid = 1.2&lt;br /&gt;
&lt;br /&gt;
The number of peaks for each RDF plot decreases in the order gas&amp;lt;liquid&amp;lt;solid. This reflects the ordering of each phase. &lt;br /&gt;
A gas has a large degree of disorder and thus produces only peak.&lt;br /&gt;
The liquid has three peaks which gradually decrease in amplitude, this behavior is due to the fact that the liquid is modeled as central molecule surrounded by shells of other molecules, this initially creates some degree of order. As the simulation continues the molecules become more diffuse so the ordering decreases and thus the amplitude of peaks decrease.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Solid nearest coordination.png|x400px|centre]]&lt;br /&gt;
&lt;br /&gt;
The above plot indicates the positions of the first three peaks. These will correspond to the three closet atoms in the lattice. &lt;br /&gt;
&lt;br /&gt;
* 1.025 will correspond to one of the atoms at the corner of the unit cell neighboring the starting position.&lt;br /&gt;
* 1.525 will correspond to one of the atoms in the centre of the face of the cube. (The lattice is fcc) &lt;br /&gt;
* 1.825 will correspond to an atom on one of the faces adjacent to the starting point. It cannot be one of the adjacent corners as this would be too large thus it must fall in between the corners and therefore on a face.&lt;br /&gt;
&lt;br /&gt;
= Dynamical Properties and the diffusion coefficient = &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid.png|thumb|solid|x300px|left]]&lt;br /&gt;
! [[File:Liquid.png|thumb|liquid|x300px|centre]]&lt;br /&gt;
! [[File:Gas.png|thumb|gas|x300px|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plot give insight into the displacement of particles. There are variations in the shape of the lines for the large number of atoms and small number of atoms, this is due to the variations in positions being averaged for a large number of atoms and thus gives a better indication of the behavior of the system. The different is very apparent for solid where one can see that the line is much more smooth in the region where the gradient becomes close to 0. &lt;br /&gt;
&lt;br /&gt;
The diffusion constant D was found by calculating the gradient of the line for each phase. The gradient after the line had leveled off was used for the solid.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 0.0304&lt;br /&gt;
| 0.0305&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| 0.001&lt;br /&gt;
| 0.0012 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| &amp;lt;math&amp;gt; 6 x 10^{-8} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 7 x 10^{-9} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There is a gradual decrease in D in the order solid&amp;lt;liquid&amp;lt;gas. This fits out chemical intuition; e.g. the motion of a solid would be much more restricted that the motion of a gas.  &lt;br /&gt;
&lt;br /&gt;
[[File:VACFvrsTS.png|x400px|thumb|VACF vrs Temperature|centre]]&lt;br /&gt;
&lt;br /&gt;
Minima in the VACF plot correspond to points where the atoms collide and change direction. The greater number of minima for a solid is due to the restricted mean square displacement in which the atoms can move, this therefore results in greater collisions as the atoms seek to minimize their potential energy. As a liquid has a greater diffusion coefficient it is able to diffuse away from an atom after a collision, this is why there are fewer minima, the line tends to 0 as the atoms eventually move in opposite directions resulting in velocities cancelling out and therefor the integration becomes 0. The harmonic oscillator is simply a mathematical function without physical meaning therefore it will continue to oscillate around 0 until infinity. &lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function for a 1D harmonic oscillator can be evaluated using the equation for a 1D harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiation of the displacement function will produce a velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx}{dt} = -A\omega\sin\left(\omega t + \phi\right) = v(t) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substitution into velocity autocorrelation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling -A\omega: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right)\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trigometric relation can simplify equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin\left(\omega t + \omega\tau + \phi\right) = cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integration of ansymmetical function results in 0:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} sin(x)cos(x)\mathrm{d}t = 0 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Thus after &amp;lt;math&amp;gt;cos(t\omega) &amp;lt;/math&amp;gt;is removed from top line the equation simplifies to: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(t\omega) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Vapourphse.png|thumb|Vapour Phase|x300px|left]]&lt;br /&gt;
! [[File:Vapour phase 1 million.png|thumb|Vapour Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid(small).png|thumb|Solid Phase|x300px|left]]&lt;br /&gt;
! [[File:Solid1million.png|thumb|Solid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Liquidsmallno..png|thumb|Liquid Phase|x300px|left]]&lt;br /&gt;
! [[File:Liquid1millionatoms.png|thumb|Liquid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 1.64&lt;br /&gt;
| 1.63&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| -0.2215&lt;br /&gt;
| 0.157 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| 0.254&lt;br /&gt;
| -0.123&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the trapezium rule to calculate D from a VACF plot yeilded a similar trend in diffusion coefficients however there was a discrepancy in one of my results. The value of D for a liquid of small number of atoms was smaller and more negative than the solid. This indictaes that using the MSD method is more accurate than VACF. This also indicates that it is more important to use the VACF plot for a large system when calculating D. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= References = &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Mark Klarpus, Gregory A. Petsko, (1990) &#039;&#039;Molecular Reaction Dynamics in Biology&#039;&#039;, &#039;&#039;&#039;347&#039;&#039;&#039;, 631-9, doi:10.1038/347631a0&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=579755</id>
		<title>Rep:Thermomp4114</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=579755"/>
		<updated>2017-02-01T09:42:50Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: /* Atomic Forces */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Molecular Dynamics Simulations of Simple Liquids Introduction == &lt;br /&gt;
&lt;br /&gt;
Molecular dynamic simulations involved studying the motion of a system of particles. Several fundamental elements of a system need to be known in order to achieve this. This includes a knowledge of the interaction potential for the particles and the equations of motion which govern the dynamics of the particles.&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt; Once we know the positions, velocities, and forces, of the atoms (which are obtained using statistical) we can calculate various thermodynamic quantities of the system such as temperature and pressure. We must introduce a series of approximations in order for the caluculations to be feasible. Firstly we apply the &#039;&#039;&#039;The Classical Particle Approximation&#039;&#039;&#039;. The schoedinger equation is too complex to solve for a large system of atoms, however if the atoms are treated classically then the positions and and velocities of each can atom can be calculated using Newton&#039;s second law (equation 1): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = m_i \mathbf{a}_i = m_i \frac{\mathrm{d}\mathbf{v}_i}{\mathrm{d}t} = m_i \frac{\mathrm{d}^2 \mathbf{x}_i}{\mathrm{d}t^2} \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As there are N atoms and therefore N equations representing each atom a computer is a necessity. The &#039;&#039;&#039;Verlet algorithim&#039;&#039;&#039; is used to solve to Newton&#039;s law for all the atoms in the system. In this case time is not continuous but is made discrete, the simulation is thus broeken up into specific &#039;&#039;&#039;timesteps&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The position of atom &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;\mathbf{x}_i \left(t\right)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Positional Verlet algorithim (equation (2)): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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 \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Velocity Verlet algorithim (equation (3)):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{v}_i \left(t\right)&amp;lt;/math&amp;gt; represents the velocity of that atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;center&amp;gt;&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 \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Put in example of industrial applications&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Harmonic Oscillator ===&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator illustrates the the accuracy and discrepancies associated with using the velocity Verlet algorithim. Equation (4) is used to model the behavior of the harmonic oscillator in an analytical sense: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)\ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; = 1.00 &lt;br /&gt;
&lt;br /&gt;
Graph (1) illustrates the results the analytical solution gave for the relationship between position and time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Avrsxt2.png|x300px|thumb|Graph 1: Analytical solution of harmonic oscillator|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The difference in position between the velocity-verlet solution and analytical solution is represented by an error. Error plotted against time is illustrated by graph (2). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ErrorvrsT.png|x300px|thumb|Graph 2: Error vrs Time|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The orange line illustrates the positive trend between error and time. This shows that error is accumulative with time. Each timestep represents a calculation which has an associated error thus as the simulation proceeds the errors will be summed. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy of the system will consist of the sum of kinetic and potential energy. Equation (5) can be used to find kinetic energy of the system:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;E_\text{k} =\tfrac{1}{2} mv(t)^2 \ \ (5)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\mathbf{x} \left(t\right)&amp;lt;/math&amp;gt; is used in equation (5) the potential energy can be found. &lt;br /&gt;
&lt;br /&gt;
The following graphs represent the difference in change in energy with time when the timestep is varied. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EvrsTime.png|x200px|thumb|Energy change when a timestep of 0.1 is used|left]]&lt;br /&gt;
! [[File:Energy vrs time for 0.15 timestep.png|x200px|thumb|Energy change when a timestep of 0.15 is used|centre]]&lt;br /&gt;
! [[File:Energy vrs time for 0.2 timestep.png|x200px|thumb|Energy change when a timestep of 0.2 is used|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The maximum change in energy for each of the different timesteps is shown in table (1). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | Timestep&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.1&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.15&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.2&lt;br /&gt;
|-&lt;br /&gt;
| Max. change in Energy&lt;br /&gt;
| 0.2%&lt;br /&gt;
| 0.6%&lt;br /&gt;
| 1%&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results clearly indicate that a timestep greater than &#039;&#039;&#039;0.2&#039;&#039;&#039; will result in an energy change greater than 1%. As the timestep increases as does the maximum error. The timestep defines the number of calculations made in a given time, therefore the shorter the timestep the larger the number of calculations carried out and therefore a more accurate result is produced. The total energy of a real physical system should not change, when modeled numerically there can be fluctuations therefore it is important to monitor this change and ensure that the fluctuations are minimised.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces ===&lt;br /&gt;
&lt;br /&gt;
The forces an atom experiences is determined by the positions of all the atoms in the system, &amp;lt;math&amp;gt;\mathbf{r}^N&amp;lt;/math&amp;gt;. The Lennard-Jones function accurately sums all the key inter-atomic forces an atoms experiences (U). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ (10)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
For a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After division by 4 and rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_0^{6}} = \frac{\sigma^{6}}{r_0^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After further rearrangement and cancelling down: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;-\sigma &amp;lt;/math&amp;gt; is also a solution however this can be disregarded. &lt;br /&gt;
&lt;br /&gt;
In order to calculate the force the following equation is used: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\sigma\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After differentiation and simplification: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}(r_0) =  \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At equilibrium: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{12\sigma^{12}}{r_e^{13}} - \frac{6\sigma^6}{r_e^7} \right)&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
After rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_e = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This value of &amp;lt;math&amp;gt; r_e &amp;lt;/math&amp;gt; can now be used to find the well depth:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{\sigma^{12}}{4sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon\left(\frac{1}{5r^{5}} - \frac{1}{11r^11} \right)^\infty_2 \simeq -2.48 \sdot 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -8.18 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -3.29 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
* No. of moles in  1 mL of water = 0.056 &amp;lt;br&amp;gt; &lt;br /&gt;
* No. of molecules = moles x Avogadro&#039;s constant = 3.37 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*1000 molecules = 1.66 x 10&amp;lt;sup&amp;gt;21&amp;lt;/sup&amp;gt; moles&lt;br /&gt;
* Density = mass/vol. = 1 &lt;br /&gt;
*vol. = mass/density = 2.99 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Due to periodic boundary condition once the atom leaves the current box it will enter the beginning of an identical box. The atom is at &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; and thus once it breaches 0.5 in a particular direction it will be at the start of the next box. Using these principles after the atom moves &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will be at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units === &lt;br /&gt;
&lt;br /&gt;
Reduced units are applied to the Lennard-Jones equation to make the calculation more managable.&lt;br /&gt;
&lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For argon:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Distance in real units: r = 1.09 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Well depth = &amp;lt;math&amp;gt;{\epsilon}&amp;lt;/math&amp;gt; = 0.996 KJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* T = 180 K &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Do I need to show working out?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Equilibriation = &lt;br /&gt;
&lt;br /&gt;
=== Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
As there is a large number of atoms in a discrete volume allowing random assignment of positions could result in atoms overlapping. This would cause an unrealistically high potential as potential is distance dependant (as observed in the Lennard - Jones equation).&lt;br /&gt;
&lt;br /&gt;
* Density is given by the following equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{n}{v} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 1 (as there is only 1 atom per unit cell) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = 1.07722^3 = 1.25 &amp;lt;/math&amp;gt; (lattice spacing = 1.07722) &lt;br /&gt;
&lt;br /&gt;
Thus: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length of a side of one fcc unit cell with number density 1.2 would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = \frac{n}{\rho} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 4 (as there is 4 atoms per unit cell in an fcc lattice) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; = 3.33&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; l = v^{-3} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The number of atoms that would be created by the create_atoms command for an fcc lattice would be: &lt;br /&gt;
&lt;br /&gt;
4 x 1000 = 4000 &lt;br /&gt;
&lt;br /&gt;
This is due to fact that there is 1 atom per unit cell that yeilds 1000 altogether in simple cubic. Fcc has 4 times the number of atoms per unit cell. &lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of Atoms === &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command above has the following purpose: &lt;br /&gt;
&lt;br /&gt;
* The first line sets the mass of all atoms of type &#039;1&#039; to 1.0. &lt;br /&gt;
*  Line 2 is used to control the Lennard-Jones potential. The value of 3.0 indicates the distance in reduced units upon which the potential is calculated. The potential is distance dependent and falls to 0 at large values of r thus only atoms within a distance of 3.0 are considered.  &#039;lj/cut&#039; defines the cut off point. &lt;br /&gt;
* The last line defines the force field constants as 1.0 for all sets of atoms. The * controls the fact that the command is set for all atoms. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet is the integration algorithm that can be used when &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; are defined. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The codes is in place to ensure that the timestep can be varied but the total time taken for the simulation to run will not change.&lt;br /&gt;
&lt;br /&gt;
=== Checking equilibration === &lt;br /&gt;
&lt;br /&gt;
The graphs below illustrate the time it takes for different thermodynamic properties to equilibriate at a timestep of 0.001. The plateau represents the point at which equilibration is achieved. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EnergyVRStime.png|x300px|thumb|Energy Vrs Time|left]]&lt;br /&gt;
! [[File:TEMPvrsTIME.png|x300px|thumb|Temp vrs Time|centre]]&lt;br /&gt;
! [[File:Press Vrs Time.png|x300px|thumb|Pressure Vrs Time|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The graph below illustrates the effect changing the timestep has on equilibration. As can be seen from the graph a from below 0.01 a shorter timestep results in a lower energy value for equilibration until 0.0025 where the value   of equilibration does not change with lower timestep. This trend is due to the fact that a smaller timestep results in a more accurate result however if it is too small this can over-complicate the calculation (especially when there is a large over-all time). Thus a timestep of 0.0025 is ideal. A timestep of 0.025 is too large and results in the system not reaching equilibrium.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EnergyVtimeFORVTS.png|x400px|thumb|Energy Vrs Time with different timesteps|centre]]&lt;br /&gt;
&lt;br /&gt;
= Running Simulations Under Specific Conditions =&lt;br /&gt;
&lt;br /&gt;
The following two equations can be used to define the energy of the system: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The instantaneous tempertaure &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will not remain constant throughout the simulation and will fluctuate, it will thus be different to out target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The value of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2} = \frac{\mathfrak{T}}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within the preceding code: &lt;br /&gt;
&lt;br /&gt;
100 - Nevery: This command results in a sample being taken every 100 steps and being incorporated into the average. 1000 - Nrepreat: Tells the computer how many samples should be used to calculate the average. Nfreq 10 000: At every 10000th timestep an average is calculated. &lt;br /&gt;
&lt;br /&gt;
All thermodynamic properties are calculated by averages that is the necessity for those commands.&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equation of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:DENSITYvrsT.png|x400px|thumb|Density Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
The densities produced from the simulation are lower than for the ideal gas. This is a result of the simulation creating a more realistic picture of how the atoms interact as it takes into account Lennard-Jones potential. In an ideal gas the motion of atoms will be random, chaotic and inter atomic interactions are ignored however in the simulation the atoms will want to minimize their potential and therefore this will drive them to occupy a greater volume thus reducing the density.&lt;br /&gt;
&lt;br /&gt;
= Calculating Heat Capacities Using Statistic Physics =&lt;br /&gt;
&lt;br /&gt;
Example of input code used: &lt;br /&gt;
&lt;br /&gt;
* Density 0.2&lt;br /&gt;
* Temperature 2.0 &lt;br /&gt;
&lt;br /&gt;
 variable density equal 0.2&lt;br /&gt;
 DEFINE SIMULATION BOX GEOMETRY &amp;lt;br&amp;gt; &lt;br /&gt;
lattice sc ${density} &amp;lt;br&amp;gt; &lt;br /&gt;
region box block 0 15 0 15 0 15 &amp;lt;br&amp;gt; &lt;br /&gt;
create_box 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
create_atoms 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
DEFINE PHYSICAL PROPERTIES OF ATOMS &amp;lt;br&amp;gt; &lt;br /&gt;
mass 1 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_style lj/cut/opt 3.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_coeff 1 1 1.0 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
neighbor 2.0 bin &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY THE REQUIRED THERMODYNAMIC STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable T equal 2.0 &amp;lt;br&amp;gt; &lt;br /&gt;
variable p equal 2.5 &amp;lt;br&amp;gt; &lt;br /&gt;
variable timestep equal 0.0025 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ASSIGN ATOMIC VELOCITIES &amp;lt;br&amp;gt; &lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
SPECIFY ENSEMBLE &amp;lt;br&amp;gt; &lt;br /&gt;
timestep ${timestep} &amp;lt;br&amp;gt; &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 THERMODYNAMIC OUTPUT CONTROL &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom time etotal temp press &amp;lt;br&amp;gt; &lt;br /&gt;
thermo 10 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RECORD TRAJECTORY &amp;lt;br&amp;gt; &lt;br /&gt;
dump traj all custom 1000 output-1 id x y z &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY TIMESTEP &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RUN SIMULATION TO MELT CRYSTAL &amp;lt;br&amp;gt; &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nve &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 BRING SYSTEM TO REQUIRED STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable tdamp equal ${timestep}*100 &amp;lt;br&amp;gt; &lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &amp;lt;br&amp;gt;  &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nvt &amp;lt;br&amp;gt;  &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 MEASURE SYSTEM STATE  &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom step atoms etotal temp press density &amp;lt;br&amp;gt; &lt;br /&gt;
variable atoms2 equal atoms*atoms &amp;lt;br&amp;gt;   &lt;br /&gt;
variable E equal etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable E2 equal etotal*etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens equal density &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens2 equal density*density &amp;lt;br&amp;gt;  &lt;br /&gt;
variable temp equal temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable temp2 equal temp*temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable press equal press &amp;lt;br&amp;gt; &lt;br /&gt;
variable press2 equal press*press &amp;lt;br&amp;gt; &lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_E2 v_E&lt;br /&gt;
run 100000 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
variable HC equal ${atoms2}*(f_aves[7] - f_aves[8]*f_aves[8])/f_aves[5] &amp;lt;br&amp;gt;  &lt;br /&gt;
variable avedens equal f_aves[1] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avetemp equal f_aves[2] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avepress equal f_aves[3] &amp;lt;br&amp;gt; &lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3]) &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;--------&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Temperature: ${temp}&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Heat capacity: ${HC}&amp;quot;  &amp;lt;br&amp;gt;  &lt;br /&gt;
print &amp;quot;atoms&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The super computer was not functional during the lab at the end and thus no output files were produced. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the above equation I can predict the behavior of the system. It can be seem that &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; is directly proportional to &amp;lt;math&amp;gt; N^2 &amp;lt;/math&amp;gt;/. This informs us that for a system with a fixed volume (isochoric) as the number of particles increase as the will the heat capacity. Therefore at a given temperature I believe the heat capacity will be greater for the system with a density of 0.8 than for a system with density of 0.2.&lt;br /&gt;
&lt;br /&gt;
= Structural Properties and the Radial Distribution function =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:G(r).png|x300px|thumb|RDF at different phases|left]]&lt;br /&gt;
! [[File:Integral.png|x300px|thumb|Integral of g(r)|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To carry out the RDF calculations temperature was kept constant at 1.2 but density was varied. &lt;br /&gt;
&lt;br /&gt;
Density in reduced units used for each phase: &lt;br /&gt;
&lt;br /&gt;
* Gas = 0.05&lt;br /&gt;
* Liquid = 0.8 &lt;br /&gt;
* Solid = 1.2&lt;br /&gt;
&lt;br /&gt;
The number of peaks for each RDF plot decreases in the order gas&amp;lt;liquid&amp;lt;solid. This reflects the ordering of each phase. &lt;br /&gt;
A gas has a large degree of disorder and thus produces only peak.&lt;br /&gt;
The liquid has three peaks which gradually decrease in amplitude, this behavior is due to the fact that the liquid is modeled as central molecule surrounded by shells of other molecules, this initially creates some degree of order. As the simulation continues the molecules become more diffuse so the ordering decreases and thus the amplitude of peaks decrease.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Solid nearest coordination.png|x400px|centre]]&lt;br /&gt;
&lt;br /&gt;
The above plot indicates the positions of the first three peaks. These will correspond to the three closet atoms in the lattice. &lt;br /&gt;
&lt;br /&gt;
* 1.025 will correspond to one of the atoms at the corner of the unit cell neighboring the starting position.&lt;br /&gt;
* 1.525 will correspond to one of the atoms in the centre of the face of the cube. (The lattice is fcc) &lt;br /&gt;
* 1.825 will correspond to an atom on one of the faces adjacent to the starting point. It cannot be one of the adjacent corners as this would be too large thus it must fall in between the corners and therefore on a face.&lt;br /&gt;
&lt;br /&gt;
= Dynamical Properties and the diffusion coefficient = &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid.png|thumb|solid|x300px|left]]&lt;br /&gt;
! [[File:Liquid.png|thumb|liquid|x300px|centre]]&lt;br /&gt;
! [[File:Gas.png|thumb|gas|x300px|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plot give insight into the displacement of particles. There are variations in the shape of the lines for the large number of atoms and small number of atoms, this is due to the variations in positions being averaged for a large number of atoms and thus gives a better indication of the behavior of the system. The different is very apparent for solid where one can see that the line is much more smooth in the region where the gradient becomes close to 0. &lt;br /&gt;
&lt;br /&gt;
The diffusion constant D was found by calculating the gradient of the line for each phase. The gradient after the line had leveled off was used for the solid.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 0.0304&lt;br /&gt;
| 0.0305&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| 0.001&lt;br /&gt;
| 0.0012 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| &amp;lt;math&amp;gt; 6 x 10^{-8} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 7 x 10^{-9} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There is a gradual decrease in D in the order solid&amp;lt;liquid&amp;lt;gas. This fits out chemical intuition; e.g. the motion of a solid would be much more restricted that the motion of a gas.  &lt;br /&gt;
&lt;br /&gt;
[[File:VACFvrsTS.png|x400px|thumb|VACF vrs Temperature|centre]]&lt;br /&gt;
&lt;br /&gt;
Minima in the VACF plot correspond to points where the atoms collide and change direction. The greater number of minima for a solid is due to the restricted mean square displacement in which the atoms can move, this therefore results in greater collisions as the atoms seek to minimize their potential energy. As a liquid has a greater diffusion coefficient it is able to diffuse away from an atom after a collision, this is why there are fewer minima, the line tends to 0 as the atoms eventually move in opposite directions resulting in velocities cancelling out and therefor the integration becomes 0. The harmonic oscillator is simply a mathematical function without physical meaning therefore it will continue to oscillate around 0 until infinity. &lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function for a 1D harmonic oscillator can be evaluated using the equation for a 1D harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiation of the displacement function will produce a velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx}{dt} = -A\omega\sin\left(\omega t + \phi\right) = v(t) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substitution into velocity autocorrelation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling -A\omega: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right)\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trigometric relation can simplify equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin\left(\omega t + \omega\tau + \phi\right) = cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integration of ansymmetical function results in 0:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} sin(x)cos(x)\mathrm{d}t = 0 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Thus after &amp;lt;math&amp;gt;cos(t\omega) &amp;lt;/math&amp;gt;is removed from top line the equation simplifies to: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(t\omega) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Vapourphse.png|thumb|Vapour Phase|x300px|left]]&lt;br /&gt;
! [[File:Vapour phase 1 million.png|thumb|Vapour Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid(small).png|thumb|Solid Phase|x300px|left]]&lt;br /&gt;
! [[File:Solid1million.png|thumb|Solid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Liquidsmallno..png|thumb|Liquid Phase|x300px|left]]&lt;br /&gt;
! [[File:Liquid1millionatoms.png|thumb|Liquid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 1.64&lt;br /&gt;
| 1.63&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| -0.2215&lt;br /&gt;
| 0.157 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| 0.254&lt;br /&gt;
| -0.123&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the trapezium rule to calculate D from a VACF plot yeilded a similar trend in diffusion coefficients however there was a discrepancy in one of my results. The value of D for a liquid of small number of atoms was smaller and more negative than the solid. This indictaes that using the MSD method is more accurate than VACF. This also indicates that it is more important to use the VACF plot for a large system when calculating D. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= References = &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Mark Klarpus, Gregory A. Petsko, (1990) &#039;&#039;Molecular Reaction Dynamics in Biology&#039;&#039;, &#039;&#039;&#039;347&#039;&#039;&#039;, 631-9, doi:10.1038/347631a0&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578911</id>
		<title>Rep:Thermomp4114</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578911"/>
		<updated>2017-01-27T10:38:47Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Molecular Dynamics Simulations of Simple Liquids Introduction == &lt;br /&gt;
&lt;br /&gt;
Molecular dynamic simulations involved studying the motion of a system of particles. Several fundamental elements of a system need to be known in order to achieve this. This includes a knowledge of the interaction potential for the particles and the equations of motion which govern the dynamics of the particles.&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt; Once we know the positions, velocities, and forces, of the atoms (which are obtained using statistical) we can calculate various thermodynamic quantities of the system such as temperature and pressure. We must introduce a series of approximations in order for the caluculations to be feasible. Firstly we apply the &#039;&#039;&#039;The Classical Particle Approximation&#039;&#039;&#039;. The schoedinger equation is too complex to solve for a large system of atoms, however if the atoms are treated classically then the positions and and velocities of each can atom can be calculated using Newton&#039;s second law (equation 1): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = m_i \mathbf{a}_i = m_i \frac{\mathrm{d}\mathbf{v}_i}{\mathrm{d}t} = m_i \frac{\mathrm{d}^2 \mathbf{x}_i}{\mathrm{d}t^2} \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As there are N atoms and therefore N equations representing each atom a computer is a necessity. The &#039;&#039;&#039;Verlet algorithim&#039;&#039;&#039; is used to solve to Newton&#039;s law for all the atoms in the system. In this case time is not continuous but is made discrete, the simulation is thus broeken up into specific &#039;&#039;&#039;timesteps&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The position of atom &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;\mathbf{x}_i \left(t\right)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Positional Verlet algorithim (equation (2)): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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 \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Velocity Verlet algorithim (equation (3)):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{v}_i \left(t\right)&amp;lt;/math&amp;gt; represents the velocity of that atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;center&amp;gt;&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 \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Put in example of industrial applications&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Harmonic Oscillator ===&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator illustrates the the accuracy and discrepancies associated with using the velocity Verlet algorithim. Equation (4) is used to model the behavior of the harmonic oscillator in an analytical sense: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)\ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; = 1.00 &lt;br /&gt;
&lt;br /&gt;
Graph (1) illustrates the results the analytical solution gave for the relationship between position and time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Avrsxt2.png|x300px|thumb|Graph 1: Analytical solution of harmonic oscillator|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The difference in position between the velocity-verlet solution and analytical solution is represented by an error. Error plotted against time is illustrated by graph (2). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ErrorvrsT.png|x300px|thumb|Graph 2: Error vrs Time|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The orange line illustrates the positive trend between error and time. This shows that error is accumulative with time. Each timestep represents a calculation which has an associated error thus as the simulation proceeds the errors will be summed. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy of the system will consist of the sum of kinetic and potential energy. Equation (5) can be used to find kinetic energy of the system:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;E_\text{k} =\tfrac{1}{2} mv(t)^2 \ \ (5)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\mathbf{x} \left(t\right)&amp;lt;/math&amp;gt; is used in equation (5) the potential energy can be found. &lt;br /&gt;
&lt;br /&gt;
The following graphs represent the difference in change in energy with time when the timestep is varied. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EvrsTime.png|x200px|thumb|Energy change when a timestep of 0.1 is used|left]]&lt;br /&gt;
! [[File:Energy vrs time for 0.15 timestep.png|x200px|thumb|Energy change when a timestep of 0.15 is used|centre]]&lt;br /&gt;
! [[File:Energy vrs time for 0.2 timestep.png|x200px|thumb|Energy change when a timestep of 0.2 is used|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The maximum change in energy for each of the different timesteps is shown in table (1). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | Timestep&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.1&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.15&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.2&lt;br /&gt;
|-&lt;br /&gt;
| Max. change in Energy&lt;br /&gt;
| 0.2%&lt;br /&gt;
| 0.6%&lt;br /&gt;
| 1%&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results clearly indicate that a timestep greater than &#039;&#039;&#039;0.2&#039;&#039;&#039; will result in an energy change greater than 1%. As the timestep increases as does the maximum error. The timestep defines the number of calculations made in a given time, therefore the shorter the timestep the larger the number of calculations carried out and therefore a more accurate result is produced. The total energy of a real physical system should not change, when modeled numerically there can be fluctuations therefore it is important to monitor this change and ensure that the fluctuations are minimised.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces ===&lt;br /&gt;
&lt;br /&gt;
The forces an atom experiences is determined by the positions of all the atoms in the system, &amp;lt;math&amp;gt;\mathbf{r}^N&amp;lt;/math&amp;gt;. The Lennard-Jones function accurately sums all the key inter-atomic forces an atoms experiences (U). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ (10)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
For a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After division by 4 and rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_0^{6}} = \frac{\sigma^{6}}{r_0^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After further rearrangement and cancelling down: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;-\sigma &amp;lt;/math&amp;gt; is also a solution however this can be disregarded. &lt;br /&gt;
&lt;br /&gt;
In order to calculate the force the following equation is used: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\sigma\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After differentiation and simplification: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}(r_0) =  \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At equilibrium: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{12\sigma^{12}}{r_e^{13}} - \frac{6\sigma^6}{r_e^7} \right)&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
After rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_e = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This value of &amp;lt;math&amp;gt; r_e &amp;lt;/math&amp;gt; can now be used to find the well depth:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{\sigma^{12}}{4sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon\left(\frac{1}{5r^{5}} - \frac{1}{11r^11} \right)^\infty_2 \simeq -2.48 \sdot 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -8.18 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -3.29 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Finish off atomic forces - enter integrals&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
* No. of moles in  1 mL of water = 0.056 &amp;lt;br&amp;gt; &lt;br /&gt;
* No. of molecules = moles x Avogadro&#039;s constant = 3.37 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*1000 molecules = 1.66 x 10&amp;lt;sup&amp;gt;21&amp;lt;/sup&amp;gt; moles&lt;br /&gt;
* Density = mass/vol. = 1 &lt;br /&gt;
*vol. = mass/density = 2.99 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Due to periodic boundary condition once the atom leaves the current box it will enter the beginning of an identical box. The atom is at &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; and thus once it breaches 0.5 in a particular direction it will be at the start of the next box. Using these principles after the atom moves &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will be at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units === &lt;br /&gt;
&lt;br /&gt;
Reduced units are applied to the Lennard-Jones equation to make the calculation more managable.&lt;br /&gt;
&lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For argon:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Distance in real units: r = 1.09 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Well depth = &amp;lt;math&amp;gt;{\epsilon}&amp;lt;/math&amp;gt; = 0.996 KJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* T = 180 K &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Do I need to show working out?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Equilibriation = &lt;br /&gt;
&lt;br /&gt;
=== Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
As there is a large number of atoms in a discrete volume allowing random assignment of positions could result in atoms overlapping. This would cause an unrealistically high potential as potential is distance dependant (as observed in the Lennard - Jones equation).&lt;br /&gt;
&lt;br /&gt;
* Density is given by the following equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{n}{v} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 1 (as there is only 1 atom per unit cell) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = 1.07722^3 = 1.25 &amp;lt;/math&amp;gt; (lattice spacing = 1.07722) &lt;br /&gt;
&lt;br /&gt;
Thus: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length of a side of one fcc unit cell with number density 1.2 would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = \frac{n}{\rho} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 4 (as there is 4 atoms per unit cell in an fcc lattice) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; = 3.33&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; l = v^{-3} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The number of atoms that would be created by the create_atoms command for an fcc lattice would be: &lt;br /&gt;
&lt;br /&gt;
4 x 1000 = 4000 &lt;br /&gt;
&lt;br /&gt;
This is due to fact that there is 1 atom per unit cell that yeilds 1000 altogether in simple cubic. Fcc has 4 times the number of atoms per unit cell. &lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of Atoms === &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command above has the following purpose: &lt;br /&gt;
&lt;br /&gt;
* The first line sets the mass of all atoms of type &#039;1&#039; to 1.0. &lt;br /&gt;
*  Line 2 is used to control the Lennard-Jones potential. The value of 3.0 indicates the distance in reduced units upon which the potential is calculated. The potential is distance dependent and falls to 0 at large values of r thus only atoms within a distance of 3.0 are considered.  &#039;lj/cut&#039; defines the cut off point. &lt;br /&gt;
* The last line defines the force field constants as 1.0 for all sets of atoms. The * controls the fact that the command is set for all atoms. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet is the integration algorithm that can be used when &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; are defined. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The codes is in place to ensure that the timestep can be varied but the total time taken for the simulation to run will not change.&lt;br /&gt;
&lt;br /&gt;
=== Checking equilibration === &lt;br /&gt;
&lt;br /&gt;
The graphs below illustrate the time it takes for different thermodynamic properties to equilibriate at a timestep of 0.001. The plateau represents the point at which equilibration is achieved. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EnergyVRStime.png|x300px|thumb|Energy Vrs Time|left]]&lt;br /&gt;
! [[File:TEMPvrsTIME.png|x300px|thumb|Temp vrs Time|centre]]&lt;br /&gt;
! [[File:Press Vrs Time.png|x300px|thumb|Pressure Vrs Time|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The graph below illustrates the effect changing the timestep has on equilibration. As can be seen from the graph a from below 0.01 a shorter timestep results in a lower energy value for equilibration until 0.0025 where the value   of equilibration does not change with lower timestep. This trend is due to the fact that a smaller timestep results in a more accurate result however if it is too small this can over-complicate the calculation (especially when there is a large over-all time). Thus a timestep of 0.0025 is ideal. A timestep of 0.025 is too large and results in the system not reaching equilibrium.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EnergyVtimeFORVTS.png|x400px|thumb|Energy Vrs Time with different timesteps|centre]]&lt;br /&gt;
&lt;br /&gt;
= Running Simulations Under Specific Conditions =&lt;br /&gt;
&lt;br /&gt;
The following two equations can be used to define the energy of the system: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The instantaneous tempertaure &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will not remain constant throughout the simulation and will fluctuate, it will thus be different to out target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The value of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2} = \frac{\mathfrak{T}}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within the preceding code: &lt;br /&gt;
&lt;br /&gt;
100 - Nevery: This command results in a sample being taken every 100 steps and being incorporated into the average. 1000 - Nrepreat: Tells the computer how many samples should be used to calculate the average. Nfreq 10 000: At every 10000th timestep an average is calculated. &lt;br /&gt;
&lt;br /&gt;
All thermodynamic properties are calculated by averages that is the necessity for those commands.&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equation of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:DENSITYvrsT.png|x400px|thumb|Density Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
The densities produced from the simulation are lower than for the ideal gas. This is a result of the simulation creating a more realistic picture of how the atoms interact as it takes into account Lennard-Jones potential. In an ideal gas the motion of atoms will be random, chaotic and inter atomic interactions are ignored however in the simulation the atoms will want to minimize their potential and therefore this will drive them to occupy a greater volume thus reducing the density.&lt;br /&gt;
&lt;br /&gt;
= Calculating Heat Capacities Using Statistic Physics =&lt;br /&gt;
&lt;br /&gt;
Example of input code used: &lt;br /&gt;
&lt;br /&gt;
* Density 0.2&lt;br /&gt;
* Temperature 2.0 &lt;br /&gt;
&lt;br /&gt;
 variable density equal 0.2&lt;br /&gt;
 DEFINE SIMULATION BOX GEOMETRY &amp;lt;br&amp;gt; &lt;br /&gt;
lattice sc ${density} &amp;lt;br&amp;gt; &lt;br /&gt;
region box block 0 15 0 15 0 15 &amp;lt;br&amp;gt; &lt;br /&gt;
create_box 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
create_atoms 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
DEFINE PHYSICAL PROPERTIES OF ATOMS &amp;lt;br&amp;gt; &lt;br /&gt;
mass 1 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_style lj/cut/opt 3.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_coeff 1 1 1.0 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
neighbor 2.0 bin &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY THE REQUIRED THERMODYNAMIC STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable T equal 2.0 &amp;lt;br&amp;gt; &lt;br /&gt;
variable p equal 2.5 &amp;lt;br&amp;gt; &lt;br /&gt;
variable timestep equal 0.0025 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ASSIGN ATOMIC VELOCITIES &amp;lt;br&amp;gt; &lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
SPECIFY ENSEMBLE &amp;lt;br&amp;gt; &lt;br /&gt;
timestep ${timestep} &amp;lt;br&amp;gt; &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 THERMODYNAMIC OUTPUT CONTROL &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom time etotal temp press &amp;lt;br&amp;gt; &lt;br /&gt;
thermo 10 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RECORD TRAJECTORY &amp;lt;br&amp;gt; &lt;br /&gt;
dump traj all custom 1000 output-1 id x y z &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY TIMESTEP &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RUN SIMULATION TO MELT CRYSTAL &amp;lt;br&amp;gt; &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nve &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 BRING SYSTEM TO REQUIRED STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable tdamp equal ${timestep}*100 &amp;lt;br&amp;gt; &lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &amp;lt;br&amp;gt;  &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nvt &amp;lt;br&amp;gt;  &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 MEASURE SYSTEM STATE  &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom step atoms etotal temp press density &amp;lt;br&amp;gt; &lt;br /&gt;
variable atoms2 equal atoms*atoms &amp;lt;br&amp;gt;   &lt;br /&gt;
variable E equal etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable E2 equal etotal*etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens equal density &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens2 equal density*density &amp;lt;br&amp;gt;  &lt;br /&gt;
variable temp equal temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable temp2 equal temp*temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable press equal press &amp;lt;br&amp;gt; &lt;br /&gt;
variable press2 equal press*press &amp;lt;br&amp;gt; &lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_E2 v_E&lt;br /&gt;
run 100000 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
variable HC equal ${atoms2}*(f_aves[7] - f_aves[8]*f_aves[8])/f_aves[5] &amp;lt;br&amp;gt;  &lt;br /&gt;
variable avedens equal f_aves[1] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avetemp equal f_aves[2] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avepress equal f_aves[3] &amp;lt;br&amp;gt; &lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3]) &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;--------&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Temperature: ${temp}&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Heat capacity: ${HC}&amp;quot;  &amp;lt;br&amp;gt;  &lt;br /&gt;
print &amp;quot;atoms&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The super computer was not functional during the lab at the end and thus no output files were produced. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the above equation I can predict the behavior of the system. It can be seem that &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; is directly proportional to &amp;lt;math&amp;gt; N^2 &amp;lt;/math&amp;gt;/. This informs us that for a system with a fixed volume (isochoric) as the number of particles increase as the will the heat capacity. Therefore at a given temperature I believe the heat capacity will be greater for the system with a density of 0.8 than for a system with density of 0.2.&lt;br /&gt;
&lt;br /&gt;
= Structural Properties and the Radial Distribution function =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:G(r).png|x300px|thumb|RDF at different phases|left]]&lt;br /&gt;
! [[File:Integral.png|x300px|thumb|Integral of g(r)|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To carry out the RDF calculations temperature was kept constant at 1.2 but density was varied. &lt;br /&gt;
&lt;br /&gt;
Density in reduced units used for each phase: &lt;br /&gt;
&lt;br /&gt;
* Gas = 0.05&lt;br /&gt;
* Liquid = 0.8 &lt;br /&gt;
* Solid = 1.2&lt;br /&gt;
&lt;br /&gt;
The number of peaks for each RDF plot decreases in the order gas&amp;lt;liquid&amp;lt;solid. This reflects the ordering of each phase. &lt;br /&gt;
A gas has a large degree of disorder and thus produces only peak.&lt;br /&gt;
The liquid has three peaks which gradually decrease in amplitude, this behavior is due to the fact that the liquid is modeled as central molecule surrounded by shells of other molecules, this initially creates some degree of order. As the simulation continues the molecules become more diffuse so the ordering decreases and thus the amplitude of peaks decrease.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Solid nearest coordination.png|x400px|centre]]&lt;br /&gt;
&lt;br /&gt;
The above plot indicates the positions of the first three peaks. These will correspond to the three closet atoms in the lattice. &lt;br /&gt;
&lt;br /&gt;
* 1.025 will correspond to one of the atoms at the corner of the unit cell neighboring the starting position.&lt;br /&gt;
* 1.525 will correspond to one of the atoms in the centre of the face of the cube. (The lattice is fcc) &lt;br /&gt;
* 1.825 will correspond to an atom on one of the faces adjacent to the starting point. It cannot be one of the adjacent corners as this would be too large thus it must fall in between the corners and therefore on a face.&lt;br /&gt;
&lt;br /&gt;
= Dynamical Properties and the diffusion coefficient = &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid.png|thumb|solid|x300px|left]]&lt;br /&gt;
! [[File:Liquid.png|thumb|liquid|x300px|centre]]&lt;br /&gt;
! [[File:Gas.png|thumb|gas|x300px|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plot give insight into the displacement of particles. There are variations in the shape of the lines for the large number of atoms and small number of atoms, this is due to the variations in positions being averaged for a large number of atoms and thus gives a better indication of the behavior of the system. The different is very apparent for solid where one can see that the line is much more smooth in the region where the gradient becomes close to 0. &lt;br /&gt;
&lt;br /&gt;
The diffusion constant D was found by calculating the gradient of the line for each phase. The gradient after the line had leveled off was used for the solid.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 0.0304&lt;br /&gt;
| 0.0305&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| 0.001&lt;br /&gt;
| 0.0012 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| &amp;lt;math&amp;gt; 6 x 10^{-8} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 7 x 10^{-9} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There is a gradual decrease in D in the order solid&amp;lt;liquid&amp;lt;gas. This fits out chemical intuition; e.g. the motion of a solid would be much more restricted that the motion of a gas.  &lt;br /&gt;
&lt;br /&gt;
[[File:VACFvrsTS.png|x400px|thumb|VACF vrs Temperature|centre]]&lt;br /&gt;
&lt;br /&gt;
Minima in the VACF plot correspond to points where the atoms collide and change direction. The greater number of minima for a solid is due to the restricted mean square displacement in which the atoms can move, this therefore results in greater collisions as the atoms seek to minimize their potential energy. As a liquid has a greater diffusion coefficient it is able to diffuse away from an atom after a collision, this is why there are fewer minima, the line tends to 0 as the atoms eventually move in opposite directions resulting in velocities cancelling out and therefor the integration becomes 0. The harmonic oscillator is simply a mathematical function without physical meaning therefore it will continue to oscillate around 0 until infinity. &lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function for a 1D harmonic oscillator can be evaluated using the equation for a 1D harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiation of the displacement function will produce a velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx}{dt} = -A\omega\sin\left(\omega t + \phi\right) = v(t) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substitution into velocity autocorrelation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling -A\omega: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right)\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trigometric relation can simplify equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin\left(\omega t + \omega\tau + \phi\right) = cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integration of ansymmetical function results in 0:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} sin(x)cos(x)\mathrm{d}t = 0 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Thus after &amp;lt;math&amp;gt;cos(t\omega) &amp;lt;/math&amp;gt;is removed from top line the equation simplifies to: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(t\omega) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Vapourphse.png|thumb|Vapour Phase|x300px|left]]&lt;br /&gt;
! [[File:Vapour phase 1 million.png|thumb|Vapour Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid(small).png|thumb|Solid Phase|x300px|left]]&lt;br /&gt;
! [[File:Solid1million.png|thumb|Solid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Liquidsmallno..png|thumb|Liquid Phase|x300px|left]]&lt;br /&gt;
! [[File:Liquid1millionatoms.png|thumb|Liquid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 1.64&lt;br /&gt;
| 1.63&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| -0.2215&lt;br /&gt;
| 0.157 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| 0.254&lt;br /&gt;
| -0.123&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the trapezium rule to calculate D from a VACF plot yeilded a similar trend in diffusion coefficients however there was a discrepancy in one of my results. The value of D for a liquid of small number of atoms was smaller and more negative than the solid. This indictaes that using the MSD method is more accurate than VACF. This also indicates that it is more important to use the VACF plot for a large system when calculating D. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= References = &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Mark Klarpus, Gregory A. Petsko, (1990) &#039;&#039;Molecular Reaction Dynamics in Biology&#039;&#039;, &#039;&#039;&#039;347&#039;&#039;&#039;, 631-9, doi:10.1038/347631a0&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578910</id>
		<title>Rep:Thermomp4114</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578910"/>
		<updated>2017-01-27T10:38:11Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: /* Dynamical Properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Molecular Dynamics Simulations of Simple Liquids Introduction == &lt;br /&gt;
&lt;br /&gt;
Molecular dynamic simulations involved studying the motion of a system of particles. Several fundamental elements of a system need to be known in order to achieve this. This includes a knowledge of the interaction potential for the particles and the equations of motion which govern the dynamics of the particles.&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt; Once we know the positions, velocities, and forces, of the atoms (which are obtained using statistical) we can calculate various thermodynamic quantities of the system such as temperature and pressure. We must introduce a series of approximations in order for the caluculations to be feasible. Firstly we apply the &#039;&#039;&#039;The Classical Particle Approximation&#039;&#039;&#039;. The schoedinger equation is too complex to solve for a large system of atoms, however if the atoms are treated classically then the positions and and velocities of each can atom can be calculated using Newton&#039;s second law (equation 1): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = m_i \mathbf{a}_i = m_i \frac{\mathrm{d}\mathbf{v}_i}{\mathrm{d}t} = m_i \frac{\mathrm{d}^2 \mathbf{x}_i}{\mathrm{d}t^2} \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As there are N atoms and therefore N equations representing each atom a computer is a necessity. The &#039;&#039;&#039;Verlet algorithim&#039;&#039;&#039; is used to solve to Newton&#039;s law for all the atoms in the system. In this case time is not continuous but is made discrete, the simulation is thus broeken up into specific &#039;&#039;&#039;timesteps&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The position of atom &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;\mathbf{x}_i \left(t\right)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Positional Verlet algorithim (equation (2)): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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 \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Velocity Verlet algorithim (equation (3)):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{v}_i \left(t\right)&amp;lt;/math&amp;gt; represents the velocity of that atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;center&amp;gt;&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 \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Put in example of industrial applications&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Harmonic Oscillator ===&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator illustrates the the accuracy and discrepancies associated with using the velocity Verlet algorithim. Equation (4) is used to model the behavior of the harmonic oscillator in an analytical sense: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)\ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; = 1.00 &lt;br /&gt;
&lt;br /&gt;
Graph (1) illustrates the results the analytical solution gave for the relationship between position and time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Avrsxt2.png|x300px|thumb|Graph 1: Analytical solution of harmonic oscillator|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The difference in position between the velocity-verlet solution and analytical solution is represented by an error. Error plotted against time is illustrated by graph (2). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ErrorvrsT.png|x300px|thumb|Graph 2: Error vrs Time|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The orange line illustrates the positive trend between error and time. This shows that error is accumulative with time. Each timestep represents a calculation which has an associated error thus as the simulation proceeds the errors will be summed. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy of the system will consist of the sum of kinetic and potential energy. Equation (5) can be used to find kinetic energy of the system:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;E_\text{k} =\tfrac{1}{2} mv(t)^2 \ \ (5)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\mathbf{x} \left(t\right)&amp;lt;/math&amp;gt; is used in equation (5) the potential energy can be found. &lt;br /&gt;
&lt;br /&gt;
The following graphs represent the difference in change in energy with time when the timestep is varied. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EvrsTime.png|x200px|thumb|Energy change when a timestep of 0.1 is used|left]]&lt;br /&gt;
! [[File:Energy vrs time for 0.15 timestep.png|x200px|thumb|Energy change when a timestep of 0.15 is used|centre]]&lt;br /&gt;
! [[File:Energy vrs time for 0.2 timestep.png|x200px|thumb|Energy change when a timestep of 0.2 is used|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The maximum change in energy for each of the different timesteps is shown in table (1). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | Timestep&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.1&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.15&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.2&lt;br /&gt;
|-&lt;br /&gt;
| Max. change in Energy&lt;br /&gt;
| 0.2%&lt;br /&gt;
| 0.6%&lt;br /&gt;
| 1%&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results clearly indicate that a timestep greater than &#039;&#039;&#039;0.2&#039;&#039;&#039; will result in an energy change greater than 1%. As the timestep increases as does the maximum error. The timestep defines the number of calculations made in a given time, therefore the shorter the timestep the larger the number of calculations carried out and therefore a more accurate result is produced. The total energy of a real physical system should not change, when modeled numerically there can be fluctuations therefore it is important to monitor this change and ensure that the fluctuations are minimised.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces ===&lt;br /&gt;
&lt;br /&gt;
The forces an atom experiences is determined by the positions of all the atoms in the system, &amp;lt;math&amp;gt;\mathbf{r}^N&amp;lt;/math&amp;gt;. The Lennard-Jones function accurately sums all the key inter-atomic forces an atoms experiences (U). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ (10)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
For a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After division by 4 and rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_0^{6}} = \frac{\sigma^{6}}{r_0^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After further rearrangement and cancelling down: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;-\sigma &amp;lt;/math&amp;gt; is also a solution however this can be disregarded. &lt;br /&gt;
&lt;br /&gt;
In order to calculate the force the following equation is used: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\sigma\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After differentiation and simplification: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}(r_0) =  \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At equilibrium: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{12\sigma^{12}}{r_e^{13}} - \frac{6\sigma^6}{r_e^7} \right)&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
After rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_e = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This value of &amp;lt;math&amp;gt; r_e &amp;lt;/math&amp;gt; can now be used to find the well depth:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{\sigma^{12}}{4sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon\left(\frac{1}{5r^{5}} - \frac{1}{11r^11} \right)^\infty_2 \simeq -2.48 \sdot 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -8.18 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -3.29 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Finish off atomic forces - enter integrals&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
* No. of moles in  1 mL of water = 0.056 &amp;lt;br&amp;gt; &lt;br /&gt;
* No. of molecules = moles x Avogadro&#039;s constant = 3.37 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*1000 molecules = 1.66 x 10&amp;lt;sup&amp;gt;21&amp;lt;/sup&amp;gt; moles&lt;br /&gt;
* Density = mass/vol. = 1 &lt;br /&gt;
*vol. = mass/density = 2.99 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Due to periodic boundary condition once the atom leaves the current box it will enter the beginning of an identical box. The atom is at &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; and thus once it breaches 0.5 in a particular direction it will be at the start of the next box. Using these principles after the atom moves &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will be at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units === &lt;br /&gt;
&lt;br /&gt;
Reduced units are applied to the Lennard-Jones equation to make the calculation more managable.&lt;br /&gt;
&lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For argon:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Distance in real units: r = 1.09 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Well depth = &amp;lt;math&amp;gt;{\epsilon}&amp;lt;/math&amp;gt; = 0.996 KJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* T = 180 K &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Do I need to show working out?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Equilibriation = &lt;br /&gt;
&lt;br /&gt;
=== Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
As there is a large number of atoms in a discrete volume allowing random assignment of positions could result in atoms overlapping. This would cause an unrealistically high potential as potential is distance dependant (as observed in the Lennard - Jones equation).&lt;br /&gt;
&lt;br /&gt;
* Density is given by the following equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{n}{v} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 1 (as there is only 1 atom per unit cell) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = 1.07722^3 = 1.25 &amp;lt;/math&amp;gt; (lattice spacing = 1.07722) &lt;br /&gt;
&lt;br /&gt;
Thus: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length of a side of one fcc unit cell with number density 1.2 would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = \frac{n}{\rho} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 4 (as there is 4 atoms per unit cell in an fcc lattice) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; = 3.33&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; l = v^{-3} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The number of atoms that would be created by the create_atoms command for an fcc lattice would be: &lt;br /&gt;
&lt;br /&gt;
4 x 1000 = 4000 &lt;br /&gt;
&lt;br /&gt;
This is due to fact that there is 1 atom per unit cell that yeilds 1000 altogether in simple cubic. Fcc has 4 times the number of atoms per unit cell. &lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of Atoms === &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command above has the following purpose: &lt;br /&gt;
&lt;br /&gt;
* The first line sets the mass of all atoms of type &#039;1&#039; to 1.0. &lt;br /&gt;
*  Line 2 is used to control the Lennard-Jones potential. The value of 3.0 indicates the distance in reduced units upon which the potential is calculated. The potential is distance dependent and falls to 0 at large values of r thus only atoms within a distance of 3.0 are considered.  &#039;lj/cut&#039; defines the cut off point. &lt;br /&gt;
* The last line defines the force field constants as 1.0 for all sets of atoms. The * controls the fact that the command is set for all atoms. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet is the integration algorithm that can be used when &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; are defined. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The codes is in place to ensure that the timestep can be varied but the total time taken for the simulation to run will not change.&lt;br /&gt;
&lt;br /&gt;
=== Checking equilibration === &lt;br /&gt;
&lt;br /&gt;
The graphs below illustrate the time it takes for different thermodynamic properties to equilibriate at a timestep of 0.001. The plateau represents the point at which equilibration is achieved. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EnergyVRStime.png|x300px|thumb|Energy Vrs Time|left]]&lt;br /&gt;
! [[File:TEMPvrsTIME.png|x300px|thumb|Temp vrs Time|centre]]&lt;br /&gt;
! [[File:Press Vrs Time.png|x300px|thumb|Pressure Vrs Time|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The graph below illustrates the effect changing the timestep has on equilibration. As can be seen from the graph a from below 0.01 a shorter timestep results in a lower energy value for equilibration until 0.0025 where the value   of equilibration does not change with lower timestep. This trend is due to the fact that a smaller timestep results in a more accurate result however if it is too small this can over-complicate the calculation (especially when there is a large over-all time). Thus a timestep of 0.0025 is ideal. A timestep of 0.025 is too large and results in the system not reaching equilibrium.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EnergyVtimeFORVTS.png|x400px|thumb|Energy Vrs Time with different timesteps|centre]]&lt;br /&gt;
&lt;br /&gt;
= Running Simulations Under Specific Conditions =&lt;br /&gt;
&lt;br /&gt;
The following two equations can be used to define the energy of the system: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The instantaneous tempertaure &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will not remain constant throughout the simulation and will fluctuate, it will thus be different to out target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The value of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2} = \frac{\mathfrak{T}}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within the preceding code: &lt;br /&gt;
&lt;br /&gt;
100 - Nevery: This command results in a sample being taken every 100 steps and being incorporated into the average. 1000 - Nrepreat: Tells the computer how many samples should be used to calculate the average. Nfreq 10 000: At every 10000th timestep an average is calculated. &lt;br /&gt;
&lt;br /&gt;
All thermodynamic properties are calculated by averages that is the necessity for those commands.&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equation of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:DENSITYvrsT.png|x400px|thumb|Density Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
The densities produced from the simulation are lower than for the ideal gas. This is a result of the simulation creating a more realistic picture of how the atoms interact as it takes into account Lennard-Jones potential. In an ideal gas the motion of atoms will be random, chaotic and inter atomic interactions are ignored however in the simulation the atoms will want to minimize their potential and therefore this will drive them to occupy a greater volume thus reducing the density.&lt;br /&gt;
&lt;br /&gt;
= Calculating Heat Capacities Using Statistic Physics =&lt;br /&gt;
&lt;br /&gt;
Example of input code used: &lt;br /&gt;
&lt;br /&gt;
* Density 0.2&lt;br /&gt;
* Temperature 2.0 &lt;br /&gt;
&lt;br /&gt;
 variable density equal 0.2&lt;br /&gt;
 DEFINE SIMULATION BOX GEOMETRY &amp;lt;br&amp;gt; &lt;br /&gt;
lattice sc ${density} &amp;lt;br&amp;gt; &lt;br /&gt;
region box block 0 15 0 15 0 15 &amp;lt;br&amp;gt; &lt;br /&gt;
create_box 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
create_atoms 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
DEFINE PHYSICAL PROPERTIES OF ATOMS &amp;lt;br&amp;gt; &lt;br /&gt;
mass 1 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_style lj/cut/opt 3.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_coeff 1 1 1.0 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
neighbor 2.0 bin &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY THE REQUIRED THERMODYNAMIC STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable T equal 2.0 &amp;lt;br&amp;gt; &lt;br /&gt;
variable p equal 2.5 &amp;lt;br&amp;gt; &lt;br /&gt;
variable timestep equal 0.0025 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ASSIGN ATOMIC VELOCITIES &amp;lt;br&amp;gt; &lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
SPECIFY ENSEMBLE &amp;lt;br&amp;gt; &lt;br /&gt;
timestep ${timestep} &amp;lt;br&amp;gt; &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 THERMODYNAMIC OUTPUT CONTROL &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom time etotal temp press &amp;lt;br&amp;gt; &lt;br /&gt;
thermo 10 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RECORD TRAJECTORY &amp;lt;br&amp;gt; &lt;br /&gt;
dump traj all custom 1000 output-1 id x y z &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY TIMESTEP &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RUN SIMULATION TO MELT CRYSTAL &amp;lt;br&amp;gt; &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nve &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 BRING SYSTEM TO REQUIRED STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable tdamp equal ${timestep}*100 &amp;lt;br&amp;gt; &lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &amp;lt;br&amp;gt;  &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nvt &amp;lt;br&amp;gt;  &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 MEASURE SYSTEM STATE  &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom step atoms etotal temp press density &amp;lt;br&amp;gt; &lt;br /&gt;
variable atoms2 equal atoms*atoms &amp;lt;br&amp;gt;   &lt;br /&gt;
variable E equal etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable E2 equal etotal*etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens equal density &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens2 equal density*density &amp;lt;br&amp;gt;  &lt;br /&gt;
variable temp equal temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable temp2 equal temp*temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable press equal press &amp;lt;br&amp;gt; &lt;br /&gt;
variable press2 equal press*press &amp;lt;br&amp;gt; &lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_E2 v_E&lt;br /&gt;
run 100000 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
variable HC equal ${atoms2}*(f_aves[7] - f_aves[8]*f_aves[8])/f_aves[5] &amp;lt;br&amp;gt;  &lt;br /&gt;
variable avedens equal f_aves[1] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avetemp equal f_aves[2] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avepress equal f_aves[3] &amp;lt;br&amp;gt; &lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3]) &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;--------&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Temperature: ${temp}&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Heat capacity: ${HC}&amp;quot;  &amp;lt;br&amp;gt;  &lt;br /&gt;
print &amp;quot;atoms&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The super computer was not functional during the lab at the end and thus no output files were produced. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the above equation I can predict the behavior of the system. It can be seem that &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; is directly proportional to &amp;lt;math&amp;gt; N^2 &amp;lt;/math&amp;gt;/. This informs us that for a system with a fixed volume (isochoric) as the number of particles increase as the will the heat capacity. Therefore at a given temperature I believe the heat capacity will be greater for the system with a density of 0.8 than for a system with density of 0.2.&lt;br /&gt;
&lt;br /&gt;
= Structural Properties and the Radial Distribution function =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:G(r).png|x300px|thumb|RDF at different phases|left]]&lt;br /&gt;
! [[File:Integral.png|x300px|thumb|Integral of g(r)|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To carry out the RDF calculations temperature was kept constant at 1.2 but density was varied. &lt;br /&gt;
&lt;br /&gt;
Density in reduced units used for each phase: &lt;br /&gt;
&lt;br /&gt;
* Gas = 0.05&lt;br /&gt;
* Liquid = 0.8 &lt;br /&gt;
* Solid = 1.2&lt;br /&gt;
&lt;br /&gt;
The number of peaks for each RDF plot decreases in the order gas&amp;lt;liquid&amp;lt;solid. This reflects the ordering of each phase. &lt;br /&gt;
A gas has a large degree of disorder and thus produces only peak.&lt;br /&gt;
The liquid has three peaks which gradually decrease in amplitude, this behavior is due to the fact that the liquid is modeled as central molecule surrounded by shells of other molecules, this initially creates some degree of order. As the simulation continues the molecules become more diffuse so the ordering decreases and thus the amplitude of peaks decrease.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Solid nearest coordination.png|x400px|centre]]&lt;br /&gt;
&lt;br /&gt;
The above plot indicates the positions of the first three peaks. These will correspond to the three closet atoms in the lattice. &lt;br /&gt;
&lt;br /&gt;
* 1.025 will correspond to one of the atoms at the corner of the unit cell neighboring the starting position.&lt;br /&gt;
* 1.525 will correspond to one of the atoms in the centre of the face of the cube. (The lattice is fcc) &lt;br /&gt;
* 1.825 will correspond to an atom on one of the faces adjacent to the starting point. It cannot be one of the adjacent corners as this would be too large thus it must fall in between the corners and therefore on a face.&lt;br /&gt;
&lt;br /&gt;
= Dynamical Properties and the diffusion coefficient = &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid.png|thumb|solid|x300px|left]]&lt;br /&gt;
! [[File:Liquid.png|thumb|liquid|x300px|centre]]&lt;br /&gt;
! [[File:Gas.png|thumb|gas|x300px|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plot give insight into the displacement of particles. There are variations in the shape of the lines for the large number of atoms and small number of atoms, this is due to the variations in positions being averaged for a large number of atoms and thus gives a better indication of the behavior of the system. The different is very apparent for solid where one can see that the line is much more smooth in the region where the gradient becomes close to 0. &lt;br /&gt;
&lt;br /&gt;
The diffusion constant D was found by calculating the gradient of the line for each phase. The gradient after the line had leveled off was used for the solid.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 0.0304&lt;br /&gt;
| 0.0305&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| 0.001&lt;br /&gt;
| 0.0012 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| &amp;lt;math&amp;gt; 6 x 10^{-8} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 7 x 10^{-9} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There is a gradual decrease in D in the order solid&amp;lt;liquid&amp;lt;gas. This fits out chemical intuition; e.g. the motion of a solid would be much more restricted that the motion of a gas.  &lt;br /&gt;
&lt;br /&gt;
[[File:VACFvrsTS.png|x400px|thumb|VACF vrs Temperature|centre]]&lt;br /&gt;
&lt;br /&gt;
Minima in the VACF plot correspond to points where the atoms collide and change direction. The greater number of minima for a solid is due to the restricted mean square displacement in which the atoms can move, this therefore results in greater collisions as the atoms seek to minimize their potential energy. As a liquid has a greater diffusion coefficient it is able to diffuse away from an atom after a collision, this is why there are fewer minima, the line tends to 0 as the atoms eventually move in opposite directions resulting in velocities cancelling out and therefor the integration becomes 0. The harmonic oscillator is simply a mathematical function without physical meaning therefore it will continue to oscillate around 0 until infinity. &lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function for a 1D harmonic oscillator can be evaluated using the equation for a 1D harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiation of the displacement function will produce a velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx}{dt} = -A\omega\sin\left(\omega t + \phi\right) = v(t) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substitution into velocity autocorrelation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling -A\omega: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right)\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trigometric relation can simplify equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin\left(\omega t + \omega\tau + \phi\right) = cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integration of ansymmetical function results in 0:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} sin(x)cos(x)\mathrm{d}t = 0 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Thus after &amp;lt;math&amp;gt;cos(t\omega) &amp;lt;/math&amp;gt;is removed from top line the equation simplifies to: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(t\omega) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Vapourphse.png|thumb|Vapour Phase|x300px|left]]&lt;br /&gt;
! [[File:Vapour phase 1 million.png|thumb|Vapour Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid(small).png|thumb|Solid Phase|x300px|left]]&lt;br /&gt;
! [[File:Solid1million.png|thumb|Solid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Liquidsmallno..png|thumb|Liquid Phase|x300px|left]]&lt;br /&gt;
! [[File:Liquid1millionatoms.png|thumb|Liquid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 1.64&lt;br /&gt;
| 1.63&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| -0.2215&lt;br /&gt;
| 0.157 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| 0.254&lt;br /&gt;
| -0.123&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the trapezium rule to calculate D from a VACF plot yeilded a similar trend in diffusion coefficients however there was a discrepancy in one of my results. The value of D for a liquid of small number of atoms was smaller and more negative than the solid. This indictaes that using the MSD method is more accurate than VACF. This also indicates that it is more important to use the VACF plot for a large system when calculating D. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Mark Klarpus, Gregory A. Petsko, (1990) &#039;&#039;Molecular Reaction Dynamics in Biology&#039;&#039;, &#039;&#039;&#039;347&#039;&#039;&#039;, 631-9, doi:10.1038/347631a0&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578899</id>
		<title>Rep:Thermomp4114</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578899"/>
		<updated>2017-01-27T10:25:48Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: /* Plotting the Equation of State */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Molecular Dynamics Simulations of Simple Liquids Introduction == &lt;br /&gt;
&lt;br /&gt;
Molecular dynamic simulations involved studying the motion of a system of particles. Several fundamental elements of a system need to be known in order to achieve this. This includes a knowledge of the interaction potential for the particles and the equations of motion which govern the dynamics of the particles.&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt; Once we know the positions, velocities, and forces, of the atoms (which are obtained using statistical) we can calculate various thermodynamic quantities of the system such as temperature and pressure. We must introduce a series of approximations in order for the caluculations to be feasible. Firstly we apply the &#039;&#039;&#039;The Classical Particle Approximation&#039;&#039;&#039;. The schoedinger equation is too complex to solve for a large system of atoms, however if the atoms are treated classically then the positions and and velocities of each can atom can be calculated using Newton&#039;s second law (equation 1): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = m_i \mathbf{a}_i = m_i \frac{\mathrm{d}\mathbf{v}_i}{\mathrm{d}t} = m_i \frac{\mathrm{d}^2 \mathbf{x}_i}{\mathrm{d}t^2} \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As there are N atoms and therefore N equations representing each atom a computer is a necessity. The &#039;&#039;&#039;Verlet algorithim&#039;&#039;&#039; is used to solve to Newton&#039;s law for all the atoms in the system. In this case time is not continuous but is made discrete, the simulation is thus broeken up into specific &#039;&#039;&#039;timesteps&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The position of atom &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;\mathbf{x}_i \left(t\right)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Positional Verlet algorithim (equation (2)): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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 \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Velocity Verlet algorithim (equation (3)):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{v}_i \left(t\right)&amp;lt;/math&amp;gt; represents the velocity of that atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;center&amp;gt;&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 \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Put in example of industrial applications&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Harmonic Oscillator ===&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator illustrates the the accuracy and discrepancies associated with using the velocity Verlet algorithim. Equation (4) is used to model the behavior of the harmonic oscillator in an analytical sense: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)\ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; = 1.00 &lt;br /&gt;
&lt;br /&gt;
Graph (1) illustrates the results the analytical solution gave for the relationship between position and time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Avrsxt2.png|x300px|thumb|Graph 1: Analytical solution of harmonic oscillator|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The difference in position between the velocity-verlet solution and analytical solution is represented by an error. Error plotted against time is illustrated by graph (2). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ErrorvrsT.png|x300px|thumb|Graph 2: Error vrs Time|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The orange line illustrates the positive trend between error and time. This shows that error is accumulative with time. Each timestep represents a calculation which has an associated error thus as the simulation proceeds the errors will be summed. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy of the system will consist of the sum of kinetic and potential energy. Equation (5) can be used to find kinetic energy of the system:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;E_\text{k} =\tfrac{1}{2} mv(t)^2 \ \ (5)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\mathbf{x} \left(t\right)&amp;lt;/math&amp;gt; is used in equation (5) the potential energy can be found. &lt;br /&gt;
&lt;br /&gt;
The following graphs represent the difference in change in energy with time when the timestep is varied. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EvrsTime.png|x200px|thumb|Energy change when a timestep of 0.1 is used|left]]&lt;br /&gt;
! [[File:Energy vrs time for 0.15 timestep.png|x200px|thumb|Energy change when a timestep of 0.15 is used|centre]]&lt;br /&gt;
! [[File:Energy vrs time for 0.2 timestep.png|x200px|thumb|Energy change when a timestep of 0.2 is used|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The maximum change in energy for each of the different timesteps is shown in table (1). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | Timestep&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.1&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.15&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.2&lt;br /&gt;
|-&lt;br /&gt;
| Max. change in Energy&lt;br /&gt;
| 0.2%&lt;br /&gt;
| 0.6%&lt;br /&gt;
| 1%&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results clearly indicate that a timestep greater than &#039;&#039;&#039;0.2&#039;&#039;&#039; will result in an energy change greater than 1%. As the timestep increases as does the maximum error. The timestep defines the number of calculations made in a given time, therefore the shorter the timestep the larger the number of calculations carried out and therefore a more accurate result is produced. The total energy of a real physical system should not change, when modeled numerically there can be fluctuations therefore it is important to monitor this change and ensure that the fluctuations are minimised.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces ===&lt;br /&gt;
&lt;br /&gt;
The forces an atom experiences is determined by the positions of all the atoms in the system, &amp;lt;math&amp;gt;\mathbf{r}^N&amp;lt;/math&amp;gt;. The Lennard-Jones function accurately sums all the key inter-atomic forces an atoms experiences (U). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ (10)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
For a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After division by 4 and rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_0^{6}} = \frac{\sigma^{6}}{r_0^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After further rearrangement and cancelling down: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;-\sigma &amp;lt;/math&amp;gt; is also a solution however this can be disregarded. &lt;br /&gt;
&lt;br /&gt;
In order to calculate the force the following equation is used: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\sigma\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After differentiation and simplification: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}(r_0) =  \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At equilibrium: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{12\sigma^{12}}{r_e^{13}} - \frac{6\sigma^6}{r_e^7} \right)&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
After rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_e = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This value of &amp;lt;math&amp;gt; r_e &amp;lt;/math&amp;gt; can now be used to find the well depth:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{\sigma^{12}}{4sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon\left(\frac{1}{5r^{5}} - \frac{1}{11r^11} \right)^\infty_2 \simeq -2.48 \sdot 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -8.18 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -3.29 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Finish off atomic forces - enter integrals&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
* No. of moles in  1 mL of water = 0.056 &amp;lt;br&amp;gt; &lt;br /&gt;
* No. of molecules = moles x Avogadro&#039;s constant = 3.37 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*1000 molecules = 1.66 x 10&amp;lt;sup&amp;gt;21&amp;lt;/sup&amp;gt; moles&lt;br /&gt;
* Density = mass/vol. = 1 &lt;br /&gt;
*vol. = mass/density = 2.99 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Due to periodic boundary condition once the atom leaves the current box it will enter the beginning of an identical box. The atom is at &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; and thus once it breaches 0.5 in a particular direction it will be at the start of the next box. Using these principles after the atom moves &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will be at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units === &lt;br /&gt;
&lt;br /&gt;
Reduced units are applied to the Lennard-Jones equation to make the calculation more managable.&lt;br /&gt;
&lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For argon:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Distance in real units: r = 1.09 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Well depth = &amp;lt;math&amp;gt;{\epsilon}&amp;lt;/math&amp;gt; = 0.996 KJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* T = 180 K &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Do I need to show working out?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Equilibriation = &lt;br /&gt;
&lt;br /&gt;
=== Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
As there is a large number of atoms in a discrete volume allowing random assignment of positions could result in atoms overlapping. This would cause an unrealistically high potential as potential is distance dependant (as observed in the Lennard - Jones equation).&lt;br /&gt;
&lt;br /&gt;
* Density is given by the following equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{n}{v} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 1 (as there is only 1 atom per unit cell) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = 1.07722^3 = 1.25 &amp;lt;/math&amp;gt; (lattice spacing = 1.07722) &lt;br /&gt;
&lt;br /&gt;
Thus: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length of a side of one fcc unit cell with number density 1.2 would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = \frac{n}{\rho} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 4 (as there is 4 atoms per unit cell in an fcc lattice) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; = 3.33&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; l = v^{-3} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The number of atoms that would be created by the create_atoms command for an fcc lattice would be: &lt;br /&gt;
&lt;br /&gt;
4 x 1000 = 4000 &lt;br /&gt;
&lt;br /&gt;
This is due to fact that there is 1 atom per unit cell that yeilds 1000 altogether in simple cubic. Fcc has 4 times the number of atoms per unit cell. &lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of Atoms === &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command above has the following purpose: &lt;br /&gt;
&lt;br /&gt;
* The first line sets the mass of all atoms of type &#039;1&#039; to 1.0. &lt;br /&gt;
*  Line 2 is used to control the Lennard-Jones potential. The value of 3.0 indicates the distance in reduced units upon which the potential is calculated. The potential is distance dependent and falls to 0 at large values of r thus only atoms within a distance of 3.0 are considered.  &#039;lj/cut&#039; defines the cut off point. &lt;br /&gt;
* The last line defines the force field constants as 1.0 for all sets of atoms. The * controls the fact that the command is set for all atoms. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet is the integration algorithm that can be used when &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; are defined. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The codes is in place to ensure that the timestep can be varied but the total time taken for the simulation to run will not change.&lt;br /&gt;
&lt;br /&gt;
=== Checking equilibration === &lt;br /&gt;
&lt;br /&gt;
The graphs below illustrate the time it takes for different thermodynamic properties to equilibriate at a timestep of 0.001. The plateau represents the point at which equilibration is achieved. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EnergyVRStime.png|x300px|thumb|Energy Vrs Time|left]]&lt;br /&gt;
! [[File:TEMPvrsTIME.png|x300px|thumb|Temp vrs Time|centre]]&lt;br /&gt;
! [[File:Press Vrs Time.png|x300px|thumb|Pressure Vrs Time|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The graph below illustrates the effect changing the timestep has on equilibration. As can be seen from the graph a from below 0.01 a shorter timestep results in a lower energy value for equilibration until 0.0025 where the value   of equilibration does not change with lower timestep. This trend is due to the fact that a smaller timestep results in a more accurate result however if it is too small this can over-complicate the calculation (especially when there is a large over-all time). Thus a timestep of 0.0025 is ideal. A timestep of 0.025 is too large and results in the system not reaching equilibrium.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EnergyVtimeFORVTS.png|x400px|thumb|Energy Vrs Time with different timesteps|centre]]&lt;br /&gt;
&lt;br /&gt;
= Running Simulations Under Specific Conditions =&lt;br /&gt;
&lt;br /&gt;
The following two equations can be used to define the energy of the system: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The instantaneous tempertaure &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will not remain constant throughout the simulation and will fluctuate, it will thus be different to out target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The value of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2} = \frac{\mathfrak{T}}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within the preceding code: &lt;br /&gt;
&lt;br /&gt;
100 - Nevery: This command results in a sample being taken every 100 steps and being incorporated into the average. 1000 - Nrepreat: Tells the computer how many samples should be used to calculate the average. Nfreq 10 000: At every 10000th timestep an average is calculated. &lt;br /&gt;
&lt;br /&gt;
All thermodynamic properties are calculated by averages that is the necessity for those commands.&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equation of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:DENSITYvrsT.png|x400px|thumb|Density Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
The densities produced from the simulation are lower than for the ideal gas. This is a result of the simulation creating a more realistic picture of how the atoms interact as it takes into account Lennard-Jones potential. In an ideal gas the motion of atoms will be random, chaotic and inter atomic interactions are ignored however in the simulation the atoms will want to minimize their potential and therefore this will drive them to occupy a greater volume thus reducing the density.&lt;br /&gt;
&lt;br /&gt;
= Calculating Heat Capacities Using Statistic Physics =&lt;br /&gt;
&lt;br /&gt;
Example of input code used: &lt;br /&gt;
&lt;br /&gt;
* Density 0.2&lt;br /&gt;
* Temperature 2.0 &lt;br /&gt;
&lt;br /&gt;
 variable density equal 0.2&lt;br /&gt;
 DEFINE SIMULATION BOX GEOMETRY &amp;lt;br&amp;gt; &lt;br /&gt;
lattice sc ${density} &amp;lt;br&amp;gt; &lt;br /&gt;
region box block 0 15 0 15 0 15 &amp;lt;br&amp;gt; &lt;br /&gt;
create_box 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
create_atoms 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
DEFINE PHYSICAL PROPERTIES OF ATOMS &amp;lt;br&amp;gt; &lt;br /&gt;
mass 1 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_style lj/cut/opt 3.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_coeff 1 1 1.0 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
neighbor 2.0 bin &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY THE REQUIRED THERMODYNAMIC STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable T equal 2.0 &amp;lt;br&amp;gt; &lt;br /&gt;
variable p equal 2.5 &amp;lt;br&amp;gt; &lt;br /&gt;
variable timestep equal 0.0025 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ASSIGN ATOMIC VELOCITIES &amp;lt;br&amp;gt; &lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
SPECIFY ENSEMBLE &amp;lt;br&amp;gt; &lt;br /&gt;
timestep ${timestep} &amp;lt;br&amp;gt; &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 THERMODYNAMIC OUTPUT CONTROL &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom time etotal temp press &amp;lt;br&amp;gt; &lt;br /&gt;
thermo 10 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RECORD TRAJECTORY &amp;lt;br&amp;gt; &lt;br /&gt;
dump traj all custom 1000 output-1 id x y z &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY TIMESTEP &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RUN SIMULATION TO MELT CRYSTAL &amp;lt;br&amp;gt; &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nve &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 BRING SYSTEM TO REQUIRED STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable tdamp equal ${timestep}*100 &amp;lt;br&amp;gt; &lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &amp;lt;br&amp;gt;  &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nvt &amp;lt;br&amp;gt;  &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 MEASURE SYSTEM STATE  &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom step atoms etotal temp press density &amp;lt;br&amp;gt; &lt;br /&gt;
variable atoms2 equal atoms*atoms &amp;lt;br&amp;gt;   &lt;br /&gt;
variable E equal etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable E2 equal etotal*etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens equal density &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens2 equal density*density &amp;lt;br&amp;gt;  &lt;br /&gt;
variable temp equal temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable temp2 equal temp*temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable press equal press &amp;lt;br&amp;gt; &lt;br /&gt;
variable press2 equal press*press &amp;lt;br&amp;gt; &lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_E2 v_E&lt;br /&gt;
run 100000 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
variable HC equal ${atoms2}*(f_aves[7] - f_aves[8]*f_aves[8])/f_aves[5] &amp;lt;br&amp;gt;  &lt;br /&gt;
variable avedens equal f_aves[1] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avetemp equal f_aves[2] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avepress equal f_aves[3] &amp;lt;br&amp;gt; &lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3]) &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;--------&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Temperature: ${temp}&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Heat capacity: ${HC}&amp;quot;  &amp;lt;br&amp;gt;  &lt;br /&gt;
print &amp;quot;atoms&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The super computer was not functional during the lab at the end and thus no output files were produced. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the above equation I can predict the behavior of the system. It can be seem that &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; is directly proportional to &amp;lt;math&amp;gt; N^2 &amp;lt;/math&amp;gt;/. This informs us that for a system with a fixed volume (isochoric) as the number of particles increase as the will the heat capacity. Therefore at a given temperature I believe the heat capacity will be greater for the system with a density of 0.8 than for a system with density of 0.2.&lt;br /&gt;
&lt;br /&gt;
= Structural Properties and the Radial Distribution function =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:G(r).png|x300px|thumb|RDF at different phases|left]]&lt;br /&gt;
! [[File:Integral.png|x300px|thumb|Integral of g(r)|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To carry out the RDF calculations temperature was kept constant at 1.2 but density was varied. &lt;br /&gt;
&lt;br /&gt;
Density in reduced units used for each phase: &lt;br /&gt;
&lt;br /&gt;
* Gas = 0.05&lt;br /&gt;
* Liquid = 0.8 &lt;br /&gt;
* Solid = 1.2&lt;br /&gt;
&lt;br /&gt;
The number of peaks for each RDF plot decreases in the order gas&amp;lt;liquid&amp;lt;solid. This reflects the ordering of each phase. &lt;br /&gt;
A gas has a large degree of disorder and thus produces only peak.&lt;br /&gt;
The liquid has three peaks which gradually decrease in amplitude, this behavior is due to the fact that the liquid is modeled as central molecule surrounded by shells of other molecules, this initially creates some degree of order. As the simulation continues the molecules become more diffuse so the ordering decreases and thus the amplitude of peaks decrease.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Solid nearest coordination.png|x400px|centre]]&lt;br /&gt;
&lt;br /&gt;
The above plot indicates the positions of the first three peaks. These will correspond to the three closet atoms in the lattice. &lt;br /&gt;
&lt;br /&gt;
* 1.025 will correspond to one of the atoms at the corner of the unit cell neighboring the starting position.&lt;br /&gt;
* 1.525 will correspond to one of the atoms in the centre of the face of the cube. (The lattice is fcc) &lt;br /&gt;
* 1.825 will correspond to an atom on one of the faces adjacent to the starting point. It cannot be one of the adjacent corners as this would be too large thus it must fall in between the corners and therefore on a face.&lt;br /&gt;
&lt;br /&gt;
= Dynamical Properties and the diffusion coefficient = &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid.png|thumb|solid|x300px|left]]&lt;br /&gt;
! [[File:Liquid.png|thumb|liquid|x300px|centre]]&lt;br /&gt;
! [[File:Gas.png|thumb|gas|x300px|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plot give insight into the displacement of particles. There are variations in the shape of the lines for the large number of atoms and small number of atoms, this is due to the variations in positions being averaged for a large number of atoms and thus gives a better indication of the behavior of the system. The different is very apparent for solid where one can see that the line is much more smooth in the region where the gradient becomes close to 0. &lt;br /&gt;
&lt;br /&gt;
The diffusion constant D was found by calculating the gradient of the line for each phase. The gradient after the line had leveled off was used for the solid.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 0.0304&lt;br /&gt;
| 0.0305&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| 0.001&lt;br /&gt;
| 0.0012 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| &amp;lt;math&amp;gt; 6 x 10^{-8} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 7 x 10^{-9} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There is a gradual decrease in D in the order solid&amp;lt;liquid&amp;lt;gas. This fits out chemical intuition; e.g. the motion of a solid would be much more restricted that the motion of a gas.  &lt;br /&gt;
&lt;br /&gt;
[[File:VACFvrsTS.png|x400px|thumb|VACF vrs Temperature|centre]]&lt;br /&gt;
&lt;br /&gt;
Minima in the VACF plot correspond to points where the atoms collide and change direction. The greater number of minima for a solid is due to the restricted mean square displacement in which the atoms can move, this therefore results in greater collisions as the atoms seek to minimize their potential energy. As a liquid has a greater diffusion coefficient it is able to diffuse away from an atom after a collision, this is why there are fewer minima, the line tends to 0 as the atoms eventually move in opposite directions resulting in velocities cancelling out and therefor the integration becomes 0. The harmonic oscillator is simply a mathematical function without physical meaning therefore it will continue to oscillate around 0 until infinity. &lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function for a 1D harmonic oscillator can be evaluated using the equation for a 1D harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiation of the displacement function will produce a velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx}{dt} = -A\omega\sin\left(\omega t + \phi\right) = v(t) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substitution into velocity autocorrelation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling -A\omega: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right)\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trigometric relation can simplify equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin\left(\omega t + \omega\tau + \phi\right) = cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integration of ansymmetical function results in 0:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} sin(x)cos(x)\mathrm{d}t = 0 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Thus after &amp;lt;math&amp;gt;cos(t\omega) &amp;lt;/math&amp;gt;is removed from top line the equation simplifies to: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(t\omega) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Vapourphse.png|thumb|Vapour Phase|x300px|left]]&lt;br /&gt;
! [[File:Vapour phase 1 million.png|thumb|Vapour Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid(small).png|thumb|Solid Phase|x300px|left]]&lt;br /&gt;
! [[File:Solid1million.png|thumb|Solid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Liquidsmallno..png|thumb|Liquid Phase|x300px|left]]&lt;br /&gt;
! [[File:Liquid1millionatoms.png|thumb|Liquid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 1.64&lt;br /&gt;
| 1.63&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| -0.2215&lt;br /&gt;
| 0.157 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| 0.254&lt;br /&gt;
| -0.123&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the trapezium rule to calculate D from a VACF plot yeilded a similar trend in diffusion coefficients however there was a discrepancy in one of my results. The value of D for a liquid of small number of atoms was smaller and more negative than the solid. This indictaes that using the MSD method is more accurate than VACF. This also indicates that it is more important to use the VACF plot for a large system when calculating D. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Mark Klarpus, Gregory A. Petsko, (1990) &#039;&#039;Molecular Reaction Dynamics in Biology&#039;&#039;, &#039;&#039;&#039;347&#039;&#039;&#039;, 631-9, doi:10.1038/347631a0&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578885</id>
		<title>Rep:Thermomp4114</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578885"/>
		<updated>2017-01-27T10:19:48Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: /* Structural Properties and the Radial Distribution function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Molecular Dynamics Simulations of Simple Liquids Introduction == &lt;br /&gt;
&lt;br /&gt;
Molecular dynamic simulations involved studying the motion of a system of particles. Several fundamental elements of a system need to be known in order to achieve this. This includes a knowledge of the interaction potential for the particles and the equations of motion which govern the dynamics of the particles.&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt; Once we know the positions, velocities, and forces, of the atoms (which are obtained using statistical) we can calculate various thermodynamic quantities of the system such as temperature and pressure. We must introduce a series of approximations in order for the caluculations to be feasible. Firstly we apply the &#039;&#039;&#039;The Classical Particle Approximation&#039;&#039;&#039;. The schoedinger equation is too complex to solve for a large system of atoms, however if the atoms are treated classically then the positions and and velocities of each can atom can be calculated using Newton&#039;s second law (equation 1): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = m_i \mathbf{a}_i = m_i \frac{\mathrm{d}\mathbf{v}_i}{\mathrm{d}t} = m_i \frac{\mathrm{d}^2 \mathbf{x}_i}{\mathrm{d}t^2} \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As there are N atoms and therefore N equations representing each atom a computer is a necessity. The &#039;&#039;&#039;Verlet algorithim&#039;&#039;&#039; is used to solve to Newton&#039;s law for all the atoms in the system. In this case time is not continuous but is made discrete, the simulation is thus broeken up into specific &#039;&#039;&#039;timesteps&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The position of atom &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;\mathbf{x}_i \left(t\right)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Positional Verlet algorithim (equation (2)): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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 \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Velocity Verlet algorithim (equation (3)):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{v}_i \left(t\right)&amp;lt;/math&amp;gt; represents the velocity of that atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;center&amp;gt;&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 \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Put in example of industrial applications&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Harmonic Oscillator ===&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator illustrates the the accuracy and discrepancies associated with using the velocity Verlet algorithim. Equation (4) is used to model the behavior of the harmonic oscillator in an analytical sense: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)\ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; = 1.00 &lt;br /&gt;
&lt;br /&gt;
Graph (1) illustrates the results the analytical solution gave for the relationship between position and time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Avrsxt2.png|x300px|thumb|Graph 1: Analytical solution of harmonic oscillator|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The difference in position between the velocity-verlet solution and analytical solution is represented by an error. Error plotted against time is illustrated by graph (2). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ErrorvrsT.png|x300px|thumb|Graph 2: Error vrs Time|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The orange line illustrates the positive trend between error and time. This shows that error is accumulative with time. Each timestep represents a calculation which has an associated error thus as the simulation proceeds the errors will be summed. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy of the system will consist of the sum of kinetic and potential energy. Equation (5) can be used to find kinetic energy of the system:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;E_\text{k} =\tfrac{1}{2} mv(t)^2 \ \ (5)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\mathbf{x} \left(t\right)&amp;lt;/math&amp;gt; is used in equation (5) the potential energy can be found. &lt;br /&gt;
&lt;br /&gt;
The following graphs represent the difference in change in energy with time when the timestep is varied. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EvrsTime.png|x200px|thumb|Energy change when a timestep of 0.1 is used|left]]&lt;br /&gt;
! [[File:Energy vrs time for 0.15 timestep.png|x200px|thumb|Energy change when a timestep of 0.15 is used|centre]]&lt;br /&gt;
! [[File:Energy vrs time for 0.2 timestep.png|x200px|thumb|Energy change when a timestep of 0.2 is used|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The maximum change in energy for each of the different timesteps is shown in table (1). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | Timestep&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.1&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.15&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.2&lt;br /&gt;
|-&lt;br /&gt;
| Max. change in Energy&lt;br /&gt;
| 0.2%&lt;br /&gt;
| 0.6%&lt;br /&gt;
| 1%&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results clearly indicate that a timestep greater than &#039;&#039;&#039;0.2&#039;&#039;&#039; will result in an energy change greater than 1%. As the timestep increases as does the maximum error. The timestep defines the number of calculations made in a given time, therefore the shorter the timestep the larger the number of calculations carried out and therefore a more accurate result is produced. The total energy of a real physical system should not change, when modeled numerically there can be fluctuations therefore it is important to monitor this change and ensure that the fluctuations are minimised.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces ===&lt;br /&gt;
&lt;br /&gt;
The forces an atom experiences is determined by the positions of all the atoms in the system, &amp;lt;math&amp;gt;\mathbf{r}^N&amp;lt;/math&amp;gt;. The Lennard-Jones function accurately sums all the key inter-atomic forces an atoms experiences (U). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ (10)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
For a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After division by 4 and rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_0^{6}} = \frac{\sigma^{6}}{r_0^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After further rearrangement and cancelling down: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;-\sigma &amp;lt;/math&amp;gt; is also a solution however this can be disregarded. &lt;br /&gt;
&lt;br /&gt;
In order to calculate the force the following equation is used: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\sigma\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After differentiation and simplification: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}(r_0) =  \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At equilibrium: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{12\sigma^{12}}{r_e^{13}} - \frac{6\sigma^6}{r_e^7} \right)&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
After rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_e = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This value of &amp;lt;math&amp;gt; r_e &amp;lt;/math&amp;gt; can now be used to find the well depth:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{\sigma^{12}}{4sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon\left(\frac{1}{5r^{5}} - \frac{1}{11r^11} \right)^\infty_2 \simeq -2.48 \sdot 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -8.18 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -3.29 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Finish off atomic forces - enter integrals&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
* No. of moles in  1 mL of water = 0.056 &amp;lt;br&amp;gt; &lt;br /&gt;
* No. of molecules = moles x Avogadro&#039;s constant = 3.37 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*1000 molecules = 1.66 x 10&amp;lt;sup&amp;gt;21&amp;lt;/sup&amp;gt; moles&lt;br /&gt;
* Density = mass/vol. = 1 &lt;br /&gt;
*vol. = mass/density = 2.99 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Due to periodic boundary condition once the atom leaves the current box it will enter the beginning of an identical box. The atom is at &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; and thus once it breaches 0.5 in a particular direction it will be at the start of the next box. Using these principles after the atom moves &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will be at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units === &lt;br /&gt;
&lt;br /&gt;
Reduced units are applied to the Lennard-Jones equation to make the calculation more managable.&lt;br /&gt;
&lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For argon:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Distance in real units: r = 1.09 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Well depth = &amp;lt;math&amp;gt;{\epsilon}&amp;lt;/math&amp;gt; = 0.996 KJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* T = 180 K &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Do I need to show working out?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Equilibriation = &lt;br /&gt;
&lt;br /&gt;
=== Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
As there is a large number of atoms in a discrete volume allowing random assignment of positions could result in atoms overlapping. This would cause an unrealistically high potential as potential is distance dependant (as observed in the Lennard - Jones equation).&lt;br /&gt;
&lt;br /&gt;
* Density is given by the following equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{n}{v} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 1 (as there is only 1 atom per unit cell) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = 1.07722^3 = 1.25 &amp;lt;/math&amp;gt; (lattice spacing = 1.07722) &lt;br /&gt;
&lt;br /&gt;
Thus: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length of a side of one fcc unit cell with number density 1.2 would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = \frac{n}{\rho} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 4 (as there is 4 atoms per unit cell in an fcc lattice) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; = 3.33&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; l = v^{-3} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The number of atoms that would be created by the create_atoms command for an fcc lattice would be: &lt;br /&gt;
&lt;br /&gt;
4 x 1000 = 4000 &lt;br /&gt;
&lt;br /&gt;
This is due to fact that there is 1 atom per unit cell that yeilds 1000 altogether in simple cubic. Fcc has 4 times the number of atoms per unit cell. &lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of Atoms === &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command above has the following purpose: &lt;br /&gt;
&lt;br /&gt;
* The first line sets the mass of all atoms of type &#039;1&#039; to 1.0. &lt;br /&gt;
*  Line 2 is used to control the Lennard-Jones potential. The value of 3.0 indicates the distance in reduced units upon which the potential is calculated. The potential is distance dependent and falls to 0 at large values of r thus only atoms within a distance of 3.0 are considered.  &#039;lj/cut&#039; defines the cut off point. &lt;br /&gt;
* The last line defines the force field constants as 1.0 for all sets of atoms. The * controls the fact that the command is set for all atoms. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet is the integration algorithm that can be used when &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; are defined. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The codes is in place to ensure that the timestep can be varied but the total time taken for the simulation to run will not change.&lt;br /&gt;
&lt;br /&gt;
=== Checking equilibration === &lt;br /&gt;
&lt;br /&gt;
The graphs below illustrate the time it takes for different thermodynamic properties to equilibriate at a timestep of 0.001. The plateau represents the point at which equilibration is achieved. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EnergyVRStime.png|x300px|thumb|Energy Vrs Time|left]]&lt;br /&gt;
! [[File:TEMPvrsTIME.png|x300px|thumb|Temp vrs Time|centre]]&lt;br /&gt;
! [[File:Press Vrs Time.png|x300px|thumb|Pressure Vrs Time|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The graph below illustrates the effect changing the timestep has on equilibration. As can be seen from the graph a from below 0.01 a shorter timestep results in a lower energy value for equilibration until 0.0025 where the value   of equilibration does not change with lower timestep. This trend is due to the fact that a smaller timestep results in a more accurate result however if it is too small this can over-complicate the calculation (especially when there is a large over-all time). Thus a timestep of 0.0025 is ideal. A timestep of 0.025 is too large and results in the system not reaching equilibrium.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EnergyVtimeFORVTS.png|x400px|thumb|Energy Vrs Time with different timesteps|centre]]&lt;br /&gt;
&lt;br /&gt;
= Running Simulations Under Specific Conditions =&lt;br /&gt;
&lt;br /&gt;
The following two equations can be used to define the energy of the system: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The instantaneous tempertaure &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will not remain constant throughout the simulation and will fluctuate, it will thus be different to out target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The value of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2} = \frac{\mathfrak{T}}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within the preceding code: &lt;br /&gt;
&lt;br /&gt;
100 - Nevery: This command results in a sample being taken every 100 steps and being incorporated into the average. 1000 - Nrepreat: Tells the computer how many samples should be used to calculate the average. Nfreq 10 000: At every 10000th timestep an average is calculated. &lt;br /&gt;
&lt;br /&gt;
All thermodynamic properties are calculated by averages that is the necessity for those commands.&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equation of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:DENSITYvrsT.png|x400px|thumb|Density Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
= Calculating Heat Capacities Using Statistic Physics =&lt;br /&gt;
&lt;br /&gt;
Example of input code used: &lt;br /&gt;
&lt;br /&gt;
* Density 0.2&lt;br /&gt;
* Temperature 2.0 &lt;br /&gt;
&lt;br /&gt;
 variable density equal 0.2&lt;br /&gt;
 DEFINE SIMULATION BOX GEOMETRY &amp;lt;br&amp;gt; &lt;br /&gt;
lattice sc ${density} &amp;lt;br&amp;gt; &lt;br /&gt;
region box block 0 15 0 15 0 15 &amp;lt;br&amp;gt; &lt;br /&gt;
create_box 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
create_atoms 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
DEFINE PHYSICAL PROPERTIES OF ATOMS &amp;lt;br&amp;gt; &lt;br /&gt;
mass 1 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_style lj/cut/opt 3.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_coeff 1 1 1.0 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
neighbor 2.0 bin &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY THE REQUIRED THERMODYNAMIC STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable T equal 2.0 &amp;lt;br&amp;gt; &lt;br /&gt;
variable p equal 2.5 &amp;lt;br&amp;gt; &lt;br /&gt;
variable timestep equal 0.0025 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ASSIGN ATOMIC VELOCITIES &amp;lt;br&amp;gt; &lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
SPECIFY ENSEMBLE &amp;lt;br&amp;gt; &lt;br /&gt;
timestep ${timestep} &amp;lt;br&amp;gt; &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 THERMODYNAMIC OUTPUT CONTROL &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom time etotal temp press &amp;lt;br&amp;gt; &lt;br /&gt;
thermo 10 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RECORD TRAJECTORY &amp;lt;br&amp;gt; &lt;br /&gt;
dump traj all custom 1000 output-1 id x y z &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY TIMESTEP &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RUN SIMULATION TO MELT CRYSTAL &amp;lt;br&amp;gt; &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nve &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 BRING SYSTEM TO REQUIRED STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable tdamp equal ${timestep}*100 &amp;lt;br&amp;gt; &lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &amp;lt;br&amp;gt;  &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nvt &amp;lt;br&amp;gt;  &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 MEASURE SYSTEM STATE  &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom step atoms etotal temp press density &amp;lt;br&amp;gt; &lt;br /&gt;
variable atoms2 equal atoms*atoms &amp;lt;br&amp;gt;   &lt;br /&gt;
variable E equal etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable E2 equal etotal*etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens equal density &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens2 equal density*density &amp;lt;br&amp;gt;  &lt;br /&gt;
variable temp equal temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable temp2 equal temp*temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable press equal press &amp;lt;br&amp;gt; &lt;br /&gt;
variable press2 equal press*press &amp;lt;br&amp;gt; &lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_E2 v_E&lt;br /&gt;
run 100000 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
variable HC equal ${atoms2}*(f_aves[7] - f_aves[8]*f_aves[8])/f_aves[5] &amp;lt;br&amp;gt;  &lt;br /&gt;
variable avedens equal f_aves[1] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avetemp equal f_aves[2] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avepress equal f_aves[3] &amp;lt;br&amp;gt; &lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3]) &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;--------&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Temperature: ${temp}&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Heat capacity: ${HC}&amp;quot;  &amp;lt;br&amp;gt;  &lt;br /&gt;
print &amp;quot;atoms&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The super computer was not functional during the lab at the end and thus no output files were produced. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the above equation I can predict the behavior of the system. It can be seem that &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; is directly proportional to &amp;lt;math&amp;gt; N^2 &amp;lt;/math&amp;gt;/. This informs us that for a system with a fixed volume (isochoric) as the number of particles increase as the will the heat capacity. Therefore at a given temperature I believe the heat capacity will be greater for the system with a density of 0.8 than for a system with density of 0.2.&lt;br /&gt;
&lt;br /&gt;
= Structural Properties and the Radial Distribution function =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:G(r).png|x300px|thumb|RDF at different phases|left]]&lt;br /&gt;
! [[File:Integral.png|x300px|thumb|Integral of g(r)|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To carry out the RDF calculations temperature was kept constant at 1.2 but density was varied. &lt;br /&gt;
&lt;br /&gt;
Density in reduced units used for each phase: &lt;br /&gt;
&lt;br /&gt;
* Gas = 0.05&lt;br /&gt;
* Liquid = 0.8 &lt;br /&gt;
* Solid = 1.2&lt;br /&gt;
&lt;br /&gt;
The number of peaks for each RDF plot decreases in the order gas&amp;lt;liquid&amp;lt;solid. This reflects the ordering of each phase. &lt;br /&gt;
A gas has a large degree of disorder and thus produces only peak.&lt;br /&gt;
The liquid has three peaks which gradually decrease in amplitude, this behavior is due to the fact that the liquid is modeled as central molecule surrounded by shells of other molecules, this initially creates some degree of order. As the simulation continues the molecules become more diffuse so the ordering decreases and thus the amplitude of peaks decrease.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Solid nearest coordination.png|x400px|centre]]&lt;br /&gt;
&lt;br /&gt;
The above plot indicates the positions of the first three peaks. These will correspond to the three closet atoms in the lattice. &lt;br /&gt;
&lt;br /&gt;
* 1.025 will correspond to one of the atoms at the corner of the unit cell neighboring the starting position.&lt;br /&gt;
* 1.525 will correspond to one of the atoms in the centre of the face of the cube. (The lattice is fcc) &lt;br /&gt;
* 1.825 will correspond to an atom on one of the faces adjacent to the starting point. It cannot be one of the adjacent corners as this would be too large thus it must fall in between the corners and therefore on a face.&lt;br /&gt;
&lt;br /&gt;
= Dynamical Properties and the diffusion coefficient = &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid.png|thumb|solid|x300px|left]]&lt;br /&gt;
! [[File:Liquid.png|thumb|liquid|x300px|centre]]&lt;br /&gt;
! [[File:Gas.png|thumb|gas|x300px|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plot give insight into the displacement of particles. There are variations in the shape of the lines for the large number of atoms and small number of atoms, this is due to the variations in positions being averaged for a large number of atoms and thus gives a better indication of the behavior of the system. The different is very apparent for solid where one can see that the line is much more smooth in the region where the gradient becomes close to 0. &lt;br /&gt;
&lt;br /&gt;
The diffusion constant D was found by calculating the gradient of the line for each phase. The gradient after the line had leveled off was used for the solid.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 0.0304&lt;br /&gt;
| 0.0305&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| 0.001&lt;br /&gt;
| 0.0012 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| &amp;lt;math&amp;gt; 6 x 10^{-8} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 7 x 10^{-9} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There is a gradual decrease in D in the order solid&amp;lt;liquid&amp;lt;gas. This fits out chemical intuition; e.g. the motion of a solid would be much more restricted that the motion of a gas.  &lt;br /&gt;
&lt;br /&gt;
[[File:VACFvrsTS.png|x400px|thumb|VACF vrs Temperature|centre]]&lt;br /&gt;
&lt;br /&gt;
Minima in the VACF plot correspond to points where the atoms collide and change direction. The greater number of minima for a solid is due to the restricted mean square displacement in which the atoms can move, this therefore results in greater collisions as the atoms seek to minimize their potential energy. As a liquid has a greater diffusion coefficient it is able to diffuse away from an atom after a collision, this is why there are fewer minima, the line tends to 0 as the atoms eventually move in opposite directions resulting in velocities cancelling out and therefor the integration becomes 0. The harmonic oscillator is simply a mathematical function without physical meaning therefore it will continue to oscillate around 0 until infinity. &lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function for a 1D harmonic oscillator can be evaluated using the equation for a 1D harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiation of the displacement function will produce a velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx}{dt} = -A\omega\sin\left(\omega t + \phi\right) = v(t) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substitution into velocity autocorrelation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling -A\omega: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right)\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trigometric relation can simplify equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin\left(\omega t + \omega\tau + \phi\right) = cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integration of ansymmetical function results in 0:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} sin(x)cos(x)\mathrm{d}t = 0 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Thus after &amp;lt;math&amp;gt;cos(t\omega) &amp;lt;/math&amp;gt;is removed from top line the equation simplifies to: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(t\omega) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Vapourphse.png|thumb|Vapour Phase|x300px|left]]&lt;br /&gt;
! [[File:Vapour phase 1 million.png|thumb|Vapour Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid(small).png|thumb|Solid Phase|x300px|left]]&lt;br /&gt;
! [[File:Solid1million.png|thumb|Solid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Liquidsmallno..png|thumb|Liquid Phase|x300px|left]]&lt;br /&gt;
! [[File:Liquid1millionatoms.png|thumb|Liquid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 1.64&lt;br /&gt;
| 1.63&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| -0.2215&lt;br /&gt;
| 0.157 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| 0.254&lt;br /&gt;
| -0.123&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the trapezium rule to calculate D from a VACF plot yeilded a similar trend in diffusion coefficients however there was a discrepancy in one of my results. The value of D for a liquid of small number of atoms was smaller and more negative than the solid. This indictaes that using the MSD method is more accurate than VACF. This also indicates that it is more important to use the VACF plot for a large system when calculating D. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Mark Klarpus, Gregory A. Petsko, (1990) &#039;&#039;Molecular Reaction Dynamics in Biology&#039;&#039;, &#039;&#039;&#039;347&#039;&#039;&#039;, 631-9, doi:10.1038/347631a0&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578877</id>
		<title>Rep:Thermomp4114</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578877"/>
		<updated>2017-01-27T10:13:28Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: /* Structural Properties and the Radial Distribution function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Molecular Dynamics Simulations of Simple Liquids Introduction == &lt;br /&gt;
&lt;br /&gt;
Molecular dynamic simulations involved studying the motion of a system of particles. Several fundamental elements of a system need to be known in order to achieve this. This includes a knowledge of the interaction potential for the particles and the equations of motion which govern the dynamics of the particles.&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt; Once we know the positions, velocities, and forces, of the atoms (which are obtained using statistical) we can calculate various thermodynamic quantities of the system such as temperature and pressure. We must introduce a series of approximations in order for the caluculations to be feasible. Firstly we apply the &#039;&#039;&#039;The Classical Particle Approximation&#039;&#039;&#039;. The schoedinger equation is too complex to solve for a large system of atoms, however if the atoms are treated classically then the positions and and velocities of each can atom can be calculated using Newton&#039;s second law (equation 1): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = m_i \mathbf{a}_i = m_i \frac{\mathrm{d}\mathbf{v}_i}{\mathrm{d}t} = m_i \frac{\mathrm{d}^2 \mathbf{x}_i}{\mathrm{d}t^2} \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As there are N atoms and therefore N equations representing each atom a computer is a necessity. The &#039;&#039;&#039;Verlet algorithim&#039;&#039;&#039; is used to solve to Newton&#039;s law for all the atoms in the system. In this case time is not continuous but is made discrete, the simulation is thus broeken up into specific &#039;&#039;&#039;timesteps&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The position of atom &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;\mathbf{x}_i \left(t\right)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Positional Verlet algorithim (equation (2)): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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 \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Velocity Verlet algorithim (equation (3)):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{v}_i \left(t\right)&amp;lt;/math&amp;gt; represents the velocity of that atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;center&amp;gt;&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 \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Put in example of industrial applications&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Harmonic Oscillator ===&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator illustrates the the accuracy and discrepancies associated with using the velocity Verlet algorithim. Equation (4) is used to model the behavior of the harmonic oscillator in an analytical sense: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)\ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; = 1.00 &lt;br /&gt;
&lt;br /&gt;
Graph (1) illustrates the results the analytical solution gave for the relationship between position and time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Avrsxt2.png|x300px|thumb|Graph 1: Analytical solution of harmonic oscillator|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The difference in position between the velocity-verlet solution and analytical solution is represented by an error. Error plotted against time is illustrated by graph (2). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ErrorvrsT.png|x300px|thumb|Graph 2: Error vrs Time|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The orange line illustrates the positive trend between error and time. This shows that error is accumulative with time. Each timestep represents a calculation which has an associated error thus as the simulation proceeds the errors will be summed. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy of the system will consist of the sum of kinetic and potential energy. Equation (5) can be used to find kinetic energy of the system:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;E_\text{k} =\tfrac{1}{2} mv(t)^2 \ \ (5)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\mathbf{x} \left(t\right)&amp;lt;/math&amp;gt; is used in equation (5) the potential energy can be found. &lt;br /&gt;
&lt;br /&gt;
The following graphs represent the difference in change in energy with time when the timestep is varied. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EvrsTime.png|x200px|thumb|Energy change when a timestep of 0.1 is used|left]]&lt;br /&gt;
! [[File:Energy vrs time for 0.15 timestep.png|x200px|thumb|Energy change when a timestep of 0.15 is used|centre]]&lt;br /&gt;
! [[File:Energy vrs time for 0.2 timestep.png|x200px|thumb|Energy change when a timestep of 0.2 is used|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The maximum change in energy for each of the different timesteps is shown in table (1). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | Timestep&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.1&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.15&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.2&lt;br /&gt;
|-&lt;br /&gt;
| Max. change in Energy&lt;br /&gt;
| 0.2%&lt;br /&gt;
| 0.6%&lt;br /&gt;
| 1%&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results clearly indicate that a timestep greater than &#039;&#039;&#039;0.2&#039;&#039;&#039; will result in an energy change greater than 1%. As the timestep increases as does the maximum error. The timestep defines the number of calculations made in a given time, therefore the shorter the timestep the larger the number of calculations carried out and therefore a more accurate result is produced. The total energy of a real physical system should not change, when modeled numerically there can be fluctuations therefore it is important to monitor this change and ensure that the fluctuations are minimised.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces ===&lt;br /&gt;
&lt;br /&gt;
The forces an atom experiences is determined by the positions of all the atoms in the system, &amp;lt;math&amp;gt;\mathbf{r}^N&amp;lt;/math&amp;gt;. The Lennard-Jones function accurately sums all the key inter-atomic forces an atoms experiences (U). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ (10)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
For a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After division by 4 and rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_0^{6}} = \frac{\sigma^{6}}{r_0^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After further rearrangement and cancelling down: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;-\sigma &amp;lt;/math&amp;gt; is also a solution however this can be disregarded. &lt;br /&gt;
&lt;br /&gt;
In order to calculate the force the following equation is used: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\sigma\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After differentiation and simplification: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}(r_0) =  \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At equilibrium: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{12\sigma^{12}}{r_e^{13}} - \frac{6\sigma^6}{r_e^7} \right)&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
After rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_e = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This value of &amp;lt;math&amp;gt; r_e &amp;lt;/math&amp;gt; can now be used to find the well depth:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{\sigma^{12}}{4sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon\left(\frac{1}{5r^{5}} - \frac{1}{11r^11} \right)^\infty_2 \simeq -2.48 \sdot 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -8.18 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -3.29 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Finish off atomic forces - enter integrals&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
* No. of moles in  1 mL of water = 0.056 &amp;lt;br&amp;gt; &lt;br /&gt;
* No. of molecules = moles x Avogadro&#039;s constant = 3.37 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*1000 molecules = 1.66 x 10&amp;lt;sup&amp;gt;21&amp;lt;/sup&amp;gt; moles&lt;br /&gt;
* Density = mass/vol. = 1 &lt;br /&gt;
*vol. = mass/density = 2.99 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Due to periodic boundary condition once the atom leaves the current box it will enter the beginning of an identical box. The atom is at &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; and thus once it breaches 0.5 in a particular direction it will be at the start of the next box. Using these principles after the atom moves &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will be at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units === &lt;br /&gt;
&lt;br /&gt;
Reduced units are applied to the Lennard-Jones equation to make the calculation more managable.&lt;br /&gt;
&lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For argon:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Distance in real units: r = 1.09 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Well depth = &amp;lt;math&amp;gt;{\epsilon}&amp;lt;/math&amp;gt; = 0.996 KJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* T = 180 K &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Do I need to show working out?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Equilibriation = &lt;br /&gt;
&lt;br /&gt;
=== Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
As there is a large number of atoms in a discrete volume allowing random assignment of positions could result in atoms overlapping. This would cause an unrealistically high potential as potential is distance dependant (as observed in the Lennard - Jones equation).&lt;br /&gt;
&lt;br /&gt;
* Density is given by the following equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{n}{v} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 1 (as there is only 1 atom per unit cell) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = 1.07722^3 = 1.25 &amp;lt;/math&amp;gt; (lattice spacing = 1.07722) &lt;br /&gt;
&lt;br /&gt;
Thus: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length of a side of one fcc unit cell with number density 1.2 would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = \frac{n}{\rho} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 4 (as there is 4 atoms per unit cell in an fcc lattice) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; = 3.33&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; l = v^{-3} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The number of atoms that would be created by the create_atoms command for an fcc lattice would be: &lt;br /&gt;
&lt;br /&gt;
4 x 1000 = 4000 &lt;br /&gt;
&lt;br /&gt;
This is due to fact that there is 1 atom per unit cell that yeilds 1000 altogether in simple cubic. Fcc has 4 times the number of atoms per unit cell. &lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of Atoms === &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command above has the following purpose: &lt;br /&gt;
&lt;br /&gt;
* The first line sets the mass of all atoms of type &#039;1&#039; to 1.0. &lt;br /&gt;
*  Line 2 is used to control the Lennard-Jones potential. The value of 3.0 indicates the distance in reduced units upon which the potential is calculated. The potential is distance dependent and falls to 0 at large values of r thus only atoms within a distance of 3.0 are considered.  &#039;lj/cut&#039; defines the cut off point. &lt;br /&gt;
* The last line defines the force field constants as 1.0 for all sets of atoms. The * controls the fact that the command is set for all atoms. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet is the integration algorithm that can be used when &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; are defined. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The codes is in place to ensure that the timestep can be varied but the total time taken for the simulation to run will not change.&lt;br /&gt;
&lt;br /&gt;
=== Checking equilibration === &lt;br /&gt;
&lt;br /&gt;
The graphs below illustrate the time it takes for different thermodynamic properties to equilibriate at a timestep of 0.001. The plateau represents the point at which equilibration is achieved. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EnergyVRStime.png|x300px|thumb|Energy Vrs Time|left]]&lt;br /&gt;
! [[File:TEMPvrsTIME.png|x300px|thumb|Temp vrs Time|centre]]&lt;br /&gt;
! [[File:Press Vrs Time.png|x300px|thumb|Pressure Vrs Time|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The graph below illustrates the effect changing the timestep has on equilibration. As can be seen from the graph a from below 0.01 a shorter timestep results in a lower energy value for equilibration until 0.0025 where the value   of equilibration does not change with lower timestep. This trend is due to the fact that a smaller timestep results in a more accurate result however if it is too small this can over-complicate the calculation (especially when there is a large over-all time). Thus a timestep of 0.0025 is ideal. A timestep of 0.025 is too large and results in the system not reaching equilibrium.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EnergyVtimeFORVTS.png|x400px|thumb|Energy Vrs Time with different timesteps|centre]]&lt;br /&gt;
&lt;br /&gt;
= Running Simulations Under Specific Conditions =&lt;br /&gt;
&lt;br /&gt;
The following two equations can be used to define the energy of the system: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The instantaneous tempertaure &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will not remain constant throughout the simulation and will fluctuate, it will thus be different to out target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The value of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2} = \frac{\mathfrak{T}}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within the preceding code: &lt;br /&gt;
&lt;br /&gt;
100 - Nevery: This command results in a sample being taken every 100 steps and being incorporated into the average. 1000 - Nrepreat: Tells the computer how many samples should be used to calculate the average. Nfreq 10 000: At every 10000th timestep an average is calculated. &lt;br /&gt;
&lt;br /&gt;
All thermodynamic properties are calculated by averages that is the necessity for those commands.&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equation of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:DENSITYvrsT.png|x400px|thumb|Density Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
= Calculating Heat Capacities Using Statistic Physics =&lt;br /&gt;
&lt;br /&gt;
Example of input code used: &lt;br /&gt;
&lt;br /&gt;
* Density 0.2&lt;br /&gt;
* Temperature 2.0 &lt;br /&gt;
&lt;br /&gt;
 variable density equal 0.2&lt;br /&gt;
 DEFINE SIMULATION BOX GEOMETRY &amp;lt;br&amp;gt; &lt;br /&gt;
lattice sc ${density} &amp;lt;br&amp;gt; &lt;br /&gt;
region box block 0 15 0 15 0 15 &amp;lt;br&amp;gt; &lt;br /&gt;
create_box 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
create_atoms 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
DEFINE PHYSICAL PROPERTIES OF ATOMS &amp;lt;br&amp;gt; &lt;br /&gt;
mass 1 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_style lj/cut/opt 3.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_coeff 1 1 1.0 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
neighbor 2.0 bin &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY THE REQUIRED THERMODYNAMIC STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable T equal 2.0 &amp;lt;br&amp;gt; &lt;br /&gt;
variable p equal 2.5 &amp;lt;br&amp;gt; &lt;br /&gt;
variable timestep equal 0.0025 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ASSIGN ATOMIC VELOCITIES &amp;lt;br&amp;gt; &lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
SPECIFY ENSEMBLE &amp;lt;br&amp;gt; &lt;br /&gt;
timestep ${timestep} &amp;lt;br&amp;gt; &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 THERMODYNAMIC OUTPUT CONTROL &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom time etotal temp press &amp;lt;br&amp;gt; &lt;br /&gt;
thermo 10 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RECORD TRAJECTORY &amp;lt;br&amp;gt; &lt;br /&gt;
dump traj all custom 1000 output-1 id x y z &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY TIMESTEP &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RUN SIMULATION TO MELT CRYSTAL &amp;lt;br&amp;gt; &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nve &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 BRING SYSTEM TO REQUIRED STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable tdamp equal ${timestep}*100 &amp;lt;br&amp;gt; &lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &amp;lt;br&amp;gt;  &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nvt &amp;lt;br&amp;gt;  &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 MEASURE SYSTEM STATE  &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom step atoms etotal temp press density &amp;lt;br&amp;gt; &lt;br /&gt;
variable atoms2 equal atoms*atoms &amp;lt;br&amp;gt;   &lt;br /&gt;
variable E equal etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable E2 equal etotal*etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens equal density &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens2 equal density*density &amp;lt;br&amp;gt;  &lt;br /&gt;
variable temp equal temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable temp2 equal temp*temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable press equal press &amp;lt;br&amp;gt; &lt;br /&gt;
variable press2 equal press*press &amp;lt;br&amp;gt; &lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_E2 v_E&lt;br /&gt;
run 100000 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
variable HC equal ${atoms2}*(f_aves[7] - f_aves[8]*f_aves[8])/f_aves[5] &amp;lt;br&amp;gt;  &lt;br /&gt;
variable avedens equal f_aves[1] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avetemp equal f_aves[2] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avepress equal f_aves[3] &amp;lt;br&amp;gt; &lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3]) &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;--------&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Temperature: ${temp}&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Heat capacity: ${HC}&amp;quot;  &amp;lt;br&amp;gt;  &lt;br /&gt;
print &amp;quot;atoms&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The super computer was not functional during the lab at the end and thus no output files were produced. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the above equation I can predict the behavior of the system. It can be seem that &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; is directly proportional to &amp;lt;math&amp;gt; N^2 &amp;lt;/math&amp;gt;/. This informs us that for a system with a fixed volume (isochoric) as the number of particles increase as the will the heat capacity. Therefore at a given temperature I believe the heat capacity will be greater for the system with a density of 0.8 than for a system with density of 0.2.&lt;br /&gt;
&lt;br /&gt;
= Structural Properties and the Radial Distribution function =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:G(r).png|x300px|thumb|RDF at different phases|left]]&lt;br /&gt;
! [[File:Integral.png|x300px|thumb|Integral of g(r)|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To carry out the RDF calculations temperature was kept constant at 1.2 but density was varied. &lt;br /&gt;
&lt;br /&gt;
Density in reduced units used for each phase: &lt;br /&gt;
&lt;br /&gt;
* Gas = 0.05&lt;br /&gt;
* Liquid = 0.8 &lt;br /&gt;
* Solid = 1.2&lt;br /&gt;
&lt;br /&gt;
The number of peaks for each RDF plot decreases in the order gas&amp;lt;liquid&amp;lt;solid. This reflects the ordering of each phase. &lt;br /&gt;
A gas has a large degree of disorder and thus produces only peak.&lt;br /&gt;
The liquid has three peaks which gradually decrease in amplitude, this behavior is due to the fact that the liquid is modeled as central molecule surrounded by shells of other molecules, this initially creates some degree of order. As the simulation continues the molecules become more diffuse so the ordering decreases and thus the amplitude of peaks decrease.&lt;br /&gt;
&lt;br /&gt;
File:Solid nearest coordination.png&lt;br /&gt;
&lt;br /&gt;
= Dynamical Properties and the diffusion coefficient = &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid.png|thumb|solid|x300px|left]]&lt;br /&gt;
! [[File:Liquid.png|thumb|liquid|x300px|centre]]&lt;br /&gt;
! [[File:Gas.png|thumb|gas|x300px|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plot give insight into the displacement of particles. There are variations in the shape of the lines for the large number of atoms and small number of atoms, this is due to the variations in positions being averaged for a large number of atoms and thus gives a better indication of the behavior of the system. The different is very apparent for solid where one can see that the line is much more smooth in the region where the gradient becomes close to 0. &lt;br /&gt;
&lt;br /&gt;
The diffusion constant D was found by calculating the gradient of the line for each phase. The gradient after the line had leveled off was used for the solid.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 0.0304&lt;br /&gt;
| 0.0305&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| 0.001&lt;br /&gt;
| 0.0012 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| &amp;lt;math&amp;gt; 6 x 10^{-8} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 7 x 10^{-9} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There is a gradual decrease in D in the order solid&amp;lt;liquid&amp;lt;gas. This fits out chemical intuition; e.g. the motion of a solid would be much more restricted that the motion of a gas.  &lt;br /&gt;
&lt;br /&gt;
[[File:VACFvrsTS.png|x400px|thumb|VACF vrs Temperature|centre]]&lt;br /&gt;
&lt;br /&gt;
Minima in the VACF plot correspond to points where the atoms collide and change direction. The greater number of minima for a solid is due to the restricted mean square displacement in which the atoms can move, this therefore results in greater collisions as the atoms seek to minimize their potential energy. As a liquid has a greater diffusion coefficient it is able to diffuse away from an atom after a collision, this is why there are fewer minima, the line tends to 0 as the atoms eventually move in opposite directions resulting in velocities cancelling out and therefor the integration becomes 0. The harmonic oscillator is simply a mathematical function without physical meaning therefore it will continue to oscillate around 0 until infinity. &lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function for a 1D harmonic oscillator can be evaluated using the equation for a 1D harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiation of the displacement function will produce a velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx}{dt} = -A\omega\sin\left(\omega t + \phi\right) = v(t) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substitution into velocity autocorrelation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling -A\omega: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right)\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trigometric relation can simplify equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin\left(\omega t + \omega\tau + \phi\right) = cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integration of ansymmetical function results in 0:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} sin(x)cos(x)\mathrm{d}t = 0 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Thus after &amp;lt;math&amp;gt;cos(t\omega) &amp;lt;/math&amp;gt;is removed from top line the equation simplifies to: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(t\omega) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Vapourphse.png|thumb|Vapour Phase|x300px|left]]&lt;br /&gt;
! [[File:Vapour phase 1 million.png|thumb|Vapour Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid(small).png|thumb|Solid Phase|x300px|left]]&lt;br /&gt;
! [[File:Solid1million.png|thumb|Solid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Liquidsmallno..png|thumb|Liquid Phase|x300px|left]]&lt;br /&gt;
! [[File:Liquid1millionatoms.png|thumb|Liquid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 1.64&lt;br /&gt;
| 1.63&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| -0.2215&lt;br /&gt;
| 0.157 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| 0.254&lt;br /&gt;
| -0.123&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the trapezium rule to calculate D from a VACF plot yeilded a similar trend in diffusion coefficients however there was a discrepancy in one of my results. The value of D for a liquid of small number of atoms was smaller and more negative than the solid. This indictaes that using the MSD method is more accurate than VACF. This also indicates that it is more important to use the VACF plot for a large system when calculating D. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Mark Klarpus, Gregory A. Petsko, (1990) &#039;&#039;Molecular Reaction Dynamics in Biology&#039;&#039;, &#039;&#039;&#039;347&#039;&#039;&#039;, 631-9, doi:10.1038/347631a0&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Solid_nearest_coordination.png&amp;diff=578875</id>
		<title>File:Solid nearest coordination.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Solid_nearest_coordination.png&amp;diff=578875"/>
		<updated>2017-01-27T10:11:57Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578829</id>
		<title>Rep:Thermomp4114</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578829"/>
		<updated>2017-01-27T09:46:36Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: /* Dynamical Properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Molecular Dynamics Simulations of Simple Liquids Introduction == &lt;br /&gt;
&lt;br /&gt;
Molecular dynamic simulations involved studying the motion of a system of particles. Several fundamental elements of a system need to be known in order to achieve this. This includes a knowledge of the interaction potential for the particles and the equations of motion which govern the dynamics of the particles.&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt; Once we know the positions, velocities, and forces, of the atoms (which are obtained using statistical) we can calculate various thermodynamic quantities of the system such as temperature and pressure. We must introduce a series of approximations in order for the caluculations to be feasible. Firstly we apply the &#039;&#039;&#039;The Classical Particle Approximation&#039;&#039;&#039;. The schoedinger equation is too complex to solve for a large system of atoms, however if the atoms are treated classically then the positions and and velocities of each can atom can be calculated using Newton&#039;s second law (equation 1): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = m_i \mathbf{a}_i = m_i \frac{\mathrm{d}\mathbf{v}_i}{\mathrm{d}t} = m_i \frac{\mathrm{d}^2 \mathbf{x}_i}{\mathrm{d}t^2} \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As there are N atoms and therefore N equations representing each atom a computer is a necessity. The &#039;&#039;&#039;Verlet algorithim&#039;&#039;&#039; is used to solve to Newton&#039;s law for all the atoms in the system. In this case time is not continuous but is made discrete, the simulation is thus broeken up into specific &#039;&#039;&#039;timesteps&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The position of atom &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;\mathbf{x}_i \left(t\right)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Positional Verlet algorithim (equation (2)): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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 \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Velocity Verlet algorithim (equation (3)):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{v}_i \left(t\right)&amp;lt;/math&amp;gt; represents the velocity of that atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;center&amp;gt;&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 \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Put in example of industrial applications&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Harmonic Oscillator ===&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator illustrates the the accuracy and discrepancies associated with using the velocity Verlet algorithim. Equation (4) is used to model the behavior of the harmonic oscillator in an analytical sense: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)\ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; = 1.00 &lt;br /&gt;
&lt;br /&gt;
Graph (1) illustrates the results the analytical solution gave for the relationship between position and time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Avrsxt2.png|x300px|thumb|Graph 1: Analytical solution of harmonic oscillator|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The difference in position between the velocity-verlet solution and analytical solution is represented by an error. Error plotted against time is illustrated by graph (2). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ErrorvrsT.png|x300px|thumb|Graph 2: Error vrs Time|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The orange line illustrates the positive trend between error and time. This shows that error is accumulative with time. Each timestep represents a calculation which has an associated error thus as the simulation proceeds the errors will be summed. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy of the system will consist of the sum of kinetic and potential energy. Equation (5) can be used to find kinetic energy of the system:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;E_\text{k} =\tfrac{1}{2} mv(t)^2 \ \ (5)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\mathbf{x} \left(t\right)&amp;lt;/math&amp;gt; is used in equation (5) the potential energy can be found. &lt;br /&gt;
&lt;br /&gt;
The following graphs represent the difference in change in energy with time when the timestep is varied. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EvrsTime.png|x200px|thumb|Energy change when a timestep of 0.1 is used|left]]&lt;br /&gt;
! [[File:Energy vrs time for 0.15 timestep.png|x200px|thumb|Energy change when a timestep of 0.15 is used|centre]]&lt;br /&gt;
! [[File:Energy vrs time for 0.2 timestep.png|x200px|thumb|Energy change when a timestep of 0.2 is used|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The maximum change in energy for each of the different timesteps is shown in table (1). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | Timestep&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.1&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.15&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.2&lt;br /&gt;
|-&lt;br /&gt;
| Max. change in Energy&lt;br /&gt;
| 0.2%&lt;br /&gt;
| 0.6%&lt;br /&gt;
| 1%&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results clearly indicate that a timestep greater than &#039;&#039;&#039;0.2&#039;&#039;&#039; will result in an energy change greater than 1%. As the timestep increases as does the maximum error. The timestep defines the number of calculations made in a given time, therefore the shorter the timestep the larger the number of calculations carried out and therefore a more accurate result is produced. The total energy of a real physical system should not change, when modeled numerically there can be fluctuations therefore it is important to monitor this change and ensure that the fluctuations are minimised.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces ===&lt;br /&gt;
&lt;br /&gt;
The forces an atom experiences is determined by the positions of all the atoms in the system, &amp;lt;math&amp;gt;\mathbf{r}^N&amp;lt;/math&amp;gt;. The Lennard-Jones function accurately sums all the key inter-atomic forces an atoms experiences (U). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ (10)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
For a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After division by 4 and rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_0^{6}} = \frac{\sigma^{6}}{r_0^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After further rearrangement and cancelling down: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;-\sigma &amp;lt;/math&amp;gt; is also a solution however this can be disregarded. &lt;br /&gt;
&lt;br /&gt;
In order to calculate the force the following equation is used: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\sigma\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After differentiation and simplification: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}(r_0) =  \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At equilibrium: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{12\sigma^{12}}{r_e^{13}} - \frac{6\sigma^6}{r_e^7} \right)&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
After rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_e = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This value of &amp;lt;math&amp;gt; r_e &amp;lt;/math&amp;gt; can now be used to find the well depth:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{\sigma^{12}}{4sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon\left(\frac{1}{5r^{5}} - \frac{1}{11r^11} \right)^\infty_2 \simeq -2.48 \sdot 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -8.18 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -3.29 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Finish off atomic forces - enter integrals&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
* No. of moles in  1 mL of water = 0.056 &amp;lt;br&amp;gt; &lt;br /&gt;
* No. of molecules = moles x Avogadro&#039;s constant = 3.37 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*1000 molecules = 1.66 x 10&amp;lt;sup&amp;gt;21&amp;lt;/sup&amp;gt; moles&lt;br /&gt;
* Density = mass/vol. = 1 &lt;br /&gt;
*vol. = mass/density = 2.99 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Due to periodic boundary condition once the atom leaves the current box it will enter the beginning of an identical box. The atom is at &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; and thus once it breaches 0.5 in a particular direction it will be at the start of the next box. Using these principles after the atom moves &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will be at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units === &lt;br /&gt;
&lt;br /&gt;
Reduced units are applied to the Lennard-Jones equation to make the calculation more managable.&lt;br /&gt;
&lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For argon:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Distance in real units: r = 1.09 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Well depth = &amp;lt;math&amp;gt;{\epsilon}&amp;lt;/math&amp;gt; = 0.996 KJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* T = 180 K &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Do I need to show working out?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Equilibriation = &lt;br /&gt;
&lt;br /&gt;
=== Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
As there is a large number of atoms in a discrete volume allowing random assignment of positions could result in atoms overlapping. This would cause an unrealistically high potential as potential is distance dependant (as observed in the Lennard - Jones equation).&lt;br /&gt;
&lt;br /&gt;
* Density is given by the following equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{n}{v} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 1 (as there is only 1 atom per unit cell) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = 1.07722^3 = 1.25 &amp;lt;/math&amp;gt; (lattice spacing = 1.07722) &lt;br /&gt;
&lt;br /&gt;
Thus: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length of a side of one fcc unit cell with number density 1.2 would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = \frac{n}{\rho} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 4 (as there is 4 atoms per unit cell in an fcc lattice) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; = 3.33&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; l = v^{-3} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The number of atoms that would be created by the create_atoms command for an fcc lattice would be: &lt;br /&gt;
&lt;br /&gt;
4 x 1000 = 4000 &lt;br /&gt;
&lt;br /&gt;
This is due to fact that there is 1 atom per unit cell that yeilds 1000 altogether in simple cubic. Fcc has 4 times the number of atoms per unit cell. &lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of Atoms === &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command above has the following purpose: &lt;br /&gt;
&lt;br /&gt;
* The first line sets the mass of all atoms of type &#039;1&#039; to 1.0. &lt;br /&gt;
*  Line 2 is used to control the Lennard-Jones potential. The value of 3.0 indicates the distance in reduced units upon which the potential is calculated. The potential is distance dependent and falls to 0 at large values of r thus only atoms within a distance of 3.0 are considered.  &#039;lj/cut&#039; defines the cut off point. &lt;br /&gt;
* The last line defines the force field constants as 1.0 for all sets of atoms. The * controls the fact that the command is set for all atoms. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet is the integration algorithm that can be used when &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; are defined. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The codes is in place to ensure that the timestep can be varied but the total time taken for the simulation to run will not change.&lt;br /&gt;
&lt;br /&gt;
=== Checking equilibration === &lt;br /&gt;
&lt;br /&gt;
The graphs below illustrate the time it takes for different thermodynamic properties to equilibriate at a timestep of 0.001. The plateau represents the point at which equilibration is achieved. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EnergyVRStime.png|x300px|thumb|Energy Vrs Time|left]]&lt;br /&gt;
! [[File:TEMPvrsTIME.png|x300px|thumb|Temp vrs Time|centre]]&lt;br /&gt;
! [[File:Press Vrs Time.png|x300px|thumb|Pressure Vrs Time|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The graph below illustrates the effect changing the timestep has on equilibration. As can be seen from the graph a from below 0.01 a shorter timestep results in a lower energy value for equilibration until 0.0025 where the value   of equilibration does not change with lower timestep. This trend is due to the fact that a smaller timestep results in a more accurate result however if it is too small this can over-complicate the calculation (especially when there is a large over-all time). Thus a timestep of 0.0025 is ideal. A timestep of 0.025 is too large and results in the system not reaching equilibrium.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EnergyVtimeFORVTS.png|x400px|thumb|Energy Vrs Time with different timesteps|centre]]&lt;br /&gt;
&lt;br /&gt;
= Running Simulations Under Specific Conditions =&lt;br /&gt;
&lt;br /&gt;
The following two equations can be used to define the energy of the system: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The instantaneous tempertaure &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will not remain constant throughout the simulation and will fluctuate, it will thus be different to out target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The value of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2} = \frac{\mathfrak{T}}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within the preceding code: &lt;br /&gt;
&lt;br /&gt;
100 - Nevery: This command results in a sample being taken every 100 steps and being incorporated into the average. 1000 - Nrepreat: Tells the computer how many samples should be used to calculate the average. Nfreq 10 000: At every 10000th timestep an average is calculated. &lt;br /&gt;
&lt;br /&gt;
All thermodynamic properties are calculated by averages that is the necessity for those commands.&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equation of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:DENSITYvrsT.png|x400px|thumb|Density Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
= Calculating Heat Capacities Using Statistic Physics =&lt;br /&gt;
&lt;br /&gt;
Example of input code used: &lt;br /&gt;
&lt;br /&gt;
* Density 0.2&lt;br /&gt;
* Temperature 2.0 &lt;br /&gt;
&lt;br /&gt;
 variable density equal 0.2&lt;br /&gt;
 DEFINE SIMULATION BOX GEOMETRY &amp;lt;br&amp;gt; &lt;br /&gt;
lattice sc ${density} &amp;lt;br&amp;gt; &lt;br /&gt;
region box block 0 15 0 15 0 15 &amp;lt;br&amp;gt; &lt;br /&gt;
create_box 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
create_atoms 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
DEFINE PHYSICAL PROPERTIES OF ATOMS &amp;lt;br&amp;gt; &lt;br /&gt;
mass 1 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_style lj/cut/opt 3.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_coeff 1 1 1.0 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
neighbor 2.0 bin &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY THE REQUIRED THERMODYNAMIC STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable T equal 2.0 &amp;lt;br&amp;gt; &lt;br /&gt;
variable p equal 2.5 &amp;lt;br&amp;gt; &lt;br /&gt;
variable timestep equal 0.0025 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ASSIGN ATOMIC VELOCITIES &amp;lt;br&amp;gt; &lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
SPECIFY ENSEMBLE &amp;lt;br&amp;gt; &lt;br /&gt;
timestep ${timestep} &amp;lt;br&amp;gt; &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 THERMODYNAMIC OUTPUT CONTROL &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom time etotal temp press &amp;lt;br&amp;gt; &lt;br /&gt;
thermo 10 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RECORD TRAJECTORY &amp;lt;br&amp;gt; &lt;br /&gt;
dump traj all custom 1000 output-1 id x y z &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY TIMESTEP &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RUN SIMULATION TO MELT CRYSTAL &amp;lt;br&amp;gt; &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nve &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 BRING SYSTEM TO REQUIRED STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable tdamp equal ${timestep}*100 &amp;lt;br&amp;gt; &lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &amp;lt;br&amp;gt;  &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nvt &amp;lt;br&amp;gt;  &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 MEASURE SYSTEM STATE  &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom step atoms etotal temp press density &amp;lt;br&amp;gt; &lt;br /&gt;
variable atoms2 equal atoms*atoms &amp;lt;br&amp;gt;   &lt;br /&gt;
variable E equal etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable E2 equal etotal*etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens equal density &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens2 equal density*density &amp;lt;br&amp;gt;  &lt;br /&gt;
variable temp equal temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable temp2 equal temp*temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable press equal press &amp;lt;br&amp;gt; &lt;br /&gt;
variable press2 equal press*press &amp;lt;br&amp;gt; &lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_E2 v_E&lt;br /&gt;
run 100000 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
variable HC equal ${atoms2}*(f_aves[7] - f_aves[8]*f_aves[8])/f_aves[5] &amp;lt;br&amp;gt;  &lt;br /&gt;
variable avedens equal f_aves[1] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avetemp equal f_aves[2] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avepress equal f_aves[3] &amp;lt;br&amp;gt; &lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3]) &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;--------&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Temperature: ${temp}&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Heat capacity: ${HC}&amp;quot;  &amp;lt;br&amp;gt;  &lt;br /&gt;
print &amp;quot;atoms&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The super computer was not functional during the lab at the end and thus no output files were produced. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the above equation I can predict the behavior of the system. It can be seem that &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; is directly proportional to &amp;lt;math&amp;gt; N^2 &amp;lt;/math&amp;gt;/. This informs us that for a system with a fixed volume (isochoric) as the number of particles increase as the will the heat capacity. Therefore at a given temperature I believe the heat capacity will be greater for the system with a density of 0.8 than for a system with density of 0.2.&lt;br /&gt;
&lt;br /&gt;
= Structural Properties and the Radial Distribution function =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:G(r).png|x300px|thumb|RDF at different phases|left]]&lt;br /&gt;
! [[File:Integral.png|x300px|thumb|Integral of g(r)|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To carry out the RDF calculations temperature was kept constant at 1.2 but density was varied. &lt;br /&gt;
&lt;br /&gt;
Density in reduced units used for each phase: &lt;br /&gt;
&lt;br /&gt;
* Gas = 0.05&lt;br /&gt;
* Liquid = 0.8 &lt;br /&gt;
* Solid = 1.2&lt;br /&gt;
&lt;br /&gt;
The number of peaks for each RDF plot decreases in the order gas&amp;lt;liquid&amp;lt;solid. This reflects the ordering of each phase. &lt;br /&gt;
A gas has a large degree of disorder and thus produces only peak.&lt;br /&gt;
The liquid has three peaks which gradually decrease in amplitude, this behavior is due to the fact that the liquid is modeled as central molecule surrounded by shells of other molecules, this initially creates some degree of order. As the simulation continues the molecules become more diffuse so the ordering decreases and thus the amplitude of peaks decrease.&lt;br /&gt;
&lt;br /&gt;
= Dynamical Properties and the diffusion coefficient = &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid.png|thumb|solid|x300px|left]]&lt;br /&gt;
! [[File:Liquid.png|thumb|liquid|x300px|centre]]&lt;br /&gt;
! [[File:Gas.png|thumb|gas|x300px|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plot give insight into the displacement of particles. There are variations in the shape of the lines for the large number of atoms and small number of atoms, this is due to the variations in positions being averaged for a large number of atoms and thus gives a better indication of the behavior of the system. The different is very apparent for solid where one can see that the line is much more smooth in the region where the gradient becomes close to 0. &lt;br /&gt;
&lt;br /&gt;
The diffusion constant D was found by calculating the gradient of the line for each phase. The gradient after the line had leveled off was used for the solid.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 0.0304&lt;br /&gt;
| 0.0305&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| 0.001&lt;br /&gt;
| 0.0012 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| &amp;lt;math&amp;gt; 6 x 10^{-8} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 7 x 10^{-9} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There is a gradual decrease in D in the order solid&amp;lt;liquid&amp;lt;gas. This fits out chemical intuition; e.g. the motion of a solid would be much more restricted that the motion of a gas.  &lt;br /&gt;
&lt;br /&gt;
[[File:VACFvrsTS.png|x400px|thumb|VACF vrs Temperature|centre]]&lt;br /&gt;
&lt;br /&gt;
Minima in the VACF plot correspond to points where the atoms collide and change direction. The greater number of minima for a solid is due to the restricted mean square displacement in which the atoms can move, this therefore results in greater collisions as the atoms seek to minimize their potential energy. As a liquid has a greater diffusion coefficient it is able to diffuse away from an atom after a collision, this is why there are fewer minima, the line tends to 0 as the atoms eventually move in opposite directions resulting in velocities cancelling out and therefor the integration becomes 0. The harmonic oscillator is simply a mathematical function without physical meaning therefore it will continue to oscillate around 0 until infinity. &lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function for a 1D harmonic oscillator can be evaluated using the equation for a 1D harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiation of the displacement function will produce a velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx}{dt} = -A\omega\sin\left(\omega t + \phi\right) = v(t) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substitution into velocity autocorrelation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling -A\omega: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right)\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trigometric relation can simplify equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin\left(\omega t + \omega\tau + \phi\right) = cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integration of ansymmetical function results in 0:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} sin(x)cos(x)\mathrm{d}t = 0 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Thus after &amp;lt;math&amp;gt;cos(t\omega) &amp;lt;/math&amp;gt;is removed from top line the equation simplifies to: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(t\omega) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Vapourphse.png|thumb|Vapour Phase|x300px|left]]&lt;br /&gt;
! [[File:Vapour phase 1 million.png|thumb|Vapour Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid(small).png|thumb|Solid Phase|x300px|left]]&lt;br /&gt;
! [[File:Solid1million.png|thumb|Solid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Liquidsmallno..png|thumb|Liquid Phase|x300px|left]]&lt;br /&gt;
! [[File:Liquid1millionatoms.png|thumb|Liquid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 1.64&lt;br /&gt;
| 1.63&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| -0.2215&lt;br /&gt;
| 0.157 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| 0.254&lt;br /&gt;
| -0.123&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the trapezium rule to calculate D from a VACF plot yeilded a similar trend in diffusion coefficients however there was a discrepancy in one of my results. The value of D for a liquid of small number of atoms was smaller and more negative than the solid. This indictaes that using the MSD method is more accurate than VACF. This also indicates that it is more important to use the VACF plot for a large system when calculating D. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Mark Klarpus, Gregory A. Petsko, (1990) &#039;&#039;Molecular Reaction Dynamics in Biology&#039;&#039;, &#039;&#039;&#039;347&#039;&#039;&#039;, 631-9, doi:10.1038/347631a0&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578819</id>
		<title>Rep:Thermomp4114</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578819"/>
		<updated>2017-01-27T09:40:05Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: /* Atomic Forces */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Molecular Dynamics Simulations of Simple Liquids Introduction == &lt;br /&gt;
&lt;br /&gt;
Molecular dynamic simulations involved studying the motion of a system of particles. Several fundamental elements of a system need to be known in order to achieve this. This includes a knowledge of the interaction potential for the particles and the equations of motion which govern the dynamics of the particles.&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt; Once we know the positions, velocities, and forces, of the atoms (which are obtained using statistical) we can calculate various thermodynamic quantities of the system such as temperature and pressure. We must introduce a series of approximations in order for the caluculations to be feasible. Firstly we apply the &#039;&#039;&#039;The Classical Particle Approximation&#039;&#039;&#039;. The schoedinger equation is too complex to solve for a large system of atoms, however if the atoms are treated classically then the positions and and velocities of each can atom can be calculated using Newton&#039;s second law (equation 1): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = m_i \mathbf{a}_i = m_i \frac{\mathrm{d}\mathbf{v}_i}{\mathrm{d}t} = m_i \frac{\mathrm{d}^2 \mathbf{x}_i}{\mathrm{d}t^2} \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As there are N atoms and therefore N equations representing each atom a computer is a necessity. The &#039;&#039;&#039;Verlet algorithim&#039;&#039;&#039; is used to solve to Newton&#039;s law for all the atoms in the system. In this case time is not continuous but is made discrete, the simulation is thus broeken up into specific &#039;&#039;&#039;timesteps&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The position of atom &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;\mathbf{x}_i \left(t\right)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Positional Verlet algorithim (equation (2)): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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 \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Velocity Verlet algorithim (equation (3)):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{v}_i \left(t\right)&amp;lt;/math&amp;gt; represents the velocity of that atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;center&amp;gt;&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 \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Put in example of industrial applications&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Harmonic Oscillator ===&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator illustrates the the accuracy and discrepancies associated with using the velocity Verlet algorithim. Equation (4) is used to model the behavior of the harmonic oscillator in an analytical sense: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)\ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; = 1.00 &lt;br /&gt;
&lt;br /&gt;
Graph (1) illustrates the results the analytical solution gave for the relationship between position and time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Avrsxt2.png|x300px|thumb|Graph 1: Analytical solution of harmonic oscillator|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The difference in position between the velocity-verlet solution and analytical solution is represented by an error. Error plotted against time is illustrated by graph (2). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ErrorvrsT.png|x300px|thumb|Graph 2: Error vrs Time|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The orange line illustrates the positive trend between error and time. This shows that error is accumulative with time. Each timestep represents a calculation which has an associated error thus as the simulation proceeds the errors will be summed. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy of the system will consist of the sum of kinetic and potential energy. Equation (5) can be used to find kinetic energy of the system:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;E_\text{k} =\tfrac{1}{2} mv(t)^2 \ \ (5)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\mathbf{x} \left(t\right)&amp;lt;/math&amp;gt; is used in equation (5) the potential energy can be found. &lt;br /&gt;
&lt;br /&gt;
The following graphs represent the difference in change in energy with time when the timestep is varied. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EvrsTime.png|x200px|thumb|Energy change when a timestep of 0.1 is used|left]]&lt;br /&gt;
! [[File:Energy vrs time for 0.15 timestep.png|x200px|thumb|Energy change when a timestep of 0.15 is used|centre]]&lt;br /&gt;
! [[File:Energy vrs time for 0.2 timestep.png|x200px|thumb|Energy change when a timestep of 0.2 is used|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The maximum change in energy for each of the different timesteps is shown in table (1). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | Timestep&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.1&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.15&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.2&lt;br /&gt;
|-&lt;br /&gt;
| Max. change in Energy&lt;br /&gt;
| 0.2%&lt;br /&gt;
| 0.6%&lt;br /&gt;
| 1%&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results clearly indicate that a timestep greater than &#039;&#039;&#039;0.2&#039;&#039;&#039; will result in an energy change greater than 1%. As the timestep increases as does the maximum error. The timestep defines the number of calculations made in a given time, therefore the shorter the timestep the larger the number of calculations carried out and therefore a more accurate result is produced. The total energy of a real physical system should not change, when modeled numerically there can be fluctuations therefore it is important to monitor this change and ensure that the fluctuations are minimised.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces ===&lt;br /&gt;
&lt;br /&gt;
The forces an atom experiences is determined by the positions of all the atoms in the system, &amp;lt;math&amp;gt;\mathbf{r}^N&amp;lt;/math&amp;gt;. The Lennard-Jones function accurately sums all the key inter-atomic forces an atoms experiences (U). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ (10)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
For a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After division by 4 and rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_0^{6}} = \frac{\sigma^{6}}{r_0^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After further rearrangement and cancelling down: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;-\sigma &amp;lt;/math&amp;gt; is also a solution however this can be disregarded. &lt;br /&gt;
&lt;br /&gt;
In order to calculate the force the following equation is used: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\sigma\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After differentiation and simplification: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}(r_0) =  \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At equilibrium: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{12\sigma^{12}}{r_e^{13}} - \frac{6\sigma^6}{r_e^7} \right)&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
After rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_e = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This value of &amp;lt;math&amp;gt; r_e &amp;lt;/math&amp;gt; can now be used to find the well depth:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{\sigma^{12}}{4sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon\left(\frac{1}{5r^{5}} - \frac{1}{11r^11} \right)^\infty_2 \simeq -2.48 \sdot 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -8.18 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -3.29 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Finish off atomic forces - enter integrals&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
* No. of moles in  1 mL of water = 0.056 &amp;lt;br&amp;gt; &lt;br /&gt;
* No. of molecules = moles x Avogadro&#039;s constant = 3.37 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*1000 molecules = 1.66 x 10&amp;lt;sup&amp;gt;21&amp;lt;/sup&amp;gt; moles&lt;br /&gt;
* Density = mass/vol. = 1 &lt;br /&gt;
*vol. = mass/density = 2.99 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Due to periodic boundary condition once the atom leaves the current box it will enter the beginning of an identical box. The atom is at &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; and thus once it breaches 0.5 in a particular direction it will be at the start of the next box. Using these principles after the atom moves &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will be at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units === &lt;br /&gt;
&lt;br /&gt;
Reduced units are applied to the Lennard-Jones equation to make the calculation more managable.&lt;br /&gt;
&lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For argon:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Distance in real units: r = 1.09 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Well depth = &amp;lt;math&amp;gt;{\epsilon}&amp;lt;/math&amp;gt; = 0.996 KJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* T = 180 K &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Do I need to show working out?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Equilibriation = &lt;br /&gt;
&lt;br /&gt;
=== Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
As there is a large number of atoms in a discrete volume allowing random assignment of positions could result in atoms overlapping. This would cause an unrealistically high potential as potential is distance dependant (as observed in the Lennard - Jones equation).&lt;br /&gt;
&lt;br /&gt;
* Density is given by the following equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{n}{v} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 1 (as there is only 1 atom per unit cell) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = 1.07722^3 = 1.25 &amp;lt;/math&amp;gt; (lattice spacing = 1.07722) &lt;br /&gt;
&lt;br /&gt;
Thus: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length of a side of one fcc unit cell with number density 1.2 would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = \frac{n}{\rho} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 4 (as there is 4 atoms per unit cell in an fcc lattice) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; = 3.33&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; l = v^{-3} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The number of atoms that would be created by the create_atoms command for an fcc lattice would be: &lt;br /&gt;
&lt;br /&gt;
4 x 1000 = 4000 &lt;br /&gt;
&lt;br /&gt;
This is due to fact that there is 1 atom per unit cell that yeilds 1000 altogether in simple cubic. Fcc has 4 times the number of atoms per unit cell. &lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of Atoms === &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command above has the following purpose: &lt;br /&gt;
&lt;br /&gt;
* The first line sets the mass of all atoms of type &#039;1&#039; to 1.0. &lt;br /&gt;
*  Line 2 is used to control the Lennard-Jones potential. The value of 3.0 indicates the distance in reduced units upon which the potential is calculated. The potential is distance dependent and falls to 0 at large values of r thus only atoms within a distance of 3.0 are considered.  &#039;lj/cut&#039; defines the cut off point. &lt;br /&gt;
* The last line defines the force field constants as 1.0 for all sets of atoms. The * controls the fact that the command is set for all atoms. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet is the integration algorithm that can be used when &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; are defined. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The codes is in place to ensure that the timestep can be varied but the total time taken for the simulation to run will not change.&lt;br /&gt;
&lt;br /&gt;
=== Checking equilibration === &lt;br /&gt;
&lt;br /&gt;
The graphs below illustrate the time it takes for different thermodynamic properties to equilibriate at a timestep of 0.001. The plateau represents the point at which equilibration is achieved. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EnergyVRStime.png|x300px|thumb|Energy Vrs Time|left]]&lt;br /&gt;
! [[File:TEMPvrsTIME.png|x300px|thumb|Temp vrs Time|centre]]&lt;br /&gt;
! [[File:Press Vrs Time.png|x300px|thumb|Pressure Vrs Time|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The graph below illustrates the effect changing the timestep has on equilibration. As can be seen from the graph a from below 0.01 a shorter timestep results in a lower energy value for equilibration until 0.0025 where the value   of equilibration does not change with lower timestep. This trend is due to the fact that a smaller timestep results in a more accurate result however if it is too small this can over-complicate the calculation (especially when there is a large over-all time). Thus a timestep of 0.0025 is ideal. A timestep of 0.025 is too large and results in the system not reaching equilibrium.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EnergyVtimeFORVTS.png|x400px|thumb|Energy Vrs Time with different timesteps|centre]]&lt;br /&gt;
&lt;br /&gt;
= Running Simulations Under Specific Conditions =&lt;br /&gt;
&lt;br /&gt;
The following two equations can be used to define the energy of the system: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The instantaneous tempertaure &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will not remain constant throughout the simulation and will fluctuate, it will thus be different to out target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The value of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2} = \frac{\mathfrak{T}}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within the preceding code: &lt;br /&gt;
&lt;br /&gt;
100 - Nevery: This command results in a sample being taken every 100 steps and being incorporated into the average. 1000 - Nrepreat: Tells the computer how many samples should be used to calculate the average. Nfreq 10 000: At every 10000th timestep an average is calculated. &lt;br /&gt;
&lt;br /&gt;
All thermodynamic properties are calculated by averages that is the necessity for those commands.&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equation of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:DENSITYvrsT.png|x400px|thumb|Density Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
= Calculating Heat Capacities Using Statistic Physics =&lt;br /&gt;
&lt;br /&gt;
Example of input code used: &lt;br /&gt;
&lt;br /&gt;
* Density 0.2&lt;br /&gt;
* Temperature 2.0 &lt;br /&gt;
&lt;br /&gt;
 variable density equal 0.2&lt;br /&gt;
 DEFINE SIMULATION BOX GEOMETRY &amp;lt;br&amp;gt; &lt;br /&gt;
lattice sc ${density} &amp;lt;br&amp;gt; &lt;br /&gt;
region box block 0 15 0 15 0 15 &amp;lt;br&amp;gt; &lt;br /&gt;
create_box 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
create_atoms 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
DEFINE PHYSICAL PROPERTIES OF ATOMS &amp;lt;br&amp;gt; &lt;br /&gt;
mass 1 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_style lj/cut/opt 3.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_coeff 1 1 1.0 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
neighbor 2.0 bin &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY THE REQUIRED THERMODYNAMIC STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable T equal 2.0 &amp;lt;br&amp;gt; &lt;br /&gt;
variable p equal 2.5 &amp;lt;br&amp;gt; &lt;br /&gt;
variable timestep equal 0.0025 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ASSIGN ATOMIC VELOCITIES &amp;lt;br&amp;gt; &lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
SPECIFY ENSEMBLE &amp;lt;br&amp;gt; &lt;br /&gt;
timestep ${timestep} &amp;lt;br&amp;gt; &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 THERMODYNAMIC OUTPUT CONTROL &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom time etotal temp press &amp;lt;br&amp;gt; &lt;br /&gt;
thermo 10 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RECORD TRAJECTORY &amp;lt;br&amp;gt; &lt;br /&gt;
dump traj all custom 1000 output-1 id x y z &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY TIMESTEP &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RUN SIMULATION TO MELT CRYSTAL &amp;lt;br&amp;gt; &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nve &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 BRING SYSTEM TO REQUIRED STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable tdamp equal ${timestep}*100 &amp;lt;br&amp;gt; &lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &amp;lt;br&amp;gt;  &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nvt &amp;lt;br&amp;gt;  &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 MEASURE SYSTEM STATE  &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom step atoms etotal temp press density &amp;lt;br&amp;gt; &lt;br /&gt;
variable atoms2 equal atoms*atoms &amp;lt;br&amp;gt;   &lt;br /&gt;
variable E equal etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable E2 equal etotal*etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens equal density &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens2 equal density*density &amp;lt;br&amp;gt;  &lt;br /&gt;
variable temp equal temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable temp2 equal temp*temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable press equal press &amp;lt;br&amp;gt; &lt;br /&gt;
variable press2 equal press*press &amp;lt;br&amp;gt; &lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_E2 v_E&lt;br /&gt;
run 100000 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
variable HC equal ${atoms2}*(f_aves[7] - f_aves[8]*f_aves[8])/f_aves[5] &amp;lt;br&amp;gt;  &lt;br /&gt;
variable avedens equal f_aves[1] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avetemp equal f_aves[2] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avepress equal f_aves[3] &amp;lt;br&amp;gt; &lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3]) &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;--------&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Temperature: ${temp}&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Heat capacity: ${HC}&amp;quot;  &amp;lt;br&amp;gt;  &lt;br /&gt;
print &amp;quot;atoms&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The super computer was not functional during the lab at the end and thus no output files were produced. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the above equation I can predict the behavior of the system. It can be seem that &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; is directly proportional to &amp;lt;math&amp;gt; N^2 &amp;lt;/math&amp;gt;/. This informs us that for a system with a fixed volume (isochoric) as the number of particles increase as the will the heat capacity. Therefore at a given temperature I believe the heat capacity will be greater for the system with a density of 0.8 than for a system with density of 0.2.&lt;br /&gt;
&lt;br /&gt;
= Structural Properties and the Radial Distribution function =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:G(r).png|x300px|thumb|RDF at different phases|left]]&lt;br /&gt;
! [[File:Integral.png|x300px|thumb|Integral of g(r)|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To carry out the RDF calculations temperature was kept constant at 1.2 but density was varied. &lt;br /&gt;
&lt;br /&gt;
Density in reduced units used for each phase: &lt;br /&gt;
&lt;br /&gt;
* Gas = 0.05&lt;br /&gt;
* Liquid = 0.8 &lt;br /&gt;
* Solid = 1.2&lt;br /&gt;
&lt;br /&gt;
The number of peaks for each RDF plot decreases in the order gas&amp;lt;liquid&amp;lt;solid. This reflects the ordering of each phase. &lt;br /&gt;
A gas has a large degree of disorder and thus produces only peak.&lt;br /&gt;
The liquid has three peaks which gradually decrease in amplitude, this behavior is due to the fact that the liquid is modeled as central molecule surrounded by shells of other molecules, this initially creates some degree of order. As the simulation continues the molecules become more diffuse so the ordering decreases and thus the amplitude of peaks decrease.&lt;br /&gt;
&lt;br /&gt;
= Dynamical Properties and the diffusion coefficient = &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid.png|thumb|solid|x300px|left]]&lt;br /&gt;
! [[File:Liquid.png|thumb|liquid|x300px|centre]]&lt;br /&gt;
! [[File:Gas.png|thumb|gas|x300px|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plot give insight into the displacement of particles. There are variations in the shape of the lines for the large number of atoms and small number of atoms, this is due to the variations in positions being averaged for a large number of atoms and thus gives a better indication of the behavior of the system. The different is very apparent for solid where one can see that the line is much more smooth in the region where the gradient becomes close to 0. &lt;br /&gt;
&lt;br /&gt;
The diffusion constant D was found by calculating the gradient of the line for each phase. The gradient after the line had leveled off was used for the solid.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 0.0304&lt;br /&gt;
| 0.0305&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| 0.001&lt;br /&gt;
| 0.0012 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| &amp;lt;math&amp;gt; 6 x 10^{-8} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 7 x 10^{-9} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There is a gradual decrease in D in the order solid&amp;lt;liquid&amp;lt;gas. This fits out chemical intuition; e.g. the motion of a solid would be much more restricted that the motion of a gas.  &lt;br /&gt;
&lt;br /&gt;
[[File:VACFvrsTS.png|x400px|thumb|VACF vrs Temperature|centre]]&lt;br /&gt;
&lt;br /&gt;
Minima in the VACF plot correspond to points where the atoms collide and change direction. The greater number of minima for a solid is due to the restricted mean square displacement in which the atoms can move, this therefore results in greater collisions as the atoms seek to minimize their potential energy. As a liquid has a greater diffusion coefficient it is able to diffuse away from an atom after a collision, this is why there are fewer minima and the line tends to 0. The harmonic oscillator is simply a mathematical function without physical meaning therefore it will continue to oscillate around 0 until infinity. &lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function for a 1D harmonic oscillator can be evaluated using the equation for a 1D harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiation of the displacement function will produce a velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx}{dt} = -A\omega\sin\left(\omega t + \phi\right) = v(t) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substitution into velocity autocorrelation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling -A\omega: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right)\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trigometric relation can simplify equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin\left(\omega t + \omega\tau + \phi\right) = cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integration of ansymmetical function results in 0:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} sin(x)cos(x)\mathrm{d}t = 0 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Thus after &amp;lt;math&amp;gt;cos(t\omega) &amp;lt;/math&amp;gt;is removed from top line the equation simplifies to: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(t\omega) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Vapourphse.png|thumb|Vapour Phase|x300px|left]]&lt;br /&gt;
! [[File:Vapour phase 1 million.png|thumb|Vapour Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid(small).png|thumb|Solid Phase|x300px|left]]&lt;br /&gt;
! [[File:Solid1million.png|thumb|Solid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Liquidsmallno..png|thumb|Liquid Phase|x300px|left]]&lt;br /&gt;
! [[File:Liquid1millionatoms.png|thumb|Liquid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 1.64&lt;br /&gt;
| 1.63&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| -0.2215&lt;br /&gt;
| 0.157 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| 0.254&lt;br /&gt;
| -0.123&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the trapezium rule to calculate D from a VACF plot yeilded a similar trend in diffusion coefficients however there was a discrepancy in one of my results. The value of D for a liquid of small number of atoms was smaller and more negative than the solid. This indictaes that using the MSD method is more accurate than VACF. This also indicates that it is more important to use the VACF plot for a large system when calculating D. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Mark Klarpus, Gregory A. Petsko, (1990) &#039;&#039;Molecular Reaction Dynamics in Biology&#039;&#039;, &#039;&#039;&#039;347&#039;&#039;&#039;, 631-9, doi:10.1038/347631a0&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578813</id>
		<title>Rep:Thermomp4114</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578813"/>
		<updated>2017-01-27T09:36:34Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: /* Calculating Heat Capacities Using Statistic Physics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Molecular Dynamics Simulations of Simple Liquids Introduction == &lt;br /&gt;
&lt;br /&gt;
Molecular dynamic simulations involved studying the motion of a system of particles. Several fundamental elements of a system need to be known in order to achieve this. This includes a knowledge of the interaction potential for the particles and the equations of motion which govern the dynamics of the particles.&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt; Once we know the positions, velocities, and forces, of the atoms (which are obtained using statistical) we can calculate various thermodynamic quantities of the system such as temperature and pressure. We must introduce a series of approximations in order for the caluculations to be feasible. Firstly we apply the &#039;&#039;&#039;The Classical Particle Approximation&#039;&#039;&#039;. The schoedinger equation is too complex to solve for a large system of atoms, however if the atoms are treated classically then the positions and and velocities of each can atom can be calculated using Newton&#039;s second law (equation 1): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = m_i \mathbf{a}_i = m_i \frac{\mathrm{d}\mathbf{v}_i}{\mathrm{d}t} = m_i \frac{\mathrm{d}^2 \mathbf{x}_i}{\mathrm{d}t^2} \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As there are N atoms and therefore N equations representing each atom a computer is a necessity. The &#039;&#039;&#039;Verlet algorithim&#039;&#039;&#039; is used to solve to Newton&#039;s law for all the atoms in the system. In this case time is not continuous but is made discrete, the simulation is thus broeken up into specific &#039;&#039;&#039;timesteps&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The position of atom &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;\mathbf{x}_i \left(t\right)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Positional Verlet algorithim (equation (2)): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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 \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Velocity Verlet algorithim (equation (3)):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{v}_i \left(t\right)&amp;lt;/math&amp;gt; represents the velocity of that atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;center&amp;gt;&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 \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Put in example of industrial applications&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Harmonic Oscillator ===&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator illustrates the the accuracy and discrepancies associated with using the velocity Verlet algorithim. Equation (4) is used to model the behavior of the harmonic oscillator in an analytical sense: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)\ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; = 1.00 &lt;br /&gt;
&lt;br /&gt;
Graph (1) illustrates the results the analytical solution gave for the relationship between position and time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Avrsxt2.png|x300px|thumb|Graph 1: Analytical solution of harmonic oscillator|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The difference in position between the velocity-verlet solution and analytical solution is represented by an error. Error plotted against time is illustrated by graph (2). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ErrorvrsT.png|x300px|thumb|Graph 2: Error vrs Time|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The orange line illustrates the positive trend between error and time. This shows that error is accumulative with time. Each timestep represents a calculation which has an associated error thus as the simulation proceeds the errors will be summed. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy of the system will consist of the sum of kinetic and potential energy. Equation (5) can be used to find kinetic energy of the system:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;E_\text{k} =\tfrac{1}{2} mv(t)^2 \ \ (5)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\mathbf{x} \left(t\right)&amp;lt;/math&amp;gt; is used in equation (5) the potential energy can be found. &lt;br /&gt;
&lt;br /&gt;
The following graphs represent the difference in change in energy with time when the timestep is varied. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EvrsTime.png|x200px|thumb|Energy change when a timestep of 0.1 is used|left]]&lt;br /&gt;
! [[File:Energy vrs time for 0.15 timestep.png|x200px|thumb|Energy change when a timestep of 0.15 is used|centre]]&lt;br /&gt;
! [[File:Energy vrs time for 0.2 timestep.png|x200px|thumb|Energy change when a timestep of 0.2 is used|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The maximum change in energy for each of the different timesteps is shown in table (1). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | Timestep&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.1&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.15&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.2&lt;br /&gt;
|-&lt;br /&gt;
| Max. change in Energy&lt;br /&gt;
| 0.2%&lt;br /&gt;
| 0.6%&lt;br /&gt;
| 1%&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results clearly indicate that a timestep greater than &#039;&#039;&#039;0.2&#039;&#039;&#039; will result in an energy change greater than 1%. As the timestep increases as does the maximum error. The timestep defines the number of calculations made in a given time, therefore the shorter the timestep the larger the number of calculations carried out and therefore a more accurate result is produced. The total energy of a real physical system should not change, when modeled numerically there can be fluctuations therefore it is important to monitor this change and ensure that the fluctuations are minimised.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces ===&lt;br /&gt;
&lt;br /&gt;
The forces an atom experiences is determined by the positions of all the atoms in the system, &amp;lt;math&amp;gt;\mathbf{r}^N&amp;lt;/math&amp;gt;. The Lennard-Jones function accurately sums all the key inter-atomic forces an atoms experiences (U). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ (10)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
For a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After division by 4 and rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_0^{6}} = \frac{\sigma^{6}}{r_0^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After further rearrangement and cancelling down: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;-\sigma &amp;lt;/math&amp;gt; is also a solution however this can be disregarded. &lt;br /&gt;
&lt;br /&gt;
In order to calculate the force the following equation is used: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\sigma\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After differentiation and simplification: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}(r_0) =  \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &#039;&#039;&#039; ask demonstrator if thats too brief &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
At equilibrium: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{12\sigma^{12}}{r_e^{13}} - \frac{6\sigma^6}{r_e^7} \right)&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
After rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_e = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This value of &amp;lt;math&amp;gt; r_e &amp;lt;/math&amp;gt; can now be used to find the well depth:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{\sigma^{12}}{4sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon\left(\frac{1}{5r^{5}} - \frac{1}{11r^11} \right)^\infty_2 \simeq -2.48 \sdot 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -8.18 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -3.29 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Finish off atomic forces - enter integrals&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
* No. of moles in  1 mL of water = 0.056 &amp;lt;br&amp;gt; &lt;br /&gt;
* No. of molecules = moles x Avogadro&#039;s constant = 3.37 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*1000 molecules = 1.66 x 10&amp;lt;sup&amp;gt;21&amp;lt;/sup&amp;gt; moles&lt;br /&gt;
* Density = mass/vol. = 1 &lt;br /&gt;
*vol. = mass/density = 2.99 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Due to periodic boundary condition once the atom leaves the current box it will enter the beginning of an identical box. The atom is at &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; and thus once it breaches 0.5 in a particular direction it will be at the start of the next box. Using these principles after the atom moves &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will be at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units === &lt;br /&gt;
&lt;br /&gt;
Reduced units are applied to the Lennard-Jones equation to make the calculation more managable.&lt;br /&gt;
&lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For argon:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Distance in real units: r = 1.09 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Well depth = &amp;lt;math&amp;gt;{\epsilon}&amp;lt;/math&amp;gt; = 0.996 KJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* T = 180 K &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Do I need to show working out?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Equilibriation = &lt;br /&gt;
&lt;br /&gt;
=== Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
As there is a large number of atoms in a discrete volume allowing random assignment of positions could result in atoms overlapping. This would cause an unrealistically high potential as potential is distance dependant (as observed in the Lennard - Jones equation).&lt;br /&gt;
&lt;br /&gt;
* Density is given by the following equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{n}{v} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 1 (as there is only 1 atom per unit cell) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = 1.07722^3 = 1.25 &amp;lt;/math&amp;gt; (lattice spacing = 1.07722) &lt;br /&gt;
&lt;br /&gt;
Thus: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length of a side of one fcc unit cell with number density 1.2 would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = \frac{n}{\rho} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 4 (as there is 4 atoms per unit cell in an fcc lattice) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; = 3.33&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; l = v^{-3} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The number of atoms that would be created by the create_atoms command for an fcc lattice would be: &lt;br /&gt;
&lt;br /&gt;
4 x 1000 = 4000 &lt;br /&gt;
&lt;br /&gt;
This is due to fact that there is 1 atom per unit cell that yeilds 1000 altogether in simple cubic. Fcc has 4 times the number of atoms per unit cell. &lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of Atoms === &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command above has the following purpose: &lt;br /&gt;
&lt;br /&gt;
* The first line sets the mass of all atoms of type &#039;1&#039; to 1.0. &lt;br /&gt;
*  Line 2 is used to control the Lennard-Jones potential. The value of 3.0 indicates the distance in reduced units upon which the potential is calculated. The potential is distance dependent and falls to 0 at large values of r thus only atoms within a distance of 3.0 are considered.  &#039;lj/cut&#039; defines the cut off point. &lt;br /&gt;
* The last line defines the force field constants as 1.0 for all sets of atoms. The * controls the fact that the command is set for all atoms. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet is the integration algorithm that can be used when &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; are defined. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The codes is in place to ensure that the timestep can be varied but the total time taken for the simulation to run will not change.&lt;br /&gt;
&lt;br /&gt;
=== Checking equilibration === &lt;br /&gt;
&lt;br /&gt;
The graphs below illustrate the time it takes for different thermodynamic properties to equilibriate at a timestep of 0.001. The plateau represents the point at which equilibration is achieved. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EnergyVRStime.png|x300px|thumb|Energy Vrs Time|left]]&lt;br /&gt;
! [[File:TEMPvrsTIME.png|x300px|thumb|Temp vrs Time|centre]]&lt;br /&gt;
! [[File:Press Vrs Time.png|x300px|thumb|Pressure Vrs Time|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The graph below illustrates the effect changing the timestep has on equilibration. As can be seen from the graph a from below 0.01 a shorter timestep results in a lower energy value for equilibration until 0.0025 where the value   of equilibration does not change with lower timestep. This trend is due to the fact that a smaller timestep results in a more accurate result however if it is too small this can over-complicate the calculation (especially when there is a large over-all time). Thus a timestep of 0.0025 is ideal. A timestep of 0.025 is too large and results in the system not reaching equilibrium.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EnergyVtimeFORVTS.png|x400px|thumb|Energy Vrs Time with different timesteps|centre]]&lt;br /&gt;
&lt;br /&gt;
= Running Simulations Under Specific Conditions =&lt;br /&gt;
&lt;br /&gt;
The following two equations can be used to define the energy of the system: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The instantaneous tempertaure &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will not remain constant throughout the simulation and will fluctuate, it will thus be different to out target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The value of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2} = \frac{\mathfrak{T}}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within the preceding code: &lt;br /&gt;
&lt;br /&gt;
100 - Nevery: This command results in a sample being taken every 100 steps and being incorporated into the average. 1000 - Nrepreat: Tells the computer how many samples should be used to calculate the average. Nfreq 10 000: At every 10000th timestep an average is calculated. &lt;br /&gt;
&lt;br /&gt;
All thermodynamic properties are calculated by averages that is the necessity for those commands.&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equation of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:DENSITYvrsT.png|x400px|thumb|Density Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
= Calculating Heat Capacities Using Statistic Physics =&lt;br /&gt;
&lt;br /&gt;
Example of input code used: &lt;br /&gt;
&lt;br /&gt;
* Density 0.2&lt;br /&gt;
* Temperature 2.0 &lt;br /&gt;
&lt;br /&gt;
 variable density equal 0.2&lt;br /&gt;
 DEFINE SIMULATION BOX GEOMETRY &amp;lt;br&amp;gt; &lt;br /&gt;
lattice sc ${density} &amp;lt;br&amp;gt; &lt;br /&gt;
region box block 0 15 0 15 0 15 &amp;lt;br&amp;gt; &lt;br /&gt;
create_box 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
create_atoms 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
DEFINE PHYSICAL PROPERTIES OF ATOMS &amp;lt;br&amp;gt; &lt;br /&gt;
mass 1 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_style lj/cut/opt 3.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_coeff 1 1 1.0 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
neighbor 2.0 bin &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY THE REQUIRED THERMODYNAMIC STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable T equal 2.0 &amp;lt;br&amp;gt; &lt;br /&gt;
variable p equal 2.5 &amp;lt;br&amp;gt; &lt;br /&gt;
variable timestep equal 0.0025 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ASSIGN ATOMIC VELOCITIES &amp;lt;br&amp;gt; &lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
SPECIFY ENSEMBLE &amp;lt;br&amp;gt; &lt;br /&gt;
timestep ${timestep} &amp;lt;br&amp;gt; &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 THERMODYNAMIC OUTPUT CONTROL &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom time etotal temp press &amp;lt;br&amp;gt; &lt;br /&gt;
thermo 10 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RECORD TRAJECTORY &amp;lt;br&amp;gt; &lt;br /&gt;
dump traj all custom 1000 output-1 id x y z &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY TIMESTEP &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RUN SIMULATION TO MELT CRYSTAL &amp;lt;br&amp;gt; &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nve &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 BRING SYSTEM TO REQUIRED STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable tdamp equal ${timestep}*100 &amp;lt;br&amp;gt; &lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &amp;lt;br&amp;gt;  &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nvt &amp;lt;br&amp;gt;  &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 MEASURE SYSTEM STATE  &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom step atoms etotal temp press density &amp;lt;br&amp;gt; &lt;br /&gt;
variable atoms2 equal atoms*atoms &amp;lt;br&amp;gt;   &lt;br /&gt;
variable E equal etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable E2 equal etotal*etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens equal density &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens2 equal density*density &amp;lt;br&amp;gt;  &lt;br /&gt;
variable temp equal temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable temp2 equal temp*temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable press equal press &amp;lt;br&amp;gt; &lt;br /&gt;
variable press2 equal press*press &amp;lt;br&amp;gt; &lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_E2 v_E&lt;br /&gt;
run 100000 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
variable HC equal ${atoms2}*(f_aves[7] - f_aves[8]*f_aves[8])/f_aves[5] &amp;lt;br&amp;gt;  &lt;br /&gt;
variable avedens equal f_aves[1] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avetemp equal f_aves[2] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avepress equal f_aves[3] &amp;lt;br&amp;gt; &lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3]) &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;--------&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Temperature: ${temp}&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Heat capacity: ${HC}&amp;quot;  &amp;lt;br&amp;gt;  &lt;br /&gt;
print &amp;quot;atoms&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The super computer was not functional during the lab at the end and thus no output files were produced. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the above equation I can predict the behavior of the system. It can be seem that &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; is directly proportional to &amp;lt;math&amp;gt; N^2 &amp;lt;/math&amp;gt;/. This informs us that for a system with a fixed volume (isochoric) as the number of particles increase as the will the heat capacity. Therefore at a given temperature I believe the heat capacity will be greater for the system with a density of 0.8 than for a system with density of 0.2.&lt;br /&gt;
&lt;br /&gt;
= Structural Properties and the Radial Distribution function =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:G(r).png|x300px|thumb|RDF at different phases|left]]&lt;br /&gt;
! [[File:Integral.png|x300px|thumb|Integral of g(r)|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To carry out the RDF calculations temperature was kept constant at 1.2 but density was varied. &lt;br /&gt;
&lt;br /&gt;
Density in reduced units used for each phase: &lt;br /&gt;
&lt;br /&gt;
* Gas = 0.05&lt;br /&gt;
* Liquid = 0.8 &lt;br /&gt;
* Solid = 1.2&lt;br /&gt;
&lt;br /&gt;
The number of peaks for each RDF plot decreases in the order gas&amp;lt;liquid&amp;lt;solid. This reflects the ordering of each phase. &lt;br /&gt;
A gas has a large degree of disorder and thus produces only peak.&lt;br /&gt;
The liquid has three peaks which gradually decrease in amplitude, this behavior is due to the fact that the liquid is modeled as central molecule surrounded by shells of other molecules, this initially creates some degree of order. As the simulation continues the molecules become more diffuse so the ordering decreases and thus the amplitude of peaks decrease.&lt;br /&gt;
&lt;br /&gt;
= Dynamical Properties and the diffusion coefficient = &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid.png|thumb|solid|x300px|left]]&lt;br /&gt;
! [[File:Liquid.png|thumb|liquid|x300px|centre]]&lt;br /&gt;
! [[File:Gas.png|thumb|gas|x300px|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plot give insight into the displacement of particles. There are variations in the shape of the lines for the large number of atoms and small number of atoms, this is due to the variations in positions being averaged for a large number of atoms and thus gives a better indication of the behavior of the system. The different is very apparent for solid where one can see that the line is much more smooth in the region where the gradient becomes close to 0. &lt;br /&gt;
&lt;br /&gt;
The diffusion constant D was found by calculating the gradient of the line for each phase. The gradient after the line had leveled off was used for the solid.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 0.0304&lt;br /&gt;
| 0.0305&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| 0.001&lt;br /&gt;
| 0.0012 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| &amp;lt;math&amp;gt; 6 x 10^{-8} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 7 x 10^{-9} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There is a gradual decrease in D in the order solid&amp;lt;liquid&amp;lt;gas. This fits out chemical intuition; e.g. the motion of a solid would be much more restricted that the motion of a gas.  &lt;br /&gt;
&lt;br /&gt;
[[File:VACFvrsTS.png|x400px|thumb|VACF vrs Temperature|centre]]&lt;br /&gt;
&lt;br /&gt;
Minima in the VACF plot correspond to points where the atoms collide and change direction. The greater number of minima for a solid is due to the restricted mean square displacement in which the atoms can move, this therefore results in greater collisions as the atoms seek to minimize their potential energy. As a liquid has a greater diffusion coefficient it is able to diffuse away from an atom after a collision, this is why there are fewer minima and the line tends to 0. The harmonic oscillator is simply a mathematical function without physical meaning therefore it will continue to oscillate around 0 until infinity. &lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function for a 1D harmonic oscillator can be evaluated using the equation for a 1D harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiation of the displacement function will produce a velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx}{dt} = -A\omega\sin\left(\omega t + \phi\right) = v(t) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substitution into velocity autocorrelation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling -A\omega: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right)\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trigometric relation can simplify equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin\left(\omega t + \omega\tau + \phi\right) = cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integration of ansymmetical function results in 0:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} sin(x)cos(x)\mathrm{d}t = 0 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Thus after &amp;lt;math&amp;gt;cos(t\omega) &amp;lt;/math&amp;gt;is removed from top line the equation simplifies to: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(t\omega) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Vapourphse.png|thumb|Vapour Phase|x300px|left]]&lt;br /&gt;
! [[File:Vapour phase 1 million.png|thumb|Vapour Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid(small).png|thumb|Solid Phase|x300px|left]]&lt;br /&gt;
! [[File:Solid1million.png|thumb|Solid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Liquidsmallno..png|thumb|Liquid Phase|x300px|left]]&lt;br /&gt;
! [[File:Liquid1millionatoms.png|thumb|Liquid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 1.64&lt;br /&gt;
| 1.63&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| -0.2215&lt;br /&gt;
| 0.157 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| 0.254&lt;br /&gt;
| -0.123&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the trapezium rule to calculate D from a VACF plot yeilded a similar trend in diffusion coefficients however there was a discrepancy in one of my results. The value of D for a liquid of small number of atoms was smaller and more negative than the solid. This indictaes that using the MSD method is more accurate than VACF. This also indicates that it is more important to use the VACF plot for a large system when calculating D. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Mark Klarpus, Gregory A. Petsko, (1990) &#039;&#039;Molecular Reaction Dynamics in Biology&#039;&#039;, &#039;&#039;&#039;347&#039;&#039;&#039;, 631-9, doi:10.1038/347631a0&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578812</id>
		<title>Rep:Thermomp4114</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578812"/>
		<updated>2017-01-27T09:35:09Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: /* Calculating Heat Capacities Using Statistic Physics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Molecular Dynamics Simulations of Simple Liquids Introduction == &lt;br /&gt;
&lt;br /&gt;
Molecular dynamic simulations involved studying the motion of a system of particles. Several fundamental elements of a system need to be known in order to achieve this. This includes a knowledge of the interaction potential for the particles and the equations of motion which govern the dynamics of the particles.&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt; Once we know the positions, velocities, and forces, of the atoms (which are obtained using statistical) we can calculate various thermodynamic quantities of the system such as temperature and pressure. We must introduce a series of approximations in order for the caluculations to be feasible. Firstly we apply the &#039;&#039;&#039;The Classical Particle Approximation&#039;&#039;&#039;. The schoedinger equation is too complex to solve for a large system of atoms, however if the atoms are treated classically then the positions and and velocities of each can atom can be calculated using Newton&#039;s second law (equation 1): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = m_i \mathbf{a}_i = m_i \frac{\mathrm{d}\mathbf{v}_i}{\mathrm{d}t} = m_i \frac{\mathrm{d}^2 \mathbf{x}_i}{\mathrm{d}t^2} \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As there are N atoms and therefore N equations representing each atom a computer is a necessity. The &#039;&#039;&#039;Verlet algorithim&#039;&#039;&#039; is used to solve to Newton&#039;s law for all the atoms in the system. In this case time is not continuous but is made discrete, the simulation is thus broeken up into specific &#039;&#039;&#039;timesteps&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The position of atom &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;\mathbf{x}_i \left(t\right)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Positional Verlet algorithim (equation (2)): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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 \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Velocity Verlet algorithim (equation (3)):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{v}_i \left(t\right)&amp;lt;/math&amp;gt; represents the velocity of that atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;center&amp;gt;&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 \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Put in example of industrial applications&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Harmonic Oscillator ===&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator illustrates the the accuracy and discrepancies associated with using the velocity Verlet algorithim. Equation (4) is used to model the behavior of the harmonic oscillator in an analytical sense: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)\ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; = 1.00 &lt;br /&gt;
&lt;br /&gt;
Graph (1) illustrates the results the analytical solution gave for the relationship between position and time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Avrsxt2.png|x300px|thumb|Graph 1: Analytical solution of harmonic oscillator|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The difference in position between the velocity-verlet solution and analytical solution is represented by an error. Error plotted against time is illustrated by graph (2). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ErrorvrsT.png|x300px|thumb|Graph 2: Error vrs Time|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The orange line illustrates the positive trend between error and time. This shows that error is accumulative with time. Each timestep represents a calculation which has an associated error thus as the simulation proceeds the errors will be summed. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy of the system will consist of the sum of kinetic and potential energy. Equation (5) can be used to find kinetic energy of the system:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;E_\text{k} =\tfrac{1}{2} mv(t)^2 \ \ (5)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\mathbf{x} \left(t\right)&amp;lt;/math&amp;gt; is used in equation (5) the potential energy can be found. &lt;br /&gt;
&lt;br /&gt;
The following graphs represent the difference in change in energy with time when the timestep is varied. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EvrsTime.png|x200px|thumb|Energy change when a timestep of 0.1 is used|left]]&lt;br /&gt;
! [[File:Energy vrs time for 0.15 timestep.png|x200px|thumb|Energy change when a timestep of 0.15 is used|centre]]&lt;br /&gt;
! [[File:Energy vrs time for 0.2 timestep.png|x200px|thumb|Energy change when a timestep of 0.2 is used|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The maximum change in energy for each of the different timesteps is shown in table (1). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | Timestep&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.1&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.15&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.2&lt;br /&gt;
|-&lt;br /&gt;
| Max. change in Energy&lt;br /&gt;
| 0.2%&lt;br /&gt;
| 0.6%&lt;br /&gt;
| 1%&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results clearly indicate that a timestep greater than &#039;&#039;&#039;0.2&#039;&#039;&#039; will result in an energy change greater than 1%. As the timestep increases as does the maximum error. The timestep defines the number of calculations made in a given time, therefore the shorter the timestep the larger the number of calculations carried out and therefore a more accurate result is produced. The total energy of a real physical system should not change, when modeled numerically there can be fluctuations therefore it is important to monitor this change and ensure that the fluctuations are minimised.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces ===&lt;br /&gt;
&lt;br /&gt;
The forces an atom experiences is determined by the positions of all the atoms in the system, &amp;lt;math&amp;gt;\mathbf{r}^N&amp;lt;/math&amp;gt;. The Lennard-Jones function accurately sums all the key inter-atomic forces an atoms experiences (U). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ (10)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
For a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After division by 4 and rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_0^{6}} = \frac{\sigma^{6}}{r_0^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After further rearrangement and cancelling down: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;-\sigma &amp;lt;/math&amp;gt; is also a solution however this can be disregarded. &lt;br /&gt;
&lt;br /&gt;
In order to calculate the force the following equation is used: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\sigma\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After differentiation and simplification: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}(r_0) =  \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &#039;&#039;&#039; ask demonstrator if thats too brief &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
At equilibrium: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{12\sigma^{12}}{r_e^{13}} - \frac{6\sigma^6}{r_e^7} \right)&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
After rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_e = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This value of &amp;lt;math&amp;gt; r_e &amp;lt;/math&amp;gt; can now be used to find the well depth:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{\sigma^{12}}{4sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon\left(\frac{1}{5r^{5}} - \frac{1}{11r^11} \right)^\infty_2 \simeq -2.48 \sdot 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -8.18 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -3.29 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Finish off atomic forces - enter integrals&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
* No. of moles in  1 mL of water = 0.056 &amp;lt;br&amp;gt; &lt;br /&gt;
* No. of molecules = moles x Avogadro&#039;s constant = 3.37 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*1000 molecules = 1.66 x 10&amp;lt;sup&amp;gt;21&amp;lt;/sup&amp;gt; moles&lt;br /&gt;
* Density = mass/vol. = 1 &lt;br /&gt;
*vol. = mass/density = 2.99 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Due to periodic boundary condition once the atom leaves the current box it will enter the beginning of an identical box. The atom is at &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; and thus once it breaches 0.5 in a particular direction it will be at the start of the next box. Using these principles after the atom moves &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will be at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units === &lt;br /&gt;
&lt;br /&gt;
Reduced units are applied to the Lennard-Jones equation to make the calculation more managable.&lt;br /&gt;
&lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For argon:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Distance in real units: r = 1.09 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Well depth = &amp;lt;math&amp;gt;{\epsilon}&amp;lt;/math&amp;gt; = 0.996 KJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* T = 180 K &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Do I need to show working out?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Equilibriation = &lt;br /&gt;
&lt;br /&gt;
=== Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
As there is a large number of atoms in a discrete volume allowing random assignment of positions could result in atoms overlapping. This would cause an unrealistically high potential as potential is distance dependant (as observed in the Lennard - Jones equation).&lt;br /&gt;
&lt;br /&gt;
* Density is given by the following equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{n}{v} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 1 (as there is only 1 atom per unit cell) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = 1.07722^3 = 1.25 &amp;lt;/math&amp;gt; (lattice spacing = 1.07722) &lt;br /&gt;
&lt;br /&gt;
Thus: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length of a side of one fcc unit cell with number density 1.2 would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = \frac{n}{\rho} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 4 (as there is 4 atoms per unit cell in an fcc lattice) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; = 3.33&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; l = v^{-3} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The number of atoms that would be created by the create_atoms command for an fcc lattice would be: &lt;br /&gt;
&lt;br /&gt;
4 x 1000 = 4000 &lt;br /&gt;
&lt;br /&gt;
This is due to fact that there is 1 atom per unit cell that yeilds 1000 altogether in simple cubic. Fcc has 4 times the number of atoms per unit cell. &lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of Atoms === &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command above has the following purpose: &lt;br /&gt;
&lt;br /&gt;
* The first line sets the mass of all atoms of type &#039;1&#039; to 1.0. &lt;br /&gt;
*  Line 2 is used to control the Lennard-Jones potential. The value of 3.0 indicates the distance in reduced units upon which the potential is calculated. The potential is distance dependent and falls to 0 at large values of r thus only atoms within a distance of 3.0 are considered.  &#039;lj/cut&#039; defines the cut off point. &lt;br /&gt;
* The last line defines the force field constants as 1.0 for all sets of atoms. The * controls the fact that the command is set for all atoms. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet is the integration algorithm that can be used when &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; are defined. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The codes is in place to ensure that the timestep can be varied but the total time taken for the simulation to run will not change.&lt;br /&gt;
&lt;br /&gt;
=== Checking equilibration === &lt;br /&gt;
&lt;br /&gt;
The graphs below illustrate the time it takes for different thermodynamic properties to equilibriate at a timestep of 0.001. The plateau represents the point at which equilibration is achieved. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EnergyVRStime.png|x300px|thumb|Energy Vrs Time|left]]&lt;br /&gt;
! [[File:TEMPvrsTIME.png|x300px|thumb|Temp vrs Time|centre]]&lt;br /&gt;
! [[File:Press Vrs Time.png|x300px|thumb|Pressure Vrs Time|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The graph below illustrates the effect changing the timestep has on equilibration. As can be seen from the graph a from below 0.01 a shorter timestep results in a lower energy value for equilibration until 0.0025 where the value   of equilibration does not change with lower timestep. This trend is due to the fact that a smaller timestep results in a more accurate result however if it is too small this can over-complicate the calculation (especially when there is a large over-all time). Thus a timestep of 0.0025 is ideal. A timestep of 0.025 is too large and results in the system not reaching equilibrium.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EnergyVtimeFORVTS.png|x400px|thumb|Energy Vrs Time with different timesteps|centre]]&lt;br /&gt;
&lt;br /&gt;
= Running Simulations Under Specific Conditions =&lt;br /&gt;
&lt;br /&gt;
The following two equations can be used to define the energy of the system: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The instantaneous tempertaure &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will not remain constant throughout the simulation and will fluctuate, it will thus be different to out target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The value of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2} = \frac{\mathfrak{T}}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within the preceding code: &lt;br /&gt;
&lt;br /&gt;
100 - Nevery: This command results in a sample being taken every 100 steps and being incorporated into the average. 1000 - Nrepreat: Tells the computer how many samples should be used to calculate the average. Nfreq 10 000: At every 10000th timestep an average is calculated. &lt;br /&gt;
&lt;br /&gt;
All thermodynamic properties are calculated by averages that is the necessity for those commands.&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equation of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:DENSITYvrsT.png|x400px|thumb|Density Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
= Calculating Heat Capacities Using Statistic Physics =&lt;br /&gt;
&lt;br /&gt;
Example of input code used: &lt;br /&gt;
&lt;br /&gt;
* Density 0.2&lt;br /&gt;
* Temperature 2.0 &lt;br /&gt;
&lt;br /&gt;
 variable density equal 0.2&lt;br /&gt;
 DEFINE SIMULATION BOX GEOMETRY &amp;lt;br&amp;gt; &lt;br /&gt;
lattice sc ${density} &amp;lt;br&amp;gt; &lt;br /&gt;
region box block 0 15 0 15 0 15 &amp;lt;br&amp;gt; &lt;br /&gt;
create_box 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
create_atoms 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
DEFINE PHYSICAL PROPERTIES OF ATOMS &amp;lt;br&amp;gt; &lt;br /&gt;
mass 1 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_style lj/cut/opt 3.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_coeff 1 1 1.0 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
neighbor 2.0 bin &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY THE REQUIRED THERMODYNAMIC STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable T equal 2.0 &amp;lt;br&amp;gt; &lt;br /&gt;
variable p equal 2.5 &amp;lt;br&amp;gt; &lt;br /&gt;
variable timestep equal 0.0025 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ASSIGN ATOMIC VELOCITIES &amp;lt;br&amp;gt; &lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
SPECIFY ENSEMBLE &amp;lt;br&amp;gt; &lt;br /&gt;
timestep ${timestep} &amp;lt;br&amp;gt; &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 THERMODYNAMIC OUTPUT CONTROL &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom time etotal temp press &amp;lt;br&amp;gt; &lt;br /&gt;
thermo 10 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RECORD TRAJECTORY &amp;lt;br&amp;gt; &lt;br /&gt;
dump traj all custom 1000 output-1 id x y z &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY TIMESTEP &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RUN SIMULATION TO MELT CRYSTAL &amp;lt;br&amp;gt; &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nve &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 BRING SYSTEM TO REQUIRED STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable tdamp equal ${timestep}*100 &amp;lt;br&amp;gt; &lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &amp;lt;br&amp;gt;  &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nvt &amp;lt;br&amp;gt;  &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 MEASURE SYSTEM STATE  &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom step atoms etotal temp press density &amp;lt;br&amp;gt; &lt;br /&gt;
variable atoms2 equal atoms*atoms &amp;lt;br&amp;gt;   &lt;br /&gt;
variable E equal etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable E2 equal etotal*etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens equal density &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens2 equal density*density &amp;lt;br&amp;gt;  &lt;br /&gt;
variable temp equal temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable temp2 equal temp*temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable press equal press &amp;lt;br&amp;gt; &lt;br /&gt;
variable press2 equal press*press &amp;lt;br&amp;gt; &lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_E2 v_E&lt;br /&gt;
run 100000 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
variable HC equal ${atoms2}*(f_aves[7] - f_aves[8]*f_aves[8])/f_aves[5] &amp;lt;br&amp;gt;  &lt;br /&gt;
variable avedens equal f_aves[1] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avetemp equal f_aves[2] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avepress equal f_aves[3] &amp;lt;br&amp;gt; &lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3]) &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;--------&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Temperature: ${temp}&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Heat capacity: ${HC}&amp;quot;  &amp;lt;br&amp;gt;  &lt;br /&gt;
print &amp;quot;atoms&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The super computer was not functional during the lab at the end and thus no output files were produced. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the above equation I can predict the behavior of the system. It can be seem that &amp;lt;math&amp;gt;C_V &amp;lt;/math&amp;gt; is directly proportional to &amp;lt;math&amp;gt; N^2 &amp;lt;/math&amp;gt;/. This informs us that for a system with a fixed volume (isochoric) as the number of particles increase as the will the heat capacity. Theerefore at a given temperature I believe the heat capacity will be greater for the system with a density of 0.8 than for a system with density of 0.2.&lt;br /&gt;
&lt;br /&gt;
= Structural Properties and the Radial Distribution function =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:G(r).png|x300px|thumb|RDF at different phases|left]]&lt;br /&gt;
! [[File:Integral.png|x300px|thumb|Integral of g(r)|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To carry out the RDF calculations temperature was kept constant at 1.2 but density was varied. &lt;br /&gt;
&lt;br /&gt;
Density in reduced units used for each phase: &lt;br /&gt;
&lt;br /&gt;
* Gas = 0.05&lt;br /&gt;
* Liquid = 0.8 &lt;br /&gt;
* Solid = 1.2&lt;br /&gt;
&lt;br /&gt;
The number of peaks for each RDF plot decreases in the order gas&amp;lt;liquid&amp;lt;solid. This reflects the ordering of each phase. &lt;br /&gt;
A gas has a large degree of disorder and thus produces only peak.&lt;br /&gt;
The liquid has three peaks which gradually decrease in amplitude, this behavior is due to the fact that the liquid is modeled as central molecule surrounded by shells of other molecules, this initially creates some degree of order. As the simulation continues the molecules become more diffuse so the ordering decreases and thus the amplitude of peaks decrease.&lt;br /&gt;
&lt;br /&gt;
= Dynamical Properties and the diffusion coefficient = &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid.png|thumb|solid|x300px|left]]&lt;br /&gt;
! [[File:Liquid.png|thumb|liquid|x300px|centre]]&lt;br /&gt;
! [[File:Gas.png|thumb|gas|x300px|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plot give insight into the displacement of particles. There are variations in the shape of the lines for the large number of atoms and small number of atoms, this is due to the variations in positions being averaged for a large number of atoms and thus gives a better indication of the behavior of the system. The different is very apparent for solid where one can see that the line is much more smooth in the region where the gradient becomes close to 0. &lt;br /&gt;
&lt;br /&gt;
The diffusion constant D was found by calculating the gradient of the line for each phase. The gradient after the line had leveled off was used for the solid.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 0.0304&lt;br /&gt;
| 0.0305&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| 0.001&lt;br /&gt;
| 0.0012 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| &amp;lt;math&amp;gt; 6 x 10^{-8} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 7 x 10^{-9} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There is a gradual decrease in D in the order solid&amp;lt;liquid&amp;lt;gas. This fits out chemical intuition; e.g. the motion of a solid would be much more restricted that the motion of a gas.  &lt;br /&gt;
&lt;br /&gt;
[[File:VACFvrsTS.png|x400px|thumb|VACF vrs Temperature|centre]]&lt;br /&gt;
&lt;br /&gt;
Minima in the VACF plot correspond to points where the atoms collide and change direction. The greater number of minima for a solid is due to the restricted mean square displacement in which the atoms can move, this therefore results in greater collisions as the atoms seek to minimize their potential energy. As a liquid has a greater diffusion coefficient it is able to diffuse away from an atom after a collision, this is why there are fewer minima and the line tends to 0. The harmonic oscillator is simply a mathematical function without physical meaning therefore it will continue to oscillate around 0 until infinity. &lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function for a 1D harmonic oscillator can be evaluated using the equation for a 1D harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiation of the displacement function will produce a velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx}{dt} = -A\omega\sin\left(\omega t + \phi\right) = v(t) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substitution into velocity autocorrelation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling -A\omega: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right)\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trigometric relation can simplify equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin\left(\omega t + \omega\tau + \phi\right) = cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integration of ansymmetical function results in 0:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} sin(x)cos(x)\mathrm{d}t = 0 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Thus after &amp;lt;math&amp;gt;cos(t\omega) &amp;lt;/math&amp;gt;is removed from top line the equation simplifies to: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(t\omega) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Vapourphse.png|thumb|Vapour Phase|x300px|left]]&lt;br /&gt;
! [[File:Vapour phase 1 million.png|thumb|Vapour Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid(small).png|thumb|Solid Phase|x300px|left]]&lt;br /&gt;
! [[File:Solid1million.png|thumb|Solid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Liquidsmallno..png|thumb|Liquid Phase|x300px|left]]&lt;br /&gt;
! [[File:Liquid1millionatoms.png|thumb|Liquid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 1.64&lt;br /&gt;
| 1.63&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| -0.2215&lt;br /&gt;
| 0.157 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| 0.254&lt;br /&gt;
| -0.123&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the trapezium rule to calculate D from a VACF plot yeilded a similar trend in diffusion coefficients however there was a discrepancy in one of my results. The value of D for a liquid of small number of atoms was smaller and more negative than the solid. This indictaes that using the MSD method is more accurate than VACF. This also indicates that it is more important to use the VACF plot for a large system when calculating D. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Mark Klarpus, Gregory A. Petsko, (1990) &#039;&#039;Molecular Reaction Dynamics in Biology&#039;&#039;, &#039;&#039;&#039;347&#039;&#039;&#039;, 631-9, doi:10.1038/347631a0&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578799</id>
		<title>Rep:Thermomp4114</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578799"/>
		<updated>2017-01-27T09:24:37Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: /* Harmonic Oscillator */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Molecular Dynamics Simulations of Simple Liquids Introduction == &lt;br /&gt;
&lt;br /&gt;
Molecular dynamic simulations involved studying the motion of a system of particles. Several fundamental elements of a system need to be known in order to achieve this. This includes a knowledge of the interaction potential for the particles and the equations of motion which govern the dynamics of the particles.&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt; Once we know the positions, velocities, and forces, of the atoms (which are obtained using statistical) we can calculate various thermodynamic quantities of the system such as temperature and pressure. We must introduce a series of approximations in order for the caluculations to be feasible. Firstly we apply the &#039;&#039;&#039;The Classical Particle Approximation&#039;&#039;&#039;. The schoedinger equation is too complex to solve for a large system of atoms, however if the atoms are treated classically then the positions and and velocities of each can atom can be calculated using Newton&#039;s second law (equation 1): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = m_i \mathbf{a}_i = m_i \frac{\mathrm{d}\mathbf{v}_i}{\mathrm{d}t} = m_i \frac{\mathrm{d}^2 \mathbf{x}_i}{\mathrm{d}t^2} \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As there are N atoms and therefore N equations representing each atom a computer is a necessity. The &#039;&#039;&#039;Verlet algorithim&#039;&#039;&#039; is used to solve to Newton&#039;s law for all the atoms in the system. In this case time is not continuous but is made discrete, the simulation is thus broeken up into specific &#039;&#039;&#039;timesteps&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The position of atom &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;\mathbf{x}_i \left(t\right)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Positional Verlet algorithim (equation (2)): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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 \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Velocity Verlet algorithim (equation (3)):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{v}_i \left(t\right)&amp;lt;/math&amp;gt; represents the velocity of that atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;center&amp;gt;&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 \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Put in example of industrial applications&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Harmonic Oscillator ===&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator illustrates the the accuracy and discrepancies associated with using the velocity Verlet algorithim. Equation (4) is used to model the behavior of the harmonic oscillator in an analytical sense: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)\ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; = 1.00 &lt;br /&gt;
&lt;br /&gt;
Graph (1) illustrates the results the analytical solution gave for the relationship between position and time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Avrsxt2.png|x300px|thumb|Graph 1: Analytical solution of harmonic oscillator|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The difference in position between the velocity-verlet solution and analytical solution is represented by an error. Error plotted against time is illustrated by graph (2). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ErrorvrsT.png|x300px|thumb|Graph 2: Error vrs Time|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The orange line illustrates the positive trend between error and time. This shows that error is accumulative with time. Each timestep represents a calculation which has an associated error thus as the simulation proceeds the errors will be summed. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy of the system will consist of the sum of kinetic and potential energy. Equation (5) can be used to find kinetic energy of the system:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;E_\text{k} =\tfrac{1}{2} mv(t)^2 \ \ (5)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\mathbf{x} \left(t\right)&amp;lt;/math&amp;gt; is used in equation (5) the potential energy can be found. &lt;br /&gt;
&lt;br /&gt;
The following graphs represent the difference in change in energy with time when the timestep is varied. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EvrsTime.png|x200px|thumb|Energy change when a timestep of 0.1 is used|left]]&lt;br /&gt;
! [[File:Energy vrs time for 0.15 timestep.png|x200px|thumb|Energy change when a timestep of 0.15 is used|centre]]&lt;br /&gt;
! [[File:Energy vrs time for 0.2 timestep.png|x200px|thumb|Energy change when a timestep of 0.2 is used|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The maximum change in energy for each of the different timesteps is shown in table (1). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | Timestep&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.1&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.15&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.2&lt;br /&gt;
|-&lt;br /&gt;
| Max. change in Energy&lt;br /&gt;
| 0.2%&lt;br /&gt;
| 0.6%&lt;br /&gt;
| 1%&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results clearly indicate that a timestep greater than &#039;&#039;&#039;0.2&#039;&#039;&#039; will result in an energy change greater than 1%. As the timestep increases as does the maximum error. The timestep defines the number of calculations made in a given time, therefore the shorter the timestep the larger the number of calculations carried out and therefore a more accurate result is produced. The total energy of a real physical system should not change, when modeled numerically there can be fluctuations therefore it is important to monitor this change and ensure that the fluctuations are minimised.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces ===&lt;br /&gt;
&lt;br /&gt;
The forces an atom experiences is determined by the positions of all the atoms in the system, &amp;lt;math&amp;gt;\mathbf{r}^N&amp;lt;/math&amp;gt;. The Lennard-Jones function accurately sums all the key inter-atomic forces an atoms experiences (U). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ (10)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
For a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After division by 4 and rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_0^{6}} = \frac{\sigma^{6}}{r_0^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After further rearrangement and cancelling down: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;-\sigma &amp;lt;/math&amp;gt; is also a solution however this can be disregarded. &lt;br /&gt;
&lt;br /&gt;
In order to calculate the force the following equation is used: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\sigma\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After differentiation and simplification: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}(r_0) =  \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &#039;&#039;&#039; ask demonstrator if thats too brief &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
At equilibrium: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{12\sigma^{12}}{r_e^{13}} - \frac{6\sigma^6}{r_e^7} \right)&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
After rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_e = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This value of &amp;lt;math&amp;gt; r_e &amp;lt;/math&amp;gt; can now be used to find the well depth:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{\sigma^{12}}{4sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon\left(\frac{1}{5r^{5}} - \frac{1}{11r^11} \right)^\infty_2 \simeq -2.48 \sdot 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -8.18 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -3.29 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Finish off atomic forces - enter integrals&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
* No. of moles in  1 mL of water = 0.056 &amp;lt;br&amp;gt; &lt;br /&gt;
* No. of molecules = moles x Avogadro&#039;s constant = 3.37 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*1000 molecules = 1.66 x 10&amp;lt;sup&amp;gt;21&amp;lt;/sup&amp;gt; moles&lt;br /&gt;
* Density = mass/vol. = 1 &lt;br /&gt;
*vol. = mass/density = 2.99 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Due to periodic boundary condition once the atom leaves the current box it will enter the beginning of an identical box. The atom is at &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; and thus once it breaches 0.5 in a particular direction it will be at the start of the next box. Using these principles after the atom moves &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will be at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units === &lt;br /&gt;
&lt;br /&gt;
Reduced units are applied to the Lennard-Jones equation to make the calculation more managable.&lt;br /&gt;
&lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For argon:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Distance in real units: r = 1.09 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Well depth = &amp;lt;math&amp;gt;{\epsilon}&amp;lt;/math&amp;gt; = 0.996 KJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* T = 180 K &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Do I need to show working out?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Equilibriation = &lt;br /&gt;
&lt;br /&gt;
=== Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
As there is a large number of atoms in a discrete volume allowing random assignment of positions could result in atoms overlapping. This would cause an unrealistically high potential as potential is distance dependant (as observed in the Lennard - Jones equation).&lt;br /&gt;
&lt;br /&gt;
* Density is given by the following equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{n}{v} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 1 (as there is only 1 atom per unit cell) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = 1.07722^3 = 1.25 &amp;lt;/math&amp;gt; (lattice spacing = 1.07722) &lt;br /&gt;
&lt;br /&gt;
Thus: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length of a side of one fcc unit cell with number density 1.2 would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = \frac{n}{\rho} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 4 (as there is 4 atoms per unit cell in an fcc lattice) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; = 3.33&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; l = v^{-3} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The number of atoms that would be created by the create_atoms command for an fcc lattice would be: &lt;br /&gt;
&lt;br /&gt;
4 x 1000 = 4000 &lt;br /&gt;
&lt;br /&gt;
This is due to fact that there is 1 atom per unit cell that yeilds 1000 altogether in simple cubic. Fcc has 4 times the number of atoms per unit cell. &lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of Atoms === &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command above has the following purpose: &lt;br /&gt;
&lt;br /&gt;
* The first line sets the mass of all atoms of type &#039;1&#039; to 1.0. &lt;br /&gt;
*  Line 2 is used to control the Lennard-Jones potential. The value of 3.0 indicates the distance in reduced units upon which the potential is calculated. The potential is distance dependent and falls to 0 at large values of r thus only atoms within a distance of 3.0 are considered.  &#039;lj/cut&#039; defines the cut off point. &lt;br /&gt;
* The last line defines the force field constants as 1.0 for all sets of atoms. The * controls the fact that the command is set for all atoms. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet is the integration algorithm that can be used when &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; are defined. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The codes is in place to ensure that the timestep can be varied but the total time taken for the simulation to run will not change.&lt;br /&gt;
&lt;br /&gt;
=== Checking equilibration === &lt;br /&gt;
&lt;br /&gt;
The graphs below illustrate the time it takes for different thermodynamic properties to equilibriate at a timestep of 0.001. The plateau represents the point at which equilibration is achieved. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EnergyVRStime.png|x300px|thumb|Energy Vrs Time|left]]&lt;br /&gt;
! [[File:TEMPvrsTIME.png|x300px|thumb|Temp vrs Time|centre]]&lt;br /&gt;
! [[File:Press Vrs Time.png|x300px|thumb|Pressure Vrs Time|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The graph below illustrates the effect changing the timestep has on equilibration. As can be seen from the graph a from below 0.01 a shorter timestep results in a lower energy value for equilibration until 0.0025 where the value   of equilibration does not change with lower timestep. This trend is due to the fact that a smaller timestep results in a more accurate result however if it is too small this can over-complicate the calculation (especially when there is a large over-all time). Thus a timestep of 0.0025 is ideal. A timestep of 0.025 is too large and results in the system not reaching equilibrium.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EnergyVtimeFORVTS.png|x400px|thumb|Energy Vrs Time with different timesteps|centre]]&lt;br /&gt;
&lt;br /&gt;
= Running Simulations Under Specific Conditions =&lt;br /&gt;
&lt;br /&gt;
The following two equations can be used to define the energy of the system: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The instantaneous tempertaure &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will not remain constant throughout the simulation and will fluctuate, it will thus be different to out target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The value of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2} = \frac{\mathfrak{T}}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within the preceding code: &lt;br /&gt;
&lt;br /&gt;
100 - Nevery: This command results in a sample being taken every 100 steps and being incorporated into the average. 1000 - Nrepreat: Tells the computer how many samples should be used to calculate the average. Nfreq 10 000: At every 10000th timestep an average is calculated. &lt;br /&gt;
&lt;br /&gt;
All thermodynamic properties are calculated by averages that is the necessity for those commands.&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equation of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:DENSITYvrsT.png|x400px|thumb|Density Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
= Calculating Heat Capacities Using Statistic Physics =&lt;br /&gt;
&lt;br /&gt;
Example of input code used: &lt;br /&gt;
&lt;br /&gt;
* Density 0.2&lt;br /&gt;
* Temperature 2.0 &lt;br /&gt;
&lt;br /&gt;
 variable density equal 0.2&lt;br /&gt;
 DEFINE SIMULATION BOX GEOMETRY &amp;lt;br&amp;gt; &lt;br /&gt;
lattice sc ${density} &amp;lt;br&amp;gt; &lt;br /&gt;
region box block 0 15 0 15 0 15 &amp;lt;br&amp;gt; &lt;br /&gt;
create_box 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
create_atoms 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
DEFINE PHYSICAL PROPERTIES OF ATOMS &amp;lt;br&amp;gt; &lt;br /&gt;
mass 1 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_style lj/cut/opt 3.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_coeff 1 1 1.0 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
neighbor 2.0 bin &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY THE REQUIRED THERMODYNAMIC STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable T equal 2.0 &amp;lt;br&amp;gt; &lt;br /&gt;
variable p equal 2.5 &amp;lt;br&amp;gt; &lt;br /&gt;
variable timestep equal 0.0025 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ASSIGN ATOMIC VELOCITIES &amp;lt;br&amp;gt; &lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
SPECIFY ENSEMBLE &amp;lt;br&amp;gt; &lt;br /&gt;
timestep ${timestep} &amp;lt;br&amp;gt; &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 THERMODYNAMIC OUTPUT CONTROL &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom time etotal temp press &amp;lt;br&amp;gt; &lt;br /&gt;
thermo 10 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RECORD TRAJECTORY &amp;lt;br&amp;gt; &lt;br /&gt;
dump traj all custom 1000 output-1 id x y z &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY TIMESTEP &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RUN SIMULATION TO MELT CRYSTAL &amp;lt;br&amp;gt; &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nve &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 BRING SYSTEM TO REQUIRED STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable tdamp equal ${timestep}*100 &amp;lt;br&amp;gt; &lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &amp;lt;br&amp;gt;  &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nvt &amp;lt;br&amp;gt;  &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 MEASURE SYSTEM STATE  &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom step atoms etotal temp press density &amp;lt;br&amp;gt; &lt;br /&gt;
variable atoms2 equal atoms*atoms &amp;lt;br&amp;gt;   &lt;br /&gt;
variable E equal etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable E2 equal etotal*etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens equal density &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens2 equal density*density &amp;lt;br&amp;gt;  &lt;br /&gt;
variable temp equal temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable temp2 equal temp*temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable press equal press &amp;lt;br&amp;gt; &lt;br /&gt;
variable press2 equal press*press &amp;lt;br&amp;gt; &lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_E2 v_E&lt;br /&gt;
run 100000 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
variable HC equal ${atoms2}*(f_aves[7] - f_aves[8]*f_aves[8])/f_aves[5] &amp;lt;br&amp;gt;  &lt;br /&gt;
variable avedens equal f_aves[1] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avetemp equal f_aves[2] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avepress equal f_aves[3] &amp;lt;br&amp;gt; &lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3]) &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;--------&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Temperature: ${temp}&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Heat capacity: ${HC}&amp;quot;  &amp;lt;br&amp;gt;  &lt;br /&gt;
print &amp;quot;atoms&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Structural Properties and the Radial Distribution function =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:G(r).png|x300px|thumb|RDF at different phases|left]]&lt;br /&gt;
! [[File:Integral.png|x300px|thumb|Integral of g(r)|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To carry out the RDF calculations temperature was kept constant at 1.2 but density was varied. &lt;br /&gt;
&lt;br /&gt;
Density in reduced units used for each phase: &lt;br /&gt;
&lt;br /&gt;
* Gas = 0.05&lt;br /&gt;
* Liquid = 0.8 &lt;br /&gt;
* Solid = 1.2&lt;br /&gt;
&lt;br /&gt;
The number of peaks for each RDF plot decreases in the order gas&amp;lt;liquid&amp;lt;solid. This reflects the ordering of each phase. &lt;br /&gt;
A gas has a large degree of disorder and thus produces only peak.&lt;br /&gt;
The liquid has three peaks which gradually decrease in amplitude, this behavior is due to the fact that the liquid is modeled as central molecule surrounded by shells of other molecules, this initially creates some degree of order. As the simulation continues the molecules become more diffuse so the ordering decreases and thus the amplitude of peaks decrease.&lt;br /&gt;
&lt;br /&gt;
= Dynamical Properties and the diffusion coefficient = &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid.png|thumb|solid|x300px|left]]&lt;br /&gt;
! [[File:Liquid.png|thumb|liquid|x300px|centre]]&lt;br /&gt;
! [[File:Gas.png|thumb|gas|x300px|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plot give insight into the displacement of particles. There are variations in the shape of the lines for the large number of atoms and small number of atoms, this is due to the variations in positions being averaged for a large number of atoms and thus gives a better indication of the behavior of the system. The different is very apparent for solid where one can see that the line is much more smooth in the region where the gradient becomes close to 0. &lt;br /&gt;
&lt;br /&gt;
The diffusion constant D was found by calculating the gradient of the line for each phase. The gradient after the line had leveled off was used for the solid.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 0.0304&lt;br /&gt;
| 0.0305&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| 0.001&lt;br /&gt;
| 0.0012 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| &amp;lt;math&amp;gt; 6 x 10^{-8} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 7 x 10^{-9} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There is a gradual decrease in D in the order solid&amp;lt;liquid&amp;lt;gas. This fits out chemical intuition; e.g. the motion of a solid would be much more restricted that the motion of a gas.  &lt;br /&gt;
&lt;br /&gt;
[[File:VACFvrsTS.png|x400px|thumb|VACF vrs Temperature|centre]]&lt;br /&gt;
&lt;br /&gt;
Minima in the VACF plot correspond to points where the atoms collide and change direction. The greater number of minima for a solid is due to the restricted mean square displacement in which the atoms can move, this therefore results in greater collisions as the atoms seek to minimize their potential energy. As a liquid has a greater diffusion coefficient it is able to diffuse away from an atom after a collision, this is why there are fewer minima and the line tends to 0. The harmonic oscillator is simply a mathematical function without physical meaning therefore it will continue to oscillate around 0 until infinity. &lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function for a 1D harmonic oscillator can be evaluated using the equation for a 1D harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiation of the displacement function will produce a velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx}{dt} = -A\omega\sin\left(\omega t + \phi\right) = v(t) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substitution into velocity autocorrelation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling -A\omega: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right)\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trigometric relation can simplify equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin\left(\omega t + \omega\tau + \phi\right) = cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integration of ansymmetical function results in 0:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} sin(x)cos(x)\mathrm{d}t = 0 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Thus after &amp;lt;math&amp;gt;cos(t\omega) &amp;lt;/math&amp;gt;is removed from top line the equation simplifies to: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(t\omega) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Vapourphse.png|thumb|Vapour Phase|x300px|left]]&lt;br /&gt;
! [[File:Vapour phase 1 million.png|thumb|Vapour Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid(small).png|thumb|Solid Phase|x300px|left]]&lt;br /&gt;
! [[File:Solid1million.png|thumb|Solid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Liquidsmallno..png|thumb|Liquid Phase|x300px|left]]&lt;br /&gt;
! [[File:Liquid1millionatoms.png|thumb|Liquid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 1.64&lt;br /&gt;
| 1.63&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| -0.2215&lt;br /&gt;
| 0.157 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| 0.254&lt;br /&gt;
| -0.123&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the trapezium rule to calculate D from a VACF plot yeilded a similar trend in diffusion coefficients however there was a discrepancy in one of my results. The value of D for a liquid of small number of atoms was smaller and more negative than the solid. This indictaes that using the MSD method is more accurate than VACF. This also indicates that it is more important to use the VACF plot for a large system when calculating D. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Mark Klarpus, Gregory A. Petsko, (1990) &#039;&#039;Molecular Reaction Dynamics in Biology&#039;&#039;, &#039;&#039;&#039;347&#039;&#039;&#039;, 631-9, doi:10.1038/347631a0&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578779</id>
		<title>Rep:Thermomp4114</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578779"/>
		<updated>2017-01-27T09:16:28Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: /* Dynamical Properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Molecular Dynamics Simulations of Simple Liquids Introduction == &lt;br /&gt;
&lt;br /&gt;
Molecular dynamic simulations involved studying the motion of a system of particles. Several fundamental elements of a system need to be known in order to achieve this. This includes a knowledge of the interaction potential for the particles and the equations of motion which govern the dynamics of the particles.&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt; Once we know the positions, velocities, and forces, of the atoms (which are obtained using statistical) we can calculate various thermodynamic quantities of the system such as temperature and pressure. We must introduce a series of approximations in order for the caluculations to be feasible. Firstly we apply the &#039;&#039;&#039;The Classical Particle Approximation&#039;&#039;&#039;. The schoedinger equation is too complex to solve for a large system of atoms, however if the atoms are treated classically then the positions and and velocities of each can atom can be calculated using Newton&#039;s second law (equation 1): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = m_i \mathbf{a}_i = m_i \frac{\mathrm{d}\mathbf{v}_i}{\mathrm{d}t} = m_i \frac{\mathrm{d}^2 \mathbf{x}_i}{\mathrm{d}t^2} \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As there are N atoms and therefore N equations representing each atom a computer is a necessity. The &#039;&#039;&#039;Verlet algorithim&#039;&#039;&#039; is used to solve to Newton&#039;s law for all the atoms in the system. In this case time is not continuous but is made discrete, the simulation is thus broeken up into specific &#039;&#039;&#039;timesteps&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The position of atom &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;\mathbf{x}_i \left(t\right)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Positional Verlet algorithim (equation (2)): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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 \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Velocity Verlet algorithim (equation (3)):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{v}_i \left(t\right)&amp;lt;/math&amp;gt; represents the velocity of that atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;center&amp;gt;&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 \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Put in example of industrial applications&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Harmonic Oscillator ===&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator illustrates the the accuracy and discrepancies associated with using the velocity Verlet algorithim. Equation (4) is used to model the behavior of the harmonic oscillator in an analytical sense: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)\ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; = 1.00 &lt;br /&gt;
&lt;br /&gt;
Graph (1) illustrates the results the analytical solution gave for the relationship between position and time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Avrsxt2.png|x300px|thumb|Graph 1: Analytical solution of harmonic oscillator|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The difference in position between the velocity-verlet solution and analytical solution is represented by an error. Error plotted against time is illustrated by graph (2). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ErrorvrsT.png|x300px|thumb|Graph 2: Error vrs Time|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The orange line illustrates the positive trend between error and time. &#039;&#039;&#039;Insert Answer from demonstrator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy of the system will consist of the sum of kinetic and potential energy. Equation (5) can be used to find kinetic energy of the system:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;E_\text{k} =\tfrac{1}{2} mv(t)^2 \ \ (5)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\mathbf{x} \left(t\right)&amp;lt;/math&amp;gt; is used in equation (5) the potential energy can be found. &lt;br /&gt;
&lt;br /&gt;
The following graphs represent the difference in change in energy with time when the timestep is varied. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EvrsTime.png|x200px|thumb|Energy change when a timestep of 0.1 is used|left]]&lt;br /&gt;
! [[File:Energy vrs time for 0.15 timestep.png|x200px|thumb|Energy change when a timestep of 0.15 is used|centre]]&lt;br /&gt;
! [[File:Energy vrs time for 0.2 timestep.png|x200px|thumb|Energy change when a timestep of 0.2 is used|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The maximum change in energy for each of the different timesteps is shown in table (1). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | Timestep&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.1&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.15&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.2&lt;br /&gt;
|-&lt;br /&gt;
| Max. change in Energy&lt;br /&gt;
| 0.2%&lt;br /&gt;
| 0.6%&lt;br /&gt;
| 1%&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results clearly indicate that a timestep greater than &#039;&#039;&#039;0.2&#039;&#039;&#039; will result in an energy change greater than 1%. As the timestep increases as does the maximum error. The timestep defines the number of calculations made in a given time, therefore the shorter the timestep the larger the number of calculations carried out and therefore a more accurate result is produced. The total energy of a real physical system should not change, when modeled numerically there can be fluctuations therefore it is important to monitor this change and ensure that the fluctuations are minimised.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces ===&lt;br /&gt;
&lt;br /&gt;
The forces an atom experiences is determined by the positions of all the atoms in the system, &amp;lt;math&amp;gt;\mathbf{r}^N&amp;lt;/math&amp;gt;. The Lennard-Jones function accurately sums all the key inter-atomic forces an atoms experiences (U). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ (10)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
For a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After division by 4 and rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_0^{6}} = \frac{\sigma^{6}}{r_0^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After further rearrangement and cancelling down: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;-\sigma &amp;lt;/math&amp;gt; is also a solution however this can be disregarded. &lt;br /&gt;
&lt;br /&gt;
In order to calculate the force the following equation is used: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\sigma\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After differentiation and simplification: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}(r_0) =  \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &#039;&#039;&#039; ask demonstrator if thats too brief &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
At equilibrium: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{12\sigma^{12}}{r_e^{13}} - \frac{6\sigma^6}{r_e^7} \right)&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
After rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_e = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This value of &amp;lt;math&amp;gt; r_e &amp;lt;/math&amp;gt; can now be used to find the well depth:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{\sigma^{12}}{4sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon\left(\frac{1}{5r^{5}} - \frac{1}{11r^11} \right)^\infty_2 \simeq -2.48 \sdot 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -8.18 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -3.29 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Finish off atomic forces - enter integrals&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
* No. of moles in  1 mL of water = 0.056 &amp;lt;br&amp;gt; &lt;br /&gt;
* No. of molecules = moles x Avogadro&#039;s constant = 3.37 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*1000 molecules = 1.66 x 10&amp;lt;sup&amp;gt;21&amp;lt;/sup&amp;gt; moles&lt;br /&gt;
* Density = mass/vol. = 1 &lt;br /&gt;
*vol. = mass/density = 2.99 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Due to periodic boundary condition once the atom leaves the current box it will enter the beginning of an identical box. The atom is at &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; and thus once it breaches 0.5 in a particular direction it will be at the start of the next box. Using these principles after the atom moves &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will be at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units === &lt;br /&gt;
&lt;br /&gt;
Reduced units are applied to the Lennard-Jones equation to make the calculation more managable.&lt;br /&gt;
&lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For argon:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Distance in real units: r = 1.09 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Well depth = &amp;lt;math&amp;gt;{\epsilon}&amp;lt;/math&amp;gt; = 0.996 KJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* T = 180 K &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Do I need to show working out?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Equilibriation = &lt;br /&gt;
&lt;br /&gt;
=== Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
As there is a large number of atoms in a discrete volume allowing random assignment of positions could result in atoms overlapping. This would cause an unrealistically high potential as potential is distance dependant (as observed in the Lennard - Jones equation).&lt;br /&gt;
&lt;br /&gt;
* Density is given by the following equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{n}{v} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 1 (as there is only 1 atom per unit cell) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = 1.07722^3 = 1.25 &amp;lt;/math&amp;gt; (lattice spacing = 1.07722) &lt;br /&gt;
&lt;br /&gt;
Thus: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length of a side of one fcc unit cell with number density 1.2 would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = \frac{n}{\rho} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 4 (as there is 4 atoms per unit cell in an fcc lattice) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; = 3.33&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; l = v^{-3} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The number of atoms that would be created by the create_atoms command for an fcc lattice would be: &lt;br /&gt;
&lt;br /&gt;
4 x 1000 = 4000 &lt;br /&gt;
&lt;br /&gt;
This is due to fact that there is 1 atom per unit cell that yeilds 1000 altogether in simple cubic. Fcc has 4 times the number of atoms per unit cell. &lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of Atoms === &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command above has the following purpose: &lt;br /&gt;
&lt;br /&gt;
* The first line sets the mass of all atoms of type &#039;1&#039; to 1.0. &lt;br /&gt;
*  Line 2 is used to control the Lennard-Jones potential. The value of 3.0 indicates the distance in reduced units upon which the potential is calculated. The potential is distance dependent and falls to 0 at large values of r thus only atoms within a distance of 3.0 are considered.  &#039;lj/cut&#039; defines the cut off point. &lt;br /&gt;
* The last line defines the force field constants as 1.0 for all sets of atoms. The * controls the fact that the command is set for all atoms. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet is the integration algorithm that can be used when &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; are defined. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The codes is in place to ensure that the timestep can be varied but the total time taken for the simulation to run will not change.&lt;br /&gt;
&lt;br /&gt;
=== Checking equilibration === &lt;br /&gt;
&lt;br /&gt;
The graphs below illustrate the time it takes for different thermodynamic properties to equilibriate at a timestep of 0.001. The plateau represents the point at which equilibration is achieved. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EnergyVRStime.png|x300px|thumb|Energy Vrs Time|left]]&lt;br /&gt;
! [[File:TEMPvrsTIME.png|x300px|thumb|Temp vrs Time|centre]]&lt;br /&gt;
! [[File:Press Vrs Time.png|x300px|thumb|Pressure Vrs Time|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The graph below illustrates the effect changing the timestep has on equilibration. As can be seen from the graph a from below 0.01 a shorter timestep results in a lower energy value for equilibration until 0.0025 where the value   of equilibration does not change with lower timestep. This trend is due to the fact that a smaller timestep results in a more accurate result however if it is too small this can over-complicate the calculation (especially when there is a large over-all time). Thus a timestep of 0.0025 is ideal. A timestep of 0.025 is too large and results in the system not reaching equilibrium.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EnergyVtimeFORVTS.png|x400px|thumb|Energy Vrs Time with different timesteps|centre]]&lt;br /&gt;
&lt;br /&gt;
= Running Simulations Under Specific Conditions =&lt;br /&gt;
&lt;br /&gt;
The following two equations can be used to define the energy of the system: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The instantaneous tempertaure &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will not remain constant throughout the simulation and will fluctuate, it will thus be different to out target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The value of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2} = \frac{\mathfrak{T}}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within the preceding code: &lt;br /&gt;
&lt;br /&gt;
100 - Nevery: This command results in a sample being taken every 100 steps and being incorporated into the average. 1000 - Nrepreat: Tells the computer how many samples should be used to calculate the average. Nfreq 10 000: At every 10000th timestep an average is calculated. &lt;br /&gt;
&lt;br /&gt;
All thermodynamic properties are calculated by averages that is the necessity for those commands.&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equation of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:DENSITYvrsT.png|x400px|thumb|Density Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
= Calculating Heat Capacities Using Statistic Physics =&lt;br /&gt;
&lt;br /&gt;
Example of input code used: &lt;br /&gt;
&lt;br /&gt;
* Density 0.2&lt;br /&gt;
* Temperature 2.0 &lt;br /&gt;
&lt;br /&gt;
 variable density equal 0.2&lt;br /&gt;
 DEFINE SIMULATION BOX GEOMETRY &amp;lt;br&amp;gt; &lt;br /&gt;
lattice sc ${density} &amp;lt;br&amp;gt; &lt;br /&gt;
region box block 0 15 0 15 0 15 &amp;lt;br&amp;gt; &lt;br /&gt;
create_box 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
create_atoms 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
DEFINE PHYSICAL PROPERTIES OF ATOMS &amp;lt;br&amp;gt; &lt;br /&gt;
mass 1 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_style lj/cut/opt 3.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_coeff 1 1 1.0 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
neighbor 2.0 bin &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY THE REQUIRED THERMODYNAMIC STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable T equal 2.0 &amp;lt;br&amp;gt; &lt;br /&gt;
variable p equal 2.5 &amp;lt;br&amp;gt; &lt;br /&gt;
variable timestep equal 0.0025 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ASSIGN ATOMIC VELOCITIES &amp;lt;br&amp;gt; &lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
SPECIFY ENSEMBLE &amp;lt;br&amp;gt; &lt;br /&gt;
timestep ${timestep} &amp;lt;br&amp;gt; &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 THERMODYNAMIC OUTPUT CONTROL &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom time etotal temp press &amp;lt;br&amp;gt; &lt;br /&gt;
thermo 10 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RECORD TRAJECTORY &amp;lt;br&amp;gt; &lt;br /&gt;
dump traj all custom 1000 output-1 id x y z &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY TIMESTEP &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RUN SIMULATION TO MELT CRYSTAL &amp;lt;br&amp;gt; &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nve &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 BRING SYSTEM TO REQUIRED STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable tdamp equal ${timestep}*100 &amp;lt;br&amp;gt; &lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &amp;lt;br&amp;gt;  &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nvt &amp;lt;br&amp;gt;  &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 MEASURE SYSTEM STATE  &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom step atoms etotal temp press density &amp;lt;br&amp;gt; &lt;br /&gt;
variable atoms2 equal atoms*atoms &amp;lt;br&amp;gt;   &lt;br /&gt;
variable E equal etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable E2 equal etotal*etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens equal density &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens2 equal density*density &amp;lt;br&amp;gt;  &lt;br /&gt;
variable temp equal temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable temp2 equal temp*temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable press equal press &amp;lt;br&amp;gt; &lt;br /&gt;
variable press2 equal press*press &amp;lt;br&amp;gt; &lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_E2 v_E&lt;br /&gt;
run 100000 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
variable HC equal ${atoms2}*(f_aves[7] - f_aves[8]*f_aves[8])/f_aves[5] &amp;lt;br&amp;gt;  &lt;br /&gt;
variable avedens equal f_aves[1] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avetemp equal f_aves[2] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avepress equal f_aves[3] &amp;lt;br&amp;gt; &lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3]) &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;--------&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Temperature: ${temp}&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Heat capacity: ${HC}&amp;quot;  &amp;lt;br&amp;gt;  &lt;br /&gt;
print &amp;quot;atoms&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Structural Properties and the Radial Distribution function =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:G(r).png|x300px|thumb|RDF at different phases|left]]&lt;br /&gt;
! [[File:Integral.png|x300px|thumb|Integral of g(r)|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To carry out the RDF calculations temperature was kept constant at 1.2 but density was varied. &lt;br /&gt;
&lt;br /&gt;
Density in reduced units used for each phase: &lt;br /&gt;
&lt;br /&gt;
* Gas = 0.05&lt;br /&gt;
* Liquid = 0.8 &lt;br /&gt;
* Solid = 1.2&lt;br /&gt;
&lt;br /&gt;
The number of peaks for each RDF plot decreases in the order gas&amp;lt;liquid&amp;lt;solid. This reflects the ordering of each phase. &lt;br /&gt;
A gas has a large degree of disorder and thus produces only peak.&lt;br /&gt;
The liquid has three peaks which gradually decrease in amplitude, this behavior is due to the fact that the liquid is modeled as central molecule surrounded by shells of other molecules, this initially creates some degree of order. As the simulation continues the molecules become more diffuse so the ordering decreases and thus the amplitude of peaks decrease.&lt;br /&gt;
&lt;br /&gt;
= Dynamical Properties and the diffusion coefficient = &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid.png|thumb|solid|x300px|left]]&lt;br /&gt;
! [[File:Liquid.png|thumb|liquid|x300px|centre]]&lt;br /&gt;
! [[File:Gas.png|thumb|gas|x300px|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plot give insight into the displacement of particles. There are variations in the shape of the lines for the large number of atoms and small number of atoms, this is due to the variations in positions being averaged for a large number of atoms and thus gives a better indication of the behavior of the system. The different is very apparent for solid where one can see that the line is much more smooth in the region where the gradient becomes close to 0. &lt;br /&gt;
&lt;br /&gt;
The diffusion constant D was found by calculating the gradient of the line for each phase. The gradient after the line had leveled off was used for the solid.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 0.0304&lt;br /&gt;
| 0.0305&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| 0.001&lt;br /&gt;
| 0.0012 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| &amp;lt;math&amp;gt; 6 x 10^{-8} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 7 x 10^{-9} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There is a gradual decrease in D in the order solid&amp;lt;liquid&amp;lt;gas. This fits out chemical intuition; e.g. the motion of a solid would be much more restricted that the motion of a gas.  &lt;br /&gt;
&lt;br /&gt;
[[File:VACFvrsTS.png|x400px|thumb|VACF vrs Temperature|centre]]&lt;br /&gt;
&lt;br /&gt;
Minima in the VACF plot correspond to points where the atoms collide and change direction. The greater number of minima for a solid is due to the restricted mean square displacement in which the atoms can move, this therefore results in greater collisions as the atoms seek to minimize their potential energy. As a liquid has a greater diffusion coefficient it is able to diffuse away from an atom after a collision, this is why there are fewer minima and the line tends to 0. The harmonic oscillator is simply a mathematical function without physical meaning therefore it will continue to oscillate around 0 until infinity. &lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function for a 1D harmonic oscillator can be evaluated using the equation for a 1D harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiation of the displacement function will produce a velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx}{dt} = -A\omega\sin\left(\omega t + \phi\right) = v(t) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substitution into velocity autocorrelation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling -A\omega: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right)\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trigometric relation can simplify equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin\left(\omega t + \omega\tau + \phi\right) = cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integration of ansymmetical function results in 0:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} sin(x)cos(x)\mathrm{d}t = 0 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Thus after &amp;lt;math&amp;gt;cos(t\omega) &amp;lt;/math&amp;gt;is removed from top line the equation simplifies to: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(t\omega) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Vapourphse.png|thumb|Vapour Phase|x300px|left]]&lt;br /&gt;
! [[File:Vapour phase 1 million.png|thumb|Vapour Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid(small).png|thumb|Solid Phase|x300px|left]]&lt;br /&gt;
! [[File:Solid1million.png|thumb|Solid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Liquidsmallno..png|thumb|Liquid Phase|x300px|left]]&lt;br /&gt;
! [[File:Liquid1millionatoms.png|thumb|Liquid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 1.64&lt;br /&gt;
| 1.63&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| -0.2215&lt;br /&gt;
| 0.157 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| 0.254&lt;br /&gt;
| -0.123&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the trapezium rule to calculate D from a VACF plot yeilded a similar trend in diffusion coefficients however there was a discrepancy in one of my results. The value of D for a liquid of small number of atoms was smaller and more negative than the solid. This indictaes that using the MSD method is more accurate than VACF. This also indicates that it is more important to use the VACF plot for a large system when calculating D. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Mark Klarpus, Gregory A. Petsko, (1990) &#039;&#039;Molecular Reaction Dynamics in Biology&#039;&#039;, &#039;&#039;&#039;347&#039;&#039;&#039;, 631-9, doi:10.1038/347631a0&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578757</id>
		<title>Rep:Thermomp4114</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578757"/>
		<updated>2017-01-27T08:53:33Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: /* Dynamical Properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Molecular Dynamics Simulations of Simple Liquids Introduction == &lt;br /&gt;
&lt;br /&gt;
Molecular dynamic simulations involved studying the motion of a system of particles. Several fundamental elements of a system need to be known in order to achieve this. This includes a knowledge of the interaction potential for the particles and the equations of motion which govern the dynamics of the particles.&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt; Once we know the positions, velocities, and forces, of the atoms (which are obtained using statistical) we can calculate various thermodynamic quantities of the system such as temperature and pressure. We must introduce a series of approximations in order for the caluculations to be feasible. Firstly we apply the &#039;&#039;&#039;The Classical Particle Approximation&#039;&#039;&#039;. The schoedinger equation is too complex to solve for a large system of atoms, however if the atoms are treated classically then the positions and and velocities of each can atom can be calculated using Newton&#039;s second law (equation 1): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = m_i \mathbf{a}_i = m_i \frac{\mathrm{d}\mathbf{v}_i}{\mathrm{d}t} = m_i \frac{\mathrm{d}^2 \mathbf{x}_i}{\mathrm{d}t^2} \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As there are N atoms and therefore N equations representing each atom a computer is a necessity. The &#039;&#039;&#039;Verlet algorithim&#039;&#039;&#039; is used to solve to Newton&#039;s law for all the atoms in the system. In this case time is not continuous but is made discrete, the simulation is thus broeken up into specific &#039;&#039;&#039;timesteps&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The position of atom &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;\mathbf{x}_i \left(t\right)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Positional Verlet algorithim (equation (2)): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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 \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Velocity Verlet algorithim (equation (3)):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{v}_i \left(t\right)&amp;lt;/math&amp;gt; represents the velocity of that atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;center&amp;gt;&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 \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Put in example of industrial applications&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Harmonic Oscillator ===&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator illustrates the the accuracy and discrepancies associated with using the velocity Verlet algorithim. Equation (4) is used to model the behavior of the harmonic oscillator in an analytical sense: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)\ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; = 1.00 &lt;br /&gt;
&lt;br /&gt;
Graph (1) illustrates the results the analytical solution gave for the relationship between position and time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Avrsxt2.png|x300px|thumb|Graph 1: Analytical solution of harmonic oscillator|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The difference in position between the velocity-verlet solution and analytical solution is represented by an error. Error plotted against time is illustrated by graph (2). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ErrorvrsT.png|x300px|thumb|Graph 2: Error vrs Time|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The orange line illustrates the positive trend between error and time. &#039;&#039;&#039;Insert Answer from demonstrator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy of the system will consist of the sum of kinetic and potential energy. Equation (5) can be used to find kinetic energy of the system:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;E_\text{k} =\tfrac{1}{2} mv(t)^2 \ \ (5)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\mathbf{x} \left(t\right)&amp;lt;/math&amp;gt; is used in equation (5) the potential energy can be found. &lt;br /&gt;
&lt;br /&gt;
The following graphs represent the difference in change in energy with time when the timestep is varied. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EvrsTime.png|x200px|thumb|Energy change when a timestep of 0.1 is used|left]]&lt;br /&gt;
! [[File:Energy vrs time for 0.15 timestep.png|x200px|thumb|Energy change when a timestep of 0.15 is used|centre]]&lt;br /&gt;
! [[File:Energy vrs time for 0.2 timestep.png|x200px|thumb|Energy change when a timestep of 0.2 is used|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The maximum change in energy for each of the different timesteps is shown in table (1). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | Timestep&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.1&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.15&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.2&lt;br /&gt;
|-&lt;br /&gt;
| Max. change in Energy&lt;br /&gt;
| 0.2%&lt;br /&gt;
| 0.6%&lt;br /&gt;
| 1%&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results clearly indicate that a timestep greater than &#039;&#039;&#039;0.2&#039;&#039;&#039; will result in an energy change greater than 1%. As the timestep increases as does the maximum error. The timestep defines the number of calculations made in a given time, therefore the shorter the timestep the larger the number of calculations carried out and therefore a more accurate result is produced. The total energy of a real physical system should not change, when modeled numerically there can be fluctuations therefore it is important to monitor this change and ensure that the fluctuations are minimised.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces ===&lt;br /&gt;
&lt;br /&gt;
The forces an atom experiences is determined by the positions of all the atoms in the system, &amp;lt;math&amp;gt;\mathbf{r}^N&amp;lt;/math&amp;gt;. The Lennard-Jones function accurately sums all the key inter-atomic forces an atoms experiences (U). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ (10)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
For a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After division by 4 and rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_0^{6}} = \frac{\sigma^{6}}{r_0^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After further rearrangement and cancelling down: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;-\sigma &amp;lt;/math&amp;gt; is also a solution however this can be disregarded. &lt;br /&gt;
&lt;br /&gt;
In order to calculate the force the following equation is used: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\sigma\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After differentiation and simplification: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}(r_0) =  \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &#039;&#039;&#039; ask demonstrator if thats too brief &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
At equilibrium: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{12\sigma^{12}}{r_e^{13}} - \frac{6\sigma^6}{r_e^7} \right)&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
After rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_e = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This value of &amp;lt;math&amp;gt; r_e &amp;lt;/math&amp;gt; can now be used to find the well depth:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{\sigma^{12}}{4sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon\left(\frac{1}{5r^{5}} - \frac{1}{11r^11} \right)^\infty_2 \simeq -2.48 \sdot 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -8.18 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -3.29 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Finish off atomic forces - enter integrals&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
* No. of moles in  1 mL of water = 0.056 &amp;lt;br&amp;gt; &lt;br /&gt;
* No. of molecules = moles x Avogadro&#039;s constant = 3.37 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*1000 molecules = 1.66 x 10&amp;lt;sup&amp;gt;21&amp;lt;/sup&amp;gt; moles&lt;br /&gt;
* Density = mass/vol. = 1 &lt;br /&gt;
*vol. = mass/density = 2.99 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Due to periodic boundary condition once the atom leaves the current box it will enter the beginning of an identical box. The atom is at &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; and thus once it breaches 0.5 in a particular direction it will be at the start of the next box. Using these principles after the atom moves &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will be at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units === &lt;br /&gt;
&lt;br /&gt;
Reduced units are applied to the Lennard-Jones equation to make the calculation more managable.&lt;br /&gt;
&lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For argon:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Distance in real units: r = 1.09 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Well depth = &amp;lt;math&amp;gt;{\epsilon}&amp;lt;/math&amp;gt; = 0.996 KJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* T = 180 K &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Do I need to show working out?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Equilibriation = &lt;br /&gt;
&lt;br /&gt;
=== Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
As there is a large number of atoms in a discrete volume allowing random assignment of positions could result in atoms overlapping. This would cause an unrealistically high potential as potential is distance dependant (as observed in the Lennard - Jones equation).&lt;br /&gt;
&lt;br /&gt;
* Density is given by the following equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{n}{v} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 1 (as there is only 1 atom per unit cell) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = 1.07722^3 = 1.25 &amp;lt;/math&amp;gt; (lattice spacing = 1.07722) &lt;br /&gt;
&lt;br /&gt;
Thus: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length of a side of one fcc unit cell with number density 1.2 would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = \frac{n}{\rho} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 4 (as there is 4 atoms per unit cell in an fcc lattice) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; = 3.33&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; l = v^{-3} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The number of atoms that would be created by the create_atoms command for an fcc lattice would be: &lt;br /&gt;
&lt;br /&gt;
4 x 1000 = 4000 &lt;br /&gt;
&lt;br /&gt;
This is due to fact that there is 1 atom per unit cell that yeilds 1000 altogether in simple cubic. Fcc has 4 times the number of atoms per unit cell. &lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of Atoms === &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command above has the following purpose: &lt;br /&gt;
&lt;br /&gt;
* The first line sets the mass of all atoms of type &#039;1&#039; to 1.0. &lt;br /&gt;
*  Line 2 is used to control the Lennard-Jones potential. The value of 3.0 indicates the distance in reduced units upon which the potential is calculated. The potential is distance dependent and falls to 0 at large values of r thus only atoms within a distance of 3.0 are considered.  &#039;lj/cut&#039; defines the cut off point. &lt;br /&gt;
* The last line defines the force field constants as 1.0 for all sets of atoms. The * controls the fact that the command is set for all atoms. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet is the integration algorithm that can be used when &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; are defined. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The codes is in place to ensure that the timestep can be varied but the total time taken for the simulation to run will not change.&lt;br /&gt;
&lt;br /&gt;
=== Checking equilibration === &lt;br /&gt;
&lt;br /&gt;
The graphs below illustrate the time it takes for different thermodynamic properties to equilibriate at a timestep of 0.001. The plateau represents the point at which equilibration is achieved. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EnergyVRStime.png|x300px|thumb|Energy Vrs Time|left]]&lt;br /&gt;
! [[File:TEMPvrsTIME.png|x300px|thumb|Temp vrs Time|centre]]&lt;br /&gt;
! [[File:Press Vrs Time.png|x300px|thumb|Pressure Vrs Time|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The graph below illustrates the effect changing the timestep has on equilibration. As can be seen from the graph a from below 0.01 a shorter timestep results in a lower energy value for equilibration until 0.0025 where the value   of equilibration does not change with lower timestep. This trend is due to the fact that a smaller timestep results in a more accurate result however if it is too small this can over-complicate the calculation (especially when there is a large over-all time). Thus a timestep of 0.0025 is ideal. A timestep of 0.025 is too large and results in the system not reaching equilibrium.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EnergyVtimeFORVTS.png|x400px|thumb|Energy Vrs Time with different timesteps|centre]]&lt;br /&gt;
&lt;br /&gt;
= Running Simulations Under Specific Conditions =&lt;br /&gt;
&lt;br /&gt;
The following two equations can be used to define the energy of the system: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The instantaneous tempertaure &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will not remain constant throughout the simulation and will fluctuate, it will thus be different to out target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The value of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2} = \frac{\mathfrak{T}}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within the preceding code: &lt;br /&gt;
&lt;br /&gt;
100 - Nevery: This command results in a sample being taken every 100 steps and being incorporated into the average. 1000 - Nrepreat: Tells the computer how many samples should be used to calculate the average. Nfreq 10 000: At every 10000th timestep an average is calculated. &lt;br /&gt;
&lt;br /&gt;
All thermodynamic properties are calculated by averages that is the necessity for those commands.&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equation of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:DENSITYvrsT.png|x400px|thumb|Density Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
= Calculating Heat Capacities Using Statistic Physics =&lt;br /&gt;
&lt;br /&gt;
Example of input code used: &lt;br /&gt;
&lt;br /&gt;
* Density 0.2&lt;br /&gt;
* Temperature 2.0 &lt;br /&gt;
&lt;br /&gt;
 variable density equal 0.2&lt;br /&gt;
 DEFINE SIMULATION BOX GEOMETRY &amp;lt;br&amp;gt; &lt;br /&gt;
lattice sc ${density} &amp;lt;br&amp;gt; &lt;br /&gt;
region box block 0 15 0 15 0 15 &amp;lt;br&amp;gt; &lt;br /&gt;
create_box 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
create_atoms 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
DEFINE PHYSICAL PROPERTIES OF ATOMS &amp;lt;br&amp;gt; &lt;br /&gt;
mass 1 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_style lj/cut/opt 3.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_coeff 1 1 1.0 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
neighbor 2.0 bin &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY THE REQUIRED THERMODYNAMIC STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable T equal 2.0 &amp;lt;br&amp;gt; &lt;br /&gt;
variable p equal 2.5 &amp;lt;br&amp;gt; &lt;br /&gt;
variable timestep equal 0.0025 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ASSIGN ATOMIC VELOCITIES &amp;lt;br&amp;gt; &lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
SPECIFY ENSEMBLE &amp;lt;br&amp;gt; &lt;br /&gt;
timestep ${timestep} &amp;lt;br&amp;gt; &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 THERMODYNAMIC OUTPUT CONTROL &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom time etotal temp press &amp;lt;br&amp;gt; &lt;br /&gt;
thermo 10 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RECORD TRAJECTORY &amp;lt;br&amp;gt; &lt;br /&gt;
dump traj all custom 1000 output-1 id x y z &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY TIMESTEP &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RUN SIMULATION TO MELT CRYSTAL &amp;lt;br&amp;gt; &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nve &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 BRING SYSTEM TO REQUIRED STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable tdamp equal ${timestep}*100 &amp;lt;br&amp;gt; &lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &amp;lt;br&amp;gt;  &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nvt &amp;lt;br&amp;gt;  &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 MEASURE SYSTEM STATE  &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom step atoms etotal temp press density &amp;lt;br&amp;gt; &lt;br /&gt;
variable atoms2 equal atoms*atoms &amp;lt;br&amp;gt;   &lt;br /&gt;
variable E equal etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable E2 equal etotal*etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens equal density &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens2 equal density*density &amp;lt;br&amp;gt;  &lt;br /&gt;
variable temp equal temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable temp2 equal temp*temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable press equal press &amp;lt;br&amp;gt; &lt;br /&gt;
variable press2 equal press*press &amp;lt;br&amp;gt; &lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_E2 v_E&lt;br /&gt;
run 100000 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
variable HC equal ${atoms2}*(f_aves[7] - f_aves[8]*f_aves[8])/f_aves[5] &amp;lt;br&amp;gt;  &lt;br /&gt;
variable avedens equal f_aves[1] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avetemp equal f_aves[2] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avepress equal f_aves[3] &amp;lt;br&amp;gt; &lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3]) &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;--------&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Temperature: ${temp}&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Heat capacity: ${HC}&amp;quot;  &amp;lt;br&amp;gt;  &lt;br /&gt;
print &amp;quot;atoms&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Structural Properties and the Radial Distribution function =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:G(r).png|x300px|thumb|RDF at different phases|left]]&lt;br /&gt;
! [[File:Integral.png|x300px|thumb|Integral of g(r)|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To carry out the RDF calculations temperature was kept constant at 1.2 but density was varied. &lt;br /&gt;
&lt;br /&gt;
Density in reduced units used for each phase: &lt;br /&gt;
&lt;br /&gt;
* Gas = 0.05&lt;br /&gt;
* Liquid = 0.8 &lt;br /&gt;
* Solid = 1.2&lt;br /&gt;
&lt;br /&gt;
The number of peaks for each RDF plot decreases in the order gas&amp;lt;liquid&amp;lt;solid. This reflects the ordering of each phase. &lt;br /&gt;
A gas has a large degree of disorder and thus produces only peak.&lt;br /&gt;
The liquid has three peaks which gradually decrease in amplitude, this behavior is due to the fact that the liquid is modeled as central molecule surrounded by shells of other molecules, this initially creates some degree of order. As the simulation continues the molecules become more diffuse so the ordering decreases and thus the amplitude of peaks decrease.&lt;br /&gt;
&lt;br /&gt;
= Dynamical Properties and the diffusion coefficient = &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid.png|thumb|solid|x300px|left]]&lt;br /&gt;
! [[File:Liquid.png|thumb|liquid|x300px|centre]]&lt;br /&gt;
! [[File:Gas.png|thumb|gas|x300px|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plot give insight into the displacement of particles. There are variations in the shape of the lines for the large number of atoms and small number of atoms, this is due to the variations in positions being averaged for a large number of atoms and thus gives a better indication of the behavior of the system. The different is very apparent for solid where one can see that the line is much more smooth in the region where the gradient becomes close to 0. &lt;br /&gt;
&lt;br /&gt;
The diffusion constant D was found by calculating the gradient of the line for each phase. The gradient after the line had leveled off was used for the solid.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 0.0304&lt;br /&gt;
| 0.0305&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| 0.001&lt;br /&gt;
| 0.0012 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| &amp;lt;math&amp;gt; 6 x 10^{-8} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 7 x 10^{-9} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There is a gradual decrease in D in the order solid&amp;lt;liquid&amp;lt;gas. This fits out chemical intuition; e.g. the motion of a solid would be much more restricted that the motion of a gas.  &lt;br /&gt;
&lt;br /&gt;
[[File:VACFvrsTS.png|x400px|thumb|VACF vrs Temperature|centre]]&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function for a 1D harmonic oscillator can be evaluated using the equation for a 1D harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiation of the displacement function will produce a velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx}{dt} = -A\omega\sin\left(\omega t + \phi\right) = v(t) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substitution into velocity autocorrelation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling -A\omega: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right)\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trigometric relation can simplify equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin\left(\omega t + \omega\tau + \phi\right) = cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integration of ansymmetical function results in 0:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} sin(x)cos(x)\mathrm{d}t = 0 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Thus after &amp;lt;math&amp;gt;cos(t\omega) &amp;lt;/math&amp;gt;is removed from top line the equation simplifies to: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(t\omega) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Vapourphse.png|thumb|Vapour Phase|x300px|left]]&lt;br /&gt;
! [[File:Vapour phase 1 million.png|thumb|Vapour Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid(small).png|thumb|Solid Phase|x300px|left]]&lt;br /&gt;
! [[File:Solid1million.png|thumb|Solid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Liquidsmallno..png|thumb|Liquid Phase|x300px|left]]&lt;br /&gt;
! [[File:Liquid1millionatoms.png|thumb|Liquid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 1.64&lt;br /&gt;
| 1.63&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| -0.2215&lt;br /&gt;
| 0.157 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| 0.254&lt;br /&gt;
| -0.123&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Mark Klarpus, Gregory A. Petsko, (1990) &#039;&#039;Molecular Reaction Dynamics in Biology&#039;&#039;, &#039;&#039;&#039;347&#039;&#039;&#039;, 631-9, doi:10.1038/347631a0&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578745</id>
		<title>Rep:Thermomp4114</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578745"/>
		<updated>2017-01-27T08:34:06Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: /* Dynamical Properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Molecular Dynamics Simulations of Simple Liquids Introduction == &lt;br /&gt;
&lt;br /&gt;
Molecular dynamic simulations involved studying the motion of a system of particles. Several fundamental elements of a system need to be known in order to achieve this. This includes a knowledge of the interaction potential for the particles and the equations of motion which govern the dynamics of the particles.&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt; Once we know the positions, velocities, and forces, of the atoms (which are obtained using statistical) we can calculate various thermodynamic quantities of the system such as temperature and pressure. We must introduce a series of approximations in order for the caluculations to be feasible. Firstly we apply the &#039;&#039;&#039;The Classical Particle Approximation&#039;&#039;&#039;. The schoedinger equation is too complex to solve for a large system of atoms, however if the atoms are treated classically then the positions and and velocities of each can atom can be calculated using Newton&#039;s second law (equation 1): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = m_i \mathbf{a}_i = m_i \frac{\mathrm{d}\mathbf{v}_i}{\mathrm{d}t} = m_i \frac{\mathrm{d}^2 \mathbf{x}_i}{\mathrm{d}t^2} \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As there are N atoms and therefore N equations representing each atom a computer is a necessity. The &#039;&#039;&#039;Verlet algorithim&#039;&#039;&#039; is used to solve to Newton&#039;s law for all the atoms in the system. In this case time is not continuous but is made discrete, the simulation is thus broeken up into specific &#039;&#039;&#039;timesteps&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The position of atom &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;\mathbf{x}_i \left(t\right)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Positional Verlet algorithim (equation (2)): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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 \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Velocity Verlet algorithim (equation (3)):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{v}_i \left(t\right)&amp;lt;/math&amp;gt; represents the velocity of that atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;center&amp;gt;&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 \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Put in example of industrial applications&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Harmonic Oscillator ===&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator illustrates the the accuracy and discrepancies associated with using the velocity Verlet algorithim. Equation (4) is used to model the behavior of the harmonic oscillator in an analytical sense: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)\ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; = 1.00 &lt;br /&gt;
&lt;br /&gt;
Graph (1) illustrates the results the analytical solution gave for the relationship between position and time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Avrsxt2.png|x300px|thumb|Graph 1: Analytical solution of harmonic oscillator|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The difference in position between the velocity-verlet solution and analytical solution is represented by an error. Error plotted against time is illustrated by graph (2). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ErrorvrsT.png|x300px|thumb|Graph 2: Error vrs Time|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The orange line illustrates the positive trend between error and time. &#039;&#039;&#039;Insert Answer from demonstrator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy of the system will consist of the sum of kinetic and potential energy. Equation (5) can be used to find kinetic energy of the system:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;E_\text{k} =\tfrac{1}{2} mv(t)^2 \ \ (5)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\mathbf{x} \left(t\right)&amp;lt;/math&amp;gt; is used in equation (5) the potential energy can be found. &lt;br /&gt;
&lt;br /&gt;
The following graphs represent the difference in change in energy with time when the timestep is varied. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EvrsTime.png|x200px|thumb|Energy change when a timestep of 0.1 is used|left]]&lt;br /&gt;
! [[File:Energy vrs time for 0.15 timestep.png|x200px|thumb|Energy change when a timestep of 0.15 is used|centre]]&lt;br /&gt;
! [[File:Energy vrs time for 0.2 timestep.png|x200px|thumb|Energy change when a timestep of 0.2 is used|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The maximum change in energy for each of the different timesteps is shown in table (1). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | Timestep&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.1&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.15&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.2&lt;br /&gt;
|-&lt;br /&gt;
| Max. change in Energy&lt;br /&gt;
| 0.2%&lt;br /&gt;
| 0.6%&lt;br /&gt;
| 1%&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results clearly indicate that a timestep greater than &#039;&#039;&#039;0.2&#039;&#039;&#039; will result in an energy change greater than 1%. As the timestep increases as does the maximum error. The timestep defines the number of calculations made in a given time, therefore the shorter the timestep the larger the number of calculations carried out and therefore a more accurate result is produced. The total energy of a real physical system should not change, when modeled numerically there can be fluctuations therefore it is important to monitor this change and ensure that the fluctuations are minimised.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces ===&lt;br /&gt;
&lt;br /&gt;
The forces an atom experiences is determined by the positions of all the atoms in the system, &amp;lt;math&amp;gt;\mathbf{r}^N&amp;lt;/math&amp;gt;. The Lennard-Jones function accurately sums all the key inter-atomic forces an atoms experiences (U). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ (10)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
For a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After division by 4 and rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_0^{6}} = \frac{\sigma^{6}}{r_0^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After further rearrangement and cancelling down: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;-\sigma &amp;lt;/math&amp;gt; is also a solution however this can be disregarded. &lt;br /&gt;
&lt;br /&gt;
In order to calculate the force the following equation is used: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\sigma\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After differentiation and simplification: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}(r_0) =  \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &#039;&#039;&#039; ask demonstrator if thats too brief &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
At equilibrium: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{12\sigma^{12}}{r_e^{13}} - \frac{6\sigma^6}{r_e^7} \right)&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
After rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_e = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This value of &amp;lt;math&amp;gt; r_e &amp;lt;/math&amp;gt; can now be used to find the well depth:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{\sigma^{12}}{4sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon\left(\frac{1}{5r^{5}} - \frac{1}{11r^11} \right)^\infty_2 \simeq -2.48 \sdot 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -8.18 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -3.29 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Finish off atomic forces - enter integrals&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
* No. of moles in  1 mL of water = 0.056 &amp;lt;br&amp;gt; &lt;br /&gt;
* No. of molecules = moles x Avogadro&#039;s constant = 3.37 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*1000 molecules = 1.66 x 10&amp;lt;sup&amp;gt;21&amp;lt;/sup&amp;gt; moles&lt;br /&gt;
* Density = mass/vol. = 1 &lt;br /&gt;
*vol. = mass/density = 2.99 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Due to periodic boundary condition once the atom leaves the current box it will enter the beginning of an identical box. The atom is at &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; and thus once it breaches 0.5 in a particular direction it will be at the start of the next box. Using these principles after the atom moves &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will be at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units === &lt;br /&gt;
&lt;br /&gt;
Reduced units are applied to the Lennard-Jones equation to make the calculation more managable.&lt;br /&gt;
&lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For argon:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Distance in real units: r = 1.09 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Well depth = &amp;lt;math&amp;gt;{\epsilon}&amp;lt;/math&amp;gt; = 0.996 KJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* T = 180 K &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Do I need to show working out?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Equilibriation = &lt;br /&gt;
&lt;br /&gt;
=== Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
As there is a large number of atoms in a discrete volume allowing random assignment of positions could result in atoms overlapping. This would cause an unrealistically high potential as potential is distance dependant (as observed in the Lennard - Jones equation).&lt;br /&gt;
&lt;br /&gt;
* Density is given by the following equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{n}{v} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 1 (as there is only 1 atom per unit cell) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = 1.07722^3 = 1.25 &amp;lt;/math&amp;gt; (lattice spacing = 1.07722) &lt;br /&gt;
&lt;br /&gt;
Thus: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length of a side of one fcc unit cell with number density 1.2 would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = \frac{n}{\rho} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 4 (as there is 4 atoms per unit cell in an fcc lattice) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; = 3.33&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; l = v^{-3} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The number of atoms that would be created by the create_atoms command for an fcc lattice would be: &lt;br /&gt;
&lt;br /&gt;
4 x 1000 = 4000 &lt;br /&gt;
&lt;br /&gt;
This is due to fact that there is 1 atom per unit cell that yeilds 1000 altogether in simple cubic. Fcc has 4 times the number of atoms per unit cell. &lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of Atoms === &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command above has the following purpose: &lt;br /&gt;
&lt;br /&gt;
* The first line sets the mass of all atoms of type &#039;1&#039; to 1.0. &lt;br /&gt;
*  Line 2 is used to control the Lennard-Jones potential. The value of 3.0 indicates the distance in reduced units upon which the potential is calculated. The potential is distance dependent and falls to 0 at large values of r thus only atoms within a distance of 3.0 are considered.  &#039;lj/cut&#039; defines the cut off point. &lt;br /&gt;
* The last line defines the force field constants as 1.0 for all sets of atoms. The * controls the fact that the command is set for all atoms. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet is the integration algorithm that can be used when &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; are defined. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The codes is in place to ensure that the timestep can be varied but the total time taken for the simulation to run will not change.&lt;br /&gt;
&lt;br /&gt;
=== Checking equilibration === &lt;br /&gt;
&lt;br /&gt;
The graphs below illustrate the time it takes for different thermodynamic properties to equilibriate at a timestep of 0.001. The plateau represents the point at which equilibration is achieved. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EnergyVRStime.png|x300px|thumb|Energy Vrs Time|left]]&lt;br /&gt;
! [[File:TEMPvrsTIME.png|x300px|thumb|Temp vrs Time|centre]]&lt;br /&gt;
! [[File:Press Vrs Time.png|x300px|thumb|Pressure Vrs Time|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The graph below illustrates the effect changing the timestep has on equilibration. As can be seen from the graph a from below 0.01 a shorter timestep results in a lower energy value for equilibration until 0.0025 where the value   of equilibration does not change with lower timestep. This trend is due to the fact that a smaller timestep results in a more accurate result however if it is too small this can over-complicate the calculation (especially when there is a large over-all time). Thus a timestep of 0.0025 is ideal. A timestep of 0.025 is too large and results in the system not reaching equilibrium.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EnergyVtimeFORVTS.png|x400px|thumb|Energy Vrs Time with different timesteps|centre]]&lt;br /&gt;
&lt;br /&gt;
= Running Simulations Under Specific Conditions =&lt;br /&gt;
&lt;br /&gt;
The following two equations can be used to define the energy of the system: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The instantaneous tempertaure &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will not remain constant throughout the simulation and will fluctuate, it will thus be different to out target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The value of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2} = \frac{\mathfrak{T}}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within the preceding code: &lt;br /&gt;
&lt;br /&gt;
100 - Nevery: This command results in a sample being taken every 100 steps and being incorporated into the average. 1000 - Nrepreat: Tells the computer how many samples should be used to calculate the average. Nfreq 10 000: At every 10000th timestep an average is calculated. &lt;br /&gt;
&lt;br /&gt;
All thermodynamic properties are calculated by averages that is the necessity for those commands.&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equation of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:DENSITYvrsT.png|x400px|thumb|Density Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
= Calculating Heat Capacities Using Statistic Physics =&lt;br /&gt;
&lt;br /&gt;
Example of input code used: &lt;br /&gt;
&lt;br /&gt;
* Density 0.2&lt;br /&gt;
* Temperature 2.0 &lt;br /&gt;
&lt;br /&gt;
 variable density equal 0.2&lt;br /&gt;
 DEFINE SIMULATION BOX GEOMETRY &amp;lt;br&amp;gt; &lt;br /&gt;
lattice sc ${density} &amp;lt;br&amp;gt; &lt;br /&gt;
region box block 0 15 0 15 0 15 &amp;lt;br&amp;gt; &lt;br /&gt;
create_box 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
create_atoms 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
DEFINE PHYSICAL PROPERTIES OF ATOMS &amp;lt;br&amp;gt; &lt;br /&gt;
mass 1 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_style lj/cut/opt 3.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_coeff 1 1 1.0 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
neighbor 2.0 bin &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY THE REQUIRED THERMODYNAMIC STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable T equal 2.0 &amp;lt;br&amp;gt; &lt;br /&gt;
variable p equal 2.5 &amp;lt;br&amp;gt; &lt;br /&gt;
variable timestep equal 0.0025 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ASSIGN ATOMIC VELOCITIES &amp;lt;br&amp;gt; &lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
SPECIFY ENSEMBLE &amp;lt;br&amp;gt; &lt;br /&gt;
timestep ${timestep} &amp;lt;br&amp;gt; &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 THERMODYNAMIC OUTPUT CONTROL &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom time etotal temp press &amp;lt;br&amp;gt; &lt;br /&gt;
thermo 10 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RECORD TRAJECTORY &amp;lt;br&amp;gt; &lt;br /&gt;
dump traj all custom 1000 output-1 id x y z &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY TIMESTEP &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RUN SIMULATION TO MELT CRYSTAL &amp;lt;br&amp;gt; &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nve &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 BRING SYSTEM TO REQUIRED STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable tdamp equal ${timestep}*100 &amp;lt;br&amp;gt; &lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &amp;lt;br&amp;gt;  &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nvt &amp;lt;br&amp;gt;  &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 MEASURE SYSTEM STATE  &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom step atoms etotal temp press density &amp;lt;br&amp;gt; &lt;br /&gt;
variable atoms2 equal atoms*atoms &amp;lt;br&amp;gt;   &lt;br /&gt;
variable E equal etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable E2 equal etotal*etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens equal density &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens2 equal density*density &amp;lt;br&amp;gt;  &lt;br /&gt;
variable temp equal temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable temp2 equal temp*temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable press equal press &amp;lt;br&amp;gt; &lt;br /&gt;
variable press2 equal press*press &amp;lt;br&amp;gt; &lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_E2 v_E&lt;br /&gt;
run 100000 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
variable HC equal ${atoms2}*(f_aves[7] - f_aves[8]*f_aves[8])/f_aves[5] &amp;lt;br&amp;gt;  &lt;br /&gt;
variable avedens equal f_aves[1] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avetemp equal f_aves[2] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avepress equal f_aves[3] &amp;lt;br&amp;gt; &lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3]) &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;--------&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Temperature: ${temp}&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Heat capacity: ${HC}&amp;quot;  &amp;lt;br&amp;gt;  &lt;br /&gt;
print &amp;quot;atoms&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Structural Properties and the Radial Distribution function =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:G(r).png|x300px|thumb|RDF at different phases|left]]&lt;br /&gt;
! [[File:Integral.png|x300px|thumb|Integral of g(r)|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To carry out the RDF calculations temperature was kept constant at 1.2 but density was varied. &lt;br /&gt;
&lt;br /&gt;
Density in reduced units used for each phase: &lt;br /&gt;
&lt;br /&gt;
* Gas = 0.05&lt;br /&gt;
* Liquid = 0.8 &lt;br /&gt;
* Solid = 1.2&lt;br /&gt;
&lt;br /&gt;
The number of peaks for each RDF plot decreases in the order gas&amp;lt;liquid&amp;lt;solid. This reflects the ordering of each phase. &lt;br /&gt;
A gas has a large degree of disorder and thus produces only peak.&lt;br /&gt;
The liquid has three peaks which gradually decrease in amplitude, this behavior is due to the fact that the liquid is modeled as central molecule surrounded by shells of other molecules, this initially creates some degree of order. As the simulation continues the molecules become more diffuse so the ordering decreases and thus the amplitude of peaks decrease.&lt;br /&gt;
&lt;br /&gt;
= Dynamical Properties and the diffusion coefficient = &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid.png|thumb|solid|x300px|left]]&lt;br /&gt;
! [[File:Liquid.png|thumb|liquid|x300px|centre]]&lt;br /&gt;
! [[File:Gas.png|thumb|gas|x300px|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion constant D was found by calculating the gradient of the line for each phase. The gradient after the line had leveled off was used for the solid.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 0.0304&lt;br /&gt;
| 0.0305&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| 0.001&lt;br /&gt;
| 0.0012 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| &amp;lt;math&amp;gt; 6 x 10^{-8} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 7 x 10^{-9} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Find gradient of each line in order to get diffustion coeffecient &#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:VACFvrsTS.png|x400px|thumb|VACF vrs Temperature|centre]]&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function for a 1D harmonic oscillator can be evaluated using the equation for a 1D harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiation of the displacement function will produce a velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx}{dt} = -A\omega\sin\left(\omega t + \phi\right) = v(t) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substitution into velocity autocorrelation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling -A\omega: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right)\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trigometric relation can simplify equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin\left(\omega t + \omega\tau + \phi\right) = cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integration of ansymmetical function results in 0:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} sin(x)cos(x)\mathrm{d}t = 0 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Thus after &amp;lt;math&amp;gt;cos(t\omega) &amp;lt;/math&amp;gt;is removed from top line the equation simplifies to: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(t\omega) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Vapourphse.png|thumb|Vapour Phase|x300px|left]]&lt;br /&gt;
! [[File:Vapour phase 1 million.png|thumb|Vapour Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid(small).png|thumb|Solid Phase|x300px|left]]&lt;br /&gt;
! [[File:Solid1million.png|thumb|Solid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Liquidsmallno..png|thumb|Liquid Phase|x300px|left]]&lt;br /&gt;
! [[File:Liquid1millionatoms.png|thumb|Liquid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 1.64&lt;br /&gt;
| 1.63&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| -0.2215&lt;br /&gt;
| 0.157 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| 0.254&lt;br /&gt;
| -0.123&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Mark Klarpus, Gregory A. Petsko, (1990) &#039;&#039;Molecular Reaction Dynamics in Biology&#039;&#039;, &#039;&#039;&#039;347&#039;&#039;&#039;, 631-9, doi:10.1038/347631a0&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578729</id>
		<title>Rep:Thermomp4114</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578729"/>
		<updated>2017-01-27T08:25:01Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: /* Dynamical Properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Molecular Dynamics Simulations of Simple Liquids Introduction == &lt;br /&gt;
&lt;br /&gt;
Molecular dynamic simulations involved studying the motion of a system of particles. Several fundamental elements of a system need to be known in order to achieve this. This includes a knowledge of the interaction potential for the particles and the equations of motion which govern the dynamics of the particles.&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt; Once we know the positions, velocities, and forces, of the atoms (which are obtained using statistical) we can calculate various thermodynamic quantities of the system such as temperature and pressure. We must introduce a series of approximations in order for the caluculations to be feasible. Firstly we apply the &#039;&#039;&#039;The Classical Particle Approximation&#039;&#039;&#039;. The schoedinger equation is too complex to solve for a large system of atoms, however if the atoms are treated classically then the positions and and velocities of each can atom can be calculated using Newton&#039;s second law (equation 1): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = m_i \mathbf{a}_i = m_i \frac{\mathrm{d}\mathbf{v}_i}{\mathrm{d}t} = m_i \frac{\mathrm{d}^2 \mathbf{x}_i}{\mathrm{d}t^2} \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As there are N atoms and therefore N equations representing each atom a computer is a necessity. The &#039;&#039;&#039;Verlet algorithim&#039;&#039;&#039; is used to solve to Newton&#039;s law for all the atoms in the system. In this case time is not continuous but is made discrete, the simulation is thus broeken up into specific &#039;&#039;&#039;timesteps&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The position of atom &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;\mathbf{x}_i \left(t\right)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Positional Verlet algorithim (equation (2)): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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 \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Velocity Verlet algorithim (equation (3)):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{v}_i \left(t\right)&amp;lt;/math&amp;gt; represents the velocity of that atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;center&amp;gt;&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 \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Put in example of industrial applications&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Harmonic Oscillator ===&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator illustrates the the accuracy and discrepancies associated with using the velocity Verlet algorithim. Equation (4) is used to model the behavior of the harmonic oscillator in an analytical sense: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)\ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; = 1.00 &lt;br /&gt;
&lt;br /&gt;
Graph (1) illustrates the results the analytical solution gave for the relationship between position and time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Avrsxt2.png|x300px|thumb|Graph 1: Analytical solution of harmonic oscillator|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The difference in position between the velocity-verlet solution and analytical solution is represented by an error. Error plotted against time is illustrated by graph (2). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ErrorvrsT.png|x300px|thumb|Graph 2: Error vrs Time|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The orange line illustrates the positive trend between error and time. &#039;&#039;&#039;Insert Answer from demonstrator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy of the system will consist of the sum of kinetic and potential energy. Equation (5) can be used to find kinetic energy of the system:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;E_\text{k} =\tfrac{1}{2} mv(t)^2 \ \ (5)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\mathbf{x} \left(t\right)&amp;lt;/math&amp;gt; is used in equation (5) the potential energy can be found. &lt;br /&gt;
&lt;br /&gt;
The following graphs represent the difference in change in energy with time when the timestep is varied. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EvrsTime.png|x200px|thumb|Energy change when a timestep of 0.1 is used|left]]&lt;br /&gt;
! [[File:Energy vrs time for 0.15 timestep.png|x200px|thumb|Energy change when a timestep of 0.15 is used|centre]]&lt;br /&gt;
! [[File:Energy vrs time for 0.2 timestep.png|x200px|thumb|Energy change when a timestep of 0.2 is used|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The maximum change in energy for each of the different timesteps is shown in table (1). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | Timestep&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.1&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.15&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.2&lt;br /&gt;
|-&lt;br /&gt;
| Max. change in Energy&lt;br /&gt;
| 0.2%&lt;br /&gt;
| 0.6%&lt;br /&gt;
| 1%&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results clearly indicate that a timestep greater than &#039;&#039;&#039;0.2&#039;&#039;&#039; will result in an energy change greater than 1%. As the timestep increases as does the maximum error. The timestep defines the number of calculations made in a given time, therefore the shorter the timestep the larger the number of calculations carried out and therefore a more accurate result is produced. The total energy of a real physical system should not change, when modeled numerically there can be fluctuations therefore it is important to monitor this change and ensure that the fluctuations are minimised.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces ===&lt;br /&gt;
&lt;br /&gt;
The forces an atom experiences is determined by the positions of all the atoms in the system, &amp;lt;math&amp;gt;\mathbf{r}^N&amp;lt;/math&amp;gt;. The Lennard-Jones function accurately sums all the key inter-atomic forces an atoms experiences (U). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ (10)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
For a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After division by 4 and rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_0^{6}} = \frac{\sigma^{6}}{r_0^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After further rearrangement and cancelling down: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;-\sigma &amp;lt;/math&amp;gt; is also a solution however this can be disregarded. &lt;br /&gt;
&lt;br /&gt;
In order to calculate the force the following equation is used: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\sigma\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After differentiation and simplification: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}(r_0) =  \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &#039;&#039;&#039; ask demonstrator if thats too brief &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
At equilibrium: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{12\sigma^{12}}{r_e^{13}} - \frac{6\sigma^6}{r_e^7} \right)&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
After rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_e = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This value of &amp;lt;math&amp;gt; r_e &amp;lt;/math&amp;gt; can now be used to find the well depth:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{\sigma^{12}}{4sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon\left(\frac{1}{5r^{5}} - \frac{1}{11r^11} \right)^\infty_2 \simeq -2.48 \sdot 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -8.18 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -3.29 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Finish off atomic forces - enter integrals&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
* No. of moles in  1 mL of water = 0.056 &amp;lt;br&amp;gt; &lt;br /&gt;
* No. of molecules = moles x Avogadro&#039;s constant = 3.37 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*1000 molecules = 1.66 x 10&amp;lt;sup&amp;gt;21&amp;lt;/sup&amp;gt; moles&lt;br /&gt;
* Density = mass/vol. = 1 &lt;br /&gt;
*vol. = mass/density = 2.99 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Due to periodic boundary condition once the atom leaves the current box it will enter the beginning of an identical box. The atom is at &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; and thus once it breaches 0.5 in a particular direction it will be at the start of the next box. Using these principles after the atom moves &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will be at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units === &lt;br /&gt;
&lt;br /&gt;
Reduced units are applied to the Lennard-Jones equation to make the calculation more managable.&lt;br /&gt;
&lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For argon:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Distance in real units: r = 1.09 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Well depth = &amp;lt;math&amp;gt;{\epsilon}&amp;lt;/math&amp;gt; = 0.996 KJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* T = 180 K &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Do I need to show working out?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Equilibriation = &lt;br /&gt;
&lt;br /&gt;
=== Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
As there is a large number of atoms in a discrete volume allowing random assignment of positions could result in atoms overlapping. This would cause an unrealistically high potential as potential is distance dependant (as observed in the Lennard - Jones equation).&lt;br /&gt;
&lt;br /&gt;
* Density is given by the following equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{n}{v} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 1 (as there is only 1 atom per unit cell) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = 1.07722^3 = 1.25 &amp;lt;/math&amp;gt; (lattice spacing = 1.07722) &lt;br /&gt;
&lt;br /&gt;
Thus: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length of a side of one fcc unit cell with number density 1.2 would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = \frac{n}{\rho} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 4 (as there is 4 atoms per unit cell in an fcc lattice) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; = 3.33&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; l = v^{-3} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The number of atoms that would be created by the create_atoms command for an fcc lattice would be: &lt;br /&gt;
&lt;br /&gt;
4 x 1000 = 4000 &lt;br /&gt;
&lt;br /&gt;
This is due to fact that there is 1 atom per unit cell that yeilds 1000 altogether in simple cubic. Fcc has 4 times the number of atoms per unit cell. &lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of Atoms === &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command above has the following purpose: &lt;br /&gt;
&lt;br /&gt;
* The first line sets the mass of all atoms of type &#039;1&#039; to 1.0. &lt;br /&gt;
*  Line 2 is used to control the Lennard-Jones potential. The value of 3.0 indicates the distance in reduced units upon which the potential is calculated. The potential is distance dependent and falls to 0 at large values of r thus only atoms within a distance of 3.0 are considered.  &#039;lj/cut&#039; defines the cut off point. &lt;br /&gt;
* The last line defines the force field constants as 1.0 for all sets of atoms. The * controls the fact that the command is set for all atoms. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet is the integration algorithm that can be used when &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; are defined. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The codes is in place to ensure that the timestep can be varied but the total time taken for the simulation to run will not change.&lt;br /&gt;
&lt;br /&gt;
=== Checking equilibration === &lt;br /&gt;
&lt;br /&gt;
The graphs below illustrate the time it takes for different thermodynamic properties to equilibriate at a timestep of 0.001. The plateau represents the point at which equilibration is achieved. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EnergyVRStime.png|x300px|thumb|Energy Vrs Time|left]]&lt;br /&gt;
! [[File:TEMPvrsTIME.png|x300px|thumb|Temp vrs Time|centre]]&lt;br /&gt;
! [[File:Press Vrs Time.png|x300px|thumb|Pressure Vrs Time|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The graph below illustrates the effect changing the timestep has on equilibration. As can be seen from the graph a from below 0.01 a shorter timestep results in a lower energy value for equilibration until 0.0025 where the value   of equilibration does not change with lower timestep. This trend is due to the fact that a smaller timestep results in a more accurate result however if it is too small this can over-complicate the calculation (especially when there is a large over-all time). Thus a timestep of 0.0025 is ideal. A timestep of 0.025 is too large and results in the system not reaching equilibrium.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EnergyVtimeFORVTS.png|x400px|thumb|Energy Vrs Time with different timesteps|centre]]&lt;br /&gt;
&lt;br /&gt;
= Running Simulations Under Specific Conditions =&lt;br /&gt;
&lt;br /&gt;
The following two equations can be used to define the energy of the system: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The instantaneous tempertaure &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will not remain constant throughout the simulation and will fluctuate, it will thus be different to out target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The value of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2} = \frac{\mathfrak{T}}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within the preceding code: &lt;br /&gt;
&lt;br /&gt;
100 - Nevery: This command results in a sample being taken every 100 steps and being incorporated into the average. 1000 - Nrepreat: Tells the computer how many samples should be used to calculate the average. Nfreq 10 000: At every 10000th timestep an average is calculated. &lt;br /&gt;
&lt;br /&gt;
All thermodynamic properties are calculated by averages that is the necessity for those commands.&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equation of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:DENSITYvrsT.png|x400px|thumb|Density Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
= Calculating Heat Capacities Using Statistic Physics =&lt;br /&gt;
&lt;br /&gt;
Example of input code used: &lt;br /&gt;
&lt;br /&gt;
* Density 0.2&lt;br /&gt;
* Temperature 2.0 &lt;br /&gt;
&lt;br /&gt;
 variable density equal 0.2&lt;br /&gt;
 DEFINE SIMULATION BOX GEOMETRY &amp;lt;br&amp;gt; &lt;br /&gt;
lattice sc ${density} &amp;lt;br&amp;gt; &lt;br /&gt;
region box block 0 15 0 15 0 15 &amp;lt;br&amp;gt; &lt;br /&gt;
create_box 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
create_atoms 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
DEFINE PHYSICAL PROPERTIES OF ATOMS &amp;lt;br&amp;gt; &lt;br /&gt;
mass 1 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_style lj/cut/opt 3.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_coeff 1 1 1.0 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
neighbor 2.0 bin &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY THE REQUIRED THERMODYNAMIC STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable T equal 2.0 &amp;lt;br&amp;gt; &lt;br /&gt;
variable p equal 2.5 &amp;lt;br&amp;gt; &lt;br /&gt;
variable timestep equal 0.0025 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ASSIGN ATOMIC VELOCITIES &amp;lt;br&amp;gt; &lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
SPECIFY ENSEMBLE &amp;lt;br&amp;gt; &lt;br /&gt;
timestep ${timestep} &amp;lt;br&amp;gt; &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 THERMODYNAMIC OUTPUT CONTROL &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom time etotal temp press &amp;lt;br&amp;gt; &lt;br /&gt;
thermo 10 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RECORD TRAJECTORY &amp;lt;br&amp;gt; &lt;br /&gt;
dump traj all custom 1000 output-1 id x y z &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY TIMESTEP &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RUN SIMULATION TO MELT CRYSTAL &amp;lt;br&amp;gt; &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nve &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 BRING SYSTEM TO REQUIRED STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable tdamp equal ${timestep}*100 &amp;lt;br&amp;gt; &lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &amp;lt;br&amp;gt;  &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nvt &amp;lt;br&amp;gt;  &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 MEASURE SYSTEM STATE  &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom step atoms etotal temp press density &amp;lt;br&amp;gt; &lt;br /&gt;
variable atoms2 equal atoms*atoms &amp;lt;br&amp;gt;   &lt;br /&gt;
variable E equal etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable E2 equal etotal*etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens equal density &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens2 equal density*density &amp;lt;br&amp;gt;  &lt;br /&gt;
variable temp equal temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable temp2 equal temp*temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable press equal press &amp;lt;br&amp;gt; &lt;br /&gt;
variable press2 equal press*press &amp;lt;br&amp;gt; &lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_E2 v_E&lt;br /&gt;
run 100000 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
variable HC equal ${atoms2}*(f_aves[7] - f_aves[8]*f_aves[8])/f_aves[5] &amp;lt;br&amp;gt;  &lt;br /&gt;
variable avedens equal f_aves[1] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avetemp equal f_aves[2] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avepress equal f_aves[3] &amp;lt;br&amp;gt; &lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3]) &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;--------&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Temperature: ${temp}&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Heat capacity: ${HC}&amp;quot;  &amp;lt;br&amp;gt;  &lt;br /&gt;
print &amp;quot;atoms&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Structural Properties and the Radial Distribution function =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:G(r).png|x300px|thumb|RDF at different phases|left]]&lt;br /&gt;
! [[File:Integral.png|x300px|thumb|Integral of g(r)|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To carry out the RDF calculations temperature was kept constant at 1.2 but density was varied. &lt;br /&gt;
&lt;br /&gt;
Density in reduced units used for each phase: &lt;br /&gt;
&lt;br /&gt;
* Gas = 0.05&lt;br /&gt;
* Liquid = 0.8 &lt;br /&gt;
* Solid = 1.2&lt;br /&gt;
&lt;br /&gt;
The number of peaks for each RDF plot decreases in the order gas&amp;lt;liquid&amp;lt;solid. This reflects the ordering of each phase. &lt;br /&gt;
A gas has a large degree of disorder and thus produces only peak.&lt;br /&gt;
The liquid has three peaks which gradually decrease in amplitude, this behavior is due to the fact that the liquid is modeled as central molecule surrounded by shells of other molecules, this initially creates some degree of order. As the simulation continues the molecules become more diffuse so the ordering decreases and thus the amplitude of peaks decrease.&lt;br /&gt;
&lt;br /&gt;
= Dynamical Properties and the diffusion coefficient = &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid.png|thumb|solid|x300px|left]]&lt;br /&gt;
! [[File:Liquid.png|thumb|liquid|x300px|centre]]&lt;br /&gt;
! [[File:Gas.png|thumb|gas|x300px|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion constant D was found by calculating the gradient of the line for each phase. The gradient after the line had leveled off was used for the solid.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 1.64&lt;br /&gt;
| 1.63&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| -0.2215&lt;br /&gt;
| 0.157 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| 0.254&lt;br /&gt;
| -0.123&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Find gradient of each line in order to get diffustion coeffecient &#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:VACFvrsTS.png|x400px|thumb|VACF vrs Temperature|centre]]&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function for a 1D harmonic oscillator can be evaluated using the equation for a 1D harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiation of the displacement function will produce a velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx}{dt} = -A\omega\sin\left(\omega t + \phi\right) = v(t) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substitution into velocity autocorrelation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling -A\omega: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right)\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trigometric relation can simplify equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin\left(\omega t + \omega\tau + \phi\right) = cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integration of ansymmetical function results in 0:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} sin(x)cos(x)\mathrm{d}t = 0 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Thus after &amp;lt;math&amp;gt;cos(t\omega) &amp;lt;/math&amp;gt;is removed from top line the equation simplifies to: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(t\omega) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Vapourphse.png|thumb|Vapour Phase|x300px|left]]&lt;br /&gt;
! [[File:Vapour phase 1 million.png|thumb|Vapour Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid(small).png|thumb|Solid Phase|x300px|left]]&lt;br /&gt;
! [[File:Solid1million.png|thumb|Solid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Liquidsmallno..png|thumb|Liquid Phase|x300px|left]]&lt;br /&gt;
! [[File:Liquid1millionatoms.png|thumb|Liquid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 1.64&lt;br /&gt;
| 1.63&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| -0.2215&lt;br /&gt;
| 0.157 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| 0.254&lt;br /&gt;
| -0.123&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Mark Klarpus, Gregory A. Petsko, (1990) &#039;&#039;Molecular Reaction Dynamics in Biology&#039;&#039;, &#039;&#039;&#039;347&#039;&#039;&#039;, 631-9, doi:10.1038/347631a0&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578482</id>
		<title>Rep:Thermomp4114</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578482"/>
		<updated>2017-01-26T22:14:30Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: /* Dynamical Properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Molecular Dynamics Simulations of Simple Liquids Introduction == &lt;br /&gt;
&lt;br /&gt;
Molecular dynamic simulations involved studying the motion of a system of particles. Several fundamental elements of a system need to be known in order to achieve this. This includes a knowledge of the interaction potential for the particles and the equations of motion which govern the dynamics of the particles.&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt; Once we know the positions, velocities, and forces, of the atoms (which are obtained using statistical) we can calculate various thermodynamic quantities of the system such as temperature and pressure. We must introduce a series of approximations in order for the caluculations to be feasible. Firstly we apply the &#039;&#039;&#039;The Classical Particle Approximation&#039;&#039;&#039;. The schoedinger equation is too complex to solve for a large system of atoms, however if the atoms are treated classically then the positions and and velocities of each can atom can be calculated using Newton&#039;s second law (equation 1): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = m_i \mathbf{a}_i = m_i \frac{\mathrm{d}\mathbf{v}_i}{\mathrm{d}t} = m_i \frac{\mathrm{d}^2 \mathbf{x}_i}{\mathrm{d}t^2} \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As there are N atoms and therefore N equations representing each atom a computer is a necessity. The &#039;&#039;&#039;Verlet algorithim&#039;&#039;&#039; is used to solve to Newton&#039;s law for all the atoms in the system. In this case time is not continuous but is made discrete, the simulation is thus broeken up into specific &#039;&#039;&#039;timesteps&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The position of atom &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;\mathbf{x}_i \left(t\right)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Positional Verlet algorithim (equation (2)): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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 \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Velocity Verlet algorithim (equation (3)):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{v}_i \left(t\right)&amp;lt;/math&amp;gt; represents the velocity of that atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;center&amp;gt;&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 \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Put in example of industrial applications&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Harmonic Oscillator ===&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator illustrates the the accuracy and discrepancies associated with using the velocity Verlet algorithim. Equation (4) is used to model the behavior of the harmonic oscillator in an analytical sense: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)\ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; = 1.00 &lt;br /&gt;
&lt;br /&gt;
Graph (1) illustrates the results the analytical solution gave for the relationship between position and time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Avrsxt2.png|x300px|thumb|Graph 1: Analytical solution of harmonic oscillator|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The difference in position between the velocity-verlet solution and analytical solution is represented by an error. Error plotted against time is illustrated by graph (2). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ErrorvrsT.png|x300px|thumb|Graph 2: Error vrs Time|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The orange line illustrates the positive trend between error and time. &#039;&#039;&#039;Insert Answer from demonstrator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy of the system will consist of the sum of kinetic and potential energy. Equation (5) can be used to find kinetic energy of the system:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;E_\text{k} =\tfrac{1}{2} mv(t)^2 \ \ (5)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\mathbf{x} \left(t\right)&amp;lt;/math&amp;gt; is used in equation (5) the potential energy can be found. &lt;br /&gt;
&lt;br /&gt;
The following graphs represent the difference in change in energy with time when the timestep is varied. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EvrsTime.png|x200px|thumb|Energy change when a timestep of 0.1 is used|left]]&lt;br /&gt;
! [[File:Energy vrs time for 0.15 timestep.png|x200px|thumb|Energy change when a timestep of 0.15 is used|centre]]&lt;br /&gt;
! [[File:Energy vrs time for 0.2 timestep.png|x200px|thumb|Energy change when a timestep of 0.2 is used|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The maximum change in energy for each of the different timesteps is shown in table (1). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | Timestep&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.1&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.15&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.2&lt;br /&gt;
|-&lt;br /&gt;
| Max. change in Energy&lt;br /&gt;
| 0.2%&lt;br /&gt;
| 0.6%&lt;br /&gt;
| 1%&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results clearly indicate that a timestep greater than &#039;&#039;&#039;0.2&#039;&#039;&#039; will result in an energy change greater than 1%. As the timestep increases as does the maximum error. The timestep defines the number of calculations made in a given time, therefore the shorter the timestep the larger the number of calculations carried out and therefore a more accurate result is produced. The total energy of a real physical system should not change, when modeled numerically there can be fluctuations therefore it is important to monitor this change and ensure that the fluctuations are minimised.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces ===&lt;br /&gt;
&lt;br /&gt;
The forces an atom experiences is determined by the positions of all the atoms in the system, &amp;lt;math&amp;gt;\mathbf{r}^N&amp;lt;/math&amp;gt;. The Lennard-Jones function accurately sums all the key inter-atomic forces an atoms experiences (U). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ (10)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
For a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After division by 4 and rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_0^{6}} = \frac{\sigma^{6}}{r_0^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After further rearrangement and cancelling down: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;-\sigma &amp;lt;/math&amp;gt; is also a solution however this can be disregarded. &lt;br /&gt;
&lt;br /&gt;
In order to calculate the force the following equation is used: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\sigma\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After differentiation and simplification: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}(r_0) =  \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &#039;&#039;&#039; ask demonstrator if thats too brief &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
At equilibrium: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{12\sigma^{12}}{r_e^{13}} - \frac{6\sigma^6}{r_e^7} \right)&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
After rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_e = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This value of &amp;lt;math&amp;gt; r_e &amp;lt;/math&amp;gt; can now be used to find the well depth:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{\sigma^{12}}{4sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon\left(\frac{1}{5r^{5}} - \frac{1}{11r^11} \right)^\infty_2 \simeq -2.48 \sdot 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -8.18 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -3.29 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Finish off atomic forces - enter integrals&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
* No. of moles in  1 mL of water = 0.056 &amp;lt;br&amp;gt; &lt;br /&gt;
* No. of molecules = moles x Avogadro&#039;s constant = 3.37 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*1000 molecules = 1.66 x 10&amp;lt;sup&amp;gt;21&amp;lt;/sup&amp;gt; moles&lt;br /&gt;
* Density = mass/vol. = 1 &lt;br /&gt;
*vol. = mass/density = 2.99 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Due to periodic boundary condition once the atom leaves the current box it will enter the beginning of an identical box. The atom is at &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; and thus once it breaches 0.5 in a particular direction it will be at the start of the next box. Using these principles after the atom moves &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will be at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units === &lt;br /&gt;
&lt;br /&gt;
Reduced units are applied to the Lennard-Jones equation to make the calculation more managable.&lt;br /&gt;
&lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For argon:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Distance in real units: r = 1.09 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Well depth = &amp;lt;math&amp;gt;{\epsilon}&amp;lt;/math&amp;gt; = 0.996 KJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* T = 180 K &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Do I need to show working out?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Equilibriation = &lt;br /&gt;
&lt;br /&gt;
=== Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
As there is a large number of atoms in a discrete volume allowing random assignment of positions could result in atoms overlapping. This would cause an unrealistically high potential as potential is distance dependant (as observed in the Lennard - Jones equation).&lt;br /&gt;
&lt;br /&gt;
* Density is given by the following equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{n}{v} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 1 (as there is only 1 atom per unit cell) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = 1.07722^3 = 1.25 &amp;lt;/math&amp;gt; (lattice spacing = 1.07722) &lt;br /&gt;
&lt;br /&gt;
Thus: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length of a side of one fcc unit cell with number density 1.2 would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = \frac{n}{\rho} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 4 (as there is 4 atoms per unit cell in an fcc lattice) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; = 3.33&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; l = v^{-3} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The number of atoms that would be created by the create_atoms command for an fcc lattice would be: &lt;br /&gt;
&lt;br /&gt;
4 x 1000 = 4000 &lt;br /&gt;
&lt;br /&gt;
This is due to fact that there is 1 atom per unit cell that yeilds 1000 altogether in simple cubic. Fcc has 4 times the number of atoms per unit cell. &lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of Atoms === &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command above has the following purpose: &lt;br /&gt;
&lt;br /&gt;
* The first line sets the mass of all atoms of type &#039;1&#039; to 1.0. &lt;br /&gt;
*  Line 2 is used to control the Lennard-Jones potential. The value of 3.0 indicates the distance in reduced units upon which the potential is calculated. The potential is distance dependent and falls to 0 at large values of r thus only atoms within a distance of 3.0 are considered.  &#039;lj/cut&#039; defines the cut off point. &lt;br /&gt;
* The last line defines the force field constants as 1.0 for all sets of atoms. The * controls the fact that the command is set for all atoms. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet is the integration algorithm that can be used when &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; are defined. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The codes is in place to ensure that the timestep can be varied but the total time taken for the simulation to run will not change.&lt;br /&gt;
&lt;br /&gt;
=== Checking equilibration === &lt;br /&gt;
&lt;br /&gt;
The graphs below illustrate the time it takes for different thermodynamic properties to equilibriate at a timestep of 0.001. The plateau represents the point at which equilibration is achieved. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EnergyVRStime.png|x300px|thumb|Energy Vrs Time|left]]&lt;br /&gt;
! [[File:TEMPvrsTIME.png|x300px|thumb|Temp vrs Time|centre]]&lt;br /&gt;
! [[File:Press Vrs Time.png|x300px|thumb|Pressure Vrs Time|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The graph below illustrates the effect changing the timestep has on equilibration. As can be seen from the graph a from below 0.01 a shorter timestep results in a lower energy value for equilibration until 0.0025 where the value   of equilibration does not change with lower timestep. This trend is due to the fact that a smaller timestep results in a more accurate result however if it is too small this can over-complicate the calculation (especially when there is a large over-all time). Thus a timestep of 0.0025 is ideal. A timestep of 0.025 is too large and results in the system not reaching equilibrium.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EnergyVtimeFORVTS.png|x400px|thumb|Energy Vrs Time with different timesteps|centre]]&lt;br /&gt;
&lt;br /&gt;
= Running Simulations Under Specific Conditions =&lt;br /&gt;
&lt;br /&gt;
The following two equations can be used to define the energy of the system: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The instantaneous tempertaure &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will not remain constant throughout the simulation and will fluctuate, it will thus be different to out target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The value of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2} = \frac{\mathfrak{T}}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within the preceding code: &lt;br /&gt;
&lt;br /&gt;
100 - Nevery: This command results in a sample being taken every 100 steps and being incorporated into the average. 1000 - Nrepreat: Tells the computer how many samples should be used to calculate the average. Nfreq 10 000: At every 10000th timestep an average is calculated. &lt;br /&gt;
&lt;br /&gt;
All thermodynamic properties are calculated by averages that is the necessity for those commands.&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equation of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:DENSITYvrsT.png|x400px|thumb|Density Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
= Calculating Heat Capacities Using Statistic Physics =&lt;br /&gt;
&lt;br /&gt;
Example of input code used: &lt;br /&gt;
&lt;br /&gt;
* Density 0.2&lt;br /&gt;
* Temperature 2.0 &lt;br /&gt;
&lt;br /&gt;
 variable density equal 0.2&lt;br /&gt;
 DEFINE SIMULATION BOX GEOMETRY &amp;lt;br&amp;gt; &lt;br /&gt;
lattice sc ${density} &amp;lt;br&amp;gt; &lt;br /&gt;
region box block 0 15 0 15 0 15 &amp;lt;br&amp;gt; &lt;br /&gt;
create_box 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
create_atoms 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
DEFINE PHYSICAL PROPERTIES OF ATOMS &amp;lt;br&amp;gt; &lt;br /&gt;
mass 1 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_style lj/cut/opt 3.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_coeff 1 1 1.0 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
neighbor 2.0 bin &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY THE REQUIRED THERMODYNAMIC STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable T equal 2.0 &amp;lt;br&amp;gt; &lt;br /&gt;
variable p equal 2.5 &amp;lt;br&amp;gt; &lt;br /&gt;
variable timestep equal 0.0025 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ASSIGN ATOMIC VELOCITIES &amp;lt;br&amp;gt; &lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
SPECIFY ENSEMBLE &amp;lt;br&amp;gt; &lt;br /&gt;
timestep ${timestep} &amp;lt;br&amp;gt; &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 THERMODYNAMIC OUTPUT CONTROL &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom time etotal temp press &amp;lt;br&amp;gt; &lt;br /&gt;
thermo 10 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RECORD TRAJECTORY &amp;lt;br&amp;gt; &lt;br /&gt;
dump traj all custom 1000 output-1 id x y z &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY TIMESTEP &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RUN SIMULATION TO MELT CRYSTAL &amp;lt;br&amp;gt; &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nve &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 BRING SYSTEM TO REQUIRED STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable tdamp equal ${timestep}*100 &amp;lt;br&amp;gt; &lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &amp;lt;br&amp;gt;  &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nvt &amp;lt;br&amp;gt;  &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 MEASURE SYSTEM STATE  &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom step atoms etotal temp press density &amp;lt;br&amp;gt; &lt;br /&gt;
variable atoms2 equal atoms*atoms &amp;lt;br&amp;gt;   &lt;br /&gt;
variable E equal etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable E2 equal etotal*etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens equal density &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens2 equal density*density &amp;lt;br&amp;gt;  &lt;br /&gt;
variable temp equal temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable temp2 equal temp*temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable press equal press &amp;lt;br&amp;gt; &lt;br /&gt;
variable press2 equal press*press &amp;lt;br&amp;gt; &lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_E2 v_E&lt;br /&gt;
run 100000 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
variable HC equal ${atoms2}*(f_aves[7] - f_aves[8]*f_aves[8])/f_aves[5] &amp;lt;br&amp;gt;  &lt;br /&gt;
variable avedens equal f_aves[1] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avetemp equal f_aves[2] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avepress equal f_aves[3] &amp;lt;br&amp;gt; &lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3]) &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;--------&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Temperature: ${temp}&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Heat capacity: ${HC}&amp;quot;  &amp;lt;br&amp;gt;  &lt;br /&gt;
print &amp;quot;atoms&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Structural Properties and the Radial Distribution function =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:G(r).png|x300px|thumb|RDF at different phases|left]]&lt;br /&gt;
! [[File:Integral.png|x300px|thumb|Integral of g(r)|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To carry out the RDF calculations temperature was kept constant at 1.2 but density was varied. &lt;br /&gt;
&lt;br /&gt;
Density in reduced units used for each phase: &lt;br /&gt;
&lt;br /&gt;
* Gas = 0.05&lt;br /&gt;
* Liquid = 0.8 &lt;br /&gt;
* Solid = 1.2&lt;br /&gt;
&lt;br /&gt;
The number of peaks for each RDF plot decreases in the order gas&amp;lt;liquid&amp;lt;solid. This reflects the ordering of each phase. &lt;br /&gt;
A gas has a large degree of disorder and thus produces only peak.&lt;br /&gt;
The liquid has three peaks which gradually decrease in amplitude, this behavior is due to the fact that the liquid is modeled as central molecule surrounded by shells of other molecules, this initially creates some degree of order. As the simulation continues the molecules become more diffuse so the ordering decreases and thus the amplitude of peaks decrease.&lt;br /&gt;
&lt;br /&gt;
= Dynamical Properties and the diffusion coefficient = &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid.png|thumb|solid|x300px|left]]&lt;br /&gt;
! [[File:Liquid.png|thumb|liquid|x300px|centre]]&lt;br /&gt;
! [[File:Gas.png|thumb|gas|x300px|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Find gradient of each line in order to get diffustion coeffecient &#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:VACFvrsTS.png|x400px|thumb|VACF vrs Temperature|centre]]&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function for a 1D harmonic oscillator can be evaluated using the equation for a 1D harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiation of the displacement function will produce a velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx}{dt} = -A\omega\sin\left(\omega t + \phi\right) = v(t) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substitution into velocity autocorrelation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling -A\omega: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right)\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trigometric relation can simplify equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin\left(\omega t + \omega\tau + \phi\right) = cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integration of ansymmetical function results in 0:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} sin(x)cos(x)\mathrm{d}t = 0 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Thus after &amp;lt;math&amp;gt;cos(t\omega) &amp;lt;/math&amp;gt;is removed from top line the equation simplifies to: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(t\omega) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Vapourphse.png|thumb|Vapour Phase|x300px|left]]&lt;br /&gt;
! [[File:Vapour phase 1 million.png|thumb|Vapour Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid(small).png|thumb|Solid Phase|x300px|left]]&lt;br /&gt;
! [[File:Solid1million.png|thumb|Solid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Liquidsmallno..png|thumb|Liquid Phase|x300px|left]]&lt;br /&gt;
! [[File:Liquid1millionatoms.png|thumb|Liquid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 1.64&lt;br /&gt;
| 1.63&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| -0.2215&lt;br /&gt;
| 0.157 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| 0.254&lt;br /&gt;
| -0.123&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Mark Klarpus, Gregory A. Petsko, (1990) &#039;&#039;Molecular Reaction Dynamics in Biology&#039;&#039;, &#039;&#039;&#039;347&#039;&#039;&#039;, 631-9, doi:10.1038/347631a0&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578481</id>
		<title>Rep:Thermomp4114</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578481"/>
		<updated>2017-01-26T22:10:18Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: /* Dynamical Properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Molecular Dynamics Simulations of Simple Liquids Introduction == &lt;br /&gt;
&lt;br /&gt;
Molecular dynamic simulations involved studying the motion of a system of particles. Several fundamental elements of a system need to be known in order to achieve this. This includes a knowledge of the interaction potential for the particles and the equations of motion which govern the dynamics of the particles.&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt; Once we know the positions, velocities, and forces, of the atoms (which are obtained using statistical) we can calculate various thermodynamic quantities of the system such as temperature and pressure. We must introduce a series of approximations in order for the caluculations to be feasible. Firstly we apply the &#039;&#039;&#039;The Classical Particle Approximation&#039;&#039;&#039;. The schoedinger equation is too complex to solve for a large system of atoms, however if the atoms are treated classically then the positions and and velocities of each can atom can be calculated using Newton&#039;s second law (equation 1): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = m_i \mathbf{a}_i = m_i \frac{\mathrm{d}\mathbf{v}_i}{\mathrm{d}t} = m_i \frac{\mathrm{d}^2 \mathbf{x}_i}{\mathrm{d}t^2} \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As there are N atoms and therefore N equations representing each atom a computer is a necessity. The &#039;&#039;&#039;Verlet algorithim&#039;&#039;&#039; is used to solve to Newton&#039;s law for all the atoms in the system. In this case time is not continuous but is made discrete, the simulation is thus broeken up into specific &#039;&#039;&#039;timesteps&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The position of atom &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;\mathbf{x}_i \left(t\right)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Positional Verlet algorithim (equation (2)): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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 \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Velocity Verlet algorithim (equation (3)):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{v}_i \left(t\right)&amp;lt;/math&amp;gt; represents the velocity of that atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;center&amp;gt;&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 \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Put in example of industrial applications&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Harmonic Oscillator ===&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator illustrates the the accuracy and discrepancies associated with using the velocity Verlet algorithim. Equation (4) is used to model the behavior of the harmonic oscillator in an analytical sense: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)\ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; = 1.00 &lt;br /&gt;
&lt;br /&gt;
Graph (1) illustrates the results the analytical solution gave for the relationship between position and time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Avrsxt2.png|x300px|thumb|Graph 1: Analytical solution of harmonic oscillator|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The difference in position between the velocity-verlet solution and analytical solution is represented by an error. Error plotted against time is illustrated by graph (2). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ErrorvrsT.png|x300px|thumb|Graph 2: Error vrs Time|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The orange line illustrates the positive trend between error and time. &#039;&#039;&#039;Insert Answer from demonstrator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy of the system will consist of the sum of kinetic and potential energy. Equation (5) can be used to find kinetic energy of the system:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;E_\text{k} =\tfrac{1}{2} mv(t)^2 \ \ (5)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\mathbf{x} \left(t\right)&amp;lt;/math&amp;gt; is used in equation (5) the potential energy can be found. &lt;br /&gt;
&lt;br /&gt;
The following graphs represent the difference in change in energy with time when the timestep is varied. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EvrsTime.png|x200px|thumb|Energy change when a timestep of 0.1 is used|left]]&lt;br /&gt;
! [[File:Energy vrs time for 0.15 timestep.png|x200px|thumb|Energy change when a timestep of 0.15 is used|centre]]&lt;br /&gt;
! [[File:Energy vrs time for 0.2 timestep.png|x200px|thumb|Energy change when a timestep of 0.2 is used|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The maximum change in energy for each of the different timesteps is shown in table (1). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | Timestep&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.1&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.15&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.2&lt;br /&gt;
|-&lt;br /&gt;
| Max. change in Energy&lt;br /&gt;
| 0.2%&lt;br /&gt;
| 0.6%&lt;br /&gt;
| 1%&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results clearly indicate that a timestep greater than &#039;&#039;&#039;0.2&#039;&#039;&#039; will result in an energy change greater than 1%. As the timestep increases as does the maximum error. The timestep defines the number of calculations made in a given time, therefore the shorter the timestep the larger the number of calculations carried out and therefore a more accurate result is produced. The total energy of a real physical system should not change, when modeled numerically there can be fluctuations therefore it is important to monitor this change and ensure that the fluctuations are minimised.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces ===&lt;br /&gt;
&lt;br /&gt;
The forces an atom experiences is determined by the positions of all the atoms in the system, &amp;lt;math&amp;gt;\mathbf{r}^N&amp;lt;/math&amp;gt;. The Lennard-Jones function accurately sums all the key inter-atomic forces an atoms experiences (U). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ (10)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
For a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After division by 4 and rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_0^{6}} = \frac{\sigma^{6}}{r_0^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After further rearrangement and cancelling down: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;-\sigma &amp;lt;/math&amp;gt; is also a solution however this can be disregarded. &lt;br /&gt;
&lt;br /&gt;
In order to calculate the force the following equation is used: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\sigma\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After differentiation and simplification: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}(r_0) =  \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &#039;&#039;&#039; ask demonstrator if thats too brief &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
At equilibrium: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{12\sigma^{12}}{r_e^{13}} - \frac{6\sigma^6}{r_e^7} \right)&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
After rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_e = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This value of &amp;lt;math&amp;gt; r_e &amp;lt;/math&amp;gt; can now be used to find the well depth:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{\sigma^{12}}{4sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon\left(\frac{1}{5r^{5}} - \frac{1}{11r^11} \right)^\infty_2 \simeq -2.48 \sdot 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -8.18 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -3.29 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Finish off atomic forces - enter integrals&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
* No. of moles in  1 mL of water = 0.056 &amp;lt;br&amp;gt; &lt;br /&gt;
* No. of molecules = moles x Avogadro&#039;s constant = 3.37 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*1000 molecules = 1.66 x 10&amp;lt;sup&amp;gt;21&amp;lt;/sup&amp;gt; moles&lt;br /&gt;
* Density = mass/vol. = 1 &lt;br /&gt;
*vol. = mass/density = 2.99 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Due to periodic boundary condition once the atom leaves the current box it will enter the beginning of an identical box. The atom is at &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; and thus once it breaches 0.5 in a particular direction it will be at the start of the next box. Using these principles after the atom moves &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will be at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units === &lt;br /&gt;
&lt;br /&gt;
Reduced units are applied to the Lennard-Jones equation to make the calculation more managable.&lt;br /&gt;
&lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For argon:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Distance in real units: r = 1.09 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Well depth = &amp;lt;math&amp;gt;{\epsilon}&amp;lt;/math&amp;gt; = 0.996 KJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* T = 180 K &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Do I need to show working out?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Equilibriation = &lt;br /&gt;
&lt;br /&gt;
=== Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
As there is a large number of atoms in a discrete volume allowing random assignment of positions could result in atoms overlapping. This would cause an unrealistically high potential as potential is distance dependant (as observed in the Lennard - Jones equation).&lt;br /&gt;
&lt;br /&gt;
* Density is given by the following equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{n}{v} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 1 (as there is only 1 atom per unit cell) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = 1.07722^3 = 1.25 &amp;lt;/math&amp;gt; (lattice spacing = 1.07722) &lt;br /&gt;
&lt;br /&gt;
Thus: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length of a side of one fcc unit cell with number density 1.2 would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = \frac{n}{\rho} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 4 (as there is 4 atoms per unit cell in an fcc lattice) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; = 3.33&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; l = v^{-3} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The number of atoms that would be created by the create_atoms command for an fcc lattice would be: &lt;br /&gt;
&lt;br /&gt;
4 x 1000 = 4000 &lt;br /&gt;
&lt;br /&gt;
This is due to fact that there is 1 atom per unit cell that yeilds 1000 altogether in simple cubic. Fcc has 4 times the number of atoms per unit cell. &lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of Atoms === &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command above has the following purpose: &lt;br /&gt;
&lt;br /&gt;
* The first line sets the mass of all atoms of type &#039;1&#039; to 1.0. &lt;br /&gt;
*  Line 2 is used to control the Lennard-Jones potential. The value of 3.0 indicates the distance in reduced units upon which the potential is calculated. The potential is distance dependent and falls to 0 at large values of r thus only atoms within a distance of 3.0 are considered.  &#039;lj/cut&#039; defines the cut off point. &lt;br /&gt;
* The last line defines the force field constants as 1.0 for all sets of atoms. The * controls the fact that the command is set for all atoms. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet is the integration algorithm that can be used when &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; are defined. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The codes is in place to ensure that the timestep can be varied but the total time taken for the simulation to run will not change.&lt;br /&gt;
&lt;br /&gt;
=== Checking equilibration === &lt;br /&gt;
&lt;br /&gt;
The graphs below illustrate the time it takes for different thermodynamic properties to equilibriate at a timestep of 0.001. The plateau represents the point at which equilibration is achieved. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EnergyVRStime.png|x300px|thumb|Energy Vrs Time|left]]&lt;br /&gt;
! [[File:TEMPvrsTIME.png|x300px|thumb|Temp vrs Time|centre]]&lt;br /&gt;
! [[File:Press Vrs Time.png|x300px|thumb|Pressure Vrs Time|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The graph below illustrates the effect changing the timestep has on equilibration. As can be seen from the graph a from below 0.01 a shorter timestep results in a lower energy value for equilibration until 0.0025 where the value   of equilibration does not change with lower timestep. This trend is due to the fact that a smaller timestep results in a more accurate result however if it is too small this can over-complicate the calculation (especially when there is a large over-all time). Thus a timestep of 0.0025 is ideal. A timestep of 0.025 is too large and results in the system not reaching equilibrium.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EnergyVtimeFORVTS.png|x400px|thumb|Energy Vrs Time with different timesteps|centre]]&lt;br /&gt;
&lt;br /&gt;
= Running Simulations Under Specific Conditions =&lt;br /&gt;
&lt;br /&gt;
The following two equations can be used to define the energy of the system: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The instantaneous tempertaure &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will not remain constant throughout the simulation and will fluctuate, it will thus be different to out target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The value of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2} = \frac{\mathfrak{T}}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within the preceding code: &lt;br /&gt;
&lt;br /&gt;
100 - Nevery: This command results in a sample being taken every 100 steps and being incorporated into the average. 1000 - Nrepreat: Tells the computer how many samples should be used to calculate the average. Nfreq 10 000: At every 10000th timestep an average is calculated. &lt;br /&gt;
&lt;br /&gt;
All thermodynamic properties are calculated by averages that is the necessity for those commands.&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equation of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:DENSITYvrsT.png|x400px|thumb|Density Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
= Calculating Heat Capacities Using Statistic Physics =&lt;br /&gt;
&lt;br /&gt;
Example of input code used: &lt;br /&gt;
&lt;br /&gt;
* Density 0.2&lt;br /&gt;
* Temperature 2.0 &lt;br /&gt;
&lt;br /&gt;
 variable density equal 0.2&lt;br /&gt;
 DEFINE SIMULATION BOX GEOMETRY &amp;lt;br&amp;gt; &lt;br /&gt;
lattice sc ${density} &amp;lt;br&amp;gt; &lt;br /&gt;
region box block 0 15 0 15 0 15 &amp;lt;br&amp;gt; &lt;br /&gt;
create_box 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
create_atoms 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
DEFINE PHYSICAL PROPERTIES OF ATOMS &amp;lt;br&amp;gt; &lt;br /&gt;
mass 1 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_style lj/cut/opt 3.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_coeff 1 1 1.0 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
neighbor 2.0 bin &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY THE REQUIRED THERMODYNAMIC STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable T equal 2.0 &amp;lt;br&amp;gt; &lt;br /&gt;
variable p equal 2.5 &amp;lt;br&amp;gt; &lt;br /&gt;
variable timestep equal 0.0025 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ASSIGN ATOMIC VELOCITIES &amp;lt;br&amp;gt; &lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
SPECIFY ENSEMBLE &amp;lt;br&amp;gt; &lt;br /&gt;
timestep ${timestep} &amp;lt;br&amp;gt; &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 THERMODYNAMIC OUTPUT CONTROL &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom time etotal temp press &amp;lt;br&amp;gt; &lt;br /&gt;
thermo 10 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RECORD TRAJECTORY &amp;lt;br&amp;gt; &lt;br /&gt;
dump traj all custom 1000 output-1 id x y z &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY TIMESTEP &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RUN SIMULATION TO MELT CRYSTAL &amp;lt;br&amp;gt; &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nve &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 BRING SYSTEM TO REQUIRED STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable tdamp equal ${timestep}*100 &amp;lt;br&amp;gt; &lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &amp;lt;br&amp;gt;  &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nvt &amp;lt;br&amp;gt;  &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 MEASURE SYSTEM STATE  &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom step atoms etotal temp press density &amp;lt;br&amp;gt; &lt;br /&gt;
variable atoms2 equal atoms*atoms &amp;lt;br&amp;gt;   &lt;br /&gt;
variable E equal etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable E2 equal etotal*etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens equal density &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens2 equal density*density &amp;lt;br&amp;gt;  &lt;br /&gt;
variable temp equal temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable temp2 equal temp*temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable press equal press &amp;lt;br&amp;gt; &lt;br /&gt;
variable press2 equal press*press &amp;lt;br&amp;gt; &lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_E2 v_E&lt;br /&gt;
run 100000 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
variable HC equal ${atoms2}*(f_aves[7] - f_aves[8]*f_aves[8])/f_aves[5] &amp;lt;br&amp;gt;  &lt;br /&gt;
variable avedens equal f_aves[1] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avetemp equal f_aves[2] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avepress equal f_aves[3] &amp;lt;br&amp;gt; &lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3]) &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;--------&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Temperature: ${temp}&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Heat capacity: ${HC}&amp;quot;  &amp;lt;br&amp;gt;  &lt;br /&gt;
print &amp;quot;atoms&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Structural Properties and the Radial Distribution function =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:G(r).png|x300px|thumb|RDF at different phases|left]]&lt;br /&gt;
! [[File:Integral.png|x300px|thumb|Integral of g(r)|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To carry out the RDF calculations temperature was kept constant at 1.2 but density was varied. &lt;br /&gt;
&lt;br /&gt;
Density in reduced units used for each phase: &lt;br /&gt;
&lt;br /&gt;
* Gas = 0.05&lt;br /&gt;
* Liquid = 0.8 &lt;br /&gt;
* Solid = 1.2&lt;br /&gt;
&lt;br /&gt;
The number of peaks for each RDF plot decreases in the order gas&amp;lt;liquid&amp;lt;solid. This reflects the ordering of each phase. &lt;br /&gt;
A gas has a large degree of disorder and thus produces only peak.&lt;br /&gt;
The liquid has three peaks which gradually decrease in amplitude, this behavior is due to the fact that the liquid is modeled as central molecule surrounded by shells of other molecules, this initially creates some degree of order. As the simulation continues the molecules become more diffuse so the ordering decreases and thus the amplitude of peaks decrease.&lt;br /&gt;
&lt;br /&gt;
= Dynamical Properties and the diffusion coefficient = &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid.png|thumb|solid|x300px|left]]&lt;br /&gt;
! [[File:Liquid.png|thumb|liquid|x300px|centre]]&lt;br /&gt;
! [[File:Gas.png|thumb|gas|x300px|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:VACFvrsTS.png|x400px|thumb|VACF vrs Temperature|centre]]&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function for a 1D harmonic oscillator can be evaluated using the equation for a 1D harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiation of the displacement function will produce a velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx}{dt} = -A\omega\sin\left(\omega t + \phi\right) = v(t) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substitution into velocity autocorrelation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling -A\omega: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right)\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trigometric relation can simplify equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin\left(\omega t + \omega\tau + \phi\right) = cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integration of ansymmetical function results in 0:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} sin(x)cos(x)\mathrm{d}t = 0 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Thus after &amp;lt;math&amp;gt;cos(t\omega) &amp;lt;/math&amp;gt;is removed from top line the equation simplifies to: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(t\omega) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Vapourphse.png|thumb|Vapour Phase|x300px|left]]&lt;br /&gt;
! [[File:Vapour phase 1 million.png|thumb|Vapour Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid(small).png|thumb|Solid Phase|x300px|left]]&lt;br /&gt;
! [[File:Solid1million.png|thumb|Solid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Liquidsmallno..png|thumb|Liquid Phase|x300px|left]]&lt;br /&gt;
! [[File:Liquid1millionatoms.png|thumb|Liquid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 1.64&lt;br /&gt;
| 1.63&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| -0.2215&lt;br /&gt;
| 0.157 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| 0.254&lt;br /&gt;
| -0.123&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Mark Klarpus, Gregory A. Petsko, (1990) &#039;&#039;Molecular Reaction Dynamics in Biology&#039;&#039;, &#039;&#039;&#039;347&#039;&#039;&#039;, 631-9, doi:10.1038/347631a0&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578479</id>
		<title>Rep:Thermomp4114</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578479"/>
		<updated>2017-01-26T22:09:25Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: /* Dynamical Properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Molecular Dynamics Simulations of Simple Liquids Introduction == &lt;br /&gt;
&lt;br /&gt;
Molecular dynamic simulations involved studying the motion of a system of particles. Several fundamental elements of a system need to be known in order to achieve this. This includes a knowledge of the interaction potential for the particles and the equations of motion which govern the dynamics of the particles.&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt; Once we know the positions, velocities, and forces, of the atoms (which are obtained using statistical) we can calculate various thermodynamic quantities of the system such as temperature and pressure. We must introduce a series of approximations in order for the caluculations to be feasible. Firstly we apply the &#039;&#039;&#039;The Classical Particle Approximation&#039;&#039;&#039;. The schoedinger equation is too complex to solve for a large system of atoms, however if the atoms are treated classically then the positions and and velocities of each can atom can be calculated using Newton&#039;s second law (equation 1): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = m_i \mathbf{a}_i = m_i \frac{\mathrm{d}\mathbf{v}_i}{\mathrm{d}t} = m_i \frac{\mathrm{d}^2 \mathbf{x}_i}{\mathrm{d}t^2} \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As there are N atoms and therefore N equations representing each atom a computer is a necessity. The &#039;&#039;&#039;Verlet algorithim&#039;&#039;&#039; is used to solve to Newton&#039;s law for all the atoms in the system. In this case time is not continuous but is made discrete, the simulation is thus broeken up into specific &#039;&#039;&#039;timesteps&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The position of atom &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;\mathbf{x}_i \left(t\right)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Positional Verlet algorithim (equation (2)): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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 \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Velocity Verlet algorithim (equation (3)):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{v}_i \left(t\right)&amp;lt;/math&amp;gt; represents the velocity of that atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;center&amp;gt;&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 \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Put in example of industrial applications&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Harmonic Oscillator ===&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator illustrates the the accuracy and discrepancies associated with using the velocity Verlet algorithim. Equation (4) is used to model the behavior of the harmonic oscillator in an analytical sense: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)\ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; = 1.00 &lt;br /&gt;
&lt;br /&gt;
Graph (1) illustrates the results the analytical solution gave for the relationship between position and time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Avrsxt2.png|x300px|thumb|Graph 1: Analytical solution of harmonic oscillator|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The difference in position between the velocity-verlet solution and analytical solution is represented by an error. Error plotted against time is illustrated by graph (2). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ErrorvrsT.png|x300px|thumb|Graph 2: Error vrs Time|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The orange line illustrates the positive trend between error and time. &#039;&#039;&#039;Insert Answer from demonstrator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy of the system will consist of the sum of kinetic and potential energy. Equation (5) can be used to find kinetic energy of the system:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;E_\text{k} =\tfrac{1}{2} mv(t)^2 \ \ (5)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\mathbf{x} \left(t\right)&amp;lt;/math&amp;gt; is used in equation (5) the potential energy can be found. &lt;br /&gt;
&lt;br /&gt;
The following graphs represent the difference in change in energy with time when the timestep is varied. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EvrsTime.png|x200px|thumb|Energy change when a timestep of 0.1 is used|left]]&lt;br /&gt;
! [[File:Energy vrs time for 0.15 timestep.png|x200px|thumb|Energy change when a timestep of 0.15 is used|centre]]&lt;br /&gt;
! [[File:Energy vrs time for 0.2 timestep.png|x200px|thumb|Energy change when a timestep of 0.2 is used|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The maximum change in energy for each of the different timesteps is shown in table (1). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | Timestep&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.1&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.15&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.2&lt;br /&gt;
|-&lt;br /&gt;
| Max. change in Energy&lt;br /&gt;
| 0.2%&lt;br /&gt;
| 0.6%&lt;br /&gt;
| 1%&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results clearly indicate that a timestep greater than &#039;&#039;&#039;0.2&#039;&#039;&#039; will result in an energy change greater than 1%. As the timestep increases as does the maximum error. The timestep defines the number of calculations made in a given time, therefore the shorter the timestep the larger the number of calculations carried out and therefore a more accurate result is produced. The total energy of a real physical system should not change, when modeled numerically there can be fluctuations therefore it is important to monitor this change and ensure that the fluctuations are minimised.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces ===&lt;br /&gt;
&lt;br /&gt;
The forces an atom experiences is determined by the positions of all the atoms in the system, &amp;lt;math&amp;gt;\mathbf{r}^N&amp;lt;/math&amp;gt;. The Lennard-Jones function accurately sums all the key inter-atomic forces an atoms experiences (U). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ (10)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
For a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After division by 4 and rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_0^{6}} = \frac{\sigma^{6}}{r_0^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After further rearrangement and cancelling down: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;-\sigma &amp;lt;/math&amp;gt; is also a solution however this can be disregarded. &lt;br /&gt;
&lt;br /&gt;
In order to calculate the force the following equation is used: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\sigma\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After differentiation and simplification: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}(r_0) =  \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &#039;&#039;&#039; ask demonstrator if thats too brief &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
At equilibrium: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{12\sigma^{12}}{r_e^{13}} - \frac{6\sigma^6}{r_e^7} \right)&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
After rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_e = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This value of &amp;lt;math&amp;gt; r_e &amp;lt;/math&amp;gt; can now be used to find the well depth:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{\sigma^{12}}{4sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon\left(\frac{1}{5r^{5}} - \frac{1}{11r^11} \right)^\infty_2 \simeq -2.48 \sdot 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -8.18 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -3.29 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Finish off atomic forces - enter integrals&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
* No. of moles in  1 mL of water = 0.056 &amp;lt;br&amp;gt; &lt;br /&gt;
* No. of molecules = moles x Avogadro&#039;s constant = 3.37 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*1000 molecules = 1.66 x 10&amp;lt;sup&amp;gt;21&amp;lt;/sup&amp;gt; moles&lt;br /&gt;
* Density = mass/vol. = 1 &lt;br /&gt;
*vol. = mass/density = 2.99 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Due to periodic boundary condition once the atom leaves the current box it will enter the beginning of an identical box. The atom is at &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; and thus once it breaches 0.5 in a particular direction it will be at the start of the next box. Using these principles after the atom moves &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will be at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units === &lt;br /&gt;
&lt;br /&gt;
Reduced units are applied to the Lennard-Jones equation to make the calculation more managable.&lt;br /&gt;
&lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For argon:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Distance in real units: r = 1.09 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Well depth = &amp;lt;math&amp;gt;{\epsilon}&amp;lt;/math&amp;gt; = 0.996 KJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* T = 180 K &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Do I need to show working out?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Equilibriation = &lt;br /&gt;
&lt;br /&gt;
=== Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
As there is a large number of atoms in a discrete volume allowing random assignment of positions could result in atoms overlapping. This would cause an unrealistically high potential as potential is distance dependant (as observed in the Lennard - Jones equation).&lt;br /&gt;
&lt;br /&gt;
* Density is given by the following equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{n}{v} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 1 (as there is only 1 atom per unit cell) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = 1.07722^3 = 1.25 &amp;lt;/math&amp;gt; (lattice spacing = 1.07722) &lt;br /&gt;
&lt;br /&gt;
Thus: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length of a side of one fcc unit cell with number density 1.2 would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = \frac{n}{\rho} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 4 (as there is 4 atoms per unit cell in an fcc lattice) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; = 3.33&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; l = v^{-3} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The number of atoms that would be created by the create_atoms command for an fcc lattice would be: &lt;br /&gt;
&lt;br /&gt;
4 x 1000 = 4000 &lt;br /&gt;
&lt;br /&gt;
This is due to fact that there is 1 atom per unit cell that yeilds 1000 altogether in simple cubic. Fcc has 4 times the number of atoms per unit cell. &lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of Atoms === &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command above has the following purpose: &lt;br /&gt;
&lt;br /&gt;
* The first line sets the mass of all atoms of type &#039;1&#039; to 1.0. &lt;br /&gt;
*  Line 2 is used to control the Lennard-Jones potential. The value of 3.0 indicates the distance in reduced units upon which the potential is calculated. The potential is distance dependent and falls to 0 at large values of r thus only atoms within a distance of 3.0 are considered.  &#039;lj/cut&#039; defines the cut off point. &lt;br /&gt;
* The last line defines the force field constants as 1.0 for all sets of atoms. The * controls the fact that the command is set for all atoms. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet is the integration algorithm that can be used when &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; are defined. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The codes is in place to ensure that the timestep can be varied but the total time taken for the simulation to run will not change.&lt;br /&gt;
&lt;br /&gt;
=== Checking equilibration === &lt;br /&gt;
&lt;br /&gt;
The graphs below illustrate the time it takes for different thermodynamic properties to equilibriate at a timestep of 0.001. The plateau represents the point at which equilibration is achieved. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EnergyVRStime.png|x300px|thumb|Energy Vrs Time|left]]&lt;br /&gt;
! [[File:TEMPvrsTIME.png|x300px|thumb|Temp vrs Time|centre]]&lt;br /&gt;
! [[File:Press Vrs Time.png|x300px|thumb|Pressure Vrs Time|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The graph below illustrates the effect changing the timestep has on equilibration. As can be seen from the graph a from below 0.01 a shorter timestep results in a lower energy value for equilibration until 0.0025 where the value   of equilibration does not change with lower timestep. This trend is due to the fact that a smaller timestep results in a more accurate result however if it is too small this can over-complicate the calculation (especially when there is a large over-all time). Thus a timestep of 0.0025 is ideal. A timestep of 0.025 is too large and results in the system not reaching equilibrium.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EnergyVtimeFORVTS.png|x400px|thumb|Energy Vrs Time with different timesteps|centre]]&lt;br /&gt;
&lt;br /&gt;
= Running Simulations Under Specific Conditions =&lt;br /&gt;
&lt;br /&gt;
The following two equations can be used to define the energy of the system: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The instantaneous tempertaure &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will not remain constant throughout the simulation and will fluctuate, it will thus be different to out target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The value of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2} = \frac{\mathfrak{T}}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within the preceding code: &lt;br /&gt;
&lt;br /&gt;
100 - Nevery: This command results in a sample being taken every 100 steps and being incorporated into the average. 1000 - Nrepreat: Tells the computer how many samples should be used to calculate the average. Nfreq 10 000: At every 10000th timestep an average is calculated. &lt;br /&gt;
&lt;br /&gt;
All thermodynamic properties are calculated by averages that is the necessity for those commands.&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equation of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:DENSITYvrsT.png|x400px|thumb|Density Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
= Calculating Heat Capacities Using Statistic Physics =&lt;br /&gt;
&lt;br /&gt;
Example of input code used: &lt;br /&gt;
&lt;br /&gt;
* Density 0.2&lt;br /&gt;
* Temperature 2.0 &lt;br /&gt;
&lt;br /&gt;
 variable density equal 0.2&lt;br /&gt;
 DEFINE SIMULATION BOX GEOMETRY &amp;lt;br&amp;gt; &lt;br /&gt;
lattice sc ${density} &amp;lt;br&amp;gt; &lt;br /&gt;
region box block 0 15 0 15 0 15 &amp;lt;br&amp;gt; &lt;br /&gt;
create_box 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
create_atoms 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
DEFINE PHYSICAL PROPERTIES OF ATOMS &amp;lt;br&amp;gt; &lt;br /&gt;
mass 1 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_style lj/cut/opt 3.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_coeff 1 1 1.0 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
neighbor 2.0 bin &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY THE REQUIRED THERMODYNAMIC STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable T equal 2.0 &amp;lt;br&amp;gt; &lt;br /&gt;
variable p equal 2.5 &amp;lt;br&amp;gt; &lt;br /&gt;
variable timestep equal 0.0025 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ASSIGN ATOMIC VELOCITIES &amp;lt;br&amp;gt; &lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
SPECIFY ENSEMBLE &amp;lt;br&amp;gt; &lt;br /&gt;
timestep ${timestep} &amp;lt;br&amp;gt; &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 THERMODYNAMIC OUTPUT CONTROL &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom time etotal temp press &amp;lt;br&amp;gt; &lt;br /&gt;
thermo 10 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RECORD TRAJECTORY &amp;lt;br&amp;gt; &lt;br /&gt;
dump traj all custom 1000 output-1 id x y z &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY TIMESTEP &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RUN SIMULATION TO MELT CRYSTAL &amp;lt;br&amp;gt; &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nve &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 BRING SYSTEM TO REQUIRED STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable tdamp equal ${timestep}*100 &amp;lt;br&amp;gt; &lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &amp;lt;br&amp;gt;  &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nvt &amp;lt;br&amp;gt;  &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 MEASURE SYSTEM STATE  &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom step atoms etotal temp press density &amp;lt;br&amp;gt; &lt;br /&gt;
variable atoms2 equal atoms*atoms &amp;lt;br&amp;gt;   &lt;br /&gt;
variable E equal etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable E2 equal etotal*etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens equal density &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens2 equal density*density &amp;lt;br&amp;gt;  &lt;br /&gt;
variable temp equal temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable temp2 equal temp*temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable press equal press &amp;lt;br&amp;gt; &lt;br /&gt;
variable press2 equal press*press &amp;lt;br&amp;gt; &lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_E2 v_E&lt;br /&gt;
run 100000 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
variable HC equal ${atoms2}*(f_aves[7] - f_aves[8]*f_aves[8])/f_aves[5] &amp;lt;br&amp;gt;  &lt;br /&gt;
variable avedens equal f_aves[1] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avetemp equal f_aves[2] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avepress equal f_aves[3] &amp;lt;br&amp;gt; &lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3]) &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;--------&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Temperature: ${temp}&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Heat capacity: ${HC}&amp;quot;  &amp;lt;br&amp;gt;  &lt;br /&gt;
print &amp;quot;atoms&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Structural Properties and the Radial Distribution function =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:G(r).png|x300px|thumb|RDF at different phases|left]]&lt;br /&gt;
! [[File:Integral.png|x300px|thumb|Integral of g(r)|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To carry out the RDF calculations temperature was kept constant at 1.2 but density was varied. &lt;br /&gt;
&lt;br /&gt;
Density in reduced units used for each phase: &lt;br /&gt;
&lt;br /&gt;
* Gas = 0.05&lt;br /&gt;
* Liquid = 0.8 &lt;br /&gt;
* Solid = 1.2&lt;br /&gt;
&lt;br /&gt;
The number of peaks for each RDF plot decreases in the order gas&amp;lt;liquid&amp;lt;solid. This reflects the ordering of each phase. &lt;br /&gt;
A gas has a large degree of disorder and thus produces only peak.&lt;br /&gt;
The liquid has three peaks which gradually decrease in amplitude, this behavior is due to the fact that the liquid is modeled as central molecule surrounded by shells of other molecules, this initially creates some degree of order. As the simulation continues the molecules become more diffuse so the ordering decreases and thus the amplitude of peaks decrease.&lt;br /&gt;
&lt;br /&gt;
= Dynamical Properties and the diffusion coefficient = &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid.png|thumb|solid|x300px|left]]&lt;br /&gt;
! [[File:Liquid.png|thumb|liquid|x300px|centre]]&lt;br /&gt;
! [[File:Gas.png|thumb|gas|x300px|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:VACFvrsTS.png|x400px|thumb|VACF vrs Temperature|centre]]&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function for a 1D harmonic oscillator can be evaluated using the equation for a 1D harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiation of the displacement function will produce a velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx}{dt} = -A\omega\sin\left(\omega t + \phi\right) = v(t) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substitution into velocity autocorrelation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling -A\omega: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right)\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trigometric relation can simplify equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin\left(\omega t + \omega\tau + \phi\right) = cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integration of ansymmetical function results in 0:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} sin(x)cos(x)\mathrm{d}t = 0 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Thus after cos(t\omega) is removed from top line the equation simplifies to: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(t\omega) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Vapourphse.png|thumb|Vapour Phase|x300px|left]]&lt;br /&gt;
! [[File:Vapour phase 1 million.png|thumb|Vapour Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid(small).png|thumb|Solid Phase|x300px|left]]&lt;br /&gt;
! [[File:Solid1million.png|thumb|Solid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Liquidsmallno..png|thumb|Liquid Phase|x300px|left]]&lt;br /&gt;
! [[File:Liquid1millionatoms.png|thumb|Liquid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 1.64&lt;br /&gt;
| 1.63&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| -0.2215&lt;br /&gt;
| 0.157 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| 0.254&lt;br /&gt;
| -0.123&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Mark Klarpus, Gregory A. Petsko, (1990) &#039;&#039;Molecular Reaction Dynamics in Biology&#039;&#039;, &#039;&#039;&#039;347&#039;&#039;&#039;, 631-9, doi:10.1038/347631a0&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578478</id>
		<title>Rep:Thermomp4114</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578478"/>
		<updated>2017-01-26T22:08:11Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: /* Dynamical Properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Molecular Dynamics Simulations of Simple Liquids Introduction == &lt;br /&gt;
&lt;br /&gt;
Molecular dynamic simulations involved studying the motion of a system of particles. Several fundamental elements of a system need to be known in order to achieve this. This includes a knowledge of the interaction potential for the particles and the equations of motion which govern the dynamics of the particles.&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt; Once we know the positions, velocities, and forces, of the atoms (which are obtained using statistical) we can calculate various thermodynamic quantities of the system such as temperature and pressure. We must introduce a series of approximations in order for the caluculations to be feasible. Firstly we apply the &#039;&#039;&#039;The Classical Particle Approximation&#039;&#039;&#039;. The schoedinger equation is too complex to solve for a large system of atoms, however if the atoms are treated classically then the positions and and velocities of each can atom can be calculated using Newton&#039;s second law (equation 1): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = m_i \mathbf{a}_i = m_i \frac{\mathrm{d}\mathbf{v}_i}{\mathrm{d}t} = m_i \frac{\mathrm{d}^2 \mathbf{x}_i}{\mathrm{d}t^2} \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As there are N atoms and therefore N equations representing each atom a computer is a necessity. The &#039;&#039;&#039;Verlet algorithim&#039;&#039;&#039; is used to solve to Newton&#039;s law for all the atoms in the system. In this case time is not continuous but is made discrete, the simulation is thus broeken up into specific &#039;&#039;&#039;timesteps&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The position of atom &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;\mathbf{x}_i \left(t\right)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Positional Verlet algorithim (equation (2)): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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 \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Velocity Verlet algorithim (equation (3)):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{v}_i \left(t\right)&amp;lt;/math&amp;gt; represents the velocity of that atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;center&amp;gt;&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 \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Put in example of industrial applications&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Harmonic Oscillator ===&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator illustrates the the accuracy and discrepancies associated with using the velocity Verlet algorithim. Equation (4) is used to model the behavior of the harmonic oscillator in an analytical sense: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)\ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; = 1.00 &lt;br /&gt;
&lt;br /&gt;
Graph (1) illustrates the results the analytical solution gave for the relationship between position and time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Avrsxt2.png|x300px|thumb|Graph 1: Analytical solution of harmonic oscillator|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The difference in position between the velocity-verlet solution and analytical solution is represented by an error. Error plotted against time is illustrated by graph (2). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ErrorvrsT.png|x300px|thumb|Graph 2: Error vrs Time|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The orange line illustrates the positive trend between error and time. &#039;&#039;&#039;Insert Answer from demonstrator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy of the system will consist of the sum of kinetic and potential energy. Equation (5) can be used to find kinetic energy of the system:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;E_\text{k} =\tfrac{1}{2} mv(t)^2 \ \ (5)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\mathbf{x} \left(t\right)&amp;lt;/math&amp;gt; is used in equation (5) the potential energy can be found. &lt;br /&gt;
&lt;br /&gt;
The following graphs represent the difference in change in energy with time when the timestep is varied. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EvrsTime.png|x200px|thumb|Energy change when a timestep of 0.1 is used|left]]&lt;br /&gt;
! [[File:Energy vrs time for 0.15 timestep.png|x200px|thumb|Energy change when a timestep of 0.15 is used|centre]]&lt;br /&gt;
! [[File:Energy vrs time for 0.2 timestep.png|x200px|thumb|Energy change when a timestep of 0.2 is used|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The maximum change in energy for each of the different timesteps is shown in table (1). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | Timestep&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.1&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.15&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.2&lt;br /&gt;
|-&lt;br /&gt;
| Max. change in Energy&lt;br /&gt;
| 0.2%&lt;br /&gt;
| 0.6%&lt;br /&gt;
| 1%&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results clearly indicate that a timestep greater than &#039;&#039;&#039;0.2&#039;&#039;&#039; will result in an energy change greater than 1%. As the timestep increases as does the maximum error. The timestep defines the number of calculations made in a given time, therefore the shorter the timestep the larger the number of calculations carried out and therefore a more accurate result is produced. The total energy of a real physical system should not change, when modeled numerically there can be fluctuations therefore it is important to monitor this change and ensure that the fluctuations are minimised.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces ===&lt;br /&gt;
&lt;br /&gt;
The forces an atom experiences is determined by the positions of all the atoms in the system, &amp;lt;math&amp;gt;\mathbf{r}^N&amp;lt;/math&amp;gt;. The Lennard-Jones function accurately sums all the key inter-atomic forces an atoms experiences (U). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ (10)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
For a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After division by 4 and rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_0^{6}} = \frac{\sigma^{6}}{r_0^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After further rearrangement and cancelling down: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;-\sigma &amp;lt;/math&amp;gt; is also a solution however this can be disregarded. &lt;br /&gt;
&lt;br /&gt;
In order to calculate the force the following equation is used: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\sigma\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After differentiation and simplification: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}(r_0) =  \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &#039;&#039;&#039; ask demonstrator if thats too brief &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
At equilibrium: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{12\sigma^{12}}{r_e^{13}} - \frac{6\sigma^6}{r_e^7} \right)&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
After rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_e = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This value of &amp;lt;math&amp;gt; r_e &amp;lt;/math&amp;gt; can now be used to find the well depth:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{\sigma^{12}}{4sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon\left(\frac{1}{5r^{5}} - \frac{1}{11r^11} \right)^\infty_2 \simeq -2.48 \sdot 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -8.18 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -3.29 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Finish off atomic forces - enter integrals&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
* No. of moles in  1 mL of water = 0.056 &amp;lt;br&amp;gt; &lt;br /&gt;
* No. of molecules = moles x Avogadro&#039;s constant = 3.37 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*1000 molecules = 1.66 x 10&amp;lt;sup&amp;gt;21&amp;lt;/sup&amp;gt; moles&lt;br /&gt;
* Density = mass/vol. = 1 &lt;br /&gt;
*vol. = mass/density = 2.99 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Due to periodic boundary condition once the atom leaves the current box it will enter the beginning of an identical box. The atom is at &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; and thus once it breaches 0.5 in a particular direction it will be at the start of the next box. Using these principles after the atom moves &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will be at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units === &lt;br /&gt;
&lt;br /&gt;
Reduced units are applied to the Lennard-Jones equation to make the calculation more managable.&lt;br /&gt;
&lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For argon:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Distance in real units: r = 1.09 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Well depth = &amp;lt;math&amp;gt;{\epsilon}&amp;lt;/math&amp;gt; = 0.996 KJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* T = 180 K &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Do I need to show working out?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Equilibriation = &lt;br /&gt;
&lt;br /&gt;
=== Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
As there is a large number of atoms in a discrete volume allowing random assignment of positions could result in atoms overlapping. This would cause an unrealistically high potential as potential is distance dependant (as observed in the Lennard - Jones equation).&lt;br /&gt;
&lt;br /&gt;
* Density is given by the following equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{n}{v} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 1 (as there is only 1 atom per unit cell) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = 1.07722^3 = 1.25 &amp;lt;/math&amp;gt; (lattice spacing = 1.07722) &lt;br /&gt;
&lt;br /&gt;
Thus: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length of a side of one fcc unit cell with number density 1.2 would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = \frac{n}{\rho} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 4 (as there is 4 atoms per unit cell in an fcc lattice) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; = 3.33&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; l = v^{-3} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The number of atoms that would be created by the create_atoms command for an fcc lattice would be: &lt;br /&gt;
&lt;br /&gt;
4 x 1000 = 4000 &lt;br /&gt;
&lt;br /&gt;
This is due to fact that there is 1 atom per unit cell that yeilds 1000 altogether in simple cubic. Fcc has 4 times the number of atoms per unit cell. &lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of Atoms === &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command above has the following purpose: &lt;br /&gt;
&lt;br /&gt;
* The first line sets the mass of all atoms of type &#039;1&#039; to 1.0. &lt;br /&gt;
*  Line 2 is used to control the Lennard-Jones potential. The value of 3.0 indicates the distance in reduced units upon which the potential is calculated. The potential is distance dependent and falls to 0 at large values of r thus only atoms within a distance of 3.0 are considered.  &#039;lj/cut&#039; defines the cut off point. &lt;br /&gt;
* The last line defines the force field constants as 1.0 for all sets of atoms. The * controls the fact that the command is set for all atoms. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet is the integration algorithm that can be used when &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; are defined. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The codes is in place to ensure that the timestep can be varied but the total time taken for the simulation to run will not change.&lt;br /&gt;
&lt;br /&gt;
=== Checking equilibration === &lt;br /&gt;
&lt;br /&gt;
The graphs below illustrate the time it takes for different thermodynamic properties to equilibriate at a timestep of 0.001. The plateau represents the point at which equilibration is achieved. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EnergyVRStime.png|x300px|thumb|Energy Vrs Time|left]]&lt;br /&gt;
! [[File:TEMPvrsTIME.png|x300px|thumb|Temp vrs Time|centre]]&lt;br /&gt;
! [[File:Press Vrs Time.png|x300px|thumb|Pressure Vrs Time|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The graph below illustrates the effect changing the timestep has on equilibration. As can be seen from the graph a from below 0.01 a shorter timestep results in a lower energy value for equilibration until 0.0025 where the value   of equilibration does not change with lower timestep. This trend is due to the fact that a smaller timestep results in a more accurate result however if it is too small this can over-complicate the calculation (especially when there is a large over-all time). Thus a timestep of 0.0025 is ideal. A timestep of 0.025 is too large and results in the system not reaching equilibrium.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EnergyVtimeFORVTS.png|x400px|thumb|Energy Vrs Time with different timesteps|centre]]&lt;br /&gt;
&lt;br /&gt;
= Running Simulations Under Specific Conditions =&lt;br /&gt;
&lt;br /&gt;
The following two equations can be used to define the energy of the system: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The instantaneous tempertaure &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will not remain constant throughout the simulation and will fluctuate, it will thus be different to out target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The value of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2} = \frac{\mathfrak{T}}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within the preceding code: &lt;br /&gt;
&lt;br /&gt;
100 - Nevery: This command results in a sample being taken every 100 steps and being incorporated into the average. 1000 - Nrepreat: Tells the computer how many samples should be used to calculate the average. Nfreq 10 000: At every 10000th timestep an average is calculated. &lt;br /&gt;
&lt;br /&gt;
All thermodynamic properties are calculated by averages that is the necessity for those commands.&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equation of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:DENSITYvrsT.png|x400px|thumb|Density Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
= Calculating Heat Capacities Using Statistic Physics =&lt;br /&gt;
&lt;br /&gt;
Example of input code used: &lt;br /&gt;
&lt;br /&gt;
* Density 0.2&lt;br /&gt;
* Temperature 2.0 &lt;br /&gt;
&lt;br /&gt;
 variable density equal 0.2&lt;br /&gt;
 DEFINE SIMULATION BOX GEOMETRY &amp;lt;br&amp;gt; &lt;br /&gt;
lattice sc ${density} &amp;lt;br&amp;gt; &lt;br /&gt;
region box block 0 15 0 15 0 15 &amp;lt;br&amp;gt; &lt;br /&gt;
create_box 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
create_atoms 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
DEFINE PHYSICAL PROPERTIES OF ATOMS &amp;lt;br&amp;gt; &lt;br /&gt;
mass 1 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_style lj/cut/opt 3.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_coeff 1 1 1.0 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
neighbor 2.0 bin &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY THE REQUIRED THERMODYNAMIC STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable T equal 2.0 &amp;lt;br&amp;gt; &lt;br /&gt;
variable p equal 2.5 &amp;lt;br&amp;gt; &lt;br /&gt;
variable timestep equal 0.0025 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ASSIGN ATOMIC VELOCITIES &amp;lt;br&amp;gt; &lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
SPECIFY ENSEMBLE &amp;lt;br&amp;gt; &lt;br /&gt;
timestep ${timestep} &amp;lt;br&amp;gt; &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 THERMODYNAMIC OUTPUT CONTROL &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom time etotal temp press &amp;lt;br&amp;gt; &lt;br /&gt;
thermo 10 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RECORD TRAJECTORY &amp;lt;br&amp;gt; &lt;br /&gt;
dump traj all custom 1000 output-1 id x y z &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY TIMESTEP &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RUN SIMULATION TO MELT CRYSTAL &amp;lt;br&amp;gt; &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nve &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 BRING SYSTEM TO REQUIRED STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable tdamp equal ${timestep}*100 &amp;lt;br&amp;gt; &lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &amp;lt;br&amp;gt;  &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nvt &amp;lt;br&amp;gt;  &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 MEASURE SYSTEM STATE  &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom step atoms etotal temp press density &amp;lt;br&amp;gt; &lt;br /&gt;
variable atoms2 equal atoms*atoms &amp;lt;br&amp;gt;   &lt;br /&gt;
variable E equal etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable E2 equal etotal*etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens equal density &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens2 equal density*density &amp;lt;br&amp;gt;  &lt;br /&gt;
variable temp equal temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable temp2 equal temp*temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable press equal press &amp;lt;br&amp;gt; &lt;br /&gt;
variable press2 equal press*press &amp;lt;br&amp;gt; &lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_E2 v_E&lt;br /&gt;
run 100000 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
variable HC equal ${atoms2}*(f_aves[7] - f_aves[8]*f_aves[8])/f_aves[5] &amp;lt;br&amp;gt;  &lt;br /&gt;
variable avedens equal f_aves[1] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avetemp equal f_aves[2] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avepress equal f_aves[3] &amp;lt;br&amp;gt; &lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3]) &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;--------&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Temperature: ${temp}&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Heat capacity: ${HC}&amp;quot;  &amp;lt;br&amp;gt;  &lt;br /&gt;
print &amp;quot;atoms&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Structural Properties and the Radial Distribution function =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:G(r).png|x300px|thumb|RDF at different phases|left]]&lt;br /&gt;
! [[File:Integral.png|x300px|thumb|Integral of g(r)|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To carry out the RDF calculations temperature was kept constant at 1.2 but density was varied. &lt;br /&gt;
&lt;br /&gt;
Density in reduced units used for each phase: &lt;br /&gt;
&lt;br /&gt;
* Gas = 0.05&lt;br /&gt;
* Liquid = 0.8 &lt;br /&gt;
* Solid = 1.2&lt;br /&gt;
&lt;br /&gt;
The number of peaks for each RDF plot decreases in the order gas&amp;lt;liquid&amp;lt;solid. This reflects the ordering of each phase. &lt;br /&gt;
A gas has a large degree of disorder and thus produces only peak.&lt;br /&gt;
The liquid has three peaks which gradually decrease in amplitude, this behavior is due to the fact that the liquid is modeled as central molecule surrounded by shells of other molecules, this initially creates some degree of order. As the simulation continues the molecules become more diffuse so the ordering decreases and thus the amplitude of peaks decrease.&lt;br /&gt;
&lt;br /&gt;
= Dynamical Properties and the diffusion coefficient = &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid.png|thumb|solid|x300px|left]]&lt;br /&gt;
! [[File:Liquid.png|thumb|liquid|x300px|centre]]&lt;br /&gt;
! [[File:Gas.png|thumb|gas|x300px|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:VACFvrsTS.png|x400px|thumb|VACF vrs Temperature|centre]]&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function for a 1D harmonic oscillator can be evaluated using the equation for a 1D harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiation of the displacement function will produce a velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx}{dt} = -A\omega\sin\left(\omega t + \phi\right) = v(t) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substitution into velocity autocorrelation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling -A\omega: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right)\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trigometric relation can simplify equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin\left(\omega t + \omega\tau + \phi\right) = cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integration of ansymmetical function results in 0:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} sin(x)cos(x)\mathrm{d}t = 0 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Thus the equation simplifies to: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(t\omega) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Vapourphse.png|thumb|Vapour Phase|x300px|left]]&lt;br /&gt;
! [[File:Vapour phase 1 million.png|thumb|Vapour Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid(small).png|thumb|Solid Phase|x300px|left]]&lt;br /&gt;
! [[File:Solid1million.png|thumb|Solid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Liquidsmallno..png|thumb|Liquid Phase|x300px|left]]&lt;br /&gt;
! [[File:Liquid1millionatoms.png|thumb|Liquid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 1.64&lt;br /&gt;
| 1.63&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| -0.2215&lt;br /&gt;
| 0.157 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| 0.254&lt;br /&gt;
| -0.123&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Mark Klarpus, Gregory A. Petsko, (1990) &#039;&#039;Molecular Reaction Dynamics in Biology&#039;&#039;, &#039;&#039;&#039;347&#039;&#039;&#039;, 631-9, doi:10.1038/347631a0&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578470</id>
		<title>Rep:Thermomp4114</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578470"/>
		<updated>2017-01-26T21:58:29Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: /* Dynamical Properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Molecular Dynamics Simulations of Simple Liquids Introduction == &lt;br /&gt;
&lt;br /&gt;
Molecular dynamic simulations involved studying the motion of a system of particles. Several fundamental elements of a system need to be known in order to achieve this. This includes a knowledge of the interaction potential for the particles and the equations of motion which govern the dynamics of the particles.&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt; Once we know the positions, velocities, and forces, of the atoms (which are obtained using statistical) we can calculate various thermodynamic quantities of the system such as temperature and pressure. We must introduce a series of approximations in order for the caluculations to be feasible. Firstly we apply the &#039;&#039;&#039;The Classical Particle Approximation&#039;&#039;&#039;. The schoedinger equation is too complex to solve for a large system of atoms, however if the atoms are treated classically then the positions and and velocities of each can atom can be calculated using Newton&#039;s second law (equation 1): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = m_i \mathbf{a}_i = m_i \frac{\mathrm{d}\mathbf{v}_i}{\mathrm{d}t} = m_i \frac{\mathrm{d}^2 \mathbf{x}_i}{\mathrm{d}t^2} \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As there are N atoms and therefore N equations representing each atom a computer is a necessity. The &#039;&#039;&#039;Verlet algorithim&#039;&#039;&#039; is used to solve to Newton&#039;s law for all the atoms in the system. In this case time is not continuous but is made discrete, the simulation is thus broeken up into specific &#039;&#039;&#039;timesteps&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The position of atom &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;\mathbf{x}_i \left(t\right)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Positional Verlet algorithim (equation (2)): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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 \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Velocity Verlet algorithim (equation (3)):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{v}_i \left(t\right)&amp;lt;/math&amp;gt; represents the velocity of that atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;center&amp;gt;&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 \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Put in example of industrial applications&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Harmonic Oscillator ===&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator illustrates the the accuracy and discrepancies associated with using the velocity Verlet algorithim. Equation (4) is used to model the behavior of the harmonic oscillator in an analytical sense: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)\ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; = 1.00 &lt;br /&gt;
&lt;br /&gt;
Graph (1) illustrates the results the analytical solution gave for the relationship between position and time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Avrsxt2.png|x300px|thumb|Graph 1: Analytical solution of harmonic oscillator|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The difference in position between the velocity-verlet solution and analytical solution is represented by an error. Error plotted against time is illustrated by graph (2). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ErrorvrsT.png|x300px|thumb|Graph 2: Error vrs Time|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The orange line illustrates the positive trend between error and time. &#039;&#039;&#039;Insert Answer from demonstrator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy of the system will consist of the sum of kinetic and potential energy. Equation (5) can be used to find kinetic energy of the system:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;E_\text{k} =\tfrac{1}{2} mv(t)^2 \ \ (5)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\mathbf{x} \left(t\right)&amp;lt;/math&amp;gt; is used in equation (5) the potential energy can be found. &lt;br /&gt;
&lt;br /&gt;
The following graphs represent the difference in change in energy with time when the timestep is varied. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EvrsTime.png|x200px|thumb|Energy change when a timestep of 0.1 is used|left]]&lt;br /&gt;
! [[File:Energy vrs time for 0.15 timestep.png|x200px|thumb|Energy change when a timestep of 0.15 is used|centre]]&lt;br /&gt;
! [[File:Energy vrs time for 0.2 timestep.png|x200px|thumb|Energy change when a timestep of 0.2 is used|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The maximum change in energy for each of the different timesteps is shown in table (1). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | Timestep&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.1&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.15&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.2&lt;br /&gt;
|-&lt;br /&gt;
| Max. change in Energy&lt;br /&gt;
| 0.2%&lt;br /&gt;
| 0.6%&lt;br /&gt;
| 1%&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results clearly indicate that a timestep greater than &#039;&#039;&#039;0.2&#039;&#039;&#039; will result in an energy change greater than 1%. As the timestep increases as does the maximum error. The timestep defines the number of calculations made in a given time, therefore the shorter the timestep the larger the number of calculations carried out and therefore a more accurate result is produced. The total energy of a real physical system should not change, when modeled numerically there can be fluctuations therefore it is important to monitor this change and ensure that the fluctuations are minimised.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces ===&lt;br /&gt;
&lt;br /&gt;
The forces an atom experiences is determined by the positions of all the atoms in the system, &amp;lt;math&amp;gt;\mathbf{r}^N&amp;lt;/math&amp;gt;. The Lennard-Jones function accurately sums all the key inter-atomic forces an atoms experiences (U). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ (10)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
For a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After division by 4 and rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_0^{6}} = \frac{\sigma^{6}}{r_0^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After further rearrangement and cancelling down: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;-\sigma &amp;lt;/math&amp;gt; is also a solution however this can be disregarded. &lt;br /&gt;
&lt;br /&gt;
In order to calculate the force the following equation is used: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\sigma\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After differentiation and simplification: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}(r_0) =  \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &#039;&#039;&#039; ask demonstrator if thats too brief &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
At equilibrium: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{12\sigma^{12}}{r_e^{13}} - \frac{6\sigma^6}{r_e^7} \right)&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
After rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_e = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This value of &amp;lt;math&amp;gt; r_e &amp;lt;/math&amp;gt; can now be used to find the well depth:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{\sigma^{12}}{4sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon\left(\frac{1}{5r^{5}} - \frac{1}{11r^11} \right)^\infty_2 \simeq -2.48 \sdot 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -8.18 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -3.29 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Finish off atomic forces - enter integrals&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
* No. of moles in  1 mL of water = 0.056 &amp;lt;br&amp;gt; &lt;br /&gt;
* No. of molecules = moles x Avogadro&#039;s constant = 3.37 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*1000 molecules = 1.66 x 10&amp;lt;sup&amp;gt;21&amp;lt;/sup&amp;gt; moles&lt;br /&gt;
* Density = mass/vol. = 1 &lt;br /&gt;
*vol. = mass/density = 2.99 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Due to periodic boundary condition once the atom leaves the current box it will enter the beginning of an identical box. The atom is at &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; and thus once it breaches 0.5 in a particular direction it will be at the start of the next box. Using these principles after the atom moves &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will be at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units === &lt;br /&gt;
&lt;br /&gt;
Reduced units are applied to the Lennard-Jones equation to make the calculation more managable.&lt;br /&gt;
&lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For argon:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Distance in real units: r = 1.09 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Well depth = &amp;lt;math&amp;gt;{\epsilon}&amp;lt;/math&amp;gt; = 0.996 KJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* T = 180 K &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Do I need to show working out?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Equilibriation = &lt;br /&gt;
&lt;br /&gt;
=== Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
As there is a large number of atoms in a discrete volume allowing random assignment of positions could result in atoms overlapping. This would cause an unrealistically high potential as potential is distance dependant (as observed in the Lennard - Jones equation).&lt;br /&gt;
&lt;br /&gt;
* Density is given by the following equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{n}{v} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 1 (as there is only 1 atom per unit cell) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = 1.07722^3 = 1.25 &amp;lt;/math&amp;gt; (lattice spacing = 1.07722) &lt;br /&gt;
&lt;br /&gt;
Thus: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length of a side of one fcc unit cell with number density 1.2 would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = \frac{n}{\rho} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 4 (as there is 4 atoms per unit cell in an fcc lattice) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; = 3.33&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; l = v^{-3} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The number of atoms that would be created by the create_atoms command for an fcc lattice would be: &lt;br /&gt;
&lt;br /&gt;
4 x 1000 = 4000 &lt;br /&gt;
&lt;br /&gt;
This is due to fact that there is 1 atom per unit cell that yeilds 1000 altogether in simple cubic. Fcc has 4 times the number of atoms per unit cell. &lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of Atoms === &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command above has the following purpose: &lt;br /&gt;
&lt;br /&gt;
* The first line sets the mass of all atoms of type &#039;1&#039; to 1.0. &lt;br /&gt;
*  Line 2 is used to control the Lennard-Jones potential. The value of 3.0 indicates the distance in reduced units upon which the potential is calculated. The potential is distance dependent and falls to 0 at large values of r thus only atoms within a distance of 3.0 are considered.  &#039;lj/cut&#039; defines the cut off point. &lt;br /&gt;
* The last line defines the force field constants as 1.0 for all sets of atoms. The * controls the fact that the command is set for all atoms. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet is the integration algorithm that can be used when &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; are defined. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The codes is in place to ensure that the timestep can be varied but the total time taken for the simulation to run will not change.&lt;br /&gt;
&lt;br /&gt;
=== Checking equilibration === &lt;br /&gt;
&lt;br /&gt;
The graphs below illustrate the time it takes for different thermodynamic properties to equilibriate at a timestep of 0.001. The plateau represents the point at which equilibration is achieved. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EnergyVRStime.png|x300px|thumb|Energy Vrs Time|left]]&lt;br /&gt;
! [[File:TEMPvrsTIME.png|x300px|thumb|Temp vrs Time|centre]]&lt;br /&gt;
! [[File:Press Vrs Time.png|x300px|thumb|Pressure Vrs Time|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The graph below illustrates the effect changing the timestep has on equilibration. As can be seen from the graph a from below 0.01 a shorter timestep results in a lower energy value for equilibration until 0.0025 where the value   of equilibration does not change with lower timestep. This trend is due to the fact that a smaller timestep results in a more accurate result however if it is too small this can over-complicate the calculation (especially when there is a large over-all time). Thus a timestep of 0.0025 is ideal. A timestep of 0.025 is too large and results in the system not reaching equilibrium.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EnergyVtimeFORVTS.png|x400px|thumb|Energy Vrs Time with different timesteps|centre]]&lt;br /&gt;
&lt;br /&gt;
= Running Simulations Under Specific Conditions =&lt;br /&gt;
&lt;br /&gt;
The following two equations can be used to define the energy of the system: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The instantaneous tempertaure &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will not remain constant throughout the simulation and will fluctuate, it will thus be different to out target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The value of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2} = \frac{\mathfrak{T}}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within the preceding code: &lt;br /&gt;
&lt;br /&gt;
100 - Nevery: This command results in a sample being taken every 100 steps and being incorporated into the average. 1000 - Nrepreat: Tells the computer how many samples should be used to calculate the average. Nfreq 10 000: At every 10000th timestep an average is calculated. &lt;br /&gt;
&lt;br /&gt;
All thermodynamic properties are calculated by averages that is the necessity for those commands.&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equation of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:DENSITYvrsT.png|x400px|thumb|Density Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
= Calculating Heat Capacities Using Statistic Physics =&lt;br /&gt;
&lt;br /&gt;
Example of input code used: &lt;br /&gt;
&lt;br /&gt;
* Density 0.2&lt;br /&gt;
* Temperature 2.0 &lt;br /&gt;
&lt;br /&gt;
 variable density equal 0.2&lt;br /&gt;
 DEFINE SIMULATION BOX GEOMETRY &amp;lt;br&amp;gt; &lt;br /&gt;
lattice sc ${density} &amp;lt;br&amp;gt; &lt;br /&gt;
region box block 0 15 0 15 0 15 &amp;lt;br&amp;gt; &lt;br /&gt;
create_box 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
create_atoms 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
DEFINE PHYSICAL PROPERTIES OF ATOMS &amp;lt;br&amp;gt; &lt;br /&gt;
mass 1 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_style lj/cut/opt 3.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_coeff 1 1 1.0 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
neighbor 2.0 bin &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY THE REQUIRED THERMODYNAMIC STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable T equal 2.0 &amp;lt;br&amp;gt; &lt;br /&gt;
variable p equal 2.5 &amp;lt;br&amp;gt; &lt;br /&gt;
variable timestep equal 0.0025 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ASSIGN ATOMIC VELOCITIES &amp;lt;br&amp;gt; &lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
SPECIFY ENSEMBLE &amp;lt;br&amp;gt; &lt;br /&gt;
timestep ${timestep} &amp;lt;br&amp;gt; &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 THERMODYNAMIC OUTPUT CONTROL &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom time etotal temp press &amp;lt;br&amp;gt; &lt;br /&gt;
thermo 10 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RECORD TRAJECTORY &amp;lt;br&amp;gt; &lt;br /&gt;
dump traj all custom 1000 output-1 id x y z &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY TIMESTEP &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RUN SIMULATION TO MELT CRYSTAL &amp;lt;br&amp;gt; &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nve &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 BRING SYSTEM TO REQUIRED STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable tdamp equal ${timestep}*100 &amp;lt;br&amp;gt; &lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &amp;lt;br&amp;gt;  &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nvt &amp;lt;br&amp;gt;  &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 MEASURE SYSTEM STATE  &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom step atoms etotal temp press density &amp;lt;br&amp;gt; &lt;br /&gt;
variable atoms2 equal atoms*atoms &amp;lt;br&amp;gt;   &lt;br /&gt;
variable E equal etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable E2 equal etotal*etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens equal density &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens2 equal density*density &amp;lt;br&amp;gt;  &lt;br /&gt;
variable temp equal temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable temp2 equal temp*temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable press equal press &amp;lt;br&amp;gt; &lt;br /&gt;
variable press2 equal press*press &amp;lt;br&amp;gt; &lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_E2 v_E&lt;br /&gt;
run 100000 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
variable HC equal ${atoms2}*(f_aves[7] - f_aves[8]*f_aves[8])/f_aves[5] &amp;lt;br&amp;gt;  &lt;br /&gt;
variable avedens equal f_aves[1] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avetemp equal f_aves[2] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avepress equal f_aves[3] &amp;lt;br&amp;gt; &lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3]) &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;--------&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Temperature: ${temp}&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Heat capacity: ${HC}&amp;quot;  &amp;lt;br&amp;gt;  &lt;br /&gt;
print &amp;quot;atoms&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Structural Properties and the Radial Distribution function =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:G(r).png|x300px|thumb|RDF at different phases|left]]&lt;br /&gt;
! [[File:Integral.png|x300px|thumb|Integral of g(r)|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To carry out the RDF calculations temperature was kept constant at 1.2 but density was varied. &lt;br /&gt;
&lt;br /&gt;
Density in reduced units used for each phase: &lt;br /&gt;
&lt;br /&gt;
* Gas = 0.05&lt;br /&gt;
* Liquid = 0.8 &lt;br /&gt;
* Solid = 1.2&lt;br /&gt;
&lt;br /&gt;
The number of peaks for each RDF plot decreases in the order gas&amp;lt;liquid&amp;lt;solid. This reflects the ordering of each phase. &lt;br /&gt;
A gas has a large degree of disorder and thus produces only peak.&lt;br /&gt;
The liquid has three peaks which gradually decrease in amplitude, this behavior is due to the fact that the liquid is modeled as central molecule surrounded by shells of other molecules, this initially creates some degree of order. As the simulation continues the molecules become more diffuse so the ordering decreases and thus the amplitude of peaks decrease.&lt;br /&gt;
&lt;br /&gt;
= Dynamical Properties and the diffusion coefficient = &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid.png|thumb|solid|x300px|left]]&lt;br /&gt;
! [[File:Liquid.png|thumb|liquid|x300px|centre]]&lt;br /&gt;
! [[File:Gas.png|thumb|gas|x300px|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:VACFvrsTS.png|x400px|thumb|VACF vrs Temperature|centre]]&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function for a 1D harmonic oscillator can be evaluated using the equation for a 1D harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiation of the displacement function will produce a velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx}{dt} = -A\omega\sin\left(\omega t + \phi\right) = v(t) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substitution into velocity autocorrelation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling -A\omega: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right)\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trigometric relation can simplify equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin\left(\omega t + \omega\tau + \phi\right) = cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Vapourphse.png|thumb|Vapour Phase|x300px|left]]&lt;br /&gt;
! [[File:Vapour phase 1 million.png|thumb|Vapour Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid(small).png|thumb|Solid Phase|x300px|left]]&lt;br /&gt;
! [[File:Solid1million.png|thumb|Solid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Liquidsmallno..png|thumb|Liquid Phase|x300px|left]]&lt;br /&gt;
! [[File:Liquid1millionatoms.png|thumb|Liquid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 1.64&lt;br /&gt;
| 1.63&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| -0.2215&lt;br /&gt;
| 0.157 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| 0.254&lt;br /&gt;
| -0.123&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Mark Klarpus, Gregory A. Petsko, (1990) &#039;&#039;Molecular Reaction Dynamics in Biology&#039;&#039;, &#039;&#039;&#039;347&#039;&#039;&#039;, 631-9, doi:10.1038/347631a0&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578469</id>
		<title>Rep:Thermomp4114</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578469"/>
		<updated>2017-01-26T21:55:59Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: /* Dynamical Properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Molecular Dynamics Simulations of Simple Liquids Introduction == &lt;br /&gt;
&lt;br /&gt;
Molecular dynamic simulations involved studying the motion of a system of particles. Several fundamental elements of a system need to be known in order to achieve this. This includes a knowledge of the interaction potential for the particles and the equations of motion which govern the dynamics of the particles.&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt; Once we know the positions, velocities, and forces, of the atoms (which are obtained using statistical) we can calculate various thermodynamic quantities of the system such as temperature and pressure. We must introduce a series of approximations in order for the caluculations to be feasible. Firstly we apply the &#039;&#039;&#039;The Classical Particle Approximation&#039;&#039;&#039;. The schoedinger equation is too complex to solve for a large system of atoms, however if the atoms are treated classically then the positions and and velocities of each can atom can be calculated using Newton&#039;s second law (equation 1): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = m_i \mathbf{a}_i = m_i \frac{\mathrm{d}\mathbf{v}_i}{\mathrm{d}t} = m_i \frac{\mathrm{d}^2 \mathbf{x}_i}{\mathrm{d}t^2} \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As there are N atoms and therefore N equations representing each atom a computer is a necessity. The &#039;&#039;&#039;Verlet algorithim&#039;&#039;&#039; is used to solve to Newton&#039;s law for all the atoms in the system. In this case time is not continuous but is made discrete, the simulation is thus broeken up into specific &#039;&#039;&#039;timesteps&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The position of atom &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;\mathbf{x}_i \left(t\right)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Positional Verlet algorithim (equation (2)): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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 \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Velocity Verlet algorithim (equation (3)):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{v}_i \left(t\right)&amp;lt;/math&amp;gt; represents the velocity of that atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;center&amp;gt;&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 \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Put in example of industrial applications&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Harmonic Oscillator ===&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator illustrates the the accuracy and discrepancies associated with using the velocity Verlet algorithim. Equation (4) is used to model the behavior of the harmonic oscillator in an analytical sense: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)\ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; = 1.00 &lt;br /&gt;
&lt;br /&gt;
Graph (1) illustrates the results the analytical solution gave for the relationship between position and time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Avrsxt2.png|x300px|thumb|Graph 1: Analytical solution of harmonic oscillator|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The difference in position between the velocity-verlet solution and analytical solution is represented by an error. Error plotted against time is illustrated by graph (2). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ErrorvrsT.png|x300px|thumb|Graph 2: Error vrs Time|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The orange line illustrates the positive trend between error and time. &#039;&#039;&#039;Insert Answer from demonstrator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy of the system will consist of the sum of kinetic and potential energy. Equation (5) can be used to find kinetic energy of the system:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;E_\text{k} =\tfrac{1}{2} mv(t)^2 \ \ (5)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\mathbf{x} \left(t\right)&amp;lt;/math&amp;gt; is used in equation (5) the potential energy can be found. &lt;br /&gt;
&lt;br /&gt;
The following graphs represent the difference in change in energy with time when the timestep is varied. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EvrsTime.png|x200px|thumb|Energy change when a timestep of 0.1 is used|left]]&lt;br /&gt;
! [[File:Energy vrs time for 0.15 timestep.png|x200px|thumb|Energy change when a timestep of 0.15 is used|centre]]&lt;br /&gt;
! [[File:Energy vrs time for 0.2 timestep.png|x200px|thumb|Energy change when a timestep of 0.2 is used|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The maximum change in energy for each of the different timesteps is shown in table (1). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | Timestep&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.1&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.15&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.2&lt;br /&gt;
|-&lt;br /&gt;
| Max. change in Energy&lt;br /&gt;
| 0.2%&lt;br /&gt;
| 0.6%&lt;br /&gt;
| 1%&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results clearly indicate that a timestep greater than &#039;&#039;&#039;0.2&#039;&#039;&#039; will result in an energy change greater than 1%. As the timestep increases as does the maximum error. The timestep defines the number of calculations made in a given time, therefore the shorter the timestep the larger the number of calculations carried out and therefore a more accurate result is produced. The total energy of a real physical system should not change, when modeled numerically there can be fluctuations therefore it is important to monitor this change and ensure that the fluctuations are minimised.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces ===&lt;br /&gt;
&lt;br /&gt;
The forces an atom experiences is determined by the positions of all the atoms in the system, &amp;lt;math&amp;gt;\mathbf{r}^N&amp;lt;/math&amp;gt;. The Lennard-Jones function accurately sums all the key inter-atomic forces an atoms experiences (U). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ (10)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
For a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After division by 4 and rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_0^{6}} = \frac{\sigma^{6}}{r_0^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After further rearrangement and cancelling down: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;-\sigma &amp;lt;/math&amp;gt; is also a solution however this can be disregarded. &lt;br /&gt;
&lt;br /&gt;
In order to calculate the force the following equation is used: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\sigma\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After differentiation and simplification: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}(r_0) =  \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &#039;&#039;&#039; ask demonstrator if thats too brief &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
At equilibrium: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{12\sigma^{12}}{r_e^{13}} - \frac{6\sigma^6}{r_e^7} \right)&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
After rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_e = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This value of &amp;lt;math&amp;gt; r_e &amp;lt;/math&amp;gt; can now be used to find the well depth:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{\sigma^{12}}{4sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon\left(\frac{1}{5r^{5}} - \frac{1}{11r^11} \right)^\infty_2 \simeq -2.48 \sdot 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -8.18 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -3.29 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Finish off atomic forces - enter integrals&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
* No. of moles in  1 mL of water = 0.056 &amp;lt;br&amp;gt; &lt;br /&gt;
* No. of molecules = moles x Avogadro&#039;s constant = 3.37 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*1000 molecules = 1.66 x 10&amp;lt;sup&amp;gt;21&amp;lt;/sup&amp;gt; moles&lt;br /&gt;
* Density = mass/vol. = 1 &lt;br /&gt;
*vol. = mass/density = 2.99 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Due to periodic boundary condition once the atom leaves the current box it will enter the beginning of an identical box. The atom is at &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; and thus once it breaches 0.5 in a particular direction it will be at the start of the next box. Using these principles after the atom moves &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will be at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units === &lt;br /&gt;
&lt;br /&gt;
Reduced units are applied to the Lennard-Jones equation to make the calculation more managable.&lt;br /&gt;
&lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For argon:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Distance in real units: r = 1.09 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Well depth = &amp;lt;math&amp;gt;{\epsilon}&amp;lt;/math&amp;gt; = 0.996 KJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* T = 180 K &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Do I need to show working out?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Equilibriation = &lt;br /&gt;
&lt;br /&gt;
=== Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
As there is a large number of atoms in a discrete volume allowing random assignment of positions could result in atoms overlapping. This would cause an unrealistically high potential as potential is distance dependant (as observed in the Lennard - Jones equation).&lt;br /&gt;
&lt;br /&gt;
* Density is given by the following equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{n}{v} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 1 (as there is only 1 atom per unit cell) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = 1.07722^3 = 1.25 &amp;lt;/math&amp;gt; (lattice spacing = 1.07722) &lt;br /&gt;
&lt;br /&gt;
Thus: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length of a side of one fcc unit cell with number density 1.2 would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = \frac{n}{\rho} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 4 (as there is 4 atoms per unit cell in an fcc lattice) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; = 3.33&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; l = v^{-3} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The number of atoms that would be created by the create_atoms command for an fcc lattice would be: &lt;br /&gt;
&lt;br /&gt;
4 x 1000 = 4000 &lt;br /&gt;
&lt;br /&gt;
This is due to fact that there is 1 atom per unit cell that yeilds 1000 altogether in simple cubic. Fcc has 4 times the number of atoms per unit cell. &lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of Atoms === &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command above has the following purpose: &lt;br /&gt;
&lt;br /&gt;
* The first line sets the mass of all atoms of type &#039;1&#039; to 1.0. &lt;br /&gt;
*  Line 2 is used to control the Lennard-Jones potential. The value of 3.0 indicates the distance in reduced units upon which the potential is calculated. The potential is distance dependent and falls to 0 at large values of r thus only atoms within a distance of 3.0 are considered.  &#039;lj/cut&#039; defines the cut off point. &lt;br /&gt;
* The last line defines the force field constants as 1.0 for all sets of atoms. The * controls the fact that the command is set for all atoms. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet is the integration algorithm that can be used when &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; are defined. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The codes is in place to ensure that the timestep can be varied but the total time taken for the simulation to run will not change.&lt;br /&gt;
&lt;br /&gt;
=== Checking equilibration === &lt;br /&gt;
&lt;br /&gt;
The graphs below illustrate the time it takes for different thermodynamic properties to equilibriate at a timestep of 0.001. The plateau represents the point at which equilibration is achieved. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EnergyVRStime.png|x300px|thumb|Energy Vrs Time|left]]&lt;br /&gt;
! [[File:TEMPvrsTIME.png|x300px|thumb|Temp vrs Time|centre]]&lt;br /&gt;
! [[File:Press Vrs Time.png|x300px|thumb|Pressure Vrs Time|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The graph below illustrates the effect changing the timestep has on equilibration. As can be seen from the graph a from below 0.01 a shorter timestep results in a lower energy value for equilibration until 0.0025 where the value   of equilibration does not change with lower timestep. This trend is due to the fact that a smaller timestep results in a more accurate result however if it is too small this can over-complicate the calculation (especially when there is a large over-all time). Thus a timestep of 0.0025 is ideal. A timestep of 0.025 is too large and results in the system not reaching equilibrium.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EnergyVtimeFORVTS.png|x400px|thumb|Energy Vrs Time with different timesteps|centre]]&lt;br /&gt;
&lt;br /&gt;
= Running Simulations Under Specific Conditions =&lt;br /&gt;
&lt;br /&gt;
The following two equations can be used to define the energy of the system: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The instantaneous tempertaure &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will not remain constant throughout the simulation and will fluctuate, it will thus be different to out target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The value of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2} = \frac{\mathfrak{T}}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within the preceding code: &lt;br /&gt;
&lt;br /&gt;
100 - Nevery: This command results in a sample being taken every 100 steps and being incorporated into the average. 1000 - Nrepreat: Tells the computer how many samples should be used to calculate the average. Nfreq 10 000: At every 10000th timestep an average is calculated. &lt;br /&gt;
&lt;br /&gt;
All thermodynamic properties are calculated by averages that is the necessity for those commands.&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equation of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:DENSITYvrsT.png|x400px|thumb|Density Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
= Calculating Heat Capacities Using Statistic Physics =&lt;br /&gt;
&lt;br /&gt;
Example of input code used: &lt;br /&gt;
&lt;br /&gt;
* Density 0.2&lt;br /&gt;
* Temperature 2.0 &lt;br /&gt;
&lt;br /&gt;
 variable density equal 0.2&lt;br /&gt;
 DEFINE SIMULATION BOX GEOMETRY &amp;lt;br&amp;gt; &lt;br /&gt;
lattice sc ${density} &amp;lt;br&amp;gt; &lt;br /&gt;
region box block 0 15 0 15 0 15 &amp;lt;br&amp;gt; &lt;br /&gt;
create_box 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
create_atoms 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
DEFINE PHYSICAL PROPERTIES OF ATOMS &amp;lt;br&amp;gt; &lt;br /&gt;
mass 1 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_style lj/cut/opt 3.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_coeff 1 1 1.0 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
neighbor 2.0 bin &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY THE REQUIRED THERMODYNAMIC STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable T equal 2.0 &amp;lt;br&amp;gt; &lt;br /&gt;
variable p equal 2.5 &amp;lt;br&amp;gt; &lt;br /&gt;
variable timestep equal 0.0025 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ASSIGN ATOMIC VELOCITIES &amp;lt;br&amp;gt; &lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
SPECIFY ENSEMBLE &amp;lt;br&amp;gt; &lt;br /&gt;
timestep ${timestep} &amp;lt;br&amp;gt; &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 THERMODYNAMIC OUTPUT CONTROL &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom time etotal temp press &amp;lt;br&amp;gt; &lt;br /&gt;
thermo 10 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RECORD TRAJECTORY &amp;lt;br&amp;gt; &lt;br /&gt;
dump traj all custom 1000 output-1 id x y z &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY TIMESTEP &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RUN SIMULATION TO MELT CRYSTAL &amp;lt;br&amp;gt; &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nve &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 BRING SYSTEM TO REQUIRED STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable tdamp equal ${timestep}*100 &amp;lt;br&amp;gt; &lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &amp;lt;br&amp;gt;  &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nvt &amp;lt;br&amp;gt;  &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 MEASURE SYSTEM STATE  &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom step atoms etotal temp press density &amp;lt;br&amp;gt; &lt;br /&gt;
variable atoms2 equal atoms*atoms &amp;lt;br&amp;gt;   &lt;br /&gt;
variable E equal etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable E2 equal etotal*etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens equal density &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens2 equal density*density &amp;lt;br&amp;gt;  &lt;br /&gt;
variable temp equal temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable temp2 equal temp*temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable press equal press &amp;lt;br&amp;gt; &lt;br /&gt;
variable press2 equal press*press &amp;lt;br&amp;gt; &lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_E2 v_E&lt;br /&gt;
run 100000 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
variable HC equal ${atoms2}*(f_aves[7] - f_aves[8]*f_aves[8])/f_aves[5] &amp;lt;br&amp;gt;  &lt;br /&gt;
variable avedens equal f_aves[1] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avetemp equal f_aves[2] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avepress equal f_aves[3] &amp;lt;br&amp;gt; &lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3]) &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;--------&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Temperature: ${temp}&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Heat capacity: ${HC}&amp;quot;  &amp;lt;br&amp;gt;  &lt;br /&gt;
print &amp;quot;atoms&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Structural Properties and the Radial Distribution function =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:G(r).png|x300px|thumb|RDF at different phases|left]]&lt;br /&gt;
! [[File:Integral.png|x300px|thumb|Integral of g(r)|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To carry out the RDF calculations temperature was kept constant at 1.2 but density was varied. &lt;br /&gt;
&lt;br /&gt;
Density in reduced units used for each phase: &lt;br /&gt;
&lt;br /&gt;
* Gas = 0.05&lt;br /&gt;
* Liquid = 0.8 &lt;br /&gt;
* Solid = 1.2&lt;br /&gt;
&lt;br /&gt;
The number of peaks for each RDF plot decreases in the order gas&amp;lt;liquid&amp;lt;solid. This reflects the ordering of each phase. &lt;br /&gt;
A gas has a large degree of disorder and thus produces only peak.&lt;br /&gt;
The liquid has three peaks which gradually decrease in amplitude, this behavior is due to the fact that the liquid is modeled as central molecule surrounded by shells of other molecules, this initially creates some degree of order. As the simulation continues the molecules become more diffuse so the ordering decreases and thus the amplitude of peaks decrease.&lt;br /&gt;
&lt;br /&gt;
= Dynamical Properties and the diffusion coefficient = &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid.png|thumb|solid|x300px|left]]&lt;br /&gt;
! [[File:Liquid.png|thumb|liquid|x300px|centre]]&lt;br /&gt;
! [[File:Gas.png|thumb|gas|x300px|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:VACFvrsTS.png|x400px|thumb|VACF vrs Temperature|centre]]&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function for a 1D harmonic oscillator can be evaluated using the equation for a 1D harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiation of the displacement function will produce a velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx}{dt} = -A\omega\sin\left(\omega t + \phi\right) = v(t) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int v(t + \tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substitution into velocity autocorrelation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling -A\omega: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right)\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trigometric relation can simplify equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin\left(\omega t + \omega\tau + \phi\right) = cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Vapourphse.png|thumb|Vapour Phase|x300px|left]]&lt;br /&gt;
! [[File:Vapour phase 1 million.png|thumb|Vapour Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid(small).png|thumb|Solid Phase|x300px|left]]&lt;br /&gt;
! [[File:Solid1million.png|thumb|Solid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Liquidsmallno..png|thumb|Liquid Phase|x300px|left]]&lt;br /&gt;
! [[File:Liquid1millionatoms.png|thumb|Liquid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 1.64&lt;br /&gt;
| 1.63&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| -0.2215&lt;br /&gt;
| 0.157 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| 0.254&lt;br /&gt;
| -0.123&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Mark Klarpus, Gregory A. Petsko, (1990) &#039;&#039;Molecular Reaction Dynamics in Biology&#039;&#039;, &#039;&#039;&#039;347&#039;&#039;&#039;, 631-9, doi:10.1038/347631a0&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578468</id>
		<title>Rep:Thermomp4114</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578468"/>
		<updated>2017-01-26T21:53:31Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: /* Dynamical Properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Molecular Dynamics Simulations of Simple Liquids Introduction == &lt;br /&gt;
&lt;br /&gt;
Molecular dynamic simulations involved studying the motion of a system of particles. Several fundamental elements of a system need to be known in order to achieve this. This includes a knowledge of the interaction potential for the particles and the equations of motion which govern the dynamics of the particles.&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt; Once we know the positions, velocities, and forces, of the atoms (which are obtained using statistical) we can calculate various thermodynamic quantities of the system such as temperature and pressure. We must introduce a series of approximations in order for the caluculations to be feasible. Firstly we apply the &#039;&#039;&#039;The Classical Particle Approximation&#039;&#039;&#039;. The schoedinger equation is too complex to solve for a large system of atoms, however if the atoms are treated classically then the positions and and velocities of each can atom can be calculated using Newton&#039;s second law (equation 1): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = m_i \mathbf{a}_i = m_i \frac{\mathrm{d}\mathbf{v}_i}{\mathrm{d}t} = m_i \frac{\mathrm{d}^2 \mathbf{x}_i}{\mathrm{d}t^2} \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As there are N atoms and therefore N equations representing each atom a computer is a necessity. The &#039;&#039;&#039;Verlet algorithim&#039;&#039;&#039; is used to solve to Newton&#039;s law for all the atoms in the system. In this case time is not continuous but is made discrete, the simulation is thus broeken up into specific &#039;&#039;&#039;timesteps&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The position of atom &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;\mathbf{x}_i \left(t\right)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Positional Verlet algorithim (equation (2)): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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 \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Velocity Verlet algorithim (equation (3)):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{v}_i \left(t\right)&amp;lt;/math&amp;gt; represents the velocity of that atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;center&amp;gt;&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 \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Put in example of industrial applications&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Harmonic Oscillator ===&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator illustrates the the accuracy and discrepancies associated with using the velocity Verlet algorithim. Equation (4) is used to model the behavior of the harmonic oscillator in an analytical sense: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)\ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; = 1.00 &lt;br /&gt;
&lt;br /&gt;
Graph (1) illustrates the results the analytical solution gave for the relationship between position and time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Avrsxt2.png|x300px|thumb|Graph 1: Analytical solution of harmonic oscillator|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The difference in position between the velocity-verlet solution and analytical solution is represented by an error. Error plotted against time is illustrated by graph (2). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ErrorvrsT.png|x300px|thumb|Graph 2: Error vrs Time|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The orange line illustrates the positive trend between error and time. &#039;&#039;&#039;Insert Answer from demonstrator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy of the system will consist of the sum of kinetic and potential energy. Equation (5) can be used to find kinetic energy of the system:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;E_\text{k} =\tfrac{1}{2} mv(t)^2 \ \ (5)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\mathbf{x} \left(t\right)&amp;lt;/math&amp;gt; is used in equation (5) the potential energy can be found. &lt;br /&gt;
&lt;br /&gt;
The following graphs represent the difference in change in energy with time when the timestep is varied. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EvrsTime.png|x200px|thumb|Energy change when a timestep of 0.1 is used|left]]&lt;br /&gt;
! [[File:Energy vrs time for 0.15 timestep.png|x200px|thumb|Energy change when a timestep of 0.15 is used|centre]]&lt;br /&gt;
! [[File:Energy vrs time for 0.2 timestep.png|x200px|thumb|Energy change when a timestep of 0.2 is used|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The maximum change in energy for each of the different timesteps is shown in table (1). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | Timestep&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.1&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.15&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.2&lt;br /&gt;
|-&lt;br /&gt;
| Max. change in Energy&lt;br /&gt;
| 0.2%&lt;br /&gt;
| 0.6%&lt;br /&gt;
| 1%&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results clearly indicate that a timestep greater than &#039;&#039;&#039;0.2&#039;&#039;&#039; will result in an energy change greater than 1%. As the timestep increases as does the maximum error. The timestep defines the number of calculations made in a given time, therefore the shorter the timestep the larger the number of calculations carried out and therefore a more accurate result is produced. The total energy of a real physical system should not change, when modeled numerically there can be fluctuations therefore it is important to monitor this change and ensure that the fluctuations are minimised.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces ===&lt;br /&gt;
&lt;br /&gt;
The forces an atom experiences is determined by the positions of all the atoms in the system, &amp;lt;math&amp;gt;\mathbf{r}^N&amp;lt;/math&amp;gt;. The Lennard-Jones function accurately sums all the key inter-atomic forces an atoms experiences (U). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ (10)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
For a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After division by 4 and rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_0^{6}} = \frac{\sigma^{6}}{r_0^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After further rearrangement and cancelling down: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;-\sigma &amp;lt;/math&amp;gt; is also a solution however this can be disregarded. &lt;br /&gt;
&lt;br /&gt;
In order to calculate the force the following equation is used: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\sigma\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After differentiation and simplification: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}(r_0) =  \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &#039;&#039;&#039; ask demonstrator if thats too brief &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
At equilibrium: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{12\sigma^{12}}{r_e^{13}} - \frac{6\sigma^6}{r_e^7} \right)&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
After rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_e = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This value of &amp;lt;math&amp;gt; r_e &amp;lt;/math&amp;gt; can now be used to find the well depth:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{\sigma^{12}}{4sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon\left(\frac{1}{5r^{5}} - \frac{1}{11r^11} \right)^\infty_2 \simeq -2.48 \sdot 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -8.18 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -3.29 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Finish off atomic forces - enter integrals&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
* No. of moles in  1 mL of water = 0.056 &amp;lt;br&amp;gt; &lt;br /&gt;
* No. of molecules = moles x Avogadro&#039;s constant = 3.37 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*1000 molecules = 1.66 x 10&amp;lt;sup&amp;gt;21&amp;lt;/sup&amp;gt; moles&lt;br /&gt;
* Density = mass/vol. = 1 &lt;br /&gt;
*vol. = mass/density = 2.99 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Due to periodic boundary condition once the atom leaves the current box it will enter the beginning of an identical box. The atom is at &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; and thus once it breaches 0.5 in a particular direction it will be at the start of the next box. Using these principles after the atom moves &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will be at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units === &lt;br /&gt;
&lt;br /&gt;
Reduced units are applied to the Lennard-Jones equation to make the calculation more managable.&lt;br /&gt;
&lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For argon:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Distance in real units: r = 1.09 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Well depth = &amp;lt;math&amp;gt;{\epsilon}&amp;lt;/math&amp;gt; = 0.996 KJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* T = 180 K &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Do I need to show working out?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Equilibriation = &lt;br /&gt;
&lt;br /&gt;
=== Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
As there is a large number of atoms in a discrete volume allowing random assignment of positions could result in atoms overlapping. This would cause an unrealistically high potential as potential is distance dependant (as observed in the Lennard - Jones equation).&lt;br /&gt;
&lt;br /&gt;
* Density is given by the following equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{n}{v} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 1 (as there is only 1 atom per unit cell) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = 1.07722^3 = 1.25 &amp;lt;/math&amp;gt; (lattice spacing = 1.07722) &lt;br /&gt;
&lt;br /&gt;
Thus: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length of a side of one fcc unit cell with number density 1.2 would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = \frac{n}{\rho} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 4 (as there is 4 atoms per unit cell in an fcc lattice) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; = 3.33&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; l = v^{-3} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The number of atoms that would be created by the create_atoms command for an fcc lattice would be: &lt;br /&gt;
&lt;br /&gt;
4 x 1000 = 4000 &lt;br /&gt;
&lt;br /&gt;
This is due to fact that there is 1 atom per unit cell that yeilds 1000 altogether in simple cubic. Fcc has 4 times the number of atoms per unit cell. &lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of Atoms === &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command above has the following purpose: &lt;br /&gt;
&lt;br /&gt;
* The first line sets the mass of all atoms of type &#039;1&#039; to 1.0. &lt;br /&gt;
*  Line 2 is used to control the Lennard-Jones potential. The value of 3.0 indicates the distance in reduced units upon which the potential is calculated. The potential is distance dependent and falls to 0 at large values of r thus only atoms within a distance of 3.0 are considered.  &#039;lj/cut&#039; defines the cut off point. &lt;br /&gt;
* The last line defines the force field constants as 1.0 for all sets of atoms. The * controls the fact that the command is set for all atoms. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet is the integration algorithm that can be used when &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; are defined. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The codes is in place to ensure that the timestep can be varied but the total time taken for the simulation to run will not change.&lt;br /&gt;
&lt;br /&gt;
=== Checking equilibration === &lt;br /&gt;
&lt;br /&gt;
The graphs below illustrate the time it takes for different thermodynamic properties to equilibriate at a timestep of 0.001. The plateau represents the point at which equilibration is achieved. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EnergyVRStime.png|x300px|thumb|Energy Vrs Time|left]]&lt;br /&gt;
! [[File:TEMPvrsTIME.png|x300px|thumb|Temp vrs Time|centre]]&lt;br /&gt;
! [[File:Press Vrs Time.png|x300px|thumb|Pressure Vrs Time|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The graph below illustrates the effect changing the timestep has on equilibration. As can be seen from the graph a from below 0.01 a shorter timestep results in a lower energy value for equilibration until 0.0025 where the value   of equilibration does not change with lower timestep. This trend is due to the fact that a smaller timestep results in a more accurate result however if it is too small this can over-complicate the calculation (especially when there is a large over-all time). Thus a timestep of 0.0025 is ideal. A timestep of 0.025 is too large and results in the system not reaching equilibrium.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EnergyVtimeFORVTS.png|x400px|thumb|Energy Vrs Time with different timesteps|centre]]&lt;br /&gt;
&lt;br /&gt;
= Running Simulations Under Specific Conditions =&lt;br /&gt;
&lt;br /&gt;
The following two equations can be used to define the energy of the system: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The instantaneous tempertaure &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will not remain constant throughout the simulation and will fluctuate, it will thus be different to out target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The value of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2} = \frac{\mathfrak{T}}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within the preceding code: &lt;br /&gt;
&lt;br /&gt;
100 - Nevery: This command results in a sample being taken every 100 steps and being incorporated into the average. 1000 - Nrepreat: Tells the computer how many samples should be used to calculate the average. Nfreq 10 000: At every 10000th timestep an average is calculated. &lt;br /&gt;
&lt;br /&gt;
All thermodynamic properties are calculated by averages that is the necessity for those commands.&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equation of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:DENSITYvrsT.png|x400px|thumb|Density Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
= Calculating Heat Capacities Using Statistic Physics =&lt;br /&gt;
&lt;br /&gt;
Example of input code used: &lt;br /&gt;
&lt;br /&gt;
* Density 0.2&lt;br /&gt;
* Temperature 2.0 &lt;br /&gt;
&lt;br /&gt;
 variable density equal 0.2&lt;br /&gt;
 DEFINE SIMULATION BOX GEOMETRY &amp;lt;br&amp;gt; &lt;br /&gt;
lattice sc ${density} &amp;lt;br&amp;gt; &lt;br /&gt;
region box block 0 15 0 15 0 15 &amp;lt;br&amp;gt; &lt;br /&gt;
create_box 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
create_atoms 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
DEFINE PHYSICAL PROPERTIES OF ATOMS &amp;lt;br&amp;gt; &lt;br /&gt;
mass 1 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_style lj/cut/opt 3.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_coeff 1 1 1.0 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
neighbor 2.0 bin &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY THE REQUIRED THERMODYNAMIC STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable T equal 2.0 &amp;lt;br&amp;gt; &lt;br /&gt;
variable p equal 2.5 &amp;lt;br&amp;gt; &lt;br /&gt;
variable timestep equal 0.0025 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ASSIGN ATOMIC VELOCITIES &amp;lt;br&amp;gt; &lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
SPECIFY ENSEMBLE &amp;lt;br&amp;gt; &lt;br /&gt;
timestep ${timestep} &amp;lt;br&amp;gt; &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 THERMODYNAMIC OUTPUT CONTROL &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom time etotal temp press &amp;lt;br&amp;gt; &lt;br /&gt;
thermo 10 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RECORD TRAJECTORY &amp;lt;br&amp;gt; &lt;br /&gt;
dump traj all custom 1000 output-1 id x y z &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY TIMESTEP &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RUN SIMULATION TO MELT CRYSTAL &amp;lt;br&amp;gt; &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nve &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 BRING SYSTEM TO REQUIRED STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable tdamp equal ${timestep}*100 &amp;lt;br&amp;gt; &lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &amp;lt;br&amp;gt;  &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nvt &amp;lt;br&amp;gt;  &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 MEASURE SYSTEM STATE  &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom step atoms etotal temp press density &amp;lt;br&amp;gt; &lt;br /&gt;
variable atoms2 equal atoms*atoms &amp;lt;br&amp;gt;   &lt;br /&gt;
variable E equal etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable E2 equal etotal*etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens equal density &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens2 equal density*density &amp;lt;br&amp;gt;  &lt;br /&gt;
variable temp equal temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable temp2 equal temp*temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable press equal press &amp;lt;br&amp;gt; &lt;br /&gt;
variable press2 equal press*press &amp;lt;br&amp;gt; &lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_E2 v_E&lt;br /&gt;
run 100000 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
variable HC equal ${atoms2}*(f_aves[7] - f_aves[8]*f_aves[8])/f_aves[5] &amp;lt;br&amp;gt;  &lt;br /&gt;
variable avedens equal f_aves[1] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avetemp equal f_aves[2] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avepress equal f_aves[3] &amp;lt;br&amp;gt; &lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3]) &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;--------&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Temperature: ${temp}&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Heat capacity: ${HC}&amp;quot;  &amp;lt;br&amp;gt;  &lt;br /&gt;
print &amp;quot;atoms&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Structural Properties and the Radial Distribution function =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:G(r).png|x300px|thumb|RDF at different phases|left]]&lt;br /&gt;
! [[File:Integral.png|x300px|thumb|Integral of g(r)|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To carry out the RDF calculations temperature was kept constant at 1.2 but density was varied. &lt;br /&gt;
&lt;br /&gt;
Density in reduced units used for each phase: &lt;br /&gt;
&lt;br /&gt;
* Gas = 0.05&lt;br /&gt;
* Liquid = 0.8 &lt;br /&gt;
* Solid = 1.2&lt;br /&gt;
&lt;br /&gt;
The number of peaks for each RDF plot decreases in the order gas&amp;lt;liquid&amp;lt;solid. This reflects the ordering of each phase. &lt;br /&gt;
A gas has a large degree of disorder and thus produces only peak.&lt;br /&gt;
The liquid has three peaks which gradually decrease in amplitude, this behavior is due to the fact that the liquid is modeled as central molecule surrounded by shells of other molecules, this initially creates some degree of order. As the simulation continues the molecules become more diffuse so the ordering decreases and thus the amplitude of peaks decrease.&lt;br /&gt;
&lt;br /&gt;
= Dynamical Properties and the diffusion coefficient = &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid.png|thumb|solid|x300px|left]]&lt;br /&gt;
! [[File:Liquid.png|thumb|liquid|x300px|centre]]&lt;br /&gt;
! [[File:Gas.png|thumb|gas|x300px|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:VACFvrsTS.png|x400px|thumb|VACF vrs Temperature|centre]]&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function for a 1D harmonic oscillator can be evaluated using the equation for a 1D harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiation of the displacement function will produce a velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx}{dt} = -A\omega\sin\left(\omega t + \phi\right) = v(t) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int v(t + \tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substitution into velocity autocorrelation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling -A\omega: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right)\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trigometric relation can simplify equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin\left(\omega t + \omega\tau + \phi\right) = cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Vapourphse.png|thumb|Vapour Phase|x300px|left]]&lt;br /&gt;
! [[File:Vapour phase 1 million.png|thumb|Vapour Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid(small).png|thumb|Solid Phase|x300px|left]]&lt;br /&gt;
! [[File:Solid1million.png|thumb|Solid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Liquidsmallno..png|thumb|Liquid Phase|x300px|left]]&lt;br /&gt;
! [[File:Liquid1millionatoms.png|thumb|Liquid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 1.64&lt;br /&gt;
| 1.63&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| -0.2215&lt;br /&gt;
| 0.157 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| 0.254&lt;br /&gt;
| -0.123&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Mark Klarpus, Gregory A. Petsko, (1990) &#039;&#039;Molecular Reaction Dynamics in Biology&#039;&#039;, &#039;&#039;&#039;347&#039;&#039;&#039;, 631-9, doi:10.1038/347631a0&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578466</id>
		<title>Rep:Thermomp4114</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578466"/>
		<updated>2017-01-26T21:47:17Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: /* Dynamical Properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Molecular Dynamics Simulations of Simple Liquids Introduction == &lt;br /&gt;
&lt;br /&gt;
Molecular dynamic simulations involved studying the motion of a system of particles. Several fundamental elements of a system need to be known in order to achieve this. This includes a knowledge of the interaction potential for the particles and the equations of motion which govern the dynamics of the particles.&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt; Once we know the positions, velocities, and forces, of the atoms (which are obtained using statistical) we can calculate various thermodynamic quantities of the system such as temperature and pressure. We must introduce a series of approximations in order for the caluculations to be feasible. Firstly we apply the &#039;&#039;&#039;The Classical Particle Approximation&#039;&#039;&#039;. The schoedinger equation is too complex to solve for a large system of atoms, however if the atoms are treated classically then the positions and and velocities of each can atom can be calculated using Newton&#039;s second law (equation 1): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = m_i \mathbf{a}_i = m_i \frac{\mathrm{d}\mathbf{v}_i}{\mathrm{d}t} = m_i \frac{\mathrm{d}^2 \mathbf{x}_i}{\mathrm{d}t^2} \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As there are N atoms and therefore N equations representing each atom a computer is a necessity. The &#039;&#039;&#039;Verlet algorithim&#039;&#039;&#039; is used to solve to Newton&#039;s law for all the atoms in the system. In this case time is not continuous but is made discrete, the simulation is thus broeken up into specific &#039;&#039;&#039;timesteps&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The position of atom &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;\mathbf{x}_i \left(t\right)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Positional Verlet algorithim (equation (2)): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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 \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Velocity Verlet algorithim (equation (3)):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{v}_i \left(t\right)&amp;lt;/math&amp;gt; represents the velocity of that atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;center&amp;gt;&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 \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Put in example of industrial applications&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Harmonic Oscillator ===&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator illustrates the the accuracy and discrepancies associated with using the velocity Verlet algorithim. Equation (4) is used to model the behavior of the harmonic oscillator in an analytical sense: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)\ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; = 1.00 &lt;br /&gt;
&lt;br /&gt;
Graph (1) illustrates the results the analytical solution gave for the relationship between position and time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Avrsxt2.png|x300px|thumb|Graph 1: Analytical solution of harmonic oscillator|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The difference in position between the velocity-verlet solution and analytical solution is represented by an error. Error plotted against time is illustrated by graph (2). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ErrorvrsT.png|x300px|thumb|Graph 2: Error vrs Time|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The orange line illustrates the positive trend between error and time. &#039;&#039;&#039;Insert Answer from demonstrator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy of the system will consist of the sum of kinetic and potential energy. Equation (5) can be used to find kinetic energy of the system:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;E_\text{k} =\tfrac{1}{2} mv(t)^2 \ \ (5)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\mathbf{x} \left(t\right)&amp;lt;/math&amp;gt; is used in equation (5) the potential energy can be found. &lt;br /&gt;
&lt;br /&gt;
The following graphs represent the difference in change in energy with time when the timestep is varied. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EvrsTime.png|x200px|thumb|Energy change when a timestep of 0.1 is used|left]]&lt;br /&gt;
! [[File:Energy vrs time for 0.15 timestep.png|x200px|thumb|Energy change when a timestep of 0.15 is used|centre]]&lt;br /&gt;
! [[File:Energy vrs time for 0.2 timestep.png|x200px|thumb|Energy change when a timestep of 0.2 is used|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The maximum change in energy for each of the different timesteps is shown in table (1). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | Timestep&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.1&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.15&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.2&lt;br /&gt;
|-&lt;br /&gt;
| Max. change in Energy&lt;br /&gt;
| 0.2%&lt;br /&gt;
| 0.6%&lt;br /&gt;
| 1%&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results clearly indicate that a timestep greater than &#039;&#039;&#039;0.2&#039;&#039;&#039; will result in an energy change greater than 1%. As the timestep increases as does the maximum error. The timestep defines the number of calculations made in a given time, therefore the shorter the timestep the larger the number of calculations carried out and therefore a more accurate result is produced. The total energy of a real physical system should not change, when modeled numerically there can be fluctuations therefore it is important to monitor this change and ensure that the fluctuations are minimised.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces ===&lt;br /&gt;
&lt;br /&gt;
The forces an atom experiences is determined by the positions of all the atoms in the system, &amp;lt;math&amp;gt;\mathbf{r}^N&amp;lt;/math&amp;gt;. The Lennard-Jones function accurately sums all the key inter-atomic forces an atoms experiences (U). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ (10)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
For a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After division by 4 and rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_0^{6}} = \frac{\sigma^{6}}{r_0^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After further rearrangement and cancelling down: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;-\sigma &amp;lt;/math&amp;gt; is also a solution however this can be disregarded. &lt;br /&gt;
&lt;br /&gt;
In order to calculate the force the following equation is used: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\sigma\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After differentiation and simplification: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}(r_0) =  \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &#039;&#039;&#039; ask demonstrator if thats too brief &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
At equilibrium: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{12\sigma^{12}}{r_e^{13}} - \frac{6\sigma^6}{r_e^7} \right)&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
After rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_e = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This value of &amp;lt;math&amp;gt; r_e &amp;lt;/math&amp;gt; can now be used to find the well depth:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{\sigma^{12}}{4sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon\left(\frac{1}{5r^{5}} - \frac{1}{11r^11} \right)^\infty_2 \simeq -2.48 \sdot 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -8.18 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -3.29 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Finish off atomic forces - enter integrals&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
* No. of moles in  1 mL of water = 0.056 &amp;lt;br&amp;gt; &lt;br /&gt;
* No. of molecules = moles x Avogadro&#039;s constant = 3.37 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*1000 molecules = 1.66 x 10&amp;lt;sup&amp;gt;21&amp;lt;/sup&amp;gt; moles&lt;br /&gt;
* Density = mass/vol. = 1 &lt;br /&gt;
*vol. = mass/density = 2.99 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Due to periodic boundary condition once the atom leaves the current box it will enter the beginning of an identical box. The atom is at &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; and thus once it breaches 0.5 in a particular direction it will be at the start of the next box. Using these principles after the atom moves &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will be at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units === &lt;br /&gt;
&lt;br /&gt;
Reduced units are applied to the Lennard-Jones equation to make the calculation more managable.&lt;br /&gt;
&lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For argon:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Distance in real units: r = 1.09 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Well depth = &amp;lt;math&amp;gt;{\epsilon}&amp;lt;/math&amp;gt; = 0.996 KJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* T = 180 K &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Do I need to show working out?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Equilibriation = &lt;br /&gt;
&lt;br /&gt;
=== Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
As there is a large number of atoms in a discrete volume allowing random assignment of positions could result in atoms overlapping. This would cause an unrealistically high potential as potential is distance dependant (as observed in the Lennard - Jones equation).&lt;br /&gt;
&lt;br /&gt;
* Density is given by the following equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{n}{v} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 1 (as there is only 1 atom per unit cell) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = 1.07722^3 = 1.25 &amp;lt;/math&amp;gt; (lattice spacing = 1.07722) &lt;br /&gt;
&lt;br /&gt;
Thus: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length of a side of one fcc unit cell with number density 1.2 would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = \frac{n}{\rho} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 4 (as there is 4 atoms per unit cell in an fcc lattice) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; = 3.33&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; l = v^{-3} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The number of atoms that would be created by the create_atoms command for an fcc lattice would be: &lt;br /&gt;
&lt;br /&gt;
4 x 1000 = 4000 &lt;br /&gt;
&lt;br /&gt;
This is due to fact that there is 1 atom per unit cell that yeilds 1000 altogether in simple cubic. Fcc has 4 times the number of atoms per unit cell. &lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of Atoms === &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command above has the following purpose: &lt;br /&gt;
&lt;br /&gt;
* The first line sets the mass of all atoms of type &#039;1&#039; to 1.0. &lt;br /&gt;
*  Line 2 is used to control the Lennard-Jones potential. The value of 3.0 indicates the distance in reduced units upon which the potential is calculated. The potential is distance dependent and falls to 0 at large values of r thus only atoms within a distance of 3.0 are considered.  &#039;lj/cut&#039; defines the cut off point. &lt;br /&gt;
* The last line defines the force field constants as 1.0 for all sets of atoms. The * controls the fact that the command is set for all atoms. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet is the integration algorithm that can be used when &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; are defined. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The codes is in place to ensure that the timestep can be varied but the total time taken for the simulation to run will not change.&lt;br /&gt;
&lt;br /&gt;
=== Checking equilibration === &lt;br /&gt;
&lt;br /&gt;
The graphs below illustrate the time it takes for different thermodynamic properties to equilibriate at a timestep of 0.001. The plateau represents the point at which equilibration is achieved. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EnergyVRStime.png|x300px|thumb|Energy Vrs Time|left]]&lt;br /&gt;
! [[File:TEMPvrsTIME.png|x300px|thumb|Temp vrs Time|centre]]&lt;br /&gt;
! [[File:Press Vrs Time.png|x300px|thumb|Pressure Vrs Time|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The graph below illustrates the effect changing the timestep has on equilibration. As can be seen from the graph a from below 0.01 a shorter timestep results in a lower energy value for equilibration until 0.0025 where the value   of equilibration does not change with lower timestep. This trend is due to the fact that a smaller timestep results in a more accurate result however if it is too small this can over-complicate the calculation (especially when there is a large over-all time). Thus a timestep of 0.0025 is ideal. A timestep of 0.025 is too large and results in the system not reaching equilibrium.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EnergyVtimeFORVTS.png|x400px|thumb|Energy Vrs Time with different timesteps|centre]]&lt;br /&gt;
&lt;br /&gt;
= Running Simulations Under Specific Conditions =&lt;br /&gt;
&lt;br /&gt;
The following two equations can be used to define the energy of the system: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The instantaneous tempertaure &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will not remain constant throughout the simulation and will fluctuate, it will thus be different to out target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The value of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2} = \frac{\mathfrak{T}}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within the preceding code: &lt;br /&gt;
&lt;br /&gt;
100 - Nevery: This command results in a sample being taken every 100 steps and being incorporated into the average. 1000 - Nrepreat: Tells the computer how many samples should be used to calculate the average. Nfreq 10 000: At every 10000th timestep an average is calculated. &lt;br /&gt;
&lt;br /&gt;
All thermodynamic properties are calculated by averages that is the necessity for those commands.&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equation of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:DENSITYvrsT.png|x400px|thumb|Density Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
= Calculating Heat Capacities Using Statistic Physics =&lt;br /&gt;
&lt;br /&gt;
Example of input code used: &lt;br /&gt;
&lt;br /&gt;
* Density 0.2&lt;br /&gt;
* Temperature 2.0 &lt;br /&gt;
&lt;br /&gt;
 variable density equal 0.2&lt;br /&gt;
 DEFINE SIMULATION BOX GEOMETRY &amp;lt;br&amp;gt; &lt;br /&gt;
lattice sc ${density} &amp;lt;br&amp;gt; &lt;br /&gt;
region box block 0 15 0 15 0 15 &amp;lt;br&amp;gt; &lt;br /&gt;
create_box 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
create_atoms 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
DEFINE PHYSICAL PROPERTIES OF ATOMS &amp;lt;br&amp;gt; &lt;br /&gt;
mass 1 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_style lj/cut/opt 3.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_coeff 1 1 1.0 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
neighbor 2.0 bin &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY THE REQUIRED THERMODYNAMIC STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable T equal 2.0 &amp;lt;br&amp;gt; &lt;br /&gt;
variable p equal 2.5 &amp;lt;br&amp;gt; &lt;br /&gt;
variable timestep equal 0.0025 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ASSIGN ATOMIC VELOCITIES &amp;lt;br&amp;gt; &lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
SPECIFY ENSEMBLE &amp;lt;br&amp;gt; &lt;br /&gt;
timestep ${timestep} &amp;lt;br&amp;gt; &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 THERMODYNAMIC OUTPUT CONTROL &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom time etotal temp press &amp;lt;br&amp;gt; &lt;br /&gt;
thermo 10 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RECORD TRAJECTORY &amp;lt;br&amp;gt; &lt;br /&gt;
dump traj all custom 1000 output-1 id x y z &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY TIMESTEP &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RUN SIMULATION TO MELT CRYSTAL &amp;lt;br&amp;gt; &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nve &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 BRING SYSTEM TO REQUIRED STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable tdamp equal ${timestep}*100 &amp;lt;br&amp;gt; &lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &amp;lt;br&amp;gt;  &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nvt &amp;lt;br&amp;gt;  &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 MEASURE SYSTEM STATE  &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom step atoms etotal temp press density &amp;lt;br&amp;gt; &lt;br /&gt;
variable atoms2 equal atoms*atoms &amp;lt;br&amp;gt;   &lt;br /&gt;
variable E equal etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable E2 equal etotal*etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens equal density &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens2 equal density*density &amp;lt;br&amp;gt;  &lt;br /&gt;
variable temp equal temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable temp2 equal temp*temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable press equal press &amp;lt;br&amp;gt; &lt;br /&gt;
variable press2 equal press*press &amp;lt;br&amp;gt; &lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_E2 v_E&lt;br /&gt;
run 100000 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
variable HC equal ${atoms2}*(f_aves[7] - f_aves[8]*f_aves[8])/f_aves[5] &amp;lt;br&amp;gt;  &lt;br /&gt;
variable avedens equal f_aves[1] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avetemp equal f_aves[2] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avepress equal f_aves[3] &amp;lt;br&amp;gt; &lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3]) &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;--------&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Temperature: ${temp}&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Heat capacity: ${HC}&amp;quot;  &amp;lt;br&amp;gt;  &lt;br /&gt;
print &amp;quot;atoms&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Structural Properties and the Radial Distribution function =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:G(r).png|x300px|thumb|RDF at different phases|left]]&lt;br /&gt;
! [[File:Integral.png|x300px|thumb|Integral of g(r)|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To carry out the RDF calculations temperature was kept constant at 1.2 but density was varied. &lt;br /&gt;
&lt;br /&gt;
Density in reduced units used for each phase: &lt;br /&gt;
&lt;br /&gt;
* Gas = 0.05&lt;br /&gt;
* Liquid = 0.8 &lt;br /&gt;
* Solid = 1.2&lt;br /&gt;
&lt;br /&gt;
The number of peaks for each RDF plot decreases in the order gas&amp;lt;liquid&amp;lt;solid. This reflects the ordering of each phase. &lt;br /&gt;
A gas has a large degree of disorder and thus produces only peak.&lt;br /&gt;
The liquid has three peaks which gradually decrease in amplitude, this behavior is due to the fact that the liquid is modeled as central molecule surrounded by shells of other molecules, this initially creates some degree of order. As the simulation continues the molecules become more diffuse so the ordering decreases and thus the amplitude of peaks decrease.&lt;br /&gt;
&lt;br /&gt;
= Dynamical Properties and the diffusion coefficient = &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid.png|thumb|solid|x300px|left]]&lt;br /&gt;
! [[File:Liquid.png|thumb|liquid|x300px|centre]]&lt;br /&gt;
! [[File:Gas.png|thumb|gas|x300px|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:VACFvrsTS.png|x400px|thumb|VACF vrs Temperature|centre]]&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function for a 1D harmonic oscillator can be evaluated using the equation for a 1D harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiation of the displacement function will produce a velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx}{dt} = -A\omega\sin\left(\omega t + \phi\right) = v(t) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int v(t + \tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substitution into velocity autocorrelation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling -A: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \omega\sin\left(\omega t + \phi\right)\omega\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \omega\sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Vapourphse.png|thumb|Vapour Phase|x300px|left]]&lt;br /&gt;
! [[File:Vapour phase 1 million.png|thumb|Vapour Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid(small).png|thumb|Solid Phase|x300px|left]]&lt;br /&gt;
! [[File:Solid1million.png|thumb|Solid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Liquidsmallno..png|thumb|Liquid Phase|x300px|left]]&lt;br /&gt;
! [[File:Liquid1millionatoms.png|thumb|Liquid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 1.64&lt;br /&gt;
| 1.63&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| -0.2215&lt;br /&gt;
| 0.157 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| 0.254&lt;br /&gt;
| -0.123&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Mark Klarpus, Gregory A. Petsko, (1990) &#039;&#039;Molecular Reaction Dynamics in Biology&#039;&#039;, &#039;&#039;&#039;347&#039;&#039;&#039;, 631-9, doi:10.1038/347631a0&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578464</id>
		<title>Rep:Thermomp4114</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578464"/>
		<updated>2017-01-26T21:45:25Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: /* Dynamical Properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Molecular Dynamics Simulations of Simple Liquids Introduction == &lt;br /&gt;
&lt;br /&gt;
Molecular dynamic simulations involved studying the motion of a system of particles. Several fundamental elements of a system need to be known in order to achieve this. This includes a knowledge of the interaction potential for the particles and the equations of motion which govern the dynamics of the particles.&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt; Once we know the positions, velocities, and forces, of the atoms (which are obtained using statistical) we can calculate various thermodynamic quantities of the system such as temperature and pressure. We must introduce a series of approximations in order for the caluculations to be feasible. Firstly we apply the &#039;&#039;&#039;The Classical Particle Approximation&#039;&#039;&#039;. The schoedinger equation is too complex to solve for a large system of atoms, however if the atoms are treated classically then the positions and and velocities of each can atom can be calculated using Newton&#039;s second law (equation 1): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = m_i \mathbf{a}_i = m_i \frac{\mathrm{d}\mathbf{v}_i}{\mathrm{d}t} = m_i \frac{\mathrm{d}^2 \mathbf{x}_i}{\mathrm{d}t^2} \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As there are N atoms and therefore N equations representing each atom a computer is a necessity. The &#039;&#039;&#039;Verlet algorithim&#039;&#039;&#039; is used to solve to Newton&#039;s law for all the atoms in the system. In this case time is not continuous but is made discrete, the simulation is thus broeken up into specific &#039;&#039;&#039;timesteps&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The position of atom &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;\mathbf{x}_i \left(t\right)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Positional Verlet algorithim (equation (2)): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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 \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Velocity Verlet algorithim (equation (3)):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{v}_i \left(t\right)&amp;lt;/math&amp;gt; represents the velocity of that atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;center&amp;gt;&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 \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Put in example of industrial applications&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Harmonic Oscillator ===&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator illustrates the the accuracy and discrepancies associated with using the velocity Verlet algorithim. Equation (4) is used to model the behavior of the harmonic oscillator in an analytical sense: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)\ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; = 1.00 &lt;br /&gt;
&lt;br /&gt;
Graph (1) illustrates the results the analytical solution gave for the relationship between position and time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Avrsxt2.png|x300px|thumb|Graph 1: Analytical solution of harmonic oscillator|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The difference in position between the velocity-verlet solution and analytical solution is represented by an error. Error plotted against time is illustrated by graph (2). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ErrorvrsT.png|x300px|thumb|Graph 2: Error vrs Time|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The orange line illustrates the positive trend between error and time. &#039;&#039;&#039;Insert Answer from demonstrator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy of the system will consist of the sum of kinetic and potential energy. Equation (5) can be used to find kinetic energy of the system:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;E_\text{k} =\tfrac{1}{2} mv(t)^2 \ \ (5)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\mathbf{x} \left(t\right)&amp;lt;/math&amp;gt; is used in equation (5) the potential energy can be found. &lt;br /&gt;
&lt;br /&gt;
The following graphs represent the difference in change in energy with time when the timestep is varied. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EvrsTime.png|x200px|thumb|Energy change when a timestep of 0.1 is used|left]]&lt;br /&gt;
! [[File:Energy vrs time for 0.15 timestep.png|x200px|thumb|Energy change when a timestep of 0.15 is used|centre]]&lt;br /&gt;
! [[File:Energy vrs time for 0.2 timestep.png|x200px|thumb|Energy change when a timestep of 0.2 is used|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The maximum change in energy for each of the different timesteps is shown in table (1). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | Timestep&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.1&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.15&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.2&lt;br /&gt;
|-&lt;br /&gt;
| Max. change in Energy&lt;br /&gt;
| 0.2%&lt;br /&gt;
| 0.6%&lt;br /&gt;
| 1%&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results clearly indicate that a timestep greater than &#039;&#039;&#039;0.2&#039;&#039;&#039; will result in an energy change greater than 1%. As the timestep increases as does the maximum error. The timestep defines the number of calculations made in a given time, therefore the shorter the timestep the larger the number of calculations carried out and therefore a more accurate result is produced. The total energy of a real physical system should not change, when modeled numerically there can be fluctuations therefore it is important to monitor this change and ensure that the fluctuations are minimised.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces ===&lt;br /&gt;
&lt;br /&gt;
The forces an atom experiences is determined by the positions of all the atoms in the system, &amp;lt;math&amp;gt;\mathbf{r}^N&amp;lt;/math&amp;gt;. The Lennard-Jones function accurately sums all the key inter-atomic forces an atoms experiences (U). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ (10)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
For a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After division by 4 and rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_0^{6}} = \frac{\sigma^{6}}{r_0^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After further rearrangement and cancelling down: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;-\sigma &amp;lt;/math&amp;gt; is also a solution however this can be disregarded. &lt;br /&gt;
&lt;br /&gt;
In order to calculate the force the following equation is used: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\sigma\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After differentiation and simplification: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}(r_0) =  \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &#039;&#039;&#039; ask demonstrator if thats too brief &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
At equilibrium: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{12\sigma^{12}}{r_e^{13}} - \frac{6\sigma^6}{r_e^7} \right)&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
After rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_e = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This value of &amp;lt;math&amp;gt; r_e &amp;lt;/math&amp;gt; can now be used to find the well depth:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{\sigma^{12}}{4sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon\left(\frac{1}{5r^{5}} - \frac{1}{11r^11} \right)^\infty_2 \simeq -2.48 \sdot 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -8.18 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -3.29 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Finish off atomic forces - enter integrals&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
* No. of moles in  1 mL of water = 0.056 &amp;lt;br&amp;gt; &lt;br /&gt;
* No. of molecules = moles x Avogadro&#039;s constant = 3.37 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*1000 molecules = 1.66 x 10&amp;lt;sup&amp;gt;21&amp;lt;/sup&amp;gt; moles&lt;br /&gt;
* Density = mass/vol. = 1 &lt;br /&gt;
*vol. = mass/density = 2.99 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Due to periodic boundary condition once the atom leaves the current box it will enter the beginning of an identical box. The atom is at &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; and thus once it breaches 0.5 in a particular direction it will be at the start of the next box. Using these principles after the atom moves &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will be at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units === &lt;br /&gt;
&lt;br /&gt;
Reduced units are applied to the Lennard-Jones equation to make the calculation more managable.&lt;br /&gt;
&lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For argon:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Distance in real units: r = 1.09 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Well depth = &amp;lt;math&amp;gt;{\epsilon}&amp;lt;/math&amp;gt; = 0.996 KJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* T = 180 K &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Do I need to show working out?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Equilibriation = &lt;br /&gt;
&lt;br /&gt;
=== Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
As there is a large number of atoms in a discrete volume allowing random assignment of positions could result in atoms overlapping. This would cause an unrealistically high potential as potential is distance dependant (as observed in the Lennard - Jones equation).&lt;br /&gt;
&lt;br /&gt;
* Density is given by the following equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{n}{v} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 1 (as there is only 1 atom per unit cell) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = 1.07722^3 = 1.25 &amp;lt;/math&amp;gt; (lattice spacing = 1.07722) &lt;br /&gt;
&lt;br /&gt;
Thus: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length of a side of one fcc unit cell with number density 1.2 would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = \frac{n}{\rho} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 4 (as there is 4 atoms per unit cell in an fcc lattice) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; = 3.33&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; l = v^{-3} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The number of atoms that would be created by the create_atoms command for an fcc lattice would be: &lt;br /&gt;
&lt;br /&gt;
4 x 1000 = 4000 &lt;br /&gt;
&lt;br /&gt;
This is due to fact that there is 1 atom per unit cell that yeilds 1000 altogether in simple cubic. Fcc has 4 times the number of atoms per unit cell. &lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of Atoms === &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command above has the following purpose: &lt;br /&gt;
&lt;br /&gt;
* The first line sets the mass of all atoms of type &#039;1&#039; to 1.0. &lt;br /&gt;
*  Line 2 is used to control the Lennard-Jones potential. The value of 3.0 indicates the distance in reduced units upon which the potential is calculated. The potential is distance dependent and falls to 0 at large values of r thus only atoms within a distance of 3.0 are considered.  &#039;lj/cut&#039; defines the cut off point. &lt;br /&gt;
* The last line defines the force field constants as 1.0 for all sets of atoms. The * controls the fact that the command is set for all atoms. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet is the integration algorithm that can be used when &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; are defined. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The codes is in place to ensure that the timestep can be varied but the total time taken for the simulation to run will not change.&lt;br /&gt;
&lt;br /&gt;
=== Checking equilibration === &lt;br /&gt;
&lt;br /&gt;
The graphs below illustrate the time it takes for different thermodynamic properties to equilibriate at a timestep of 0.001. The plateau represents the point at which equilibration is achieved. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EnergyVRStime.png|x300px|thumb|Energy Vrs Time|left]]&lt;br /&gt;
! [[File:TEMPvrsTIME.png|x300px|thumb|Temp vrs Time|centre]]&lt;br /&gt;
! [[File:Press Vrs Time.png|x300px|thumb|Pressure Vrs Time|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The graph below illustrates the effect changing the timestep has on equilibration. As can be seen from the graph a from below 0.01 a shorter timestep results in a lower energy value for equilibration until 0.0025 where the value   of equilibration does not change with lower timestep. This trend is due to the fact that a smaller timestep results in a more accurate result however if it is too small this can over-complicate the calculation (especially when there is a large over-all time). Thus a timestep of 0.0025 is ideal. A timestep of 0.025 is too large and results in the system not reaching equilibrium.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EnergyVtimeFORVTS.png|x400px|thumb|Energy Vrs Time with different timesteps|centre]]&lt;br /&gt;
&lt;br /&gt;
= Running Simulations Under Specific Conditions =&lt;br /&gt;
&lt;br /&gt;
The following two equations can be used to define the energy of the system: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The instantaneous tempertaure &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will not remain constant throughout the simulation and will fluctuate, it will thus be different to out target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The value of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2} = \frac{\mathfrak{T}}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within the preceding code: &lt;br /&gt;
&lt;br /&gt;
100 - Nevery: This command results in a sample being taken every 100 steps and being incorporated into the average. 1000 - Nrepreat: Tells the computer how many samples should be used to calculate the average. Nfreq 10 000: At every 10000th timestep an average is calculated. &lt;br /&gt;
&lt;br /&gt;
All thermodynamic properties are calculated by averages that is the necessity for those commands.&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equation of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:DENSITYvrsT.png|x400px|thumb|Density Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
= Calculating Heat Capacities Using Statistic Physics =&lt;br /&gt;
&lt;br /&gt;
Example of input code used: &lt;br /&gt;
&lt;br /&gt;
* Density 0.2&lt;br /&gt;
* Temperature 2.0 &lt;br /&gt;
&lt;br /&gt;
 variable density equal 0.2&lt;br /&gt;
 DEFINE SIMULATION BOX GEOMETRY &amp;lt;br&amp;gt; &lt;br /&gt;
lattice sc ${density} &amp;lt;br&amp;gt; &lt;br /&gt;
region box block 0 15 0 15 0 15 &amp;lt;br&amp;gt; &lt;br /&gt;
create_box 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
create_atoms 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
DEFINE PHYSICAL PROPERTIES OF ATOMS &amp;lt;br&amp;gt; &lt;br /&gt;
mass 1 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_style lj/cut/opt 3.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_coeff 1 1 1.0 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
neighbor 2.0 bin &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY THE REQUIRED THERMODYNAMIC STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable T equal 2.0 &amp;lt;br&amp;gt; &lt;br /&gt;
variable p equal 2.5 &amp;lt;br&amp;gt; &lt;br /&gt;
variable timestep equal 0.0025 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ASSIGN ATOMIC VELOCITIES &amp;lt;br&amp;gt; &lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
SPECIFY ENSEMBLE &amp;lt;br&amp;gt; &lt;br /&gt;
timestep ${timestep} &amp;lt;br&amp;gt; &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 THERMODYNAMIC OUTPUT CONTROL &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom time etotal temp press &amp;lt;br&amp;gt; &lt;br /&gt;
thermo 10 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RECORD TRAJECTORY &amp;lt;br&amp;gt; &lt;br /&gt;
dump traj all custom 1000 output-1 id x y z &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY TIMESTEP &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RUN SIMULATION TO MELT CRYSTAL &amp;lt;br&amp;gt; &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nve &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 BRING SYSTEM TO REQUIRED STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable tdamp equal ${timestep}*100 &amp;lt;br&amp;gt; &lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &amp;lt;br&amp;gt;  &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nvt &amp;lt;br&amp;gt;  &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 MEASURE SYSTEM STATE  &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom step atoms etotal temp press density &amp;lt;br&amp;gt; &lt;br /&gt;
variable atoms2 equal atoms*atoms &amp;lt;br&amp;gt;   &lt;br /&gt;
variable E equal etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable E2 equal etotal*etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens equal density &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens2 equal density*density &amp;lt;br&amp;gt;  &lt;br /&gt;
variable temp equal temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable temp2 equal temp*temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable press equal press &amp;lt;br&amp;gt; &lt;br /&gt;
variable press2 equal press*press &amp;lt;br&amp;gt; &lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_E2 v_E&lt;br /&gt;
run 100000 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
variable HC equal ${atoms2}*(f_aves[7] - f_aves[8]*f_aves[8])/f_aves[5] &amp;lt;br&amp;gt;  &lt;br /&gt;
variable avedens equal f_aves[1] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avetemp equal f_aves[2] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avepress equal f_aves[3] &amp;lt;br&amp;gt; &lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3]) &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;--------&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Temperature: ${temp}&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Heat capacity: ${HC}&amp;quot;  &amp;lt;br&amp;gt;  &lt;br /&gt;
print &amp;quot;atoms&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Structural Properties and the Radial Distribution function =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:G(r).png|x300px|thumb|RDF at different phases|left]]&lt;br /&gt;
! [[File:Integral.png|x300px|thumb|Integral of g(r)|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To carry out the RDF calculations temperature was kept constant at 1.2 but density was varied. &lt;br /&gt;
&lt;br /&gt;
Density in reduced units used for each phase: &lt;br /&gt;
&lt;br /&gt;
* Gas = 0.05&lt;br /&gt;
* Liquid = 0.8 &lt;br /&gt;
* Solid = 1.2&lt;br /&gt;
&lt;br /&gt;
The number of peaks for each RDF plot decreases in the order gas&amp;lt;liquid&amp;lt;solid. This reflects the ordering of each phase. &lt;br /&gt;
A gas has a large degree of disorder and thus produces only peak.&lt;br /&gt;
The liquid has three peaks which gradually decrease in amplitude, this behavior is due to the fact that the liquid is modeled as central molecule surrounded by shells of other molecules, this initially creates some degree of order. As the simulation continues the molecules become more diffuse so the ordering decreases and thus the amplitude of peaks decrease.&lt;br /&gt;
&lt;br /&gt;
= Dynamical Properties and the diffusion coefficient = &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid.png|thumb|solid|x300px|left]]&lt;br /&gt;
! [[File:Liquid.png|thumb|liquid|x300px|centre]]&lt;br /&gt;
! [[File:Gas.png|thumb|gas|x300px|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:VACFvrsTS.png|x400px|thumb|VACF vrs Temperature|centre]]&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function for a 1D harmonic oscillator can be evaluated using the equation for a 1D harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiation of the displacement function will produce a velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx}{dt} = -A\omega\sin\left(\omega t + \phi\right) = v(t) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int v(t + \tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substitution into velocity autocorrelation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \omega\tau + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right)-A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Vapourphse.png|thumb|Vapour Phase|x300px|left]]&lt;br /&gt;
! [[File:Vapour phase 1 million.png|thumb|Vapour Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid(small).png|thumb|Solid Phase|x300px|left]]&lt;br /&gt;
! [[File:Solid1million.png|thumb|Solid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Liquidsmallno..png|thumb|Liquid Phase|x300px|left]]&lt;br /&gt;
! [[File:Liquid1millionatoms.png|thumb|Liquid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 1.64&lt;br /&gt;
| 1.63&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| -0.2215&lt;br /&gt;
| 0.157 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| 0.254&lt;br /&gt;
| -0.123&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Mark Klarpus, Gregory A. Petsko, (1990) &#039;&#039;Molecular Reaction Dynamics in Biology&#039;&#039;, &#039;&#039;&#039;347&#039;&#039;&#039;, 631-9, doi:10.1038/347631a0&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578463</id>
		<title>Rep:Thermomp4114</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578463"/>
		<updated>2017-01-26T21:42:41Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Molecular Dynamics Simulations of Simple Liquids Introduction == &lt;br /&gt;
&lt;br /&gt;
Molecular dynamic simulations involved studying the motion of a system of particles. Several fundamental elements of a system need to be known in order to achieve this. This includes a knowledge of the interaction potential for the particles and the equations of motion which govern the dynamics of the particles.&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt; Once we know the positions, velocities, and forces, of the atoms (which are obtained using statistical) we can calculate various thermodynamic quantities of the system such as temperature and pressure. We must introduce a series of approximations in order for the caluculations to be feasible. Firstly we apply the &#039;&#039;&#039;The Classical Particle Approximation&#039;&#039;&#039;. The schoedinger equation is too complex to solve for a large system of atoms, however if the atoms are treated classically then the positions and and velocities of each can atom can be calculated using Newton&#039;s second law (equation 1): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = m_i \mathbf{a}_i = m_i \frac{\mathrm{d}\mathbf{v}_i}{\mathrm{d}t} = m_i \frac{\mathrm{d}^2 \mathbf{x}_i}{\mathrm{d}t^2} \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As there are N atoms and therefore N equations representing each atom a computer is a necessity. The &#039;&#039;&#039;Verlet algorithim&#039;&#039;&#039; is used to solve to Newton&#039;s law for all the atoms in the system. In this case time is not continuous but is made discrete, the simulation is thus broeken up into specific &#039;&#039;&#039;timesteps&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The position of atom &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;\mathbf{x}_i \left(t\right)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Positional Verlet algorithim (equation (2)): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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 \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Velocity Verlet algorithim (equation (3)):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{v}_i \left(t\right)&amp;lt;/math&amp;gt; represents the velocity of that atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;center&amp;gt;&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 \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Put in example of industrial applications&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Harmonic Oscillator ===&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator illustrates the the accuracy and discrepancies associated with using the velocity Verlet algorithim. Equation (4) is used to model the behavior of the harmonic oscillator in an analytical sense: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)\ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; = 1.00 &lt;br /&gt;
&lt;br /&gt;
Graph (1) illustrates the results the analytical solution gave for the relationship between position and time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Avrsxt2.png|x300px|thumb|Graph 1: Analytical solution of harmonic oscillator|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The difference in position between the velocity-verlet solution and analytical solution is represented by an error. Error plotted against time is illustrated by graph (2). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ErrorvrsT.png|x300px|thumb|Graph 2: Error vrs Time|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The orange line illustrates the positive trend between error and time. &#039;&#039;&#039;Insert Answer from demonstrator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy of the system will consist of the sum of kinetic and potential energy. Equation (5) can be used to find kinetic energy of the system:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;E_\text{k} =\tfrac{1}{2} mv(t)^2 \ \ (5)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\mathbf{x} \left(t\right)&amp;lt;/math&amp;gt; is used in equation (5) the potential energy can be found. &lt;br /&gt;
&lt;br /&gt;
The following graphs represent the difference in change in energy with time when the timestep is varied. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EvrsTime.png|x200px|thumb|Energy change when a timestep of 0.1 is used|left]]&lt;br /&gt;
! [[File:Energy vrs time for 0.15 timestep.png|x200px|thumb|Energy change when a timestep of 0.15 is used|centre]]&lt;br /&gt;
! [[File:Energy vrs time for 0.2 timestep.png|x200px|thumb|Energy change when a timestep of 0.2 is used|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The maximum change in energy for each of the different timesteps is shown in table (1). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | Timestep&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.1&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.15&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.2&lt;br /&gt;
|-&lt;br /&gt;
| Max. change in Energy&lt;br /&gt;
| 0.2%&lt;br /&gt;
| 0.6%&lt;br /&gt;
| 1%&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results clearly indicate that a timestep greater than &#039;&#039;&#039;0.2&#039;&#039;&#039; will result in an energy change greater than 1%. As the timestep increases as does the maximum error. The timestep defines the number of calculations made in a given time, therefore the shorter the timestep the larger the number of calculations carried out and therefore a more accurate result is produced. The total energy of a real physical system should not change, when modeled numerically there can be fluctuations therefore it is important to monitor this change and ensure that the fluctuations are minimised.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces ===&lt;br /&gt;
&lt;br /&gt;
The forces an atom experiences is determined by the positions of all the atoms in the system, &amp;lt;math&amp;gt;\mathbf{r}^N&amp;lt;/math&amp;gt;. The Lennard-Jones function accurately sums all the key inter-atomic forces an atoms experiences (U). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ (10)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
For a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After division by 4 and rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_0^{6}} = \frac{\sigma^{6}}{r_0^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After further rearrangement and cancelling down: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;-\sigma &amp;lt;/math&amp;gt; is also a solution however this can be disregarded. &lt;br /&gt;
&lt;br /&gt;
In order to calculate the force the following equation is used: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\sigma\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After differentiation and simplification: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}(r_0) =  \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &#039;&#039;&#039; ask demonstrator if thats too brief &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
At equilibrium: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{12\sigma^{12}}{r_e^{13}} - \frac{6\sigma^6}{r_e^7} \right)&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
After rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_e = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This value of &amp;lt;math&amp;gt; r_e &amp;lt;/math&amp;gt; can now be used to find the well depth:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{\sigma^{12}}{4sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon\left(\frac{1}{5r^{5}} - \frac{1}{11r^11} \right)^\infty_2 \simeq -2.48 \sdot 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -8.18 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -3.29 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Finish off atomic forces - enter integrals&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
* No. of moles in  1 mL of water = 0.056 &amp;lt;br&amp;gt; &lt;br /&gt;
* No. of molecules = moles x Avogadro&#039;s constant = 3.37 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*1000 molecules = 1.66 x 10&amp;lt;sup&amp;gt;21&amp;lt;/sup&amp;gt; moles&lt;br /&gt;
* Density = mass/vol. = 1 &lt;br /&gt;
*vol. = mass/density = 2.99 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Due to periodic boundary condition once the atom leaves the current box it will enter the beginning of an identical box. The atom is at &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; and thus once it breaches 0.5 in a particular direction it will be at the start of the next box. Using these principles after the atom moves &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will be at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units === &lt;br /&gt;
&lt;br /&gt;
Reduced units are applied to the Lennard-Jones equation to make the calculation more managable.&lt;br /&gt;
&lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For argon:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Distance in real units: r = 1.09 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Well depth = &amp;lt;math&amp;gt;{\epsilon}&amp;lt;/math&amp;gt; = 0.996 KJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* T = 180 K &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Do I need to show working out?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Equilibriation = &lt;br /&gt;
&lt;br /&gt;
=== Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
As there is a large number of atoms in a discrete volume allowing random assignment of positions could result in atoms overlapping. This would cause an unrealistically high potential as potential is distance dependant (as observed in the Lennard - Jones equation).&lt;br /&gt;
&lt;br /&gt;
* Density is given by the following equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{n}{v} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 1 (as there is only 1 atom per unit cell) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = 1.07722^3 = 1.25 &amp;lt;/math&amp;gt; (lattice spacing = 1.07722) &lt;br /&gt;
&lt;br /&gt;
Thus: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length of a side of one fcc unit cell with number density 1.2 would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = \frac{n}{\rho} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 4 (as there is 4 atoms per unit cell in an fcc lattice) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; = 3.33&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; l = v^{-3} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The number of atoms that would be created by the create_atoms command for an fcc lattice would be: &lt;br /&gt;
&lt;br /&gt;
4 x 1000 = 4000 &lt;br /&gt;
&lt;br /&gt;
This is due to fact that there is 1 atom per unit cell that yeilds 1000 altogether in simple cubic. Fcc has 4 times the number of atoms per unit cell. &lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of Atoms === &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command above has the following purpose: &lt;br /&gt;
&lt;br /&gt;
* The first line sets the mass of all atoms of type &#039;1&#039; to 1.0. &lt;br /&gt;
*  Line 2 is used to control the Lennard-Jones potential. The value of 3.0 indicates the distance in reduced units upon which the potential is calculated. The potential is distance dependent and falls to 0 at large values of r thus only atoms within a distance of 3.0 are considered.  &#039;lj/cut&#039; defines the cut off point. &lt;br /&gt;
* The last line defines the force field constants as 1.0 for all sets of atoms. The * controls the fact that the command is set for all atoms. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet is the integration algorithm that can be used when &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; are defined. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The codes is in place to ensure that the timestep can be varied but the total time taken for the simulation to run will not change.&lt;br /&gt;
&lt;br /&gt;
=== Checking equilibration === &lt;br /&gt;
&lt;br /&gt;
The graphs below illustrate the time it takes for different thermodynamic properties to equilibriate at a timestep of 0.001. The plateau represents the point at which equilibration is achieved. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EnergyVRStime.png|x300px|thumb|Energy Vrs Time|left]]&lt;br /&gt;
! [[File:TEMPvrsTIME.png|x300px|thumb|Temp vrs Time|centre]]&lt;br /&gt;
! [[File:Press Vrs Time.png|x300px|thumb|Pressure Vrs Time|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The graph below illustrates the effect changing the timestep has on equilibration. As can be seen from the graph a from below 0.01 a shorter timestep results in a lower energy value for equilibration until 0.0025 where the value   of equilibration does not change with lower timestep. This trend is due to the fact that a smaller timestep results in a more accurate result however if it is too small this can over-complicate the calculation (especially when there is a large over-all time). Thus a timestep of 0.0025 is ideal. A timestep of 0.025 is too large and results in the system not reaching equilibrium.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EnergyVtimeFORVTS.png|x400px|thumb|Energy Vrs Time with different timesteps|centre]]&lt;br /&gt;
&lt;br /&gt;
= Running Simulations Under Specific Conditions =&lt;br /&gt;
&lt;br /&gt;
The following two equations can be used to define the energy of the system: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The instantaneous tempertaure &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will not remain constant throughout the simulation and will fluctuate, it will thus be different to out target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The value of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2} = \frac{\mathfrak{T}}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within the preceding code: &lt;br /&gt;
&lt;br /&gt;
100 - Nevery: This command results in a sample being taken every 100 steps and being incorporated into the average. 1000 - Nrepreat: Tells the computer how many samples should be used to calculate the average. Nfreq 10 000: At every 10000th timestep an average is calculated. &lt;br /&gt;
&lt;br /&gt;
All thermodynamic properties are calculated by averages that is the necessity for those commands.&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equation of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:DENSITYvrsT.png|x400px|thumb|Density Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
= Calculating Heat Capacities Using Statistic Physics =&lt;br /&gt;
&lt;br /&gt;
Example of input code used: &lt;br /&gt;
&lt;br /&gt;
* Density 0.2&lt;br /&gt;
* Temperature 2.0 &lt;br /&gt;
&lt;br /&gt;
 variable density equal 0.2&lt;br /&gt;
 DEFINE SIMULATION BOX GEOMETRY &amp;lt;br&amp;gt; &lt;br /&gt;
lattice sc ${density} &amp;lt;br&amp;gt; &lt;br /&gt;
region box block 0 15 0 15 0 15 &amp;lt;br&amp;gt; &lt;br /&gt;
create_box 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
create_atoms 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
DEFINE PHYSICAL PROPERTIES OF ATOMS &amp;lt;br&amp;gt; &lt;br /&gt;
mass 1 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_style lj/cut/opt 3.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_coeff 1 1 1.0 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
neighbor 2.0 bin &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY THE REQUIRED THERMODYNAMIC STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable T equal 2.0 &amp;lt;br&amp;gt; &lt;br /&gt;
variable p equal 2.5 &amp;lt;br&amp;gt; &lt;br /&gt;
variable timestep equal 0.0025 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ASSIGN ATOMIC VELOCITIES &amp;lt;br&amp;gt; &lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
SPECIFY ENSEMBLE &amp;lt;br&amp;gt; &lt;br /&gt;
timestep ${timestep} &amp;lt;br&amp;gt; &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 THERMODYNAMIC OUTPUT CONTROL &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom time etotal temp press &amp;lt;br&amp;gt; &lt;br /&gt;
thermo 10 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RECORD TRAJECTORY &amp;lt;br&amp;gt; &lt;br /&gt;
dump traj all custom 1000 output-1 id x y z &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY TIMESTEP &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RUN SIMULATION TO MELT CRYSTAL &amp;lt;br&amp;gt; &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nve &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 BRING SYSTEM TO REQUIRED STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable tdamp equal ${timestep}*100 &amp;lt;br&amp;gt; &lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &amp;lt;br&amp;gt;  &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nvt &amp;lt;br&amp;gt;  &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 MEASURE SYSTEM STATE  &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom step atoms etotal temp press density &amp;lt;br&amp;gt; &lt;br /&gt;
variable atoms2 equal atoms*atoms &amp;lt;br&amp;gt;   &lt;br /&gt;
variable E equal etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable E2 equal etotal*etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens equal density &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens2 equal density*density &amp;lt;br&amp;gt;  &lt;br /&gt;
variable temp equal temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable temp2 equal temp*temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable press equal press &amp;lt;br&amp;gt; &lt;br /&gt;
variable press2 equal press*press &amp;lt;br&amp;gt; &lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_E2 v_E&lt;br /&gt;
run 100000 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
variable HC equal ${atoms2}*(f_aves[7] - f_aves[8]*f_aves[8])/f_aves[5] &amp;lt;br&amp;gt;  &lt;br /&gt;
variable avedens equal f_aves[1] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avetemp equal f_aves[2] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avepress equal f_aves[3] &amp;lt;br&amp;gt; &lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3]) &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;--------&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Temperature: ${temp}&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Heat capacity: ${HC}&amp;quot;  &amp;lt;br&amp;gt;  &lt;br /&gt;
print &amp;quot;atoms&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Structural Properties and the Radial Distribution function =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:G(r).png|x300px|thumb|RDF at different phases|left]]&lt;br /&gt;
! [[File:Integral.png|x300px|thumb|Integral of g(r)|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To carry out the RDF calculations temperature was kept constant at 1.2 but density was varied. &lt;br /&gt;
&lt;br /&gt;
Density in reduced units used for each phase: &lt;br /&gt;
&lt;br /&gt;
* Gas = 0.05&lt;br /&gt;
* Liquid = 0.8 &lt;br /&gt;
* Solid = 1.2&lt;br /&gt;
&lt;br /&gt;
The number of peaks for each RDF plot decreases in the order gas&amp;lt;liquid&amp;lt;solid. This reflects the ordering of each phase. &lt;br /&gt;
A gas has a large degree of disorder and thus produces only peak.&lt;br /&gt;
The liquid has three peaks which gradually decrease in amplitude, this behavior is due to the fact that the liquid is modeled as central molecule surrounded by shells of other molecules, this initially creates some degree of order. As the simulation continues the molecules become more diffuse so the ordering decreases and thus the amplitude of peaks decrease.&lt;br /&gt;
&lt;br /&gt;
= Dynamical Properties and the diffusion coefficient = &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid.png|thumb|solid|x300px|left]]&lt;br /&gt;
! [[File:Liquid.png|thumb|liquid|x300px|centre]]&lt;br /&gt;
! [[File:Gas.png|thumb|gas|x300px|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:VACFvrsTS.png|x400px|thumb|VACF vrs Temperature|centre]]&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function for a 1D harmonic oscillator can be evaluated using the equation for a 1D harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiation of the displacement function will produce a velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx}{dt} = -A\omega\sin\left(\omega t + \phi\right) = v(t) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int v(t + \tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Vapourphse.png|thumb|Vapour Phase|x300px|left]]&lt;br /&gt;
! [[File:Vapour phase 1 million.png|thumb|Vapour Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid(small).png|thumb|Solid Phase|x300px|left]]&lt;br /&gt;
! [[File:Solid1million.png|thumb|Solid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Liquidsmallno..png|thumb|Liquid Phase|x300px|left]]&lt;br /&gt;
! [[File:Liquid1millionatoms.png|thumb|Liquid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 1.64&lt;br /&gt;
| 1.63&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| -0.2215&lt;br /&gt;
| 0.157 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| 0.254&lt;br /&gt;
| -0.123&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Mark Klarpus, Gregory A. Petsko, (1990) &#039;&#039;Molecular Reaction Dynamics in Biology&#039;&#039;, &#039;&#039;&#039;347&#039;&#039;&#039;, 631-9, doi:10.1038/347631a0&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578458</id>
		<title>Rep:Thermomp4114</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578458"/>
		<updated>2017-01-26T21:17:51Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: /* Dynamical Properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Molecular Dynamics Simulations of Simple Liquids Introduction == &lt;br /&gt;
&lt;br /&gt;
Molecular dynamic simulations involved studying the motion of a system of particles. Several fundamental elements of a system need to be known in order to achieve this. This includes a knowledge of the interaction potential for the particles and the equations of motion which govern the dynamics of the particles.&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt; Once we know the positions, velocities, and forces, of the atoms (which are obtained using statistical) we can calculate various thermodynamic quantities of the system such as temperature and pressure. We must introduce a series of approximations in order for the caluculations to be feasible. Firstly we apply the &#039;&#039;&#039;The Classical Particle Approximation&#039;&#039;&#039;. The schoedinger equation is too complex to solve for a large system of atoms, however if the atoms are treated classically then the positions and and velocities of each can atom can be calculated using Newton&#039;s second law (equation 1): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = m_i \mathbf{a}_i = m_i \frac{\mathrm{d}\mathbf{v}_i}{\mathrm{d}t} = m_i \frac{\mathrm{d}^2 \mathbf{x}_i}{\mathrm{d}t^2} \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As there are N atoms and therefore N equations representing each atom a computer is a necessity. The &#039;&#039;&#039;Verlet algorithim&#039;&#039;&#039; is used to solve to Newton&#039;s law for all the atoms in the system. In this case time is not continuous but is made discrete, the simulation is thus broeken up into specific &#039;&#039;&#039;timesteps&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The position of atom &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;\mathbf{x}_i \left(t\right)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Positional Verlet algorithim (equation (2)): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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 \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Velocity Verlet algorithim (equation (3)):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{v}_i \left(t\right)&amp;lt;/math&amp;gt; represents the velocity of that atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;center&amp;gt;&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 \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Put in example of industrial applications&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Harmonic Oscillator ===&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator illustrates the the accuracy and discrepancies associated with using the velocity Verlet algorithim. Equation (4) is used to model the behavior of the harmonic oscillator in an analytical sense: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)\ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; = 1.00 &lt;br /&gt;
&lt;br /&gt;
Graph (1) illustrates the results the analytical solution gave for the relationship between position and time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Avrsxt2.png|x300px|thumb|Graph 1: Analytical solution of harmonic oscillator|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The difference in position between the velocity-verlet solution and analytical solution is represented by an error. Error plotted against time is illustrated by graph (2). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ErrorvrsT.png|x300px|thumb|Graph 2: Error vrs Time|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The orange line illustrates the positive trend between error and time. &#039;&#039;&#039;Insert Answer from demonstrator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy of the system will consist of the sum of kinetic and potential energy. Equation (5) can be used to find kinetic energy of the system:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;E_\text{k} =\tfrac{1}{2} mv(t)^2 \ \ (5)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\mathbf{x} \left(t\right)&amp;lt;/math&amp;gt; is used in equation (5) the potential energy can be found. &lt;br /&gt;
&lt;br /&gt;
The following graphs represent the difference in change in energy with time when the timestep is varied. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EvrsTime.png|x200px|thumb|Energy change when a timestep of 0.1 is used|left]]&lt;br /&gt;
! [[File:Energy vrs time for 0.15 timestep.png|x200px|thumb|Energy change when a timestep of 0.15 is used|centre]]&lt;br /&gt;
! [[File:Energy vrs time for 0.2 timestep.png|x200px|thumb|Energy change when a timestep of 0.2 is used|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The maximum change in energy for each of the different timesteps is shown in table (1). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | Timestep&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.1&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.15&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.2&lt;br /&gt;
|-&lt;br /&gt;
| Max. change in Energy&lt;br /&gt;
| 0.2%&lt;br /&gt;
| 0.6%&lt;br /&gt;
| 1%&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results clearly indicate that a timestep greater than &#039;&#039;&#039;0.2&#039;&#039;&#039; will result in an energy change greater than 1%. As the timestep increases as does the maximum error. The timestep defines the number of calculations made in a given time, therefore the shorter the timestep the larger the number of calculations carried out and therefore a more accurate result is produced. The total energy of a real physical system should not change, when modeled numerically there can be fluctuations therefore it is important to monitor this change and ensure that the fluctuations are minimised.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces ===&lt;br /&gt;
&lt;br /&gt;
The forces an atom experiences is determined by the positions of all the atoms in the system, &amp;lt;math&amp;gt;\mathbf{r}^N&amp;lt;/math&amp;gt;. The Lennard-Jones function accurately sums all the key inter-atomic forces an atoms experiences (U). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ (10)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
For a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After division by 4 and rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_0^{6}} = \frac{\sigma^{6}}{r_0^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After further rearrangement and cancelling down: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;-\sigma &amp;lt;/math&amp;gt; is also a solution however this can be disregarded. &lt;br /&gt;
&lt;br /&gt;
In order to calculate the force the following equation is used: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\sigma\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After differentiation and simplification: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}(r_0) =  \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &#039;&#039;&#039; ask demonstrator if thats too brief &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
At equilibrium: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{12\sigma^{12}}{r_e^{13}} - \frac{6\sigma^6}{r_e^7} \right)&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
After rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_e = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This value of &amp;lt;math&amp;gt; r_e &amp;lt;/math&amp;gt; can now be used to find the well depth:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{\sigma^{12}}{4sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon\left(\frac{1}{5r^{5}} - \frac{1}{11r^11} \right)^\infty_2 \simeq -2.48 \sdot 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -8.18 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -3.29 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Finish off atomic forces - enter integrals&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
* No. of moles in  1 mL of water = 0.056 &amp;lt;br&amp;gt; &lt;br /&gt;
* No. of molecules = moles x Avogadro&#039;s constant = 3.37 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*1000 molecules = 1.66 x 10&amp;lt;sup&amp;gt;21&amp;lt;/sup&amp;gt; moles&lt;br /&gt;
* Density = mass/vol. = 1 &lt;br /&gt;
*vol. = mass/density = 2.99 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Due to periodic boundary condition once the atom leaves the current box it will enter the beginning of an identical box. The atom is at &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; and thus once it breaches 0.5 in a particular direction it will be at the start of the next box. Using these principles after the atom moves &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will be at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units === &lt;br /&gt;
&lt;br /&gt;
Reduced units are applied to the Lennard-Jones equation to make the calculation more managable.&lt;br /&gt;
&lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For argon:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Distance in real units: r = 1.09 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Well depth = &amp;lt;math&amp;gt;{\epsilon}&amp;lt;/math&amp;gt; = 0.996 KJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* T = 180 K &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Do I need to show working out?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Equilibriation = &lt;br /&gt;
&lt;br /&gt;
=== Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
As there is a large number of atoms in a discrete volume allowing random assignment of positions could result in atoms overlapping. This would cause an unrealistically high potential as potential is distance dependant (as observed in the Lennard - Jones equation).&lt;br /&gt;
&lt;br /&gt;
* Density is given by the following equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{n}{v} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 1 (as there is only 1 atom per unit cell) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = 1.07722^3 = 1.25 &amp;lt;/math&amp;gt; (lattice spacing = 1.07722) &lt;br /&gt;
&lt;br /&gt;
Thus: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length of a side of one fcc unit cell with number density 1.2 would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = \frac{n}{\rho} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 4 (as there is 4 atoms per unit cell in an fcc lattice) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; = 3.33&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; l = v^{-3} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The number of atoms that would be created by the create_atoms command for an fcc lattice would be: &lt;br /&gt;
&lt;br /&gt;
4 x 1000 = 4000 &lt;br /&gt;
&lt;br /&gt;
This is due to fact that there is 1 atom per unit cell that yeilds 1000 altogether in simple cubic. Fcc has 4 times the number of atoms per unit cell. &lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of Atoms === &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command above has the following purpose: &lt;br /&gt;
&lt;br /&gt;
* The first line sets the mass of all atoms of type &#039;1&#039; to 1.0. &lt;br /&gt;
*  Line 2 is used to control the Lennard-Jones potential. The value of 3.0 indicates the distance in reduced units upon which the potential is calculated. The potential is distance dependent and falls to 0 at large values of r thus only atoms within a distance of 3.0 are considered.  &#039;lj/cut&#039; defines the cut off point. &lt;br /&gt;
* The last line defines the force field constants as 1.0 for all sets of atoms. The * controls the fact that the command is set for all atoms. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet is the integration algorithm that can be used when &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; are defined. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The codes is in place to ensure that the timestep can be varied but the total time taken for the simulation to run will not change.&lt;br /&gt;
&lt;br /&gt;
=== Checking equilibration === &lt;br /&gt;
&lt;br /&gt;
The graphs below illustrate the time it takes for different thermodynamic properties to equilibriate at a timestep of 0.001. The plateau represents the point at which equilibration is achieved. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EnergyVRStime.png|x300px|thumb|Energy Vrs Time|left]]&lt;br /&gt;
! [[File:TEMPvrsTIME.png|x300px|thumb|Temp vrs Time|centre]]&lt;br /&gt;
! [[File:Press Vrs Time.png|x300px|thumb|Pressure Vrs Time|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The graph below illustrates the effect changing the timestep has on equilibration. As can be seen from the graph a from below 0.01 a shorter timestep results in a lower energy value for equilibration until 0.0025 where the value   of equilibration does not change with lower timestep. This trend is due to the fact that a smaller timestep results in a more accurate result however if it is too small this can over-complicate the calculation (especially when there is a large over-all time). Thus a timestep of 0.0025 is ideal. A timestep of 0.025 is too large and results in the system not reaching equilibrium.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EnergyVtimeFORVTS.png|x400px|thumb|Energy Vrs Time with different timesteps|centre]]&lt;br /&gt;
&lt;br /&gt;
= Running Simulations Under Specific Conditions =&lt;br /&gt;
&lt;br /&gt;
The following two equations can be used to define the energy of the system: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The instantaneous tempertaure &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will not remain constant throughout the simulation and will fluctuate, it will thus be different to out target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The value of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2} = \frac{\mathfrak{T}}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within the preceding code: &lt;br /&gt;
&lt;br /&gt;
100 - Nevery: This command results in a sample being taken every 100 steps and being incorporated into the average. 1000 - Nrepreat: Tells the computer how many samples should be used to calculate the average. Nfreq 10 000: At every 10000th timestep an average is calculated. &lt;br /&gt;
&lt;br /&gt;
All thermodynamic properties are calculated by averages that is the necessity for those commands.&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equation of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:DENSITYvrsT.png|x400px|thumb|Density Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
= Calculating Heat Capacities Using Statistic Physics =&lt;br /&gt;
&lt;br /&gt;
Example of input code used: &lt;br /&gt;
&lt;br /&gt;
* Density 0.2&lt;br /&gt;
* Temperature 2.0 &lt;br /&gt;
&lt;br /&gt;
 variable density equal 0.2&lt;br /&gt;
 DEFINE SIMULATION BOX GEOMETRY &amp;lt;br&amp;gt; &lt;br /&gt;
lattice sc ${density} &amp;lt;br&amp;gt; &lt;br /&gt;
region box block 0 15 0 15 0 15 &amp;lt;br&amp;gt; &lt;br /&gt;
create_box 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
create_atoms 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
DEFINE PHYSICAL PROPERTIES OF ATOMS &amp;lt;br&amp;gt; &lt;br /&gt;
mass 1 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_style lj/cut/opt 3.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_coeff 1 1 1.0 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
neighbor 2.0 bin &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY THE REQUIRED THERMODYNAMIC STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable T equal 2.0 &amp;lt;br&amp;gt; &lt;br /&gt;
variable p equal 2.5 &amp;lt;br&amp;gt; &lt;br /&gt;
variable timestep equal 0.0025 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ASSIGN ATOMIC VELOCITIES &amp;lt;br&amp;gt; &lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
SPECIFY ENSEMBLE &amp;lt;br&amp;gt; &lt;br /&gt;
timestep ${timestep} &amp;lt;br&amp;gt; &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 THERMODYNAMIC OUTPUT CONTROL &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom time etotal temp press &amp;lt;br&amp;gt; &lt;br /&gt;
thermo 10 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RECORD TRAJECTORY &amp;lt;br&amp;gt; &lt;br /&gt;
dump traj all custom 1000 output-1 id x y z &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY TIMESTEP &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RUN SIMULATION TO MELT CRYSTAL &amp;lt;br&amp;gt; &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nve &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 BRING SYSTEM TO REQUIRED STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable tdamp equal ${timestep}*100 &amp;lt;br&amp;gt; &lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &amp;lt;br&amp;gt;  &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nvt &amp;lt;br&amp;gt;  &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 MEASURE SYSTEM STATE  &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom step atoms etotal temp press density &amp;lt;br&amp;gt; &lt;br /&gt;
variable atoms2 equal atoms*atoms &amp;lt;br&amp;gt;   &lt;br /&gt;
variable E equal etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable E2 equal etotal*etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens equal density &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens2 equal density*density &amp;lt;br&amp;gt;  &lt;br /&gt;
variable temp equal temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable temp2 equal temp*temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable press equal press &amp;lt;br&amp;gt; &lt;br /&gt;
variable press2 equal press*press &amp;lt;br&amp;gt; &lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_E2 v_E&lt;br /&gt;
run 100000 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
variable HC equal ${atoms2}*(f_aves[7] - f_aves[8]*f_aves[8])/f_aves[5] &amp;lt;br&amp;gt;  &lt;br /&gt;
variable avedens equal f_aves[1] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avetemp equal f_aves[2] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avepress equal f_aves[3] &amp;lt;br&amp;gt; &lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3]) &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;--------&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Temperature: ${temp}&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Heat capacity: ${HC}&amp;quot;  &amp;lt;br&amp;gt;  &lt;br /&gt;
print &amp;quot;atoms&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Structural Properties and the Radial Distribution function =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:G(r).png|x300px|thumb|RDF at different phases|left]]&lt;br /&gt;
! [[File:Integral.png|x300px|thumb|Integral of g(r)|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To carry out the RDF calculations temperature was kept constant at 1.2 but density was varied. &lt;br /&gt;
&lt;br /&gt;
Density in reduced units used for each phase: &lt;br /&gt;
&lt;br /&gt;
* Gas = 0.05&lt;br /&gt;
* Liquid = 0.8 &lt;br /&gt;
* Solid = 1.2&lt;br /&gt;
&lt;br /&gt;
The number of peaks for each RDF plot decreases in the order gas&amp;lt;liquid&amp;lt;solid. This reflects the ordering of each phase. &lt;br /&gt;
A gas has a large degree of disorder and thus produces only peak.&lt;br /&gt;
The liquid has three peaks which gradually decrease in amplitude, this behavior is due to the fact that the liquid is modeled as central molecule surrounded by shells of other molecules, this initially creates some degree of order. As the simulation continues the molecules become more diffuse so the ordering decreases and thus the amplitude of peaks decrease.&lt;br /&gt;
&lt;br /&gt;
= Dynamical Properties and the diffusion coefficient = &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid.png|thumb|solid|x300px|left]]&lt;br /&gt;
! [[File:Liquid.png|thumb|liquid|x300px|centre]]&lt;br /&gt;
! [[File:Gas.png|thumb|gas|x300px|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:VACFvrsTS.png|x400px|thumb|VACF vrs Temperature|centre]]&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function for a 1D harmonic oscillator can be evaluated using the equation for a 1D harmonic oscillator. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiation of the displacement function will produce a velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx}{dt} = -A\omega\sin\left(\omega t + \phi\right) = v(t) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Vapourphse.png|thumb|Vapour Phase|x300px|left]]&lt;br /&gt;
! [[File:Vapour phase 1 million.png|thumb|Vapour Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid(small).png|thumb|Solid Phase|x300px|left]]&lt;br /&gt;
! [[File:Solid1million.png|thumb|Solid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Liquidsmallno..png|thumb|Liquid Phase|x300px|left]]&lt;br /&gt;
! [[File:Liquid1millionatoms.png|thumb|Liquid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 1.64&lt;br /&gt;
| 1.63&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| -0.2215&lt;br /&gt;
| 0.157 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| 0.254&lt;br /&gt;
| -0.123&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Mark Klarpus, Gregory A. Petsko, (1990) &#039;&#039;Molecular Reaction Dynamics in Biology&#039;&#039;, &#039;&#039;&#039;347&#039;&#039;&#039;, 631-9, doi:10.1038/347631a0&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578415</id>
		<title>Rep:Thermomp4114</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578415"/>
		<updated>2017-01-26T19:12:24Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: /* Dynamical Properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Molecular Dynamics Simulations of Simple Liquids Introduction == &lt;br /&gt;
&lt;br /&gt;
Molecular dynamic simulations involved studying the motion of a system of particles. Several fundamental elements of a system need to be known in order to achieve this. This includes a knowledge of the interaction potential for the particles and the equations of motion which govern the dynamics of the particles.&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt; Once we know the positions, velocities, and forces, of the atoms (which are obtained using statistical) we can calculate various thermodynamic quantities of the system such as temperature and pressure. We must introduce a series of approximations in order for the caluculations to be feasible. Firstly we apply the &#039;&#039;&#039;The Classical Particle Approximation&#039;&#039;&#039;. The schoedinger equation is too complex to solve for a large system of atoms, however if the atoms are treated classically then the positions and and velocities of each can atom can be calculated using Newton&#039;s second law (equation 1): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = m_i \mathbf{a}_i = m_i \frac{\mathrm{d}\mathbf{v}_i}{\mathrm{d}t} = m_i \frac{\mathrm{d}^2 \mathbf{x}_i}{\mathrm{d}t^2} \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As there are N atoms and therefore N equations representing each atom a computer is a necessity. The &#039;&#039;&#039;Verlet algorithim&#039;&#039;&#039; is used to solve to Newton&#039;s law for all the atoms in the system. In this case time is not continuous but is made discrete, the simulation is thus broeken up into specific &#039;&#039;&#039;timesteps&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The position of atom &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;\mathbf{x}_i \left(t\right)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Positional Verlet algorithim (equation (2)): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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 \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Velocity Verlet algorithim (equation (3)):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{v}_i \left(t\right)&amp;lt;/math&amp;gt; represents the velocity of that atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;center&amp;gt;&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 \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Put in example of industrial applications&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Harmonic Oscillator ===&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator illustrates the the accuracy and discrepancies associated with using the velocity Verlet algorithim. Equation (4) is used to model the behavior of the harmonic oscillator in an analytical sense: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)\ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; = 1.00 &lt;br /&gt;
&lt;br /&gt;
Graph (1) illustrates the results the analytical solution gave for the relationship between position and time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Avrsxt2.png|x300px|thumb|Graph 1: Analytical solution of harmonic oscillator|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The difference in position between the velocity-verlet solution and analytical solution is represented by an error. Error plotted against time is illustrated by graph (2). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ErrorvrsT.png|x300px|thumb|Graph 2: Error vrs Time|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The orange line illustrates the positive trend between error and time. &#039;&#039;&#039;Insert Answer from demonstrator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy of the system will consist of the sum of kinetic and potential energy. Equation (5) can be used to find kinetic energy of the system:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;E_\text{k} =\tfrac{1}{2} mv(t)^2 \ \ (5)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\mathbf{x} \left(t\right)&amp;lt;/math&amp;gt; is used in equation (5) the potential energy can be found. &lt;br /&gt;
&lt;br /&gt;
The following graphs represent the difference in change in energy with time when the timestep is varied. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EvrsTime.png|x200px|thumb|Energy change when a timestep of 0.1 is used|left]]&lt;br /&gt;
! [[File:Energy vrs time for 0.15 timestep.png|x200px|thumb|Energy change when a timestep of 0.15 is used|centre]]&lt;br /&gt;
! [[File:Energy vrs time for 0.2 timestep.png|x200px|thumb|Energy change when a timestep of 0.2 is used|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The maximum change in energy for each of the different timesteps is shown in table (1). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | Timestep&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.1&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.15&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.2&lt;br /&gt;
|-&lt;br /&gt;
| Max. change in Energy&lt;br /&gt;
| 0.2%&lt;br /&gt;
| 0.6%&lt;br /&gt;
| 1%&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results clearly indicate that a timestep greater than &#039;&#039;&#039;0.2&#039;&#039;&#039; will result in an energy change greater than 1%. As the timestep increases as does the maximum error. The timestep defines the number of calculations made in a given time, therefore the shorter the timestep the larger the number of calculations carried out and therefore a more accurate result is produced. The total energy of a real physical system should not change, when modeled numerically there can be fluctuations therefore it is important to monitor this change and ensure that the fluctuations are minimised.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces ===&lt;br /&gt;
&lt;br /&gt;
The forces an atom experiences is determined by the positions of all the atoms in the system, &amp;lt;math&amp;gt;\mathbf{r}^N&amp;lt;/math&amp;gt;. The Lennard-Jones function accurately sums all the key inter-atomic forces an atoms experiences (U). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ (10)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
For a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After division by 4 and rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_0^{6}} = \frac{\sigma^{6}}{r_0^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After further rearrangement and cancelling down: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;-\sigma &amp;lt;/math&amp;gt; is also a solution however this can be disregarded. &lt;br /&gt;
&lt;br /&gt;
In order to calculate the force the following equation is used: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\sigma\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After differentiation and simplification: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}(r_0) =  \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &#039;&#039;&#039; ask demonstrator if thats too brief &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
At equilibrium: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{12\sigma^{12}}{r_e^{13}} - \frac{6\sigma^6}{r_e^7} \right)&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
After rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_e = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This value of &amp;lt;math&amp;gt; r_e &amp;lt;/math&amp;gt; can now be used to find the well depth:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{\sigma^{12}}{4sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon\left(\frac{1}{5r^{5}} - \frac{1}{11r^11} \right)^\infty_2 \simeq -2.48 \sdot 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -8.18 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -3.29 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Finish off atomic forces - enter integrals&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
* No. of moles in  1 mL of water = 0.056 &amp;lt;br&amp;gt; &lt;br /&gt;
* No. of molecules = moles x Avogadro&#039;s constant = 3.37 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*1000 molecules = 1.66 x 10&amp;lt;sup&amp;gt;21&amp;lt;/sup&amp;gt; moles&lt;br /&gt;
* Density = mass/vol. = 1 &lt;br /&gt;
*vol. = mass/density = 2.99 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Due to periodic boundary condition once the atom leaves the current box it will enter the beginning of an identical box. The atom is at &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; and thus once it breaches 0.5 in a particular direction it will be at the start of the next box. Using these principles after the atom moves &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will be at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units === &lt;br /&gt;
&lt;br /&gt;
Reduced units are applied to the Lennard-Jones equation to make the calculation more managable.&lt;br /&gt;
&lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For argon:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Distance in real units: r = 1.09 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Well depth = &amp;lt;math&amp;gt;{\epsilon}&amp;lt;/math&amp;gt; = 0.996 KJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* T = 180 K &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Do I need to show working out?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Equilibriation = &lt;br /&gt;
&lt;br /&gt;
=== Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
As there is a large number of atoms in a discrete volume allowing random assignment of positions could result in atoms overlapping. This would cause an unrealistically high potential as potential is distance dependant (as observed in the Lennard - Jones equation).&lt;br /&gt;
&lt;br /&gt;
* Density is given by the following equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{n}{v} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 1 (as there is only 1 atom per unit cell) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = 1.07722^3 = 1.25 &amp;lt;/math&amp;gt; (lattice spacing = 1.07722) &lt;br /&gt;
&lt;br /&gt;
Thus: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length of a side of one fcc unit cell with number density 1.2 would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = \frac{n}{\rho} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 4 (as there is 4 atoms per unit cell in an fcc lattice) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; = 3.33&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; l = v^{-3} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The number of atoms that would be created by the create_atoms command for an fcc lattice would be: &lt;br /&gt;
&lt;br /&gt;
4 x 1000 = 4000 &lt;br /&gt;
&lt;br /&gt;
This is due to fact that there is 1 atom per unit cell that yeilds 1000 altogether in simple cubic. Fcc has 4 times the number of atoms per unit cell. &lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of Atoms === &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command above has the following purpose: &lt;br /&gt;
&lt;br /&gt;
* The first line sets the mass of all atoms of type &#039;1&#039; to 1.0. &lt;br /&gt;
*  Line 2 is used to control the Lennard-Jones potential. The value of 3.0 indicates the distance in reduced units upon which the potential is calculated. The potential is distance dependent and falls to 0 at large values of r thus only atoms within a distance of 3.0 are considered.  &#039;lj/cut&#039; defines the cut off point. &lt;br /&gt;
* The last line defines the force field constants as 1.0 for all sets of atoms. The * controls the fact that the command is set for all atoms. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet is the integration algorithm that can be used when &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; are defined. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The codes is in place to ensure that the timestep can be varied but the total time taken for the simulation to run will not change.&lt;br /&gt;
&lt;br /&gt;
=== Checking equilibration === &lt;br /&gt;
&lt;br /&gt;
The graphs below illustrate the time it takes for different thermodynamic properties to equilibriate at a timestep of 0.001. The plateau represents the point at which equilibration is achieved. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EnergyVRStime.png|x300px|thumb|Energy Vrs Time|left]]&lt;br /&gt;
! [[File:TEMPvrsTIME.png|x300px|thumb|Temp vrs Time|centre]]&lt;br /&gt;
! [[File:Press Vrs Time.png|x300px|thumb|Pressure Vrs Time|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The graph below illustrates the effect changing the timestep has on equilibration. As can be seen from the graph a from below 0.01 a shorter timestep results in a lower energy value for equilibration until 0.0025 where the value   of equilibration does not change with lower timestep. This trend is due to the fact that a smaller timestep results in a more accurate result however if it is too small this can over-complicate the calculation (especially when there is a large over-all time). Thus a timestep of 0.0025 is ideal. A timestep of 0.025 is too large and results in the system not reaching equilibrium.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EnergyVtimeFORVTS.png|x400px|thumb|Energy Vrs Time with different timesteps|centre]]&lt;br /&gt;
&lt;br /&gt;
= Running Simulations Under Specific Conditions =&lt;br /&gt;
&lt;br /&gt;
The following two equations can be used to define the energy of the system: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The instantaneous tempertaure &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will not remain constant throughout the simulation and will fluctuate, it will thus be different to out target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The value of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2} = \frac{\mathfrak{T}}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within the preceding code: &lt;br /&gt;
&lt;br /&gt;
100 - Nevery: This command results in a sample being taken every 100 steps and being incorporated into the average. 1000 - Nrepreat: Tells the computer how many samples should be used to calculate the average. Nfreq 10 000: At every 10000th timestep an average is calculated. &lt;br /&gt;
&lt;br /&gt;
All thermodynamic properties are calculated by averages that is the necessity for those commands.&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equation of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:DENSITYvrsT.png|x400px|thumb|Density Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
= Calculating Heat Capacities Using Statistic Physics =&lt;br /&gt;
&lt;br /&gt;
Example of input code used: &lt;br /&gt;
&lt;br /&gt;
* Density 0.2&lt;br /&gt;
* Temperature 2.0 &lt;br /&gt;
&lt;br /&gt;
 variable density equal 0.2&lt;br /&gt;
 DEFINE SIMULATION BOX GEOMETRY &amp;lt;br&amp;gt; &lt;br /&gt;
lattice sc ${density} &amp;lt;br&amp;gt; &lt;br /&gt;
region box block 0 15 0 15 0 15 &amp;lt;br&amp;gt; &lt;br /&gt;
create_box 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
create_atoms 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
DEFINE PHYSICAL PROPERTIES OF ATOMS &amp;lt;br&amp;gt; &lt;br /&gt;
mass 1 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_style lj/cut/opt 3.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_coeff 1 1 1.0 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
neighbor 2.0 bin &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY THE REQUIRED THERMODYNAMIC STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable T equal 2.0 &amp;lt;br&amp;gt; &lt;br /&gt;
variable p equal 2.5 &amp;lt;br&amp;gt; &lt;br /&gt;
variable timestep equal 0.0025 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ASSIGN ATOMIC VELOCITIES &amp;lt;br&amp;gt; &lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
SPECIFY ENSEMBLE &amp;lt;br&amp;gt; &lt;br /&gt;
timestep ${timestep} &amp;lt;br&amp;gt; &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 THERMODYNAMIC OUTPUT CONTROL &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom time etotal temp press &amp;lt;br&amp;gt; &lt;br /&gt;
thermo 10 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RECORD TRAJECTORY &amp;lt;br&amp;gt; &lt;br /&gt;
dump traj all custom 1000 output-1 id x y z &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY TIMESTEP &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RUN SIMULATION TO MELT CRYSTAL &amp;lt;br&amp;gt; &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nve &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 BRING SYSTEM TO REQUIRED STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable tdamp equal ${timestep}*100 &amp;lt;br&amp;gt; &lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &amp;lt;br&amp;gt;  &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nvt &amp;lt;br&amp;gt;  &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 MEASURE SYSTEM STATE  &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom step atoms etotal temp press density &amp;lt;br&amp;gt; &lt;br /&gt;
variable atoms2 equal atoms*atoms &amp;lt;br&amp;gt;   &lt;br /&gt;
variable E equal etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable E2 equal etotal*etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens equal density &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens2 equal density*density &amp;lt;br&amp;gt;  &lt;br /&gt;
variable temp equal temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable temp2 equal temp*temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable press equal press &amp;lt;br&amp;gt; &lt;br /&gt;
variable press2 equal press*press &amp;lt;br&amp;gt; &lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_E2 v_E&lt;br /&gt;
run 100000 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
variable HC equal ${atoms2}*(f_aves[7] - f_aves[8]*f_aves[8])/f_aves[5] &amp;lt;br&amp;gt;  &lt;br /&gt;
variable avedens equal f_aves[1] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avetemp equal f_aves[2] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avepress equal f_aves[3] &amp;lt;br&amp;gt; &lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3]) &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;--------&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Temperature: ${temp}&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Heat capacity: ${HC}&amp;quot;  &amp;lt;br&amp;gt;  &lt;br /&gt;
print &amp;quot;atoms&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Structural Properties and the Radial Distribution function =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:G(r).png|x300px|thumb|RDF at different phases|left]]&lt;br /&gt;
! [[File:Integral.png|x300px|thumb|Integral of g(r)|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To carry out the RDF calculations temperature was kept constant at 1.2 but density was varied. &lt;br /&gt;
&lt;br /&gt;
Density in reduced units used for each phase: &lt;br /&gt;
&lt;br /&gt;
* Gas = 0.05&lt;br /&gt;
* Liquid = 0.8 &lt;br /&gt;
* Solid = 1.2&lt;br /&gt;
&lt;br /&gt;
The number of peaks for each RDF plot decreases in the order gas&amp;lt;liquid&amp;lt;solid. This reflects the ordering of each phase. &lt;br /&gt;
A gas has a large degree of disorder and thus produces only peak.&lt;br /&gt;
The liquid has three peaks which gradually decrease in amplitude, this behavior is due to the fact that the liquid is modeled as central molecule surrounded by shells of other molecules, this initially creates some degree of order. As the simulation continues the molecules become more diffuse so the ordering decreases and thus the amplitude of peaks decrease.&lt;br /&gt;
&lt;br /&gt;
= Dynamical Properties and the diffusion coefficient = &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid.png|thumb|solid|x300px|left]]&lt;br /&gt;
! [[File:Liquid.png|thumb|liquid|x300px|centre]]&lt;br /&gt;
! [[File:Gas.png|thumb|gas|x300px|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:VACFvrsTS.png|x400px|thumb|VACF vrs Temperature|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Vapourphse.png|thumb|Vapour Phase|x300px|left]]&lt;br /&gt;
! [[File:Vapour phase 1 million.png|thumb|Vapour Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid(small).png|thumb|Solid Phase|x300px|left]]&lt;br /&gt;
! [[File:Solid1million.png|thumb|Solid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Liquidsmallno..png|thumb|Liquid Phase|x300px|left]]&lt;br /&gt;
! [[File:Liquid1millionatoms.png|thumb|Liquid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 1.64&lt;br /&gt;
| 1.63&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| -0.2215&lt;br /&gt;
| 0.157 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| 0.254&lt;br /&gt;
| -0.123&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Mark Klarpus, Gregory A. Petsko, (1990) &#039;&#039;Molecular Reaction Dynamics in Biology&#039;&#039;, &#039;&#039;&#039;347&#039;&#039;&#039;, 631-9, doi:10.1038/347631a0&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578408</id>
		<title>Rep:Thermomp4114</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Thermomp4114&amp;diff=578408"/>
		<updated>2017-01-26T19:01:41Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: /* Dynamical Properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Molecular Dynamics Simulations of Simple Liquids Introduction == &lt;br /&gt;
&lt;br /&gt;
Molecular dynamic simulations involved studying the motion of a system of particles. Several fundamental elements of a system need to be known in order to achieve this. This includes a knowledge of the interaction potential for the particles and the equations of motion which govern the dynamics of the particles.&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt; Once we know the positions, velocities, and forces, of the atoms (which are obtained using statistical) we can calculate various thermodynamic quantities of the system such as temperature and pressure. We must introduce a series of approximations in order for the caluculations to be feasible. Firstly we apply the &#039;&#039;&#039;The Classical Particle Approximation&#039;&#039;&#039;. The schoedinger equation is too complex to solve for a large system of atoms, however if the atoms are treated classically then the positions and and velocities of each can atom can be calculated using Newton&#039;s second law (equation 1): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = m_i \mathbf{a}_i = m_i \frac{\mathrm{d}\mathbf{v}_i}{\mathrm{d}t} = m_i \frac{\mathrm{d}^2 \mathbf{x}_i}{\mathrm{d}t^2} \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As there are N atoms and therefore N equations representing each atom a computer is a necessity. The &#039;&#039;&#039;Verlet algorithim&#039;&#039;&#039; is used to solve to Newton&#039;s law for all the atoms in the system. In this case time is not continuous but is made discrete, the simulation is thus broeken up into specific &#039;&#039;&#039;timesteps&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The position of atom &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;\mathbf{x}_i \left(t\right)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Positional Verlet algorithim (equation (2)): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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 \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Velocity Verlet algorithim (equation (3)):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{v}_i \left(t\right)&amp;lt;/math&amp;gt; represents the velocity of that atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;center&amp;gt;&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 \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Put in example of industrial applications&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Harmonic Oscillator ===&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator illustrates the the accuracy and discrepancies associated with using the velocity Verlet algorithim. Equation (4) is used to model the behavior of the harmonic oscillator in an analytical sense: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)\ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; = 1.00 &lt;br /&gt;
&lt;br /&gt;
Graph (1) illustrates the results the analytical solution gave for the relationship between position and time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Avrsxt2.png|x300px|thumb|Graph 1: Analytical solution of harmonic oscillator|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The difference in position between the velocity-verlet solution and analytical solution is represented by an error. Error plotted against time is illustrated by graph (2). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ErrorvrsT.png|x300px|thumb|Graph 2: Error vrs Time|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The orange line illustrates the positive trend between error and time. &#039;&#039;&#039;Insert Answer from demonstrator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy of the system will consist of the sum of kinetic and potential energy. Equation (5) can be used to find kinetic energy of the system:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;E_\text{k} =\tfrac{1}{2} mv(t)^2 \ \ (5)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\mathbf{x} \left(t\right)&amp;lt;/math&amp;gt; is used in equation (5) the potential energy can be found. &lt;br /&gt;
&lt;br /&gt;
The following graphs represent the difference in change in energy with time when the timestep is varied. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EvrsTime.png|x200px|thumb|Energy change when a timestep of 0.1 is used|left]]&lt;br /&gt;
! [[File:Energy vrs time for 0.15 timestep.png|x200px|thumb|Energy change when a timestep of 0.15 is used|centre]]&lt;br /&gt;
! [[File:Energy vrs time for 0.2 timestep.png|x200px|thumb|Energy change when a timestep of 0.2 is used|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The maximum change in energy for each of the different timesteps is shown in table (1). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | Timestep&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.1&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.15&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.2&lt;br /&gt;
|-&lt;br /&gt;
| Max. change in Energy&lt;br /&gt;
| 0.2%&lt;br /&gt;
| 0.6%&lt;br /&gt;
| 1%&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results clearly indicate that a timestep greater than &#039;&#039;&#039;0.2&#039;&#039;&#039; will result in an energy change greater than 1%. As the timestep increases as does the maximum error. The timestep defines the number of calculations made in a given time, therefore the shorter the timestep the larger the number of calculations carried out and therefore a more accurate result is produced. The total energy of a real physical system should not change, when modeled numerically there can be fluctuations therefore it is important to monitor this change and ensure that the fluctuations are minimised.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces ===&lt;br /&gt;
&lt;br /&gt;
The forces an atom experiences is determined by the positions of all the atoms in the system, &amp;lt;math&amp;gt;\mathbf{r}^N&amp;lt;/math&amp;gt;. The Lennard-Jones function accurately sums all the key inter-atomic forces an atoms experiences (U). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ (10)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
For a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After division by 4 and rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_0^{6}} = \frac{\sigma^{6}}{r_0^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After further rearrangement and cancelling down: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;-\sigma &amp;lt;/math&amp;gt; is also a solution however this can be disregarded. &lt;br /&gt;
&lt;br /&gt;
In order to calculate the force the following equation is used: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\sigma\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After differentiation and simplification: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}(r_0) =  \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &#039;&#039;&#039; ask demonstrator if thats too brief &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
At equilibrium: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{12\sigma^{12}}{r_e^{13}} - \frac{6\sigma^6}{r_e^7} \right)&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
After rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_e = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This value of &amp;lt;math&amp;gt; r_e &amp;lt;/math&amp;gt; can now be used to find the well depth:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{\sigma^{12}}{4sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon\left(\frac{1}{5r^{5}} - \frac{1}{11r^11} \right)^\infty_2 \simeq -2.48 \sdot 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -8.18 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -3.29 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Finish off atomic forces - enter integrals&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
* No. of moles in  1 mL of water = 0.056 &amp;lt;br&amp;gt; &lt;br /&gt;
* No. of molecules = moles x Avogadro&#039;s constant = 3.37 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*1000 molecules = 1.66 x 10&amp;lt;sup&amp;gt;21&amp;lt;/sup&amp;gt; moles&lt;br /&gt;
* Density = mass/vol. = 1 &lt;br /&gt;
*vol. = mass/density = 2.99 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Due to periodic boundary condition once the atom leaves the current box it will enter the beginning of an identical box. The atom is at &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; and thus once it breaches 0.5 in a particular direction it will be at the start of the next box. Using these principles after the atom moves &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will be at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units === &lt;br /&gt;
&lt;br /&gt;
Reduced units are applied to the Lennard-Jones equation to make the calculation more managable.&lt;br /&gt;
&lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For argon:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Distance in real units: r = 1.09 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Well depth = &amp;lt;math&amp;gt;{\epsilon}&amp;lt;/math&amp;gt; = 0.996 KJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* T = 180 K &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Do I need to show working out?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Equilibriation = &lt;br /&gt;
&lt;br /&gt;
=== Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
As there is a large number of atoms in a discrete volume allowing random assignment of positions could result in atoms overlapping. This would cause an unrealistically high potential as potential is distance dependant (as observed in the Lennard - Jones equation).&lt;br /&gt;
&lt;br /&gt;
* Density is given by the following equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{n}{v} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 1 (as there is only 1 atom per unit cell) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = 1.07722^3 = 1.25 &amp;lt;/math&amp;gt; (lattice spacing = 1.07722) &lt;br /&gt;
&lt;br /&gt;
Thus: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length of a side of one fcc unit cell with number density 1.2 would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = \frac{n}{\rho} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 4 (as there is 4 atoms per unit cell in an fcc lattice) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; = 3.33&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; l = v^{-3} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The number of atoms that would be created by the create_atoms command for an fcc lattice would be: &lt;br /&gt;
&lt;br /&gt;
4 x 1000 = 4000 &lt;br /&gt;
&lt;br /&gt;
This is due to fact that there is 1 atom per unit cell that yeilds 1000 altogether in simple cubic. Fcc has 4 times the number of atoms per unit cell. &lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of Atoms === &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command above has the following purpose: &lt;br /&gt;
&lt;br /&gt;
* The first line sets the mass of all atoms of type &#039;1&#039; to 1.0. &lt;br /&gt;
*  Line 2 is used to control the Lennard-Jones potential. The value of 3.0 indicates the distance in reduced units upon which the potential is calculated. The potential is distance dependent and falls to 0 at large values of r thus only atoms within a distance of 3.0 are considered.  &#039;lj/cut&#039; defines the cut off point. &lt;br /&gt;
* The last line defines the force field constants as 1.0 for all sets of atoms. The * controls the fact that the command is set for all atoms. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet is the integration algorithm that can be used when &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; are defined. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The codes is in place to ensure that the timestep can be varied but the total time taken for the simulation to run will not change.&lt;br /&gt;
&lt;br /&gt;
=== Checking equilibration === &lt;br /&gt;
&lt;br /&gt;
The graphs below illustrate the time it takes for different thermodynamic properties to equilibriate at a timestep of 0.001. The plateau represents the point at which equilibration is achieved. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EnergyVRStime.png|x300px|thumb|Energy Vrs Time|left]]&lt;br /&gt;
! [[File:TEMPvrsTIME.png|x300px|thumb|Temp vrs Time|centre]]&lt;br /&gt;
! [[File:Press Vrs Time.png|x300px|thumb|Pressure Vrs Time|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The graph below illustrates the effect changing the timestep has on equilibration. As can be seen from the graph a from below 0.01 a shorter timestep results in a lower energy value for equilibration until 0.0025 where the value   of equilibration does not change with lower timestep. This trend is due to the fact that a smaller timestep results in a more accurate result however if it is too small this can over-complicate the calculation (especially when there is a large over-all time). Thus a timestep of 0.0025 is ideal. A timestep of 0.025 is too large and results in the system not reaching equilibrium.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EnergyVtimeFORVTS.png|x400px|thumb|Energy Vrs Time with different timesteps|centre]]&lt;br /&gt;
&lt;br /&gt;
= Running Simulations Under Specific Conditions =&lt;br /&gt;
&lt;br /&gt;
The following two equations can be used to define the energy of the system: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The instantaneous tempertaure &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will not remain constant throughout the simulation and will fluctuate, it will thus be different to out target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The value of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2} = \frac{\mathfrak{T}}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within the preceding code: &lt;br /&gt;
&lt;br /&gt;
100 - Nevery: This command results in a sample being taken every 100 steps and being incorporated into the average. 1000 - Nrepreat: Tells the computer how many samples should be used to calculate the average. Nfreq 10 000: At every 10000th timestep an average is calculated. &lt;br /&gt;
&lt;br /&gt;
All thermodynamic properties are calculated by averages that is the necessity for those commands.&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equation of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:DENSITYvrsT.png|x400px|thumb|Density Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
= Calculating Heat Capacities Using Statistic Physics =&lt;br /&gt;
&lt;br /&gt;
Example of input code used: &lt;br /&gt;
&lt;br /&gt;
* Density 0.2&lt;br /&gt;
* Temperature 2.0 &lt;br /&gt;
&lt;br /&gt;
 variable density equal 0.2&lt;br /&gt;
 DEFINE SIMULATION BOX GEOMETRY &amp;lt;br&amp;gt; &lt;br /&gt;
lattice sc ${density} &amp;lt;br&amp;gt; &lt;br /&gt;
region box block 0 15 0 15 0 15 &amp;lt;br&amp;gt; &lt;br /&gt;
create_box 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
create_atoms 1 box &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
DEFINE PHYSICAL PROPERTIES OF ATOMS &amp;lt;br&amp;gt; &lt;br /&gt;
mass 1 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_style lj/cut/opt 3.0 &amp;lt;br&amp;gt; &lt;br /&gt;
pair_coeff 1 1 1.0 1.0 &amp;lt;br&amp;gt; &lt;br /&gt;
neighbor 2.0 bin &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY THE REQUIRED THERMODYNAMIC STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable T equal 2.0 &amp;lt;br&amp;gt; &lt;br /&gt;
variable p equal 2.5 &amp;lt;br&amp;gt; &lt;br /&gt;
variable timestep equal 0.0025 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ASSIGN ATOMIC VELOCITIES &amp;lt;br&amp;gt; &lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
SPECIFY ENSEMBLE &amp;lt;br&amp;gt; &lt;br /&gt;
timestep ${timestep} &amp;lt;br&amp;gt; &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 THERMODYNAMIC OUTPUT CONTROL &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom time etotal temp press &amp;lt;br&amp;gt; &lt;br /&gt;
thermo 10 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RECORD TRAJECTORY &amp;lt;br&amp;gt; &lt;br /&gt;
dump traj all custom 1000 output-1 id x y z &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 SPECIFY TIMESTEP &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 RUN SIMULATION TO MELT CRYSTAL &amp;lt;br&amp;gt; &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nve &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 BRING SYSTEM TO REQUIRED STATE &amp;lt;br&amp;gt; &lt;br /&gt;
variable tdamp equal ${timestep}*100 &amp;lt;br&amp;gt; &lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &amp;lt;br&amp;gt;  &lt;br /&gt;
run 10000 &amp;lt;br&amp;gt; &lt;br /&gt;
reset_timestep 0 &amp;lt;br&amp;gt; &lt;br /&gt;
unfix nvt &amp;lt;br&amp;gt;  &lt;br /&gt;
fix nve all nve &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 MEASURE SYSTEM STATE  &amp;lt;br&amp;gt; &lt;br /&gt;
thermo_style custom step atoms etotal temp press density &amp;lt;br&amp;gt; &lt;br /&gt;
variable atoms2 equal atoms*atoms &amp;lt;br&amp;gt;   &lt;br /&gt;
variable E equal etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable E2 equal etotal*etotal &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens equal density &amp;lt;br&amp;gt; &lt;br /&gt;
variable dens2 equal density*density &amp;lt;br&amp;gt;  &lt;br /&gt;
variable temp equal temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable temp2 equal temp*temp &amp;lt;br&amp;gt; &lt;br /&gt;
variable press equal press &amp;lt;br&amp;gt; &lt;br /&gt;
variable press2 equal press*press &amp;lt;br&amp;gt; &lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_E2 v_E&lt;br /&gt;
run 100000 &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
variable HC equal ${atoms2}*(f_aves[7] - f_aves[8]*f_aves[8])/f_aves[5] &amp;lt;br&amp;gt;  &lt;br /&gt;
variable avedens equal f_aves[1] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avetemp equal f_aves[2] &amp;lt;br&amp;gt; &lt;br /&gt;
variable avepress equal f_aves[3] &amp;lt;br&amp;gt; &lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2]) &amp;lt;br&amp;gt; &lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3]) &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;--------&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Temperature: ${temp}&amp;quot; &amp;lt;br&amp;gt; &lt;br /&gt;
print &amp;quot;Heat capacity: ${HC}&amp;quot;  &amp;lt;br&amp;gt;  &lt;br /&gt;
print &amp;quot;atoms&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Structural Properties and the Radial Distribution function =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:G(r).png|x300px|thumb|RDF at different phases|left]]&lt;br /&gt;
! [[File:Integral.png|x300px|thumb|Integral of g(r)|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To carry out the RDF calculations temperature was kept constant at 1.2 but density was varied. &lt;br /&gt;
&lt;br /&gt;
Density in reduced units used for each phase: &lt;br /&gt;
&lt;br /&gt;
* Gas = 0.05&lt;br /&gt;
* Liquid = 0.8 &lt;br /&gt;
* Solid = 1.2&lt;br /&gt;
&lt;br /&gt;
The number of peaks for each RDF plot decreases in the order gas&amp;lt;liquid&amp;lt;solid. This reflects the ordering of each phase. &lt;br /&gt;
A gas has a large degree of disorder and thus produces only peak.&lt;br /&gt;
The liquid has three peaks which gradually decrease in amplitude, this behavior is due to the fact that the liquid is modeled as central molecule surrounded by shells of other molecules, this initially creates some degree of order. As the simulation continues the molecules become more diffuse so the ordering decreases and thus the amplitude of peaks decrease.&lt;br /&gt;
&lt;br /&gt;
= Dynamical Properties and the diffusion coefficient = &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid.png|thumb|solid|x300px|left]]&lt;br /&gt;
! [[File:Liquid.png|thumb|liquid|x300px|centre]]&lt;br /&gt;
! [[File:Gas.png|thumb|gas|x300px|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:VACFvrsTS.png|x400px|thumb|VACF vrs Temperature|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Vapourphse.png|thumb|Vapour Phase|x300px|left]]&lt;br /&gt;
! [[File:Vapour phase 1 million.png|thumb|Vapour Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid(small).png|thumb|Solid Phase|x300px|left]]&lt;br /&gt;
! [[File:Solid1million.png|thumb|Solid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Liquidsmallno..png|thumb|Liquid Phase|x300px|left]]&lt;br /&gt;
! [[File:Liquid1millionatoms.png|thumb|Liquid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Mark Klarpus, Gregory A. Petsko, (1990) &#039;&#039;Molecular Reaction Dynamics in Biology&#039;&#039;, &#039;&#039;&#039;347&#039;&#039;&#039;, 631-9, doi:10.1038/347631a0&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Liquidsmallno..png&amp;diff=578407</id>
		<title>File:Liquidsmallno..png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Liquidsmallno..png&amp;diff=578407"/>
		<updated>2017-01-26T19:01:20Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Liquid1millionatoms.png&amp;diff=578405</id>
		<title>File:Liquid1millionatoms.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Liquid1millionatoms.png&amp;diff=578405"/>
		<updated>2017-01-26T18:59:21Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Solid1million.png&amp;diff=578403</id>
		<title>File:Solid1million.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Solid1million.png&amp;diff=578403"/>
		<updated>2017-01-26T18:58:08Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Solid(small).png&amp;diff=578396</id>
		<title>File:Solid(small).png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Solid(small).png&amp;diff=578396"/>
		<updated>2017-01-26T18:56:47Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Vapour_phase_1_million.png&amp;diff=578393</id>
		<title>File:Vapour phase 1 million.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Vapour_phase_1_million.png&amp;diff=578393"/>
		<updated>2017-01-26T18:55:43Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Vapourphse.png&amp;diff=578391</id>
		<title>File:Vapourphse.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Vapourphse.png&amp;diff=578391"/>
		<updated>2017-01-26T18:54:34Z</updated>

		<summary type="html">&lt;p&gt;Mp4114: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mp4114</name></author>
	</entry>
</feed>