<?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=Sl10014</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=Sl10014"/>
	<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/wiki/Special:Contributions/Sl10014"/>
	<updated>2026-04-30T03:19:32Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560841</id>
		<title>Rep:Mod:SUNG95</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560841"/>
		<updated>2016-10-21T11:00:01Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: /* Velocity Autocorrelation Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Theory ==&lt;br /&gt;
=== The Velocity-Verlet Algorithm ===&lt;br /&gt;
[[File:Verlet-Velocity.png|thumb|700px|x(t) derived from the velocity-Verlet algorithm compared with the position of the classical harmonic oscillator.|left]]&lt;br /&gt;
[[File:Verlet-Energy.png|thumb|700px|Total energy of the system with respect to time|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Verlet-Error.png|thumb|700px|The error derived by comparing the solution of the velocity-Verlet algorithm with the position of the classical harmonic oscillator|none]]&lt;br /&gt;
&lt;br /&gt;
The three graphs above display the position of an atom, the total energy of the system and the error between the two methods of calculating the atom position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Error wrt Time.png|thumb|600px|Maximum Error against Time|none]]&lt;br /&gt;
&lt;br /&gt;
From this graph of Maximum error vs Time, we can see that error increases with time at a stable linear rate.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Running the same calculations with varying timesteps show the importance of choosing the right value of the timestep:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Energy at t=0.05.png|Energy at timestep=0.05&lt;br /&gt;
Image:Energy at t=0.5.png|Energy at timestep=0.5&lt;br /&gt;
Image:Error at t=0.5.png|Error at timestep=0.5&lt;br /&gt;
Image:Error at t=0.05.png|Error at timestep=0.05&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examining the four additional graphs above, we can notice that a shorter timestep is able to provide a smaller value for error and that the energy fluctuates less than when a bigger value of timestep is used. However, a shorter timestep results in a shorter simulation type, which can result in a less realistic simulation. It is therefore important to find the right balance between the two.&lt;br /&gt;
&lt;br /&gt;
Through trial and error, it has been found that timestep = 0.2850 or lower results in an energy fluctuation that is smaller than 1% over the course of the simulation. A small fluctuation in energy indicates higher resemblance to reality as technically the total energy should not fluctuate at all due to the Law of Conservation of Energy.&lt;br /&gt;
&lt;br /&gt;
=== Lennard-Jones Potential ===&lt;br /&gt;
The equation to calculate the Lennard-Jones potential is as follows:&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;
By equating this to 0, we find that the &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the separation at which the potential is 0, is &amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We can then find the force at this separation by differentiating the Lennard-Jones potential with respect to r, and substituting in &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}=\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24 \frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation (&amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;) is the separation of the particles at equilibrium, and represents the separation at which the potential energy is at a minimum. It can thus be found by setting &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}&amp;lt;/math&amp;gt;, (or &amp;lt;math&amp;gt;\mathbf{F}&amp;lt;/math&amp;gt;) to 0.&lt;br /&gt;
&lt;br /&gt;
Hence,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right) 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; gives us the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To put this equation into perspective, let us calculate the L-J potential for some realistic cutoff values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int 4\epsilon \left(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=4 \epsilon \left(\frac{\sigma^{12}}{11r^{11}}-\frac{\sigma^6}{5r^5}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\lim_{r\rightarrow \infty} 4 \left(\frac{1^{12}}{11r^{11}}-\frac{1^6}{5r^5}\right) - 4\left(\frac{1^{12}}{11\times 2^{11}}+\frac{1^6}{5\times 2^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=0-0.024822\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following the same calculations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0081767\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0032901\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The calculations show that as the cutoff distance increases, the Lennard-Jones potential decreases, which agrees with the theory.&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
It is very difficult to simulate realistic volumes of liquid and in the scope of this experiment, we have simulated liquids with N (number of atoms) between 1,000 and 10,000. To demonstrate why simulating realistic volumes of liquid is difficult, let us first calculate the number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
(Assuming: Standard conditions; Density of water = 1.00 g/ml)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.00 \mathrm{ml} = 1.00 \mathrm{g}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;18.02 \mathrm{g/mol} = 0.0555 \text{ mols of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.0555 \times 6.022 \times 10^{23} = 3.34 \times 10^{22} \text{ molecules of water.}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the other hand, 10,000 water molecules is only &amp;lt;math&amp;gt;2.99 \times 10^{-19} \text{ ml of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus, in order to be able to complete the simulation in a practical amount of time, we place our atoms in a box that is repeated in all directions, similar to how unit cells repeat themselves in a lattice. When an atom crosses the boundary of the box, its replica enters the same box from the other side, thus keeping the total number of atoms in the box constant.&lt;br /&gt;
&lt;br /&gt;
For example, if an atom at position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a cubic box ranging from &amp;lt;math&amp;gt;(0, 0, 0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;, its final position would be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;, if the periodic boundary conditions have been applied.&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units ===&lt;br /&gt;
The LAMMPS calculations run in this experiment are all done in reduced units&lt;br /&gt;
&lt;br /&gt;
For example, the Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34 \mathrm{nm}&amp;lt;/math&amp;gt;; &amp;lt;math&amp;gt;\epsilon/k_B=120K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If we set the cutoff to be &amp;lt;math&amp;gt;r*=3.2,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=3.2\times0.34=1.088\mathrm{nm}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Well depth: &amp;lt;math&amp;gt;\epsilon=120K\times k_B \times 6.02 \times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon=0.998 \mathrm{kJ/mol}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and reduced temperature &amp;lt;math&amp;gt;T*=1.5&amp;lt;/math&amp;gt; would be &amp;lt;math&amp;gt;T=1.5 \times 120=180\mathrm{K}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
=== Creating Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
In order to simulate a liquid for this experiment, we first create a crystal lattice, then melt that lattice to create a liquid. This is preferable to generating a liquid since assigning a random position for each new atom could result in two or more atoms being generated in the same space, causing an error when running the simulation.&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is one lattice point per unit cell. Hence, if the number density is 0.8,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8 \text{ points/volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sqrt[3]{0.8}=0.9283\text{ points/length}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.9283^{-1}=1.0772 \text{ length/point}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is thus 1.0772 unit lengths of spacing between each point.&lt;br /&gt;
&lt;br /&gt;
Following the same logic, a face-centred cubic lattice (with 4 lattice points per unit cell) with a density of 1.2 would have a spacing of &amp;lt;math&amp;gt;0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\because \sqrt[3]{4.8^{-1}}=0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, the simple cubic lattice with a density of 0.8 would create 1,000 atoms in the given constraints of the box:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;region box block 0 10 0 10 0 10&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and a face centred cubic lattice with a density of 1.2 would create 4,000 atoms in the same box.&lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of the Atoms ===&lt;br /&gt;
In the input script, there are the following lines describing the properties of the atoms:&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;
In the first line, we are setting the mass of type 1 atoms (which includes all of the atoms in our simulation box, as we have created only one type of atoms) as &amp;lt;math&amp;gt;1.0&amp;lt;/math&amp;gt;, in reduced units. The second line defines the interaction between the atoms as a Lenard-Jones interaction, with a cutoff distance of &amp;lt;math&amp;gt;3.0 \text{ units.}&amp;lt;/math&amp;gt; Finally, the last line defines the coefficient in the Lenard-Jones interaction; the asterisk tells LAMMPS that the coefficients apply to all atoms in our system; the first coefficient is &amp;lt;math&amp;gt;\epsilon=1.0&amp;lt;/math&amp;gt; and the second coefficient is &amp;lt;math&amp;gt;\sigma=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After setting the properties of the atoms, we also defined the initial positions and the initial velocities for the atoms in the input script. Since we have both the &amp;lt;math&amp;gt;\mathbf{x}_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, we can use the Velocity-Verlet integration algorithm that employs the half-step method.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
In the following lines from the input script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we created and reset a variable called timestep to equal 0.001, then used that value to calculate how many runs (${n_steps}) to carry out. This is more beneficial than simply setting&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;
as it allows us to only change the value of the timestep variable to alter the number of runs, rather than having to calculate ${n_steps} ourselves every time we change the timestep, especially in cases such as this computational experiment where the timestep was changed multiple times.&lt;br /&gt;
&lt;br /&gt;
=== Checking Equilibration ===&lt;br /&gt;
&lt;br /&gt;
[[File:TotalE at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Temp at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Press at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
&lt;br /&gt;
These graphs have been plotted to ensure that the simulation reaches equilibrium, and we can see that indeed, they do, and very quickly. Analysis of the graphs show that equilibrium is reached before 1 timestep.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
The following graph shows the total energy of the system against time at varying timestep values:&lt;br /&gt;
&lt;br /&gt;
[[File:Equil Energy.png|thumb|800px|none]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from the graphs that for timestep = 0.001, 0.0025 and 0.0075, the energy reaches a stable equilibrium but for timestep = 0.01 and timestep = 0.015, the energy slowly decreases and rapidly increases, respectively, indicating that the results of the simulation are not very accurate for these values of timestep. Timestep = 0.015 is especially bad as it very obviously does not reach an equilibrium.&lt;br /&gt;
&lt;br /&gt;
Therefore, timestep = 0.0075 would be the ideal value as it provides the highest accuracy, while running the simulation for a suitably long time to provide realistic results.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions (NpT) ==&lt;br /&gt;
&lt;br /&gt;
=== Temperature and Pressure Control ===&lt;br /&gt;
&lt;br /&gt;
Pressures chosen: 2.61, 2.63&lt;br /&gt;
&lt;br /&gt;
Temperatures chosen: 1.5, 1.6, 1.7, 1.8, 1.9&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 was chosen to provide the highest accuracy possible, without shortening the simulation time too much.&lt;br /&gt;
&lt;br /&gt;
In our simulation, the temperature was controlled by solving the two following equations for the instantaneous temperature &amp;lt;math&amp;gt;T,&amp;lt;/math&amp;gt; which fluctuates.&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 \qquad\qquad\qquad(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order for &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; to reach our target temperature &amp;lt;math&amp;gt;\mathfrak{T},&amp;lt;/math&amp;gt; we introduce a constant &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; to control the velocity such that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}\qquad\qquad(2)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can solve eq. &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt; to solve for &amp;lt;math&amp;gt;\gamma.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\sum_i m_i v_i^2 = 3N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substituting &amp;lt;math&amp;gt;\sum_i m_i v_i^2&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 3 N k_b T = 3N k_b \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\epsilon}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Examining the Input Script ===&lt;br /&gt;
&lt;br /&gt;
To calculate the average values for our simulation, we set certain parameters for LAMMPS in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time Nevery Nrepeat Nfreq&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Final averages are generated on timesteps that are multiples of Nevery, for Nrepeat number of times and an average is generated every Nfreq timesteps.&lt;br /&gt;
&lt;br /&gt;
In our script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The results are sampled at every 100 timesteps for 1000 times (100, 200, 300, etc.) Averages are generated every 100,000 timesteps, but our simulation runs for the same amount of time so only one average is generated from this code.&lt;br /&gt;
&lt;br /&gt;
The timestep chosen for this section of the experiment was 0.0025. Therefore, the simulation was run for &amp;lt;math&amp;gt;100000 \times 0.0025 = 250 \text{ unit time}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equations of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:Density Temp.png|700px]]&lt;br /&gt;
&lt;br /&gt;
The graph above shows the density of the simulated liquid against temperature, compared with the densities derived from the ideal gas law.&lt;br /&gt;
&lt;br /&gt;
It can be seen that within the ranges set for this simulation, the discrepancy between the simulated densities compared to the calculated densities are very high, to the point that the error bars for the y-axis is not even visible on the graph. Perhaps a more accurate simulation could have been run if a wider temperature and pressure ranges were selected.&lt;br /&gt;
&lt;br /&gt;
With the data range being one possible source of error between the simulation and the ideal gas law prediction, another possible factor is that the parameters set for this simulation are such that the repulsive force of the Lennard-Jones interaction is more significant than the attractive force. Since the ideal gas law assumes no electronic interaction between the particles, introducing a repulsive force would result in the density of the liquid being lower than the prediction.&lt;br /&gt;
&lt;br /&gt;
The most likely explanation, however, is that the ideal gas law, as its name suggests, is not very good at predicting the behavious of liquids. While both gas and liquid phases are fluids, there are major differences between them such as a much more prominent long-range order effect in liquids compared to gases.&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacity ==&lt;br /&gt;
&lt;br /&gt;
[[File:HeatCap vs Density.png|thumb|800px|Graph of &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; against Temperature|none]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From thermodynamics:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;dU = TdS - PdV&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = T\frac{\partial S}{\partial T}-P\frac{\partial V}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and since &amp;lt;math&amp;gt;\frac{\partial S}{\partial T}\geq 0,&amp;lt;/math&amp;gt; heat capacity should increase with increasing temperature.&lt;br /&gt;
&lt;br /&gt;
The fact that &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; decreases with increasing temperature suggests that either the increase in temperature is causing the internal energy to increase at a faster rate than itself, or that there are issues with the simulation originating from possible sources such as small sampling size (number of atoms generated) or short run time.&lt;br /&gt;
&lt;br /&gt;
== Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
[[File:RDF SHL.png|thumb|700px]]&lt;br /&gt;
&lt;br /&gt;
Looking at the graph on the right, it can be noticed that the three phases have clearly different Radial Distribution Functions (RDF) from each other. This can be attributed to the varying degrees of order each of the phases have: the atoms in the gas phase are completely free to move around, while atoms in the liquid phase have less freedom and in the solid phase, the atoms are set in a lattice, with only vibrational motion and no (or negligible) translational motion.&lt;br /&gt;
&lt;br /&gt;
In order to explain the graph, let us consider the RDF to be displaying the &amp;quot;effective density&amp;quot; of atoms in an area of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; at a distance &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; from a certain reference atom.&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf schematic.jpg|thumb|200px|Schematic of RDF|left]]&lt;br /&gt;
&lt;br /&gt;
There are three main parts to the RDF graphs: the region near the origin where the &amp;lt;math&amp;gt;\mathrm{RDF} = 0&amp;lt;/math&amp;gt;, the region after where there are big peaks and troughs, and the final region where the graphs have mostly reached equilibrium.&lt;br /&gt;
&lt;br /&gt;
First of all, the region near the origin is 0 for all three phases as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; is still within the volume (the hard sphere) of the reference atom, and hence there can be no other atoms in that radius.&lt;br /&gt;
&lt;br /&gt;
The peaks in the second region indicate that there is a higher &amp;quot;effective density&amp;quot; of atoms. The explanation for this is different for the lattice structure (solid) and the fluids (liquid and gas).&lt;br /&gt;
&lt;br /&gt;
For the liquid and gas phase, the peaks are due to the attractive force caused by the Lennard-Jones potential. We have calculated above [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:SUNG95#Lennard-Jones_Potential (1.2 LJ Potential)] that &amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}.&amp;lt;/math&amp;gt; Setting &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt; (as we have in our input file), we get &amp;lt;math&amp;gt;r_{eq} = 1.122&amp;lt;/math&amp;gt;, which is very close to where the largest peaks are for the two fluid phases.&lt;br /&gt;
&lt;br /&gt;
For the solid, where all the atoms are in a lattice structure, the effects due to the Lennard-Jones interaction becomes neglibigle. Instead, there will be certain values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where the effective density is higher than the overall density of the sample (the peaks), and some values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where it is lower than the density of the sample (the troughs). This is arisen from the fact that as the value of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the total volume covered by &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; also increases. But since all the atoms are set in place by the lattice, the number of atoms that &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; encompasses stays relatively constant. As a result, the peaks and the troughs tend to 1 with increasing &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the case of the gas phase, the atoms are completely free to move around and the RDF graph can be entirely attributed to the effects of the L-J interaction. This justifies the lack of troughs for this phase. Furthermore, as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the attractive part of the L-J interaction &amp;lt;math&amp;gt;\frac{1}{r^6}&amp;lt;/math&amp;gt; gets exponentially smaller and quickly becomes negligible - RDF reaches equilibrium.&lt;br /&gt;
&lt;br /&gt;
Finally, the liquid phase can be considered to act as a mix between the solid phase and the gas phase: the L-J interactions are significant enough to reach equilibrium at a rate similar to the gas phase, but there exists an ordering of the atoms such that there are values of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; where the effective density is lower than the overall density.&lt;br /&gt;
&lt;br /&gt;
From the RDF of the solid phase, each of the peaks point to a certain lattice point. Simple geometrical calculations can be done to indicate that the first peak, which is the lattice point (1) closest to the reference atom (O), is at a separation of &amp;lt;math&amp;gt;\mathrm{r}=1.056.&amp;lt;/math&amp;gt; Second closest point (2) is at a distance of &amp;lt;math&amp;gt;\mathrm{r}=1.4938&amp;lt;/math&amp;gt; and the third (3) at &amp;lt;math&amp;gt;\mathrm{r}=1.8295.&amp;lt;/math&amp;gt; These points agree with the x-axis on the RDF graphs.&lt;br /&gt;
&lt;br /&gt;
[[File:FCC-SHL.png|thumb|Face-centered cubic lattice|none]]&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
The Diffusion Coefficients &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; of a simulated gas, liquid and solid were calculated using several different methods:&lt;br /&gt;
&lt;br /&gt;
1) From the Mean Squared Displacement (MSD) of 8,000 simulated atoms, according to the equation &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) From the MSD of a million atoms&lt;br /&gt;
&lt;br /&gt;
3) From the Velocity Autocorrelation Function (VACF), by integration.&lt;br /&gt;
&lt;br /&gt;
4) From the VACF of a million atoms&lt;br /&gt;
&lt;br /&gt;
The results were as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Diffusion Coefficients (unit area/unit time)&lt;br /&gt;
! Phase !! From MSD !! From MSD (million atoms) !! From VCAF !! From VCAF (million atoms)&lt;br /&gt;
|-&lt;br /&gt;
| Gas || &amp;lt;math&amp;gt;6.05&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;3.22&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;6.32&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;3.27&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || &amp;lt;math&amp;gt;0.0855&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.0892&amp;lt;/math&amp;gt; ||&amp;lt;math&amp;gt;0.0979&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.09&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Solid || &amp;lt;math&amp;gt;0.000896&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;1.5 \times 10^{-5}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;-1.66 \times 10^{-5}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;4.55\times 10^{-5}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
We can see from the table that the diffusion coefficients calculated from the same number of atoms agree very well with each other, which suggests that the results are quite precise. However, we can assume that the million atoms simulations inevitably provide more accurate data.&lt;br /&gt;
&lt;br /&gt;
The results also make sense logically, where the gas have the highest diffusion coefficient (they are able to diffuse much faster) than the liquid, and the diffusion coefficient of the solid is close to 0.&lt;br /&gt;
&lt;br /&gt;
=== Mean Squared Displacement ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The Mean Squared Displacement can be used to find the Diffusion Coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, via the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Plotting the mean squared displacement (MSD) against time, then finding the linear gradient would give us the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD-SHL.png|thumb|600px|none]][[File:MSD Mill SHL.png|thumb|600px|none]]&lt;br /&gt;
&lt;br /&gt;
Graphical analysis showed that the last 1,000 timesteps are suitably linear to apply this equation, and the Diffusion Coefficients for the three different phases were found from the last 1,000 timesteps.&lt;br /&gt;
&lt;br /&gt;
=== Velocity Autocorrelation Function ===&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;
From the 1D Harmonic Oscillator:&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;
Differentiating this gives the velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = -A\omega \sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting this into the integrated form of the VAFC:&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) \cdot A \omega \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(A \omega \sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, from the trigonometric identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin \left(\alpha + \beta \right)= \sin\alpha\cos\beta + \sin\beta\cos\alpha,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(\omega t + \phi + \omega\tau\right) = \sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \left(\sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\cos\left(\omega \tau\right) + \int_{-\infty}^{\infty} \sin \left(\omega \tau\right) \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt; is a constant so &amp;lt;math&amp;gt;\cos\left(\omega\tau\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sin\left(\omega\tau\right)&amp;lt;/math&amp;gt; can be taken out of the integral.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\cos\left(\omega \tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) + \sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; can cancel out:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\sin(x)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;\cos(x)&amp;lt;/math&amp;gt; is an even function, &amp;lt;math&amp;gt;\sin(x)\cos(x)&amp;lt;/math&amp;gt; is an odd function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; is an odd function (While the value of &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; can change whether or not the functions are even or odd, it shifts both functions by the same amount and the resulting &amp;lt;math&amp;gt;\cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; will still be odd)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}=\cos\left(\omega \tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\cos\left(\omega \tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF-SHL.png|thumb|800px|Comparison of Normalised VACF with VACF of Liquid and Solid|left]]&lt;br /&gt;
&lt;br /&gt;
We can see from this graph that while the VACF of the liquid quickly decorrelates to 0, the solid still retains some minor fluctuations. This is due to the fact that the atoms in a liquid are more free to move around and collide with each other, &amp;quot;forgetting&amp;quot; what its initial velocity was from exchanging energy, whereas for atoms in the solid state, they are already in a relatively stable position (similar to &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; in L-J interactions) and oscillate about 0. Eventually, atoms in solids, too, will decay, but at a much slower rate than in liquids.&lt;br /&gt;
&lt;br /&gt;
The VACF for the harmonic oscillator does not decay at all since the decorrelation arises from the atoms exchanging energy with their neighbours, which does not occur in harmonic oscillators.&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560839</id>
		<title>Rep:Mod:SUNG95</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560839"/>
		<updated>2016-10-21T10:58:52Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: /* Dynamical Properties and the Diffusion Coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Theory ==&lt;br /&gt;
=== The Velocity-Verlet Algorithm ===&lt;br /&gt;
[[File:Verlet-Velocity.png|thumb|700px|x(t) derived from the velocity-Verlet algorithm compared with the position of the classical harmonic oscillator.|left]]&lt;br /&gt;
[[File:Verlet-Energy.png|thumb|700px|Total energy of the system with respect to time|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Verlet-Error.png|thumb|700px|The error derived by comparing the solution of the velocity-Verlet algorithm with the position of the classical harmonic oscillator|none]]&lt;br /&gt;
&lt;br /&gt;
The three graphs above display the position of an atom, the total energy of the system and the error between the two methods of calculating the atom position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Error wrt Time.png|thumb|600px|Maximum Error against Time|none]]&lt;br /&gt;
&lt;br /&gt;
From this graph of Maximum error vs Time, we can see that error increases with time at a stable linear rate.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Running the same calculations with varying timesteps show the importance of choosing the right value of the timestep:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Energy at t=0.05.png|Energy at timestep=0.05&lt;br /&gt;
Image:Energy at t=0.5.png|Energy at timestep=0.5&lt;br /&gt;
Image:Error at t=0.5.png|Error at timestep=0.5&lt;br /&gt;
Image:Error at t=0.05.png|Error at timestep=0.05&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examining the four additional graphs above, we can notice that a shorter timestep is able to provide a smaller value for error and that the energy fluctuates less than when a bigger value of timestep is used. However, a shorter timestep results in a shorter simulation type, which can result in a less realistic simulation. It is therefore important to find the right balance between the two.&lt;br /&gt;
&lt;br /&gt;
Through trial and error, it has been found that timestep = 0.2850 or lower results in an energy fluctuation that is smaller than 1% over the course of the simulation. A small fluctuation in energy indicates higher resemblance to reality as technically the total energy should not fluctuate at all due to the Law of Conservation of Energy.&lt;br /&gt;
&lt;br /&gt;
=== Lennard-Jones Potential ===&lt;br /&gt;
The equation to calculate the Lennard-Jones potential is as follows:&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;
By equating this to 0, we find that the &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the separation at which the potential is 0, is &amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We can then find the force at this separation by differentiating the Lennard-Jones potential with respect to r, and substituting in &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}=\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24 \frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation (&amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;) is the separation of the particles at equilibrium, and represents the separation at which the potential energy is at a minimum. It can thus be found by setting &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}&amp;lt;/math&amp;gt;, (or &amp;lt;math&amp;gt;\mathbf{F}&amp;lt;/math&amp;gt;) to 0.&lt;br /&gt;
&lt;br /&gt;
Hence,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right) 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; gives us the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To put this equation into perspective, let us calculate the L-J potential for some realistic cutoff values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int 4\epsilon \left(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=4 \epsilon \left(\frac{\sigma^{12}}{11r^{11}}-\frac{\sigma^6}{5r^5}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\lim_{r\rightarrow \infty} 4 \left(\frac{1^{12}}{11r^{11}}-\frac{1^6}{5r^5}\right) - 4\left(\frac{1^{12}}{11\times 2^{11}}+\frac{1^6}{5\times 2^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=0-0.024822\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following the same calculations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0081767\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0032901\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The calculations show that as the cutoff distance increases, the Lennard-Jones potential decreases, which agrees with the theory.&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
It is very difficult to simulate realistic volumes of liquid and in the scope of this experiment, we have simulated liquids with N (number of atoms) between 1,000 and 10,000. To demonstrate why simulating realistic volumes of liquid is difficult, let us first calculate the number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
(Assuming: Standard conditions; Density of water = 1.00 g/ml)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.00 \mathrm{ml} = 1.00 \mathrm{g}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;18.02 \mathrm{g/mol} = 0.0555 \text{ mols of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.0555 \times 6.022 \times 10^{23} = 3.34 \times 10^{22} \text{ molecules of water.}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the other hand, 10,000 water molecules is only &amp;lt;math&amp;gt;2.99 \times 10^{-19} \text{ ml of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus, in order to be able to complete the simulation in a practical amount of time, we place our atoms in a box that is repeated in all directions, similar to how unit cells repeat themselves in a lattice. When an atom crosses the boundary of the box, its replica enters the same box from the other side, thus keeping the total number of atoms in the box constant.&lt;br /&gt;
&lt;br /&gt;
For example, if an atom at position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a cubic box ranging from &amp;lt;math&amp;gt;(0, 0, 0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;, its final position would be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;, if the periodic boundary conditions have been applied.&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units ===&lt;br /&gt;
The LAMMPS calculations run in this experiment are all done in reduced units&lt;br /&gt;
&lt;br /&gt;
For example, the Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34 \mathrm{nm}&amp;lt;/math&amp;gt;; &amp;lt;math&amp;gt;\epsilon/k_B=120K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If we set the cutoff to be &amp;lt;math&amp;gt;r*=3.2,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=3.2\times0.34=1.088\mathrm{nm}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Well depth: &amp;lt;math&amp;gt;\epsilon=120K\times k_B \times 6.02 \times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon=0.998 \mathrm{kJ/mol}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and reduced temperature &amp;lt;math&amp;gt;T*=1.5&amp;lt;/math&amp;gt; would be &amp;lt;math&amp;gt;T=1.5 \times 120=180\mathrm{K}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
=== Creating Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
In order to simulate a liquid for this experiment, we first create a crystal lattice, then melt that lattice to create a liquid. This is preferable to generating a liquid since assigning a random position for each new atom could result in two or more atoms being generated in the same space, causing an error when running the simulation.&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is one lattice point per unit cell. Hence, if the number density is 0.8,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8 \text{ points/volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sqrt[3]{0.8}=0.9283\text{ points/length}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.9283^{-1}=1.0772 \text{ length/point}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is thus 1.0772 unit lengths of spacing between each point.&lt;br /&gt;
&lt;br /&gt;
Following the same logic, a face-centred cubic lattice (with 4 lattice points per unit cell) with a density of 1.2 would have a spacing of &amp;lt;math&amp;gt;0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\because \sqrt[3]{4.8^{-1}}=0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, the simple cubic lattice with a density of 0.8 would create 1,000 atoms in the given constraints of the box:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;region box block 0 10 0 10 0 10&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and a face centred cubic lattice with a density of 1.2 would create 4,000 atoms in the same box.&lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of the Atoms ===&lt;br /&gt;
In the input script, there are the following lines describing the properties of the atoms:&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;
In the first line, we are setting the mass of type 1 atoms (which includes all of the atoms in our simulation box, as we have created only one type of atoms) as &amp;lt;math&amp;gt;1.0&amp;lt;/math&amp;gt;, in reduced units. The second line defines the interaction between the atoms as a Lenard-Jones interaction, with a cutoff distance of &amp;lt;math&amp;gt;3.0 \text{ units.}&amp;lt;/math&amp;gt; Finally, the last line defines the coefficient in the Lenard-Jones interaction; the asterisk tells LAMMPS that the coefficients apply to all atoms in our system; the first coefficient is &amp;lt;math&amp;gt;\epsilon=1.0&amp;lt;/math&amp;gt; and the second coefficient is &amp;lt;math&amp;gt;\sigma=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After setting the properties of the atoms, we also defined the initial positions and the initial velocities for the atoms in the input script. Since we have both the &amp;lt;math&amp;gt;\mathbf{x}_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, we can use the Velocity-Verlet integration algorithm that employs the half-step method.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
In the following lines from the input script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we created and reset a variable called timestep to equal 0.001, then used that value to calculate how many runs (${n_steps}) to carry out. This is more beneficial than simply setting&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;
as it allows us to only change the value of the timestep variable to alter the number of runs, rather than having to calculate ${n_steps} ourselves every time we change the timestep, especially in cases such as this computational experiment where the timestep was changed multiple times.&lt;br /&gt;
&lt;br /&gt;
=== Checking Equilibration ===&lt;br /&gt;
&lt;br /&gt;
[[File:TotalE at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Temp at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Press at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
&lt;br /&gt;
These graphs have been plotted to ensure that the simulation reaches equilibrium, and we can see that indeed, they do, and very quickly. Analysis of the graphs show that equilibrium is reached before 1 timestep.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
The following graph shows the total energy of the system against time at varying timestep values:&lt;br /&gt;
&lt;br /&gt;
[[File:Equil Energy.png|thumb|800px|none]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from the graphs that for timestep = 0.001, 0.0025 and 0.0075, the energy reaches a stable equilibrium but for timestep = 0.01 and timestep = 0.015, the energy slowly decreases and rapidly increases, respectively, indicating that the results of the simulation are not very accurate for these values of timestep. Timestep = 0.015 is especially bad as it very obviously does not reach an equilibrium.&lt;br /&gt;
&lt;br /&gt;
Therefore, timestep = 0.0075 would be the ideal value as it provides the highest accuracy, while running the simulation for a suitably long time to provide realistic results.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions (NpT) ==&lt;br /&gt;
&lt;br /&gt;
=== Temperature and Pressure Control ===&lt;br /&gt;
&lt;br /&gt;
Pressures chosen: 2.61, 2.63&lt;br /&gt;
&lt;br /&gt;
Temperatures chosen: 1.5, 1.6, 1.7, 1.8, 1.9&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 was chosen to provide the highest accuracy possible, without shortening the simulation time too much.&lt;br /&gt;
&lt;br /&gt;
In our simulation, the temperature was controlled by solving the two following equations for the instantaneous temperature &amp;lt;math&amp;gt;T,&amp;lt;/math&amp;gt; which fluctuates.&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 \qquad\qquad\qquad(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order for &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; to reach our target temperature &amp;lt;math&amp;gt;\mathfrak{T},&amp;lt;/math&amp;gt; we introduce a constant &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; to control the velocity such that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}\qquad\qquad(2)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can solve eq. &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt; to solve for &amp;lt;math&amp;gt;\gamma.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\sum_i m_i v_i^2 = 3N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substituting &amp;lt;math&amp;gt;\sum_i m_i v_i^2&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 3 N k_b T = 3N k_b \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\epsilon}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Examining the Input Script ===&lt;br /&gt;
&lt;br /&gt;
To calculate the average values for our simulation, we set certain parameters for LAMMPS in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time Nevery Nrepeat Nfreq&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Final averages are generated on timesteps that are multiples of Nevery, for Nrepeat number of times and an average is generated every Nfreq timesteps.&lt;br /&gt;
&lt;br /&gt;
In our script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The results are sampled at every 100 timesteps for 1000 times (100, 200, 300, etc.) Averages are generated every 100,000 timesteps, but our simulation runs for the same amount of time so only one average is generated from this code.&lt;br /&gt;
&lt;br /&gt;
The timestep chosen for this section of the experiment was 0.0025. Therefore, the simulation was run for &amp;lt;math&amp;gt;100000 \times 0.0025 = 250 \text{ unit time}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equations of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:Density Temp.png|700px]]&lt;br /&gt;
&lt;br /&gt;
The graph above shows the density of the simulated liquid against temperature, compared with the densities derived from the ideal gas law.&lt;br /&gt;
&lt;br /&gt;
It can be seen that within the ranges set for this simulation, the discrepancy between the simulated densities compared to the calculated densities are very high, to the point that the error bars for the y-axis is not even visible on the graph. Perhaps a more accurate simulation could have been run if a wider temperature and pressure ranges were selected.&lt;br /&gt;
&lt;br /&gt;
With the data range being one possible source of error between the simulation and the ideal gas law prediction, another possible factor is that the parameters set for this simulation are such that the repulsive force of the Lennard-Jones interaction is more significant than the attractive force. Since the ideal gas law assumes no electronic interaction between the particles, introducing a repulsive force would result in the density of the liquid being lower than the prediction.&lt;br /&gt;
&lt;br /&gt;
The most likely explanation, however, is that the ideal gas law, as its name suggests, is not very good at predicting the behavious of liquids. While both gas and liquid phases are fluids, there are major differences between them such as a much more prominent long-range order effect in liquids compared to gases.&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacity ==&lt;br /&gt;
&lt;br /&gt;
[[File:HeatCap vs Density.png|thumb|800px|Graph of &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; against Temperature|none]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From thermodynamics:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;dU = TdS - PdV&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = T\frac{\partial S}{\partial T}-P\frac{\partial V}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and since &amp;lt;math&amp;gt;\frac{\partial S}{\partial T}\geq 0,&amp;lt;/math&amp;gt; heat capacity should increase with increasing temperature.&lt;br /&gt;
&lt;br /&gt;
The fact that &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; decreases with increasing temperature suggests that either the increase in temperature is causing the internal energy to increase at a faster rate than itself, or that there are issues with the simulation originating from possible sources such as small sampling size (number of atoms generated) or short run time.&lt;br /&gt;
&lt;br /&gt;
== Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
[[File:RDF SHL.png|thumb|700px]]&lt;br /&gt;
&lt;br /&gt;
Looking at the graph on the right, it can be noticed that the three phases have clearly different Radial Distribution Functions (RDF) from each other. This can be attributed to the varying degrees of order each of the phases have: the atoms in the gas phase are completely free to move around, while atoms in the liquid phase have less freedom and in the solid phase, the atoms are set in a lattice, with only vibrational motion and no (or negligible) translational motion.&lt;br /&gt;
&lt;br /&gt;
In order to explain the graph, let us consider the RDF to be displaying the &amp;quot;effective density&amp;quot; of atoms in an area of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; at a distance &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; from a certain reference atom.&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf schematic.jpg|thumb|200px|Schematic of RDF|left]]&lt;br /&gt;
&lt;br /&gt;
There are three main parts to the RDF graphs: the region near the origin where the &amp;lt;math&amp;gt;\mathrm{RDF} = 0&amp;lt;/math&amp;gt;, the region after where there are big peaks and troughs, and the final region where the graphs have mostly reached equilibrium.&lt;br /&gt;
&lt;br /&gt;
First of all, the region near the origin is 0 for all three phases as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; is still within the volume (the hard sphere) of the reference atom, and hence there can be no other atoms in that radius.&lt;br /&gt;
&lt;br /&gt;
The peaks in the second region indicate that there is a higher &amp;quot;effective density&amp;quot; of atoms. The explanation for this is different for the lattice structure (solid) and the fluids (liquid and gas).&lt;br /&gt;
&lt;br /&gt;
For the liquid and gas phase, the peaks are due to the attractive force caused by the Lennard-Jones potential. We have calculated above [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:SUNG95#Lennard-Jones_Potential (1.2 LJ Potential)] that &amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}.&amp;lt;/math&amp;gt; Setting &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt; (as we have in our input file), we get &amp;lt;math&amp;gt;r_{eq} = 1.122&amp;lt;/math&amp;gt;, which is very close to where the largest peaks are for the two fluid phases.&lt;br /&gt;
&lt;br /&gt;
For the solid, where all the atoms are in a lattice structure, the effects due to the Lennard-Jones interaction becomes neglibigle. Instead, there will be certain values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where the effective density is higher than the overall density of the sample (the peaks), and some values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where it is lower than the density of the sample (the troughs). This is arisen from the fact that as the value of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the total volume covered by &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; also increases. But since all the atoms are set in place by the lattice, the number of atoms that &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; encompasses stays relatively constant. As a result, the peaks and the troughs tend to 1 with increasing &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the case of the gas phase, the atoms are completely free to move around and the RDF graph can be entirely attributed to the effects of the L-J interaction. This justifies the lack of troughs for this phase. Furthermore, as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the attractive part of the L-J interaction &amp;lt;math&amp;gt;\frac{1}{r^6}&amp;lt;/math&amp;gt; gets exponentially smaller and quickly becomes negligible - RDF reaches equilibrium.&lt;br /&gt;
&lt;br /&gt;
Finally, the liquid phase can be considered to act as a mix between the solid phase and the gas phase: the L-J interactions are significant enough to reach equilibrium at a rate similar to the gas phase, but there exists an ordering of the atoms such that there are values of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; where the effective density is lower than the overall density.&lt;br /&gt;
&lt;br /&gt;
From the RDF of the solid phase, each of the peaks point to a certain lattice point. Simple geometrical calculations can be done to indicate that the first peak, which is the lattice point (1) closest to the reference atom (O), is at a separation of &amp;lt;math&amp;gt;\mathrm{r}=1.056.&amp;lt;/math&amp;gt; Second closest point (2) is at a distance of &amp;lt;math&amp;gt;\mathrm{r}=1.4938&amp;lt;/math&amp;gt; and the third (3) at &amp;lt;math&amp;gt;\mathrm{r}=1.8295.&amp;lt;/math&amp;gt; These points agree with the x-axis on the RDF graphs.&lt;br /&gt;
&lt;br /&gt;
[[File:FCC-SHL.png|thumb|Face-centered cubic lattice|none]]&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
The Diffusion Coefficients &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; of a simulated gas, liquid and solid were calculated using several different methods:&lt;br /&gt;
&lt;br /&gt;
1) From the Mean Squared Displacement (MSD) of 8,000 simulated atoms, according to the equation &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) From the MSD of a million atoms&lt;br /&gt;
&lt;br /&gt;
3) From the Velocity Autocorrelation Function (VACF), by integration.&lt;br /&gt;
&lt;br /&gt;
4) From the VACF of a million atoms&lt;br /&gt;
&lt;br /&gt;
The results were as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Diffusion Coefficients (unit area/unit time)&lt;br /&gt;
! Phase !! From MSD !! From MSD (million atoms) !! From VCAF !! From VCAF (million atoms)&lt;br /&gt;
|-&lt;br /&gt;
| Gas || &amp;lt;math&amp;gt;6.05&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;3.22&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;6.32&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;3.27&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || &amp;lt;math&amp;gt;0.0855&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.0892&amp;lt;/math&amp;gt; ||&amp;lt;math&amp;gt;0.0979&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.09&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Solid || &amp;lt;math&amp;gt;0.000896&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;1.5 \times 10^{-5}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;-1.66 \times 10^{-5}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;4.55\times 10^{-5}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
We can see from the table that the diffusion coefficients calculated from the same number of atoms agree very well with each other, which suggests that the results are quite precise. However, we can assume that the million atoms simulations inevitably provide more accurate data.&lt;br /&gt;
&lt;br /&gt;
The results also make sense logically, where the gas have the highest diffusion coefficient (they are able to diffuse much faster) than the liquid, and the diffusion coefficient of the solid is close to 0.&lt;br /&gt;
&lt;br /&gt;
=== Mean Squared Displacement ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The Mean Squared Displacement can be used to find the Diffusion Coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, via the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Plotting the mean squared displacement (MSD) against time, then finding the linear gradient would give us the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD-SHL.png|thumb|600px|none]][[File:MSD Mill SHL.png|thumb|600px|none]]&lt;br /&gt;
&lt;br /&gt;
Graphical analysis showed that the last 1,000 timesteps are suitably linear to apply this equation, and the Diffusion Coefficients for the three different phases were found from the last 1,000 timesteps.&lt;br /&gt;
&lt;br /&gt;
=== Velocity Autocorrelation Function ===&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;
From the 1D Harmonic Oscillator:&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;
Differentiating this gives the velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = -A\omega \sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting this into the integrated form of the VAFC:&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) \cdot A \omega \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(A \omega \sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, from the trigonometric identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin \left(\alpha + \beta \right)= \sin\alpha\cos\beta + \sin\beta\cos\alpha,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(\omega t + \phi + \omega\tau\right) = \sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \left(\sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\cos\left(\omega \tau\right) + \int_{-\infty}^{\infty} \sin \left(\omega \tau\right) \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt; is a constant so &amp;lt;math&amp;gt;\cos\left(\omega\tau\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sin\left(\omega\tau\right)&amp;lt;/math&amp;gt; can be taken out of the integral.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\cos\left(\omega \tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) + \sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; can cancel out:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\sin(x)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;\cos(x)&amp;lt;/math&amp;gt; is an even function, &amp;lt;math&amp;gt;\sin(x)\cos(x)&amp;lt;/math&amp;gt; is an odd function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; is an odd function (While the value of &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; can change whether or not the functions are even or odd, it shifts both functions by the same amount and the resulting &amp;lt;math&amp;gt;\cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; will still be odd)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}=\cos\left(\omega \tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\cos\left(\omega \tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF-SHL.png|thumb|800px|Comparison of Normalised VACF with VACF of Liquid and Solid|left]]&lt;br /&gt;
&lt;br /&gt;
We can see from this graph that while the VACF of the liquid quickly decorrelates to 0, the solid still retains some minor fluctuations. This is due to the fact that the atoms in a liquid are more free to move around and collide with each other, &amp;quot;forgetting&amp;quot; what its initial velocity was, whereas for atoms in the solid state, they are already in a relatively stable position (similar to &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; in L-J interactions) and oscillate about 0. Eventually, atoms in solids, too, will decay, but at a much slower rate than in liquids.&lt;br /&gt;
&lt;br /&gt;
The VACF for the harmonic oscillator does not decay at all since the decorrelation arises from the atoms exchanging energy with their neighbours, which does not occur in harmonic oscillators.&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560835</id>
		<title>Rep:Mod:SUNG95</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560835"/>
		<updated>2016-10-21T10:54:23Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: /* Dynamical Properties and the Diffusion Coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Theory ==&lt;br /&gt;
=== The Velocity-Verlet Algorithm ===&lt;br /&gt;
[[File:Verlet-Velocity.png|thumb|700px|x(t) derived from the velocity-Verlet algorithm compared with the position of the classical harmonic oscillator.|left]]&lt;br /&gt;
[[File:Verlet-Energy.png|thumb|700px|Total energy of the system with respect to time|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Verlet-Error.png|thumb|700px|The error derived by comparing the solution of the velocity-Verlet algorithm with the position of the classical harmonic oscillator|none]]&lt;br /&gt;
&lt;br /&gt;
The three graphs above display the position of an atom, the total energy of the system and the error between the two methods of calculating the atom position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Error wrt Time.png|thumb|600px|Maximum Error against Time|none]]&lt;br /&gt;
&lt;br /&gt;
From this graph of Maximum error vs Time, we can see that error increases with time at a stable linear rate.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Running the same calculations with varying timesteps show the importance of choosing the right value of the timestep:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Energy at t=0.05.png|Energy at timestep=0.05&lt;br /&gt;
Image:Energy at t=0.5.png|Energy at timestep=0.5&lt;br /&gt;
Image:Error at t=0.5.png|Error at timestep=0.5&lt;br /&gt;
Image:Error at t=0.05.png|Error at timestep=0.05&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examining the four additional graphs above, we can notice that a shorter timestep is able to provide a smaller value for error and that the energy fluctuates less than when a bigger value of timestep is used. However, a shorter timestep results in a shorter simulation type, which can result in a less realistic simulation. It is therefore important to find the right balance between the two.&lt;br /&gt;
&lt;br /&gt;
Through trial and error, it has been found that timestep = 0.2850 or lower results in an energy fluctuation that is smaller than 1% over the course of the simulation. A small fluctuation in energy indicates higher resemblance to reality as technically the total energy should not fluctuate at all due to the Law of Conservation of Energy.&lt;br /&gt;
&lt;br /&gt;
=== Lennard-Jones Potential ===&lt;br /&gt;
The equation to calculate the Lennard-Jones potential is as follows:&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;
By equating this to 0, we find that the &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the separation at which the potential is 0, is &amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We can then find the force at this separation by differentiating the Lennard-Jones potential with respect to r, and substituting in &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}=\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24 \frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation (&amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;) is the separation of the particles at equilibrium, and represents the separation at which the potential energy is at a minimum. It can thus be found by setting &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}&amp;lt;/math&amp;gt;, (or &amp;lt;math&amp;gt;\mathbf{F}&amp;lt;/math&amp;gt;) to 0.&lt;br /&gt;
&lt;br /&gt;
Hence,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right) 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; gives us the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To put this equation into perspective, let us calculate the L-J potential for some realistic cutoff values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int 4\epsilon \left(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=4 \epsilon \left(\frac{\sigma^{12}}{11r^{11}}-\frac{\sigma^6}{5r^5}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\lim_{r\rightarrow \infty} 4 \left(\frac{1^{12}}{11r^{11}}-\frac{1^6}{5r^5}\right) - 4\left(\frac{1^{12}}{11\times 2^{11}}+\frac{1^6}{5\times 2^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=0-0.024822\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following the same calculations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0081767\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0032901\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The calculations show that as the cutoff distance increases, the Lennard-Jones potential decreases, which agrees with the theory.&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
It is very difficult to simulate realistic volumes of liquid and in the scope of this experiment, we have simulated liquids with N (number of atoms) between 1,000 and 10,000. To demonstrate why simulating realistic volumes of liquid is difficult, let us first calculate the number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
(Assuming: Standard conditions; Density of water = 1.00 g/ml)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.00 \mathrm{ml} = 1.00 \mathrm{g}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;18.02 \mathrm{g/mol} = 0.0555 \text{ mols of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.0555 \times 6.022 \times 10^{23} = 3.34 \times 10^{22} \text{ molecules of water.}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the other hand, 10,000 water molecules is only &amp;lt;math&amp;gt;2.99 \times 10^{-19} \text{ ml of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus, in order to be able to complete the simulation in a practical amount of time, we place our atoms in a box that is repeated in all directions, similar to how unit cells repeat themselves in a lattice. When an atom crosses the boundary of the box, its replica enters the same box from the other side, thus keeping the total number of atoms in the box constant.&lt;br /&gt;
&lt;br /&gt;
For example, if an atom at position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a cubic box ranging from &amp;lt;math&amp;gt;(0, 0, 0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;, its final position would be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;, if the periodic boundary conditions have been applied.&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units ===&lt;br /&gt;
The LAMMPS calculations run in this experiment are all done in reduced units&lt;br /&gt;
&lt;br /&gt;
For example, the Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34 \mathrm{nm}&amp;lt;/math&amp;gt;; &amp;lt;math&amp;gt;\epsilon/k_B=120K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If we set the cutoff to be &amp;lt;math&amp;gt;r*=3.2,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=3.2\times0.34=1.088\mathrm{nm}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Well depth: &amp;lt;math&amp;gt;\epsilon=120K\times k_B \times 6.02 \times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon=0.998 \mathrm{kJ/mol}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and reduced temperature &amp;lt;math&amp;gt;T*=1.5&amp;lt;/math&amp;gt; would be &amp;lt;math&amp;gt;T=1.5 \times 120=180\mathrm{K}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
=== Creating Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
In order to simulate a liquid for this experiment, we first create a crystal lattice, then melt that lattice to create a liquid. This is preferable to generating a liquid since assigning a random position for each new atom could result in two or more atoms being generated in the same space, causing an error when running the simulation.&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is one lattice point per unit cell. Hence, if the number density is 0.8,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8 \text{ points/volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sqrt[3]{0.8}=0.9283\text{ points/length}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.9283^{-1}=1.0772 \text{ length/point}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is thus 1.0772 unit lengths of spacing between each point.&lt;br /&gt;
&lt;br /&gt;
Following the same logic, a face-centred cubic lattice (with 4 lattice points per unit cell) with a density of 1.2 would have a spacing of &amp;lt;math&amp;gt;0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\because \sqrt[3]{4.8^{-1}}=0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, the simple cubic lattice with a density of 0.8 would create 1,000 atoms in the given constraints of the box:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;region box block 0 10 0 10 0 10&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and a face centred cubic lattice with a density of 1.2 would create 4,000 atoms in the same box.&lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of the Atoms ===&lt;br /&gt;
In the input script, there are the following lines describing the properties of the atoms:&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;
In the first line, we are setting the mass of type 1 atoms (which includes all of the atoms in our simulation box, as we have created only one type of atoms) as &amp;lt;math&amp;gt;1.0&amp;lt;/math&amp;gt;, in reduced units. The second line defines the interaction between the atoms as a Lenard-Jones interaction, with a cutoff distance of &amp;lt;math&amp;gt;3.0 \text{ units.}&amp;lt;/math&amp;gt; Finally, the last line defines the coefficient in the Lenard-Jones interaction; the asterisk tells LAMMPS that the coefficients apply to all atoms in our system; the first coefficient is &amp;lt;math&amp;gt;\epsilon=1.0&amp;lt;/math&amp;gt; and the second coefficient is &amp;lt;math&amp;gt;\sigma=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After setting the properties of the atoms, we also defined the initial positions and the initial velocities for the atoms in the input script. Since we have both the &amp;lt;math&amp;gt;\mathbf{x}_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, we can use the Velocity-Verlet integration algorithm that employs the half-step method.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
In the following lines from the input script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we created and reset a variable called timestep to equal 0.001, then used that value to calculate how many runs (${n_steps}) to carry out. This is more beneficial than simply setting&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;
as it allows us to only change the value of the timestep variable to alter the number of runs, rather than having to calculate ${n_steps} ourselves every time we change the timestep, especially in cases such as this computational experiment where the timestep was changed multiple times.&lt;br /&gt;
&lt;br /&gt;
=== Checking Equilibration ===&lt;br /&gt;
&lt;br /&gt;
[[File:TotalE at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Temp at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Press at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
&lt;br /&gt;
These graphs have been plotted to ensure that the simulation reaches equilibrium, and we can see that indeed, they do, and very quickly. Analysis of the graphs show that equilibrium is reached before 1 timestep.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
The following graph shows the total energy of the system against time at varying timestep values:&lt;br /&gt;
&lt;br /&gt;
[[File:Equil Energy.png|thumb|800px|none]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from the graphs that for timestep = 0.001, 0.0025 and 0.0075, the energy reaches a stable equilibrium but for timestep = 0.01 and timestep = 0.015, the energy slowly decreases and rapidly increases, respectively, indicating that the results of the simulation are not very accurate for these values of timestep. Timestep = 0.015 is especially bad as it very obviously does not reach an equilibrium.&lt;br /&gt;
&lt;br /&gt;
Therefore, timestep = 0.0075 would be the ideal value as it provides the highest accuracy, while running the simulation for a suitably long time to provide realistic results.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions (NpT) ==&lt;br /&gt;
&lt;br /&gt;
=== Temperature and Pressure Control ===&lt;br /&gt;
&lt;br /&gt;
Pressures chosen: 2.61, 2.63&lt;br /&gt;
&lt;br /&gt;
Temperatures chosen: 1.5, 1.6, 1.7, 1.8, 1.9&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 was chosen to provide the highest accuracy possible, without shortening the simulation time too much.&lt;br /&gt;
&lt;br /&gt;
In our simulation, the temperature was controlled by solving the two following equations for the instantaneous temperature &amp;lt;math&amp;gt;T,&amp;lt;/math&amp;gt; which fluctuates.&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 \qquad\qquad\qquad(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order for &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; to reach our target temperature &amp;lt;math&amp;gt;\mathfrak{T},&amp;lt;/math&amp;gt; we introduce a constant &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; to control the velocity such that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}\qquad\qquad(2)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can solve eq. &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt; to solve for &amp;lt;math&amp;gt;\gamma.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\sum_i m_i v_i^2 = 3N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substituting &amp;lt;math&amp;gt;\sum_i m_i v_i^2&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 3 N k_b T = 3N k_b \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\epsilon}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Examining the Input Script ===&lt;br /&gt;
&lt;br /&gt;
To calculate the average values for our simulation, we set certain parameters for LAMMPS in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time Nevery Nrepeat Nfreq&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Final averages are generated on timesteps that are multiples of Nevery, for Nrepeat number of times and an average is generated every Nfreq timesteps.&lt;br /&gt;
&lt;br /&gt;
In our script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The results are sampled at every 100 timesteps for 1000 times (100, 200, 300, etc.) Averages are generated every 100,000 timesteps, but our simulation runs for the same amount of time so only one average is generated from this code.&lt;br /&gt;
&lt;br /&gt;
The timestep chosen for this section of the experiment was 0.0025. Therefore, the simulation was run for &amp;lt;math&amp;gt;100000 \times 0.0025 = 250 \text{ unit time}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equations of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:Density Temp.png|700px]]&lt;br /&gt;
&lt;br /&gt;
The graph above shows the density of the simulated liquid against temperature, compared with the densities derived from the ideal gas law.&lt;br /&gt;
&lt;br /&gt;
It can be seen that within the ranges set for this simulation, the discrepancy between the simulated densities compared to the calculated densities are very high, to the point that the error bars for the y-axis is not even visible on the graph. Perhaps a more accurate simulation could have been run if a wider temperature and pressure ranges were selected.&lt;br /&gt;
&lt;br /&gt;
With the data range being one possible source of error between the simulation and the ideal gas law prediction, another possible factor is that the parameters set for this simulation are such that the repulsive force of the Lennard-Jones interaction is more significant than the attractive force. Since the ideal gas law assumes no electronic interaction between the particles, introducing a repulsive force would result in the density of the liquid being lower than the prediction.&lt;br /&gt;
&lt;br /&gt;
The most likely explanation, however, is that the ideal gas law, as its name suggests, is not very good at predicting the behavious of liquids. While both gas and liquid phases are fluids, there are major differences between them such as a much more prominent long-range order effect in liquids compared to gases.&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacity ==&lt;br /&gt;
&lt;br /&gt;
[[File:HeatCap vs Density.png|thumb|800px|Graph of &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; against Temperature|none]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From thermodynamics:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;dU = TdS - PdV&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = T\frac{\partial S}{\partial T}-P\frac{\partial V}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and since &amp;lt;math&amp;gt;\frac{\partial S}{\partial T}\geq 0,&amp;lt;/math&amp;gt; heat capacity should increase with increasing temperature.&lt;br /&gt;
&lt;br /&gt;
The fact that &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; decreases with increasing temperature suggests that either the increase in temperature is causing the internal energy to increase at a faster rate than itself, or that there are issues with the simulation originating from possible sources such as small sampling size (number of atoms generated) or short run time.&lt;br /&gt;
&lt;br /&gt;
== Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
[[File:RDF SHL.png|thumb|700px]]&lt;br /&gt;
&lt;br /&gt;
Looking at the graph on the right, it can be noticed that the three phases have clearly different Radial Distribution Functions (RDF) from each other. This can be attributed to the varying degrees of order each of the phases have: the atoms in the gas phase are completely free to move around, while atoms in the liquid phase have less freedom and in the solid phase, the atoms are set in a lattice, with only vibrational motion and no (or negligible) translational motion.&lt;br /&gt;
&lt;br /&gt;
In order to explain the graph, let us consider the RDF to be displaying the &amp;quot;effective density&amp;quot; of atoms in an area of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; at a distance &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; from a certain reference atom.&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf schematic.jpg|thumb|200px|Schematic of RDF|left]]&lt;br /&gt;
&lt;br /&gt;
There are three main parts to the RDF graphs: the region near the origin where the &amp;lt;math&amp;gt;\mathrm{RDF} = 0&amp;lt;/math&amp;gt;, the region after where there are big peaks and troughs, and the final region where the graphs have mostly reached equilibrium.&lt;br /&gt;
&lt;br /&gt;
First of all, the region near the origin is 0 for all three phases as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; is still within the volume (the hard sphere) of the reference atom, and hence there can be no other atoms in that radius.&lt;br /&gt;
&lt;br /&gt;
The peaks in the second region indicate that there is a higher &amp;quot;effective density&amp;quot; of atoms. The explanation for this is different for the lattice structure (solid) and the fluids (liquid and gas).&lt;br /&gt;
&lt;br /&gt;
For the liquid and gas phase, the peaks are due to the attractive force caused by the Lennard-Jones potential. We have calculated above [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:SUNG95#Lennard-Jones_Potential (1.2 LJ Potential)] that &amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}.&amp;lt;/math&amp;gt; Setting &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt; (as we have in our input file), we get &amp;lt;math&amp;gt;r_{eq} = 1.122&amp;lt;/math&amp;gt;, which is very close to where the largest peaks are for the two fluid phases.&lt;br /&gt;
&lt;br /&gt;
For the solid, where all the atoms are in a lattice structure, the effects due to the Lennard-Jones interaction becomes neglibigle. Instead, there will be certain values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where the effective density is higher than the overall density of the sample (the peaks), and some values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where it is lower than the density of the sample (the troughs). This is arisen from the fact that as the value of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the total volume covered by &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; also increases. But since all the atoms are set in place by the lattice, the number of atoms that &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; encompasses stays relatively constant. As a result, the peaks and the troughs tend to 1 with increasing &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the case of the gas phase, the atoms are completely free to move around and the RDF graph can be entirely attributed to the effects of the L-J interaction. This justifies the lack of troughs for this phase. Furthermore, as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the attractive part of the L-J interaction &amp;lt;math&amp;gt;\frac{1}{r^6}&amp;lt;/math&amp;gt; gets exponentially smaller and quickly becomes negligible - RDF reaches equilibrium.&lt;br /&gt;
&lt;br /&gt;
Finally, the liquid phase can be considered to act as a mix between the solid phase and the gas phase: the L-J interactions are significant enough to reach equilibrium at a rate similar to the gas phase, but there exists an ordering of the atoms such that there are values of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; where the effective density is lower than the overall density.&lt;br /&gt;
&lt;br /&gt;
From the RDF of the solid phase, each of the peaks point to a certain lattice point. Simple geometrical calculations can be done to indicate that the first peak, which is the lattice point (1) closest to the reference atom (O), is at a separation of &amp;lt;math&amp;gt;\mathrm{r}=1.056.&amp;lt;/math&amp;gt; Second closest point (2) is at a distance of &amp;lt;math&amp;gt;\mathrm{r}=1.4938&amp;lt;/math&amp;gt; and the third (3) at &amp;lt;math&amp;gt;\mathrm{r}=1.8295.&amp;lt;/math&amp;gt; These points agree with the x-axis on the RDF graphs.&lt;br /&gt;
&lt;br /&gt;
[[File:FCC-SHL.png|thumb|Face-centered cubic lattice|none]]&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
The Diffusion Coefficients &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; of a simulated gas, liquid and solid were calculated using several different methods:&lt;br /&gt;
&lt;br /&gt;
1) From the Mean Squared Displacement (MSD) of 8,000 simulated atoms, according to the equation &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) From the MSD of a million atoms&lt;br /&gt;
&lt;br /&gt;
3) From the Velocity Autocorrelation Function (VACF), by integration.&lt;br /&gt;
&lt;br /&gt;
4) From the VACF of a million atoms&lt;br /&gt;
&lt;br /&gt;
The results were as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Diffusion Coefficients (unit area/unit time)&lt;br /&gt;
! Phase !! From MSD !! From MSD (million atoms) !! From VCAF !! From VCAF (million atoms)&lt;br /&gt;
|-&lt;br /&gt;
| Gas || &amp;lt;math&amp;gt;6.05&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;3.22&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;6.32&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;3.27&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || &amp;lt;math&amp;gt;0.0855&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.0892&amp;lt;/math&amp;gt; ||&amp;lt;math&amp;gt;0.0979&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.09&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Solid || &amp;lt;math&amp;gt;0.000896&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;1.5 \times 10^{-5}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;-1.66 \times 10^{-5}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;4.55\times 10^{-5}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
We can see from the table that the diffusion coefficients calculated from the same number of atoms agree very well with each other, which suggests that the results are quite precise. However, we can assume that the million atoms simulations inevitably provide more accurate data.&lt;br /&gt;
&lt;br /&gt;
The results also make sense logically, where the gas have the highest diffusion coefficient (they are able to diffuse much faster) than the liquid, and the diffusion coefficient of the solid is close to 0.&lt;br /&gt;
&lt;br /&gt;
=== Mean Squared Displacement ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The Mean Squared Displacement can be used to find the Diffusion Coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, via the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Plotting the mean squared displacement (MSD) against time, then finding the linear gradient would give us the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD-SHL.png|thumb|600px|none]][[File:MSD Mill SHL.png|thumb|600px|none]]&lt;br /&gt;
&lt;br /&gt;
Graphical analysis showed that the last 1,000 timesteps are suitably linear to apply this equation, and the Diffusion Coefficients for the three different phases were found from the last 1,000 timesteps.&lt;br /&gt;
&lt;br /&gt;
=== Velocity Autocorrelation Function ===&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;
From the 1D Harmonic Oscillator:&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;
Differentiating this gives the velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = -A\omega \sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting this into the integrated form of the VAFC:&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) \cdot A \omega \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(A \omega \sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, from the trigonometric identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin \left(\alpha + \beta \right)= \sin\alpha\cos\beta + \sin\beta\cos\alpha,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(\omega t + \phi + \omega\tau\right) = \sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \left(\sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\cos\left(\omega \tau\right) + \int_{-\infty}^{\infty} \sin \left(\omega \tau\right) \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt; is a constant so &amp;lt;math&amp;gt;\cos\left(\omega\tau\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sin\left(\omega\tau\right)&amp;lt;/math&amp;gt; can be taken out of the integral.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\cos\left(\omega \tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) + \sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; can cancel out:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\sin(x)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;\cos(x)&amp;lt;/math&amp;gt; is an even function, &amp;lt;math&amp;gt;\sin(x)\cos(x)&amp;lt;/math&amp;gt; is an odd function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; is an odd function (While the value of &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; can change whether or not the functions are even or odd, it shifts both functions by the same amount and the resulting &amp;lt;math&amp;gt;\cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; will still be odd)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}=\cos\left(\omega \tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\cos\left(\omega \tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF-SHL.png|thumb|800px|Comparison of Normalised VACF with VACF of Liquid and Solid|left]]&lt;br /&gt;
&lt;br /&gt;
We can see from this graph that while the VACF of the liquid quickly decorrelates to 0, the solid still retains some minor fluctuations. This is due to the fact that liquids are more free to move around and collide with each other, &amp;quot;forgetting&amp;quot; what its initial velocity was, whereas for atoms in the solid state, they are already in a relatively stable position (similar to &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; in L-J interactions) and oscillate from positive to negative. Eventually, atoms in solids, too, will decay, but at a much slower rate than in liquids.&lt;br /&gt;
&lt;br /&gt;
The VACF for the harmonic oscillator does not decay at all since the decorrelation arises from the atoms exchanging energy with its neighbours, which does not occur in harmonic oscillators.&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560830</id>
		<title>Rep:Mod:SUNG95</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560830"/>
		<updated>2016-10-21T10:52:27Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: /* Dynamical Properties and the Diffusion Coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Theory ==&lt;br /&gt;
=== The Velocity-Verlet Algorithm ===&lt;br /&gt;
[[File:Verlet-Velocity.png|thumb|700px|x(t) derived from the velocity-Verlet algorithm compared with the position of the classical harmonic oscillator.|left]]&lt;br /&gt;
[[File:Verlet-Energy.png|thumb|700px|Total energy of the system with respect to time|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Verlet-Error.png|thumb|700px|The error derived by comparing the solution of the velocity-Verlet algorithm with the position of the classical harmonic oscillator|none]]&lt;br /&gt;
&lt;br /&gt;
The three graphs above display the position of an atom, the total energy of the system and the error between the two methods of calculating the atom position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Error wrt Time.png|thumb|600px|Maximum Error against Time|none]]&lt;br /&gt;
&lt;br /&gt;
From this graph of Maximum error vs Time, we can see that error increases with time at a stable linear rate.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Running the same calculations with varying timesteps show the importance of choosing the right value of the timestep:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Energy at t=0.05.png|Energy at timestep=0.05&lt;br /&gt;
Image:Energy at t=0.5.png|Energy at timestep=0.5&lt;br /&gt;
Image:Error at t=0.5.png|Error at timestep=0.5&lt;br /&gt;
Image:Error at t=0.05.png|Error at timestep=0.05&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examining the four additional graphs above, we can notice that a shorter timestep is able to provide a smaller value for error and that the energy fluctuates less than when a bigger value of timestep is used. However, a shorter timestep results in a shorter simulation type, which can result in a less realistic simulation. It is therefore important to find the right balance between the two.&lt;br /&gt;
&lt;br /&gt;
Through trial and error, it has been found that timestep = 0.2850 or lower results in an energy fluctuation that is smaller than 1% over the course of the simulation. A small fluctuation in energy indicates higher resemblance to reality as technically the total energy should not fluctuate at all due to the Law of Conservation of Energy.&lt;br /&gt;
&lt;br /&gt;
=== Lennard-Jones Potential ===&lt;br /&gt;
The equation to calculate the Lennard-Jones potential is as follows:&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;
By equating this to 0, we find that the &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the separation at which the potential is 0, is &amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We can then find the force at this separation by differentiating the Lennard-Jones potential with respect to r, and substituting in &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}=\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24 \frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation (&amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;) is the separation of the particles at equilibrium, and represents the separation at which the potential energy is at a minimum. It can thus be found by setting &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}&amp;lt;/math&amp;gt;, (or &amp;lt;math&amp;gt;\mathbf{F}&amp;lt;/math&amp;gt;) to 0.&lt;br /&gt;
&lt;br /&gt;
Hence,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right) 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; gives us the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To put this equation into perspective, let us calculate the L-J potential for some realistic cutoff values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int 4\epsilon \left(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=4 \epsilon \left(\frac{\sigma^{12}}{11r^{11}}-\frac{\sigma^6}{5r^5}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\lim_{r\rightarrow \infty} 4 \left(\frac{1^{12}}{11r^{11}}-\frac{1^6}{5r^5}\right) - 4\left(\frac{1^{12}}{11\times 2^{11}}+\frac{1^6}{5\times 2^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=0-0.024822\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following the same calculations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0081767\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0032901\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The calculations show that as the cutoff distance increases, the Lennard-Jones potential decreases, which agrees with the theory.&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
It is very difficult to simulate realistic volumes of liquid and in the scope of this experiment, we have simulated liquids with N (number of atoms) between 1,000 and 10,000. To demonstrate why simulating realistic volumes of liquid is difficult, let us first calculate the number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
(Assuming: Standard conditions; Density of water = 1.00 g/ml)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.00 \mathrm{ml} = 1.00 \mathrm{g}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;18.02 \mathrm{g/mol} = 0.0555 \text{ mols of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.0555 \times 6.022 \times 10^{23} = 3.34 \times 10^{22} \text{ molecules of water.}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the other hand, 10,000 water molecules is only &amp;lt;math&amp;gt;2.99 \times 10^{-19} \text{ ml of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus, in order to be able to complete the simulation in a practical amount of time, we place our atoms in a box that is repeated in all directions, similar to how unit cells repeat themselves in a lattice. When an atom crosses the boundary of the box, its replica enters the same box from the other side, thus keeping the total number of atoms in the box constant.&lt;br /&gt;
&lt;br /&gt;
For example, if an atom at position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a cubic box ranging from &amp;lt;math&amp;gt;(0, 0, 0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;, its final position would be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;, if the periodic boundary conditions have been applied.&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units ===&lt;br /&gt;
The LAMMPS calculations run in this experiment are all done in reduced units&lt;br /&gt;
&lt;br /&gt;
For example, the Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34 \mathrm{nm}&amp;lt;/math&amp;gt;; &amp;lt;math&amp;gt;\epsilon/k_B=120K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If we set the cutoff to be &amp;lt;math&amp;gt;r*=3.2,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=3.2\times0.34=1.088\mathrm{nm}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Well depth: &amp;lt;math&amp;gt;\epsilon=120K\times k_B \times 6.02 \times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon=0.998 \mathrm{kJ/mol}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and reduced temperature &amp;lt;math&amp;gt;T*=1.5&amp;lt;/math&amp;gt; would be &amp;lt;math&amp;gt;T=1.5 \times 120=180\mathrm{K}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
=== Creating Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
In order to simulate a liquid for this experiment, we first create a crystal lattice, then melt that lattice to create a liquid. This is preferable to generating a liquid since assigning a random position for each new atom could result in two or more atoms being generated in the same space, causing an error when running the simulation.&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is one lattice point per unit cell. Hence, if the number density is 0.8,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8 \text{ points/volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sqrt[3]{0.8}=0.9283\text{ points/length}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.9283^{-1}=1.0772 \text{ length/point}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is thus 1.0772 unit lengths of spacing between each point.&lt;br /&gt;
&lt;br /&gt;
Following the same logic, a face-centred cubic lattice (with 4 lattice points per unit cell) with a density of 1.2 would have a spacing of &amp;lt;math&amp;gt;0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\because \sqrt[3]{4.8^{-1}}=0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, the simple cubic lattice with a density of 0.8 would create 1,000 atoms in the given constraints of the box:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;region box block 0 10 0 10 0 10&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and a face centred cubic lattice with a density of 1.2 would create 4,000 atoms in the same box.&lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of the Atoms ===&lt;br /&gt;
In the input script, there are the following lines describing the properties of the atoms:&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;
In the first line, we are setting the mass of type 1 atoms (which includes all of the atoms in our simulation box, as we have created only one type of atoms) as &amp;lt;math&amp;gt;1.0&amp;lt;/math&amp;gt;, in reduced units. The second line defines the interaction between the atoms as a Lenard-Jones interaction, with a cutoff distance of &amp;lt;math&amp;gt;3.0 \text{ units.}&amp;lt;/math&amp;gt; Finally, the last line defines the coefficient in the Lenard-Jones interaction; the asterisk tells LAMMPS that the coefficients apply to all atoms in our system; the first coefficient is &amp;lt;math&amp;gt;\epsilon=1.0&amp;lt;/math&amp;gt; and the second coefficient is &amp;lt;math&amp;gt;\sigma=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After setting the properties of the atoms, we also defined the initial positions and the initial velocities for the atoms in the input script. Since we have both the &amp;lt;math&amp;gt;\mathbf{x}_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, we can use the Velocity-Verlet integration algorithm that employs the half-step method.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
In the following lines from the input script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we created and reset a variable called timestep to equal 0.001, then used that value to calculate how many runs (${n_steps}) to carry out. This is more beneficial than simply setting&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;
as it allows us to only change the value of the timestep variable to alter the number of runs, rather than having to calculate ${n_steps} ourselves every time we change the timestep, especially in cases such as this computational experiment where the timestep was changed multiple times.&lt;br /&gt;
&lt;br /&gt;
=== Checking Equilibration ===&lt;br /&gt;
&lt;br /&gt;
[[File:TotalE at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Temp at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Press at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
&lt;br /&gt;
These graphs have been plotted to ensure that the simulation reaches equilibrium, and we can see that indeed, they do, and very quickly. Analysis of the graphs show that equilibrium is reached before 1 timestep.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
The following graph shows the total energy of the system against time at varying timestep values:&lt;br /&gt;
&lt;br /&gt;
[[File:Equil Energy.png|thumb|800px|none]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from the graphs that for timestep = 0.001, 0.0025 and 0.0075, the energy reaches a stable equilibrium but for timestep = 0.01 and timestep = 0.015, the energy slowly decreases and rapidly increases, respectively, indicating that the results of the simulation are not very accurate for these values of timestep. Timestep = 0.015 is especially bad as it very obviously does not reach an equilibrium.&lt;br /&gt;
&lt;br /&gt;
Therefore, timestep = 0.0075 would be the ideal value as it provides the highest accuracy, while running the simulation for a suitably long time to provide realistic results.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions (NpT) ==&lt;br /&gt;
&lt;br /&gt;
=== Temperature and Pressure Control ===&lt;br /&gt;
&lt;br /&gt;
Pressures chosen: 2.61, 2.63&lt;br /&gt;
&lt;br /&gt;
Temperatures chosen: 1.5, 1.6, 1.7, 1.8, 1.9&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 was chosen to provide the highest accuracy possible, without shortening the simulation time too much.&lt;br /&gt;
&lt;br /&gt;
In our simulation, the temperature was controlled by solving the two following equations for the instantaneous temperature &amp;lt;math&amp;gt;T,&amp;lt;/math&amp;gt; which fluctuates.&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 \qquad\qquad\qquad(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order for &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; to reach our target temperature &amp;lt;math&amp;gt;\mathfrak{T},&amp;lt;/math&amp;gt; we introduce a constant &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; to control the velocity such that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}\qquad\qquad(2)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can solve eq. &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt; to solve for &amp;lt;math&amp;gt;\gamma.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\sum_i m_i v_i^2 = 3N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substituting &amp;lt;math&amp;gt;\sum_i m_i v_i^2&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 3 N k_b T = 3N k_b \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\epsilon}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Examining the Input Script ===&lt;br /&gt;
&lt;br /&gt;
To calculate the average values for our simulation, we set certain parameters for LAMMPS in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time Nevery Nrepeat Nfreq&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Final averages are generated on timesteps that are multiples of Nevery, for Nrepeat number of times and an average is generated every Nfreq timesteps.&lt;br /&gt;
&lt;br /&gt;
In our script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The results are sampled at every 100 timesteps for 1000 times (100, 200, 300, etc.) Averages are generated every 100,000 timesteps, but our simulation runs for the same amount of time so only one average is generated from this code.&lt;br /&gt;
&lt;br /&gt;
The timestep chosen for this section of the experiment was 0.0025. Therefore, the simulation was run for &amp;lt;math&amp;gt;100000 \times 0.0025 = 250 \text{ unit time}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equations of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:Density Temp.png|700px]]&lt;br /&gt;
&lt;br /&gt;
The graph above shows the density of the simulated liquid against temperature, compared with the densities derived from the ideal gas law.&lt;br /&gt;
&lt;br /&gt;
It can be seen that within the ranges set for this simulation, the discrepancy between the simulated densities compared to the calculated densities are very high, to the point that the error bars for the y-axis is not even visible on the graph. Perhaps a more accurate simulation could have been run if a wider temperature and pressure ranges were selected.&lt;br /&gt;
&lt;br /&gt;
With the data range being one possible source of error between the simulation and the ideal gas law prediction, another possible factor is that the parameters set for this simulation are such that the repulsive force of the Lennard-Jones interaction is more significant than the attractive force. Since the ideal gas law assumes no electronic interaction between the particles, introducing a repulsive force would result in the density of the liquid being lower than the prediction.&lt;br /&gt;
&lt;br /&gt;
The most likely explanation, however, is that the ideal gas law, as its name suggests, is not very good at predicting the behavious of liquids. While both gas and liquid phases are fluids, there are major differences between them such as a much more prominent long-range order effect in liquids compared to gases.&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacity ==&lt;br /&gt;
&lt;br /&gt;
[[File:HeatCap vs Density.png|thumb|800px|Graph of &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; against Temperature|none]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From thermodynamics:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;dU = TdS - PdV&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = T\frac{\partial S}{\partial T}-P\frac{\partial V}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and since &amp;lt;math&amp;gt;\frac{\partial S}{\partial T}\geq 0,&amp;lt;/math&amp;gt; heat capacity should increase with increasing temperature.&lt;br /&gt;
&lt;br /&gt;
The fact that &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; decreases with increasing temperature suggests that either the increase in temperature is causing the internal energy to increase at a faster rate than itself, or that there are issues with the simulation originating from possible sources such as small sampling size (number of atoms generated) or short run time.&lt;br /&gt;
&lt;br /&gt;
== Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
[[File:RDF SHL.png|thumb|700px]]&lt;br /&gt;
&lt;br /&gt;
Looking at the graph on the right, it can be noticed that the three phases have clearly different Radial Distribution Functions (RDF) from each other. This can be attributed to the varying degrees of order each of the phases have: the atoms in the gas phase are completely free to move around, while atoms in the liquid phase have less freedom and in the solid phase, the atoms are set in a lattice, with only vibrational motion and no (or negligible) translational motion.&lt;br /&gt;
&lt;br /&gt;
In order to explain the graph, let us consider the RDF to be displaying the &amp;quot;effective density&amp;quot; of atoms in an area of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; at a distance &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; from a certain reference atom.&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf schematic.jpg|thumb|200px|Schematic of RDF|left]]&lt;br /&gt;
&lt;br /&gt;
There are three main parts to the RDF graphs: the region near the origin where the &amp;lt;math&amp;gt;\mathrm{RDF} = 0&amp;lt;/math&amp;gt;, the region after where there are big peaks and troughs, and the final region where the graphs have mostly reached equilibrium.&lt;br /&gt;
&lt;br /&gt;
First of all, the region near the origin is 0 for all three phases as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; is still within the volume (the hard sphere) of the reference atom, and hence there can be no other atoms in that radius.&lt;br /&gt;
&lt;br /&gt;
The peaks in the second region indicate that there is a higher &amp;quot;effective density&amp;quot; of atoms. The explanation for this is different for the lattice structure (solid) and the fluids (liquid and gas).&lt;br /&gt;
&lt;br /&gt;
For the liquid and gas phase, the peaks are due to the attractive force caused by the Lennard-Jones potential. We have calculated above [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:SUNG95#Lennard-Jones_Potential (1.2 LJ Potential)] that &amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}.&amp;lt;/math&amp;gt; Setting &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt; (as we have in our input file), we get &amp;lt;math&amp;gt;r_{eq} = 1.122&amp;lt;/math&amp;gt;, which is very close to where the largest peaks are for the two fluid phases.&lt;br /&gt;
&lt;br /&gt;
For the solid, where all the atoms are in a lattice structure, the effects due to the Lennard-Jones interaction becomes neglibigle. Instead, there will be certain values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where the effective density is higher than the overall density of the sample (the peaks), and some values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where it is lower than the density of the sample (the troughs). This is arisen from the fact that as the value of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the total volume covered by &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; also increases. But since all the atoms are set in place by the lattice, the number of atoms that &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; encompasses stays relatively constant. As a result, the peaks and the troughs tend to 1 with increasing &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the case of the gas phase, the atoms are completely free to move around and the RDF graph can be entirely attributed to the effects of the L-J interaction. This justifies the lack of troughs for this phase. Furthermore, as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the attractive part of the L-J interaction &amp;lt;math&amp;gt;\frac{1}{r^6}&amp;lt;/math&amp;gt; gets exponentially smaller and quickly becomes negligible - RDF reaches equilibrium.&lt;br /&gt;
&lt;br /&gt;
Finally, the liquid phase can be considered to act as a mix between the solid phase and the gas phase: the L-J interactions are significant enough to reach equilibrium at a rate similar to the gas phase, but there exists an ordering of the atoms such that there are values of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; where the effective density is lower than the overall density.&lt;br /&gt;
&lt;br /&gt;
From the RDF of the solid phase, each of the peaks point to a certain lattice point. Simple geometrical calculations can be done to indicate that the first peak, which is the lattice point (1) closest to the reference atom (O), is at a separation of &amp;lt;math&amp;gt;\mathrm{r}=1.056.&amp;lt;/math&amp;gt; Second closest point (2) is at a distance of &amp;lt;math&amp;gt;\mathrm{r}=1.4938&amp;lt;/math&amp;gt; and the third (3) at &amp;lt;math&amp;gt;\mathrm{r}=1.8295.&amp;lt;/math&amp;gt; These points agree with the x-axis on the RDF graphs.&lt;br /&gt;
&lt;br /&gt;
[[File:FCC-SHL.png|thumb|Face-centered cubic lattice|none]]&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
The Diffusion Coefficients &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; of a simulated gas, liquid and solid were calculated using several different methods:&lt;br /&gt;
&lt;br /&gt;
1) From the Mean Squared Displacement (MSD) of 8,000 simulated atoms, according to the equation &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) From the MSD of a million atoms&lt;br /&gt;
&lt;br /&gt;
3) From the Velocity Autocorrelation Function (VACF), by integration.&lt;br /&gt;
&lt;br /&gt;
4) From the VACF of a million atoms&lt;br /&gt;
&lt;br /&gt;
The results were as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Diffusion Coefficients (unit area/unit time)&lt;br /&gt;
! Phase !! From MSD !! From MSD (million atoms) !! From VCAF !! From VCAF (million atoms)&lt;br /&gt;
|-&lt;br /&gt;
| Gas || &amp;lt;math&amp;gt;6.05&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;3.22&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;6.32&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;3.27&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || &amp;lt;math&amp;gt;0.0855&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.0892&amp;lt;/math&amp;gt; ||&amp;lt;math&amp;gt;0.0979&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.09&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Solid || &amp;lt;math&amp;gt;0.000896&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;1.5 \times 10^{-5}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;-1.66 \times 10^{-5}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;4.55\times 10^{-5}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
We can see from the table that the diffusion coefficients calculated from the same number of atoms agree very well with each other, which suggests that the results are quite accurate. However, we can assume that the million atoms simulations inevitably provide more accurate data.&lt;br /&gt;
&lt;br /&gt;
The results also make sense logically, where gases have the highest diffusion coefficient (they are able to diffuse much faster) than liquids, and then solids.&lt;br /&gt;
&lt;br /&gt;
=== Mean Squared Displacement ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The Mean Squared Displacement can be used to find the Diffusion Coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, via the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Plotting the mean squared displacement (MSD) against time, then finding the linear gradient would give us the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD-SHL.png|thumb|600px|none]][[File:MSD Mill SHL.png|thumb|600px|none]]&lt;br /&gt;
&lt;br /&gt;
Graphical analysis showed that the last 1,000 timesteps are suitably linear to apply this equation, and the Diffusion Coefficients for the three different phases were found from the last 1,000 timesteps.&lt;br /&gt;
&lt;br /&gt;
=== Velocity Autocorrelation Function ===&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;
From the 1D Harmonic Oscillator:&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;
Differentiating this gives the velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = -A\omega \sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting this into the integrated form of the VAFC:&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) \cdot A \omega \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(A \omega \sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, from the trigonometric identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin \left(\alpha + \beta \right)= \sin\alpha\cos\beta + \sin\beta\cos\alpha,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(\omega t + \phi + \omega\tau\right) = \sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \left(\sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\cos\left(\omega \tau\right) + \int_{-\infty}^{\infty} \sin \left(\omega \tau\right) \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt; is a constant so &amp;lt;math&amp;gt;\cos\left(\omega\tau\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sin\left(\omega\tau\right)&amp;lt;/math&amp;gt; can be taken out of the integral.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\cos\left(\omega \tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) + \sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; can cancel out:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\sin(x)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;\cos(x)&amp;lt;/math&amp;gt; is an even function, &amp;lt;math&amp;gt;\sin(x)\cos(x)&amp;lt;/math&amp;gt; is an odd function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; is an odd function (While the value of &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; can change whether or not the functions are even or odd, it shifts both functions by the same amount and the resulting &amp;lt;math&amp;gt;\cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; will still be odd)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}=\cos\left(\omega \tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\cos\left(\omega \tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF-SHL.png|thumb|800px|Comparison of Normalised VACF with VACF of Liquid and Solid|left]]&lt;br /&gt;
&lt;br /&gt;
We can see from this graph that while the VACF of the liquid quickly decorrelates to 0, the solid still retains some minor fluctuations. This is due to the fact that liquids are more free to move around and collide with each other, &amp;quot;forgetting&amp;quot; what its initial velocity was, whereas for atoms in the solid state, they are already in a relatively stable position (similar to &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; in L-J interactions) and oscillate from positive to negative. Eventually, atoms in solids, too, will decay, but at a much slower rate than in liquids.&lt;br /&gt;
&lt;br /&gt;
The VACF for the harmonic oscillator does not decay at all since the decorrelation arises from the atoms exchanging energy with its neighbours, which does not occur in harmonic oscillators.&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560826</id>
		<title>Rep:Mod:SUNG95</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560826"/>
		<updated>2016-10-21T10:49:55Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: /* Dynamical Properties and the Diffusion Coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Theory ==&lt;br /&gt;
=== The Velocity-Verlet Algorithm ===&lt;br /&gt;
[[File:Verlet-Velocity.png|thumb|700px|x(t) derived from the velocity-Verlet algorithm compared with the position of the classical harmonic oscillator.|left]]&lt;br /&gt;
[[File:Verlet-Energy.png|thumb|700px|Total energy of the system with respect to time|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Verlet-Error.png|thumb|700px|The error derived by comparing the solution of the velocity-Verlet algorithm with the position of the classical harmonic oscillator|none]]&lt;br /&gt;
&lt;br /&gt;
The three graphs above display the position of an atom, the total energy of the system and the error between the two methods of calculating the atom position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Error wrt Time.png|thumb|600px|Maximum Error against Time|none]]&lt;br /&gt;
&lt;br /&gt;
From this graph of Maximum error vs Time, we can see that error increases with time at a stable linear rate.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Running the same calculations with varying timesteps show the importance of choosing the right value of the timestep:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Energy at t=0.05.png|Energy at timestep=0.05&lt;br /&gt;
Image:Energy at t=0.5.png|Energy at timestep=0.5&lt;br /&gt;
Image:Error at t=0.5.png|Error at timestep=0.5&lt;br /&gt;
Image:Error at t=0.05.png|Error at timestep=0.05&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examining the four additional graphs above, we can notice that a shorter timestep is able to provide a smaller value for error and that the energy fluctuates less than when a bigger value of timestep is used. However, a shorter timestep results in a shorter simulation type, which can result in a less realistic simulation. It is therefore important to find the right balance between the two.&lt;br /&gt;
&lt;br /&gt;
Through trial and error, it has been found that timestep = 0.2850 or lower results in an energy fluctuation that is smaller than 1% over the course of the simulation. A small fluctuation in energy indicates higher resemblance to reality as technically the total energy should not fluctuate at all due to the Law of Conservation of Energy.&lt;br /&gt;
&lt;br /&gt;
=== Lennard-Jones Potential ===&lt;br /&gt;
The equation to calculate the Lennard-Jones potential is as follows:&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;
By equating this to 0, we find that the &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the separation at which the potential is 0, is &amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We can then find the force at this separation by differentiating the Lennard-Jones potential with respect to r, and substituting in &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}=\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24 \frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation (&amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;) is the separation of the particles at equilibrium, and represents the separation at which the potential energy is at a minimum. It can thus be found by setting &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}&amp;lt;/math&amp;gt;, (or &amp;lt;math&amp;gt;\mathbf{F}&amp;lt;/math&amp;gt;) to 0.&lt;br /&gt;
&lt;br /&gt;
Hence,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right) 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; gives us the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To put this equation into perspective, let us calculate the L-J potential for some realistic cutoff values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int 4\epsilon \left(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=4 \epsilon \left(\frac{\sigma^{12}}{11r^{11}}-\frac{\sigma^6}{5r^5}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\lim_{r\rightarrow \infty} 4 \left(\frac{1^{12}}{11r^{11}}-\frac{1^6}{5r^5}\right) - 4\left(\frac{1^{12}}{11\times 2^{11}}+\frac{1^6}{5\times 2^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=0-0.024822\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following the same calculations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0081767\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0032901\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The calculations show that as the cutoff distance increases, the Lennard-Jones potential decreases, which agrees with the theory.&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
It is very difficult to simulate realistic volumes of liquid and in the scope of this experiment, we have simulated liquids with N (number of atoms) between 1,000 and 10,000. To demonstrate why simulating realistic volumes of liquid is difficult, let us first calculate the number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
(Assuming: Standard conditions; Density of water = 1.00 g/ml)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.00 \mathrm{ml} = 1.00 \mathrm{g}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;18.02 \mathrm{g/mol} = 0.0555 \text{ mols of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.0555 \times 6.022 \times 10^{23} = 3.34 \times 10^{22} \text{ molecules of water.}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the other hand, 10,000 water molecules is only &amp;lt;math&amp;gt;2.99 \times 10^{-19} \text{ ml of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus, in order to be able to complete the simulation in a practical amount of time, we place our atoms in a box that is repeated in all directions, similar to how unit cells repeat themselves in a lattice. When an atom crosses the boundary of the box, its replica enters the same box from the other side, thus keeping the total number of atoms in the box constant.&lt;br /&gt;
&lt;br /&gt;
For example, if an atom at position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a cubic box ranging from &amp;lt;math&amp;gt;(0, 0, 0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;, its final position would be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;, if the periodic boundary conditions have been applied.&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units ===&lt;br /&gt;
The LAMMPS calculations run in this experiment are all done in reduced units&lt;br /&gt;
&lt;br /&gt;
For example, the Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34 \mathrm{nm}&amp;lt;/math&amp;gt;; &amp;lt;math&amp;gt;\epsilon/k_B=120K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If we set the cutoff to be &amp;lt;math&amp;gt;r*=3.2,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=3.2\times0.34=1.088\mathrm{nm}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Well depth: &amp;lt;math&amp;gt;\epsilon=120K\times k_B \times 6.02 \times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon=0.998 \mathrm{kJ/mol}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and reduced temperature &amp;lt;math&amp;gt;T*=1.5&amp;lt;/math&amp;gt; would be &amp;lt;math&amp;gt;T=1.5 \times 120=180\mathrm{K}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
=== Creating Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
In order to simulate a liquid for this experiment, we first create a crystal lattice, then melt that lattice to create a liquid. This is preferable to generating a liquid since assigning a random position for each new atom could result in two or more atoms being generated in the same space, causing an error when running the simulation.&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is one lattice point per unit cell. Hence, if the number density is 0.8,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8 \text{ points/volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sqrt[3]{0.8}=0.9283\text{ points/length}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.9283^{-1}=1.0772 \text{ length/point}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is thus 1.0772 unit lengths of spacing between each point.&lt;br /&gt;
&lt;br /&gt;
Following the same logic, a face-centred cubic lattice (with 4 lattice points per unit cell) with a density of 1.2 would have a spacing of &amp;lt;math&amp;gt;0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\because \sqrt[3]{4.8^{-1}}=0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, the simple cubic lattice with a density of 0.8 would create 1,000 atoms in the given constraints of the box:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;region box block 0 10 0 10 0 10&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and a face centred cubic lattice with a density of 1.2 would create 4,000 atoms in the same box.&lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of the Atoms ===&lt;br /&gt;
In the input script, there are the following lines describing the properties of the atoms:&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;
In the first line, we are setting the mass of type 1 atoms (which includes all of the atoms in our simulation box, as we have created only one type of atoms) as &amp;lt;math&amp;gt;1.0&amp;lt;/math&amp;gt;, in reduced units. The second line defines the interaction between the atoms as a Lenard-Jones interaction, with a cutoff distance of &amp;lt;math&amp;gt;3.0 \text{ units.}&amp;lt;/math&amp;gt; Finally, the last line defines the coefficient in the Lenard-Jones interaction; the asterisk tells LAMMPS that the coefficients apply to all atoms in our system; the first coefficient is &amp;lt;math&amp;gt;\epsilon=1.0&amp;lt;/math&amp;gt; and the second coefficient is &amp;lt;math&amp;gt;\sigma=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After setting the properties of the atoms, we also defined the initial positions and the initial velocities for the atoms in the input script. Since we have both the &amp;lt;math&amp;gt;\mathbf{x}_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, we can use the Velocity-Verlet integration algorithm that employs the half-step method.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
In the following lines from the input script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we created and reset a variable called timestep to equal 0.001, then used that value to calculate how many runs (${n_steps}) to carry out. This is more beneficial than simply setting&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;
as it allows us to only change the value of the timestep variable to alter the number of runs, rather than having to calculate ${n_steps} ourselves every time we change the timestep, especially in cases such as this computational experiment where the timestep was changed multiple times.&lt;br /&gt;
&lt;br /&gt;
=== Checking Equilibration ===&lt;br /&gt;
&lt;br /&gt;
[[File:TotalE at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Temp at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Press at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
&lt;br /&gt;
These graphs have been plotted to ensure that the simulation reaches equilibrium, and we can see that indeed, they do, and very quickly. Analysis of the graphs show that equilibrium is reached before 1 timestep.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
The following graph shows the total energy of the system against time at varying timestep values:&lt;br /&gt;
&lt;br /&gt;
[[File:Equil Energy.png|thumb|800px|none]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from the graphs that for timestep = 0.001, 0.0025 and 0.0075, the energy reaches a stable equilibrium but for timestep = 0.01 and timestep = 0.015, the energy slowly decreases and rapidly increases, respectively, indicating that the results of the simulation are not very accurate for these values of timestep. Timestep = 0.015 is especially bad as it very obviously does not reach an equilibrium.&lt;br /&gt;
&lt;br /&gt;
Therefore, timestep = 0.0075 would be the ideal value as it provides the highest accuracy, while running the simulation for a suitably long time to provide realistic results.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions (NpT) ==&lt;br /&gt;
&lt;br /&gt;
=== Temperature and Pressure Control ===&lt;br /&gt;
&lt;br /&gt;
Pressures chosen: 2.61, 2.63&lt;br /&gt;
&lt;br /&gt;
Temperatures chosen: 1.5, 1.6, 1.7, 1.8, 1.9&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 was chosen to provide the highest accuracy possible, without shortening the simulation time too much.&lt;br /&gt;
&lt;br /&gt;
In our simulation, the temperature was controlled by solving the two following equations for the instantaneous temperature &amp;lt;math&amp;gt;T,&amp;lt;/math&amp;gt; which fluctuates.&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 \qquad\qquad\qquad(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order for &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; to reach our target temperature &amp;lt;math&amp;gt;\mathfrak{T},&amp;lt;/math&amp;gt; we introduce a constant &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; to control the velocity such that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}\qquad\qquad(2)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can solve eq. &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt; to solve for &amp;lt;math&amp;gt;\gamma.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\sum_i m_i v_i^2 = 3N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substituting &amp;lt;math&amp;gt;\sum_i m_i v_i^2&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 3 N k_b T = 3N k_b \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\epsilon}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Examining the Input Script ===&lt;br /&gt;
&lt;br /&gt;
To calculate the average values for our simulation, we set certain parameters for LAMMPS in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time Nevery Nrepeat Nfreq&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Final averages are generated on timesteps that are multiples of Nevery, for Nrepeat number of times and an average is generated every Nfreq timesteps.&lt;br /&gt;
&lt;br /&gt;
In our script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The results are sampled at every 100 timesteps for 1000 times (100, 200, 300, etc.) Averages are generated every 100,000 timesteps, but our simulation runs for the same amount of time so only one average is generated from this code.&lt;br /&gt;
&lt;br /&gt;
The timestep chosen for this section of the experiment was 0.0025. Therefore, the simulation was run for &amp;lt;math&amp;gt;100000 \times 0.0025 = 250 \text{ unit time}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equations of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:Density Temp.png|700px]]&lt;br /&gt;
&lt;br /&gt;
The graph above shows the density of the simulated liquid against temperature, compared with the densities derived from the ideal gas law.&lt;br /&gt;
&lt;br /&gt;
It can be seen that within the ranges set for this simulation, the discrepancy between the simulated densities compared to the calculated densities are very high, to the point that the error bars for the y-axis is not even visible on the graph. Perhaps a more accurate simulation could have been run if a wider temperature and pressure ranges were selected.&lt;br /&gt;
&lt;br /&gt;
With the data range being one possible source of error between the simulation and the ideal gas law prediction, another possible factor is that the parameters set for this simulation are such that the repulsive force of the Lennard-Jones interaction is more significant than the attractive force. Since the ideal gas law assumes no electronic interaction between the particles, introducing a repulsive force would result in the density of the liquid being lower than the prediction.&lt;br /&gt;
&lt;br /&gt;
The most likely explanation, however, is that the ideal gas law, as its name suggests, is not very good at predicting the behavious of liquids. While both gas and liquid phases are fluids, there are major differences between them such as a much more prominent long-range order effect in liquids compared to gases.&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacity ==&lt;br /&gt;
&lt;br /&gt;
[[File:HeatCap vs Density.png|thumb|800px|Graph of &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; against Temperature|none]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From thermodynamics:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;dU = TdS - PdV&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = T\frac{\partial S}{\partial T}-P\frac{\partial V}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and since &amp;lt;math&amp;gt;\frac{\partial S}{\partial T}\geq 0,&amp;lt;/math&amp;gt; heat capacity should increase with increasing temperature.&lt;br /&gt;
&lt;br /&gt;
The fact that &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; decreases with increasing temperature suggests that either the increase in temperature is causing the internal energy to increase at a faster rate than itself, or that there are issues with the simulation originating from possible sources such as small sampling size (number of atoms generated) or short run time.&lt;br /&gt;
&lt;br /&gt;
== Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
[[File:RDF SHL.png|thumb|700px]]&lt;br /&gt;
&lt;br /&gt;
Looking at the graph on the right, it can be noticed that the three phases have clearly different Radial Distribution Functions (RDF) from each other. This can be attributed to the varying degrees of order each of the phases have: the atoms in the gas phase are completely free to move around, while atoms in the liquid phase have less freedom and in the solid phase, the atoms are set in a lattice, with only vibrational motion and no (or negligible) translational motion.&lt;br /&gt;
&lt;br /&gt;
In order to explain the graph, let us consider the RDF to be displaying the &amp;quot;effective density&amp;quot; of atoms in an area of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; at a distance &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; from a certain reference atom.&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf schematic.jpg|thumb|200px|Schematic of RDF|left]]&lt;br /&gt;
&lt;br /&gt;
There are three main parts to the RDF graphs: the region near the origin where the &amp;lt;math&amp;gt;\mathrm{RDF} = 0&amp;lt;/math&amp;gt;, the region after where there are big peaks and troughs, and the final region where the graphs have mostly reached equilibrium.&lt;br /&gt;
&lt;br /&gt;
First of all, the region near the origin is 0 for all three phases as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; is still within the volume (the hard sphere) of the reference atom, and hence there can be no other atoms in that radius.&lt;br /&gt;
&lt;br /&gt;
The peaks in the second region indicate that there is a higher &amp;quot;effective density&amp;quot; of atoms. The explanation for this is different for the lattice structure (solid) and the fluids (liquid and gas).&lt;br /&gt;
&lt;br /&gt;
For the liquid and gas phase, the peaks are due to the attractive force caused by the Lennard-Jones potential. We have calculated above [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:SUNG95#Lennard-Jones_Potential (1.2 LJ Potential)] that &amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}.&amp;lt;/math&amp;gt; Setting &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt; (as we have in our input file), we get &amp;lt;math&amp;gt;r_{eq} = 1.122&amp;lt;/math&amp;gt;, which is very close to where the largest peaks are for the two fluid phases.&lt;br /&gt;
&lt;br /&gt;
For the solid, where all the atoms are in a lattice structure, the effects due to the Lennard-Jones interaction becomes neglibigle. Instead, there will be certain values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where the effective density is higher than the overall density of the sample (the peaks), and some values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where it is lower than the density of the sample (the troughs). This is arisen from the fact that as the value of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the total volume covered by &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; also increases. But since all the atoms are set in place by the lattice, the number of atoms that &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; encompasses stays relatively constant. As a result, the peaks and the troughs tend to 1 with increasing &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the case of the gas phase, the atoms are completely free to move around and the RDF graph can be entirely attributed to the effects of the L-J interaction. This justifies the lack of troughs for this phase. Furthermore, as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the attractive part of the L-J interaction &amp;lt;math&amp;gt;\frac{1}{r^6}&amp;lt;/math&amp;gt; gets exponentially smaller and quickly becomes negligible - RDF reaches equilibrium.&lt;br /&gt;
&lt;br /&gt;
Finally, the liquid phase can be considered to act as a mix between the solid phase and the gas phase: the L-J interactions are significant enough to reach equilibrium at a rate similar to the gas phase, but there exists an ordering of the atoms such that there are values of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; where the effective density is lower than the overall density.&lt;br /&gt;
&lt;br /&gt;
From the RDF of the solid phase, each of the peaks point to a certain lattice point. Simple geometrical calculations can be done to indicate that the first peak, which is the lattice point (1) closest to the reference atom (O), is at a separation of &amp;lt;math&amp;gt;\mathrm{r}=1.056.&amp;lt;/math&amp;gt; Second closest point (2) is at a distance of &amp;lt;math&amp;gt;\mathrm{r}=1.4938&amp;lt;/math&amp;gt; and the third (3) at &amp;lt;math&amp;gt;\mathrm{r}=1.8295.&amp;lt;/math&amp;gt; These points agree with the x-axis on the RDF graphs.&lt;br /&gt;
&lt;br /&gt;
[[File:FCC-SHL.png|thumb|Face-centered cubic lattice|none]]&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
The Diffusion Coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; were calculated using several different methods:&lt;br /&gt;
&lt;br /&gt;
1) From the Mean Squared Displacement (MSD) of 8,000 simulated atoms, according to the equation &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) From the MSD of a million atoms&lt;br /&gt;
&lt;br /&gt;
3) From the Velocity Autocorrelation Function (VACF), by integration.&lt;br /&gt;
&lt;br /&gt;
4) From the VACF of a million atoms&lt;br /&gt;
&lt;br /&gt;
The results were as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Diffusion Coefficients (unit area/unit time)&lt;br /&gt;
! Phase !! From MSD !! From MSD (million atoms) !! From VCAF !! From VCAF (million atoms)&lt;br /&gt;
|-&lt;br /&gt;
| Gas || &amp;lt;math&amp;gt;6.05&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;3.22&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;6.32&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;3.27&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || &amp;lt;math&amp;gt;0.0855&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.0892&amp;lt;/math&amp;gt; ||&amp;lt;math&amp;gt;0.0979&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.09&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Solid || &amp;lt;math&amp;gt;0.000896&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;1.5 \times 10^{-5}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;-1.66 \times 10^{-5}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;4.55\times 10^{-5}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
We can see from the table that the diffusion coefficients calculated from the same number of atoms agree very well with each other, which suggests that the results are quite accurate. However, we can assume that the million atoms simulations inevitably provide more accurate data.&lt;br /&gt;
&lt;br /&gt;
The results also make sense logically, where gases have the highest diffusion coefficient (they are able to diffuse much faster) than liquids, and then solids.&lt;br /&gt;
&lt;br /&gt;
=== Mean Squared Displacement ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The Mean Squared Displacement can be used to find the Diffusion Coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, via the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Plotting the mean squared displacement (MSD) against time, then finding the linear gradient would give us the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD-SHL.png|thumb|600px|none]][[File:MSD Mill SHL.png|thumb|600px|none]]&lt;br /&gt;
&lt;br /&gt;
Graphical analysis showed that the last 1,000 timesteps are suitably linear to apply this equation, and the Diffusion Coefficients for the three different phases were found from the last 1,000 timesteps.&lt;br /&gt;
&lt;br /&gt;
=== Velocity Autocorrelation Function ===&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;
From the 1D Harmonic Oscillator:&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;
Differentiating this gives the velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = -A\omega \sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting this into the integrated form of the VAFC:&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) \cdot A \omega \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(A \omega \sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, from the trigonometric identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin \left(\alpha + \beta \right)= \sin\alpha\cos\beta + \sin\beta\cos\alpha,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(\omega t + \phi + \omega\tau\right) = \sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \left(\sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\cos\left(\omega \tau\right) + \int_{-\infty}^{\infty} \sin \left(\omega \tau\right) \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt; is a constant so &amp;lt;math&amp;gt;\cos\left(\omega\tau\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sin\left(\omega\tau\right)&amp;lt;/math&amp;gt; can be taken out of the integral.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\cos\left(\omega \tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) + \sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; can cancel out:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\sin(x)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;\cos(x)&amp;lt;/math&amp;gt; is an even function, &amp;lt;math&amp;gt;\sin(x)\cos(x)&amp;lt;/math&amp;gt; is an odd function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; is an odd function (While the value of &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; can change whether or not the functions are even or odd, it shifts both functions by the same amount and the resulting &amp;lt;math&amp;gt;\cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; will still be odd)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}=\cos\left(\omega \tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\cos\left(\omega \tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF-SHL.png|thumb|800px|Comparison of Normalised VACF with VACF of Liquid and Solid|left]]&lt;br /&gt;
&lt;br /&gt;
We can see from this graph that while the VACF of the liquid quickly decorrelates to 0, the solid still retains some minor fluctuations. This is due to the fact that liquids are more free to move around and collide with each other, &amp;quot;forgetting&amp;quot; what its initial velocity was, whereas for atoms in the solid state, they are already in a relatively stable position (similar to &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; in L-J interactions) and oscillate from positive to negative. Eventually, atoms in solids, too, will decay, but at a much slower rate than in liquids.&lt;br /&gt;
&lt;br /&gt;
The VACF for the harmonic oscillator does not decay at all since the decorrelation arises from the atoms exchanging energy with its neighbours, which does not occur in harmonic oscillators.&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560811</id>
		<title>Rep:Mod:SUNG95</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560811"/>
		<updated>2016-10-21T10:42:27Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: /* Lennard-Jones Potential */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Theory ==&lt;br /&gt;
=== The Velocity-Verlet Algorithm ===&lt;br /&gt;
[[File:Verlet-Velocity.png|thumb|700px|x(t) derived from the velocity-Verlet algorithm compared with the position of the classical harmonic oscillator.|left]]&lt;br /&gt;
[[File:Verlet-Energy.png|thumb|700px|Total energy of the system with respect to time|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Verlet-Error.png|thumb|700px|The error derived by comparing the solution of the velocity-Verlet algorithm with the position of the classical harmonic oscillator|none]]&lt;br /&gt;
&lt;br /&gt;
The three graphs above display the position of an atom, the total energy of the system and the error between the two methods of calculating the atom position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Error wrt Time.png|thumb|600px|Maximum Error against Time|none]]&lt;br /&gt;
&lt;br /&gt;
From this graph of Maximum error vs Time, we can see that error increases with time at a stable linear rate.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Running the same calculations with varying timesteps show the importance of choosing the right value of the timestep:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Energy at t=0.05.png|Energy at timestep=0.05&lt;br /&gt;
Image:Energy at t=0.5.png|Energy at timestep=0.5&lt;br /&gt;
Image:Error at t=0.5.png|Error at timestep=0.5&lt;br /&gt;
Image:Error at t=0.05.png|Error at timestep=0.05&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examining the four additional graphs above, we can notice that a shorter timestep is able to provide a smaller value for error and that the energy fluctuates less than when a bigger value of timestep is used. However, a shorter timestep results in a shorter simulation type, which can result in a less realistic simulation. It is therefore important to find the right balance between the two.&lt;br /&gt;
&lt;br /&gt;
Through trial and error, it has been found that timestep = 0.2850 or lower results in an energy fluctuation that is smaller than 1% over the course of the simulation. A small fluctuation in energy indicates higher resemblance to reality as technically the total energy should not fluctuate at all due to the Law of Conservation of Energy.&lt;br /&gt;
&lt;br /&gt;
=== Lennard-Jones Potential ===&lt;br /&gt;
The equation to calculate the Lennard-Jones potential is as follows:&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;
By equating this to 0, we find that the &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the separation at which the potential is 0, is &amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We can then find the force at this separation by differentiating the Lennard-Jones potential with respect to r, and substituting in &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}=\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24 \frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation (&amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;) is the separation of the particles at equilibrium, and represents the separation at which the potential energy is at a minimum. It can thus be found by setting &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}&amp;lt;/math&amp;gt;, (or &amp;lt;math&amp;gt;\mathbf{F}&amp;lt;/math&amp;gt;) to 0.&lt;br /&gt;
&lt;br /&gt;
Hence,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right) 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; gives us the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To put this equation into perspective, let us calculate the L-J potential for some realistic cutoff values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int 4\epsilon \left(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=4 \epsilon \left(\frac{\sigma^{12}}{11r^{11}}-\frac{\sigma^6}{5r^5}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\lim_{r\rightarrow \infty} 4 \left(\frac{1^{12}}{11r^{11}}-\frac{1^6}{5r^5}\right) - 4\left(\frac{1^{12}}{11\times 2^{11}}+\frac{1^6}{5\times 2^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=0-0.024822\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following the same calculations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0081767\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0032901\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The calculations show that as the cutoff distance increases, the Lennard-Jones potential decreases, which agrees with the theory.&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
It is very difficult to simulate realistic volumes of liquid and in the scope of this experiment, we have simulated liquids with N (number of atoms) between 1,000 and 10,000. To demonstrate why simulating realistic volumes of liquid is difficult, let us first calculate the number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
(Assuming: Standard conditions; Density of water = 1.00 g/ml)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.00 \mathrm{ml} = 1.00 \mathrm{g}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;18.02 \mathrm{g/mol} = 0.0555 \text{ mols of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.0555 \times 6.022 \times 10^{23} = 3.34 \times 10^{22} \text{ molecules of water.}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the other hand, 10,000 water molecules is only &amp;lt;math&amp;gt;2.99 \times 10^{-19} \text{ ml of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus, in order to be able to complete the simulation in a practical amount of time, we place our atoms in a box that is repeated in all directions, similar to how unit cells repeat themselves in a lattice. When an atom crosses the boundary of the box, its replica enters the same box from the other side, thus keeping the total number of atoms in the box constant.&lt;br /&gt;
&lt;br /&gt;
For example, if an atom at position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a cubic box ranging from &amp;lt;math&amp;gt;(0, 0, 0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;, its final position would be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;, if the periodic boundary conditions have been applied.&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units ===&lt;br /&gt;
The LAMMPS calculations run in this experiment are all done in reduced units&lt;br /&gt;
&lt;br /&gt;
For example, the Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34 \mathrm{nm}&amp;lt;/math&amp;gt;; &amp;lt;math&amp;gt;\epsilon/k_B=120K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If we set the cutoff to be &amp;lt;math&amp;gt;r*=3.2,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=3.2\times0.34=1.088\mathrm{nm}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Well depth: &amp;lt;math&amp;gt;\epsilon=120K\times k_B \times 6.02 \times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon=0.998 \mathrm{kJ/mol}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and reduced temperature &amp;lt;math&amp;gt;T*=1.5&amp;lt;/math&amp;gt; would be &amp;lt;math&amp;gt;T=1.5 \times 120=180\mathrm{K}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
=== Creating Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
In order to simulate a liquid for this experiment, we first create a crystal lattice, then melt that lattice to create a liquid. This is preferable to generating a liquid since assigning a random position for each new atom could result in two or more atoms being generated in the same space, causing an error when running the simulation.&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is one lattice point per unit cell. Hence, if the number density is 0.8,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8 \text{ points/volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sqrt[3]{0.8}=0.9283\text{ points/length}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.9283^{-1}=1.0772 \text{ length/point}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is thus 1.0772 unit lengths of spacing between each point.&lt;br /&gt;
&lt;br /&gt;
Following the same logic, a face-centred cubic lattice (with 4 lattice points per unit cell) with a density of 1.2 would have a spacing of &amp;lt;math&amp;gt;0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\because \sqrt[3]{4.8^{-1}}=0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, the simple cubic lattice with a density of 0.8 would create 1,000 atoms in the given constraints of the box:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;region box block 0 10 0 10 0 10&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and a face centred cubic lattice with a density of 1.2 would create 4,000 atoms in the same box.&lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of the Atoms ===&lt;br /&gt;
In the input script, there are the following lines describing the properties of the atoms:&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;
In the first line, we are setting the mass of type 1 atoms (which includes all of the atoms in our simulation box, as we have created only one type of atoms) as &amp;lt;math&amp;gt;1.0&amp;lt;/math&amp;gt;, in reduced units. The second line defines the interaction between the atoms as a Lenard-Jones interaction, with a cutoff distance of &amp;lt;math&amp;gt;3.0 \text{ units.}&amp;lt;/math&amp;gt; Finally, the last line defines the coefficient in the Lenard-Jones interaction; the asterisk tells LAMMPS that the coefficients apply to all atoms in our system; the first coefficient is &amp;lt;math&amp;gt;\epsilon=1.0&amp;lt;/math&amp;gt; and the second coefficient is &amp;lt;math&amp;gt;\sigma=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After setting the properties of the atoms, we also defined the initial positions and the initial velocities for the atoms in the input script. Since we have both the &amp;lt;math&amp;gt;\mathbf{x}_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, we can use the Velocity-Verlet integration algorithm that employs the half-step method.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
In the following lines from the input script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we created and reset a variable called timestep to equal 0.001, then used that value to calculate how many runs (${n_steps}) to carry out. This is more beneficial than simply setting&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;
as it allows us to only change the value of the timestep variable to alter the number of runs, rather than having to calculate ${n_steps} ourselves every time we change the timestep, especially in cases such as this computational experiment where the timestep was changed multiple times.&lt;br /&gt;
&lt;br /&gt;
=== Checking Equilibration ===&lt;br /&gt;
&lt;br /&gt;
[[File:TotalE at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Temp at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Press at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
&lt;br /&gt;
These graphs have been plotted to ensure that the simulation reaches equilibrium, and we can see that indeed, they do, and very quickly. Analysis of the graphs show that equilibrium is reached before 1 timestep.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
The following graph shows the total energy of the system against time at varying timestep values:&lt;br /&gt;
&lt;br /&gt;
[[File:Equil Energy.png|thumb|800px|none]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from the graphs that for timestep = 0.001, 0.0025 and 0.0075, the energy reaches a stable equilibrium but for timestep = 0.01 and timestep = 0.015, the energy slowly decreases and rapidly increases, respectively, indicating that the results of the simulation are not very accurate for these values of timestep. Timestep = 0.015 is especially bad as it very obviously does not reach an equilibrium.&lt;br /&gt;
&lt;br /&gt;
Therefore, timestep = 0.0075 would be the ideal value as it provides the highest accuracy, while running the simulation for a suitably long time to provide realistic results.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions (NpT) ==&lt;br /&gt;
&lt;br /&gt;
=== Temperature and Pressure Control ===&lt;br /&gt;
&lt;br /&gt;
Pressures chosen: 2.61, 2.63&lt;br /&gt;
&lt;br /&gt;
Temperatures chosen: 1.5, 1.6, 1.7, 1.8, 1.9&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 was chosen to provide the highest accuracy possible, without shortening the simulation time too much.&lt;br /&gt;
&lt;br /&gt;
In our simulation, the temperature was controlled by solving the two following equations for the instantaneous temperature &amp;lt;math&amp;gt;T,&amp;lt;/math&amp;gt; which fluctuates.&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 \qquad\qquad\qquad(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order for &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; to reach our target temperature &amp;lt;math&amp;gt;\mathfrak{T},&amp;lt;/math&amp;gt; we introduce a constant &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; to control the velocity such that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}\qquad\qquad(2)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can solve eq. &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt; to solve for &amp;lt;math&amp;gt;\gamma.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\sum_i m_i v_i^2 = 3N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substituting &amp;lt;math&amp;gt;\sum_i m_i v_i^2&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 3 N k_b T = 3N k_b \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\epsilon}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Examining the Input Script ===&lt;br /&gt;
&lt;br /&gt;
To calculate the average values for our simulation, we set certain parameters for LAMMPS in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time Nevery Nrepeat Nfreq&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Final averages are generated on timesteps that are multiples of Nevery, for Nrepeat number of times and an average is generated every Nfreq timesteps.&lt;br /&gt;
&lt;br /&gt;
In our script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The results are sampled at every 100 timesteps for 1000 times (100, 200, 300, etc.) Averages are generated every 100,000 timesteps, but our simulation runs for the same amount of time so only one average is generated from this code.&lt;br /&gt;
&lt;br /&gt;
The timestep chosen for this section of the experiment was 0.0025. Therefore, the simulation was run for &amp;lt;math&amp;gt;100000 \times 0.0025 = 250 \text{ unit time}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equations of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:Density Temp.png|700px]]&lt;br /&gt;
&lt;br /&gt;
The graph above shows the density of the simulated liquid against temperature, compared with the densities derived from the ideal gas law.&lt;br /&gt;
&lt;br /&gt;
It can be seen that within the ranges set for this simulation, the discrepancy between the simulated densities compared to the calculated densities are very high, to the point that the error bars for the y-axis is not even visible on the graph. Perhaps a more accurate simulation could have been run if a wider temperature and pressure ranges were selected.&lt;br /&gt;
&lt;br /&gt;
With the data range being one possible source of error between the simulation and the ideal gas law prediction, another possible factor is that the parameters set for this simulation are such that the repulsive force of the Lennard-Jones interaction is more significant than the attractive force. Since the ideal gas law assumes no electronic interaction between the particles, introducing a repulsive force would result in the density of the liquid being lower than the prediction.&lt;br /&gt;
&lt;br /&gt;
The most likely explanation, however, is that the ideal gas law, as its name suggests, is not very good at predicting the behavious of liquids. While both gas and liquid phases are fluids, there are major differences between them such as a much more prominent long-range order effect in liquids compared to gases.&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacity ==&lt;br /&gt;
&lt;br /&gt;
[[File:HeatCap vs Density.png|thumb|800px|Graph of &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; against Temperature|none]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From thermodynamics:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;dU = TdS - PdV&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = T\frac{\partial S}{\partial T}-P\frac{\partial V}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and since &amp;lt;math&amp;gt;\frac{\partial S}{\partial T}\geq 0,&amp;lt;/math&amp;gt; heat capacity should increase with increasing temperature.&lt;br /&gt;
&lt;br /&gt;
The fact that &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; decreases with increasing temperature suggests that either the increase in temperature is causing the internal energy to increase at a faster rate than itself, or that there are issues with the simulation originating from possible sources such as small sampling size (number of atoms generated) or short run time.&lt;br /&gt;
&lt;br /&gt;
== Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
[[File:RDF SHL.png|thumb|700px]]&lt;br /&gt;
&lt;br /&gt;
Looking at the graph on the right, it can be noticed that the three phases have clearly different Radial Distribution Functions (RDF) from each other. This can be attributed to the varying degrees of order each of the phases have: the atoms in the gas phase are completely free to move around, while atoms in the liquid phase have less freedom and in the solid phase, the atoms are set in a lattice, with only vibrational motion and no (or negligible) translational motion.&lt;br /&gt;
&lt;br /&gt;
In order to explain the graph, let us consider the RDF to be displaying the &amp;quot;effective density&amp;quot; of atoms in an area of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; at a distance &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; from a certain reference atom.&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf schematic.jpg|thumb|200px|Schematic of RDF|left]]&lt;br /&gt;
&lt;br /&gt;
There are three main parts to the RDF graphs: the region near the origin where the &amp;lt;math&amp;gt;\mathrm{RDF} = 0&amp;lt;/math&amp;gt;, the region after where there are big peaks and troughs, and the final region where the graphs have mostly reached equilibrium.&lt;br /&gt;
&lt;br /&gt;
First of all, the region near the origin is 0 for all three phases as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; is still within the volume (the hard sphere) of the reference atom, and hence there can be no other atoms in that radius.&lt;br /&gt;
&lt;br /&gt;
The peaks in the second region indicate that there is a higher &amp;quot;effective density&amp;quot; of atoms. The explanation for this is different for the lattice structure (solid) and the fluids (liquid and gas).&lt;br /&gt;
&lt;br /&gt;
For the liquid and gas phase, the peaks are due to the attractive force caused by the Lennard-Jones potential. We have calculated above [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:SUNG95#Lennard-Jones_Potential (1.2 LJ Potential)] that &amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}.&amp;lt;/math&amp;gt; Setting &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt; (as we have in our input file), we get &amp;lt;math&amp;gt;r_{eq} = 1.122&amp;lt;/math&amp;gt;, which is very close to where the largest peaks are for the two fluid phases.&lt;br /&gt;
&lt;br /&gt;
For the solid, where all the atoms are in a lattice structure, the effects due to the Lennard-Jones interaction becomes neglibigle. Instead, there will be certain values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where the effective density is higher than the overall density of the sample (the peaks), and some values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where it is lower than the density of the sample (the troughs). This is arisen from the fact that as the value of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the total volume covered by &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; also increases. But since all the atoms are set in place by the lattice, the number of atoms that &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; encompasses stays relatively constant. As a result, the peaks and the troughs tend to 1 with increasing &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the case of the gas phase, the atoms are completely free to move around and the RDF graph can be entirely attributed to the effects of the L-J interaction. This justifies the lack of troughs for this phase. Furthermore, as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the attractive part of the L-J interaction &amp;lt;math&amp;gt;\frac{1}{r^6}&amp;lt;/math&amp;gt; gets exponentially smaller and quickly becomes negligible - RDF reaches equilibrium.&lt;br /&gt;
&lt;br /&gt;
Finally, the liquid phase can be considered to act as a mix between the solid phase and the gas phase: the L-J interactions are significant enough to reach equilibrium at a rate similar to the gas phase, but there exists an ordering of the atoms such that there are values of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; where the effective density is lower than the overall density.&lt;br /&gt;
&lt;br /&gt;
From the RDF of the solid phase, each of the peaks point to a certain lattice point. Simple geometrical calculations can be done to indicate that the first peak, which is the lattice point (1) closest to the reference atom (O), is at a separation of &amp;lt;math&amp;gt;\mathrm{r}=1.056.&amp;lt;/math&amp;gt; Second closest point (2) is at a distance of &amp;lt;math&amp;gt;\mathrm{r}=1.4938&amp;lt;/math&amp;gt; and the third (3) at &amp;lt;math&amp;gt;\mathrm{r}=1.8295.&amp;lt;/math&amp;gt; These points agree with the x-axis on the RDF graphs.&lt;br /&gt;
&lt;br /&gt;
[[File:FCC-SHL.png|thumb|Face-centered cubic lattice|none]]&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
The Diffusion Coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; were calculated using several different methods:&lt;br /&gt;
&lt;br /&gt;
1) From the Mean Squared Displacement (MSD) of 8,000 simulated atoms, according to the equation &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) From the MSD of a million atoms&lt;br /&gt;
&lt;br /&gt;
3) From the Velocity Autocorrelation Function (VACF), by integration.&lt;br /&gt;
&lt;br /&gt;
4) From the VACF of a million atoms&lt;br /&gt;
&lt;br /&gt;
The results were as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Diffusion Coefficients (unit area/unit time)&lt;br /&gt;
! Phase !! From MSD !! From MSD (million atoms) !! From VCAF !! From VCAF (million atoms)&lt;br /&gt;
|-&lt;br /&gt;
| Gas || &amp;lt;math&amp;gt;6.05&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;3.22&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;6.32&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;3.27&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || &amp;lt;math&amp;gt;0.0855&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.0892&amp;lt;/math&amp;gt; ||&amp;lt;math&amp;gt;0.0979&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.09&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Solid || &amp;lt;math&amp;gt;0.000896&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;1.5 \times 10^{-5}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;-1.66 \times 10^{-5}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;4.55\times 10^{-5}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
We can see from the table that the diffusion coefficients calculated from the same number of atoms agree very well with each other, which suggests that the results are quite accurate. However, we can assume that the million atoms simulations inevitably provide more accurate data.&lt;br /&gt;
&lt;br /&gt;
=== Mean Squared Displacement ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The Mean Squared Displacement can be used to find the Diffusion Coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, via the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Plotting the mean squared displacement (MSD) against time, then finding the linear gradient would give us the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD-SHL.png|thumb|600px|none]][[File:MSD Mill SHL.png|thumb|600px|none]]&lt;br /&gt;
&lt;br /&gt;
Graphical analysis showed that the last 1,000 timesteps are suitably linear to apply this equation, and the Diffusion Coefficients for the three different phases were found from the last 1,000 timesteps.&lt;br /&gt;
&lt;br /&gt;
=== Velocity Autocorrelation Function ===&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;
From the 1D Harmonic Oscillator:&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;
Differentiating this gives the velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = -A\omega \sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting this into the integrated form of the VAFC:&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) \cdot A \omega \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(A \omega \sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, from the trigonometric identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin \left(\alpha + \beta \right)= \sin\alpha\cos\beta + \sin\beta\cos\alpha,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(\omega t + \phi + \omega\tau\right) = \sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \left(\sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\cos\left(\omega \tau\right) + \int_{-\infty}^{\infty} \sin \left(\omega \tau\right) \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt; is a constant so &amp;lt;math&amp;gt;\cos\left(\omega\tau\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sin\left(\omega\tau\right)&amp;lt;/math&amp;gt; can be taken out of the integral.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\cos\left(\omega \tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) + \sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; can cancel out:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\sin(x)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;\cos(x)&amp;lt;/math&amp;gt; is an even function, &amp;lt;math&amp;gt;\sin(x)\cos(x)&amp;lt;/math&amp;gt; is an odd function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; is an odd function (While the value of &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; can change whether or not the functions are even or odd, it shifts both functions by the same amount and the resulting &amp;lt;math&amp;gt;\cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; will still be odd)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}=\cos\left(\omega \tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\cos\left(\omega \tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF-SHL.png|thumb|800px|Comparison of Normalised VACF with VACF of Liquid and Solid|left]]&lt;br /&gt;
&lt;br /&gt;
We can see from this graph that while the liquid quickly decorrelates to 0, the solid still retains some minor fluctuations. This is due to the fact that liquids are more free to move around and collide with each other, &amp;quot;forgetting&amp;quot; what its initial velocity was, whereas for atoms in the solid state, they are already in a relatively stable position (similar to &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; in L-J interactions) and oscillate from positive to negative. Eventually, atoms in solids, too, will decay, but at a much slower rate than in liquids.&lt;br /&gt;
&lt;br /&gt;
The VACF for the harmonic oscillator does not decay at all since the decorrelation arises from the atoms exchanging energy with its neighbours, which does not occur in harmonic oscillators.&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560800</id>
		<title>Rep:Mod:SUNG95</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560800"/>
		<updated>2016-10-21T10:38:58Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Theory ==&lt;br /&gt;
=== The Velocity-Verlet Algorithm ===&lt;br /&gt;
[[File:Verlet-Velocity.png|thumb|700px|x(t) derived from the velocity-Verlet algorithm compared with the position of the classical harmonic oscillator.|left]]&lt;br /&gt;
[[File:Verlet-Energy.png|thumb|700px|Total energy of the system with respect to time|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Verlet-Error.png|thumb|700px|The error derived by comparing the solution of the velocity-Verlet algorithm with the position of the classical harmonic oscillator|none]]&lt;br /&gt;
&lt;br /&gt;
The three graphs above display the position of an atom, the total energy of the system and the error between the two methods of calculating the atom position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Error wrt Time.png|thumb|600px|Maximum Error against Time|none]]&lt;br /&gt;
&lt;br /&gt;
From this graph of Maximum error vs Time, we can see that error increases with time at a stable linear rate.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Running the same calculations with varying timesteps show the importance of choosing the right value of the timestep:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Energy at t=0.05.png|Energy at timestep=0.05&lt;br /&gt;
Image:Energy at t=0.5.png|Energy at timestep=0.5&lt;br /&gt;
Image:Error at t=0.5.png|Error at timestep=0.5&lt;br /&gt;
Image:Error at t=0.05.png|Error at timestep=0.05&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examining the four additional graphs above, we can notice that a shorter timestep is able to provide a smaller value for error and that the energy fluctuates less than when a bigger value of timestep is used. However, a shorter timestep results in a shorter simulation type, which can result in a less realistic simulation. It is therefore important to find the right balance between the two.&lt;br /&gt;
&lt;br /&gt;
Through trial and error, it has been found that timestep = 0.2850 or lower results in an energy fluctuation that is smaller than 1% over the course of the simulation. A small fluctuation in energy indicates higher resemblance to reality as technically the total energy should not fluctuate at all due to the Law of Conservation of Energy.&lt;br /&gt;
&lt;br /&gt;
=== Lennard-Jones Potential ===&lt;br /&gt;
The equation to calculate the Lennard-Jones potential is as follows:&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;
By equating this to 0, we find that the &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the separation at which the potential is 0, is &amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We can then find the force at this separation by differentiating the Lennard-Jones potential with respect to r, and substituting in &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}=\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24 \frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation (&amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;) is the separation of the particles at equilibrium, and represents the separation at which the potential energy is at a minimum. It can thus be found by setting &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}&amp;lt;/math&amp;gt;, (or &amp;lt;math&amp;gt;\mathbf{F}&amp;lt;/math&amp;gt;) to 0.&lt;br /&gt;
&lt;br /&gt;
Hence,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right) 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; gives us the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To put this equation into perspective, let us calculate the L-J potential for some realistic cutoff values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int 4\epsilon \left(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=4 \epsilon \left(\frac{\sigma^{12}}{11r^{11}}-\frac{\sigma^6}{5r^5}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\lim_{r\rightarrow \infty} 4 \left(\frac{1^{12}}{11r^{11}}-\frac{1^6}{5r^5}\right) - 4\left(\frac{1^{12}}{11\times 2^{11}}+\frac{1^6}{5\times 2^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=0-0.024822\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following the same calculations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0081767\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0032901\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
It is very difficult to simulate realistic volumes of liquid and in the scope of this experiment, we have simulated liquids with N (number of atoms) between 1,000 and 10,000. To demonstrate why simulating realistic volumes of liquid is difficult, let us first calculate the number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
(Assuming: Standard conditions; Density of water = 1.00 g/ml)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.00 \mathrm{ml} = 1.00 \mathrm{g}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;18.02 \mathrm{g/mol} = 0.0555 \text{ mols of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.0555 \times 6.022 \times 10^{23} = 3.34 \times 10^{22} \text{ molecules of water.}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the other hand, 10,000 water molecules is only &amp;lt;math&amp;gt;2.99 \times 10^{-19} \text{ ml of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus, in order to be able to complete the simulation in a practical amount of time, we place our atoms in a box that is repeated in all directions, similar to how unit cells repeat themselves in a lattice. When an atom crosses the boundary of the box, its replica enters the same box from the other side, thus keeping the total number of atoms in the box constant.&lt;br /&gt;
&lt;br /&gt;
For example, if an atom at position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a cubic box ranging from &amp;lt;math&amp;gt;(0, 0, 0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;, its final position would be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;, if the periodic boundary conditions have been applied.&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units ===&lt;br /&gt;
The LAMMPS calculations run in this experiment are all done in reduced units&lt;br /&gt;
&lt;br /&gt;
For example, the Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34 \mathrm{nm}&amp;lt;/math&amp;gt;; &amp;lt;math&amp;gt;\epsilon/k_B=120K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If we set the cutoff to be &amp;lt;math&amp;gt;r*=3.2,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=3.2\times0.34=1.088\mathrm{nm}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Well depth: &amp;lt;math&amp;gt;\epsilon=120K\times k_B \times 6.02 \times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon=0.998 \mathrm{kJ/mol}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and reduced temperature &amp;lt;math&amp;gt;T*=1.5&amp;lt;/math&amp;gt; would be &amp;lt;math&amp;gt;T=1.5 \times 120=180\mathrm{K}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
=== Creating Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
In order to simulate a liquid for this experiment, we first create a crystal lattice, then melt that lattice to create a liquid. This is preferable to generating a liquid since assigning a random position for each new atom could result in two or more atoms being generated in the same space, causing an error when running the simulation.&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is one lattice point per unit cell. Hence, if the number density is 0.8,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8 \text{ points/volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sqrt[3]{0.8}=0.9283\text{ points/length}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.9283^{-1}=1.0772 \text{ length/point}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is thus 1.0772 unit lengths of spacing between each point.&lt;br /&gt;
&lt;br /&gt;
Following the same logic, a face-centred cubic lattice (with 4 lattice points per unit cell) with a density of 1.2 would have a spacing of &amp;lt;math&amp;gt;0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\because \sqrt[3]{4.8^{-1}}=0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, the simple cubic lattice with a density of 0.8 would create 1,000 atoms in the given constraints of the box:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;region box block 0 10 0 10 0 10&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and a face centred cubic lattice with a density of 1.2 would create 4,000 atoms in the same box.&lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of the Atoms ===&lt;br /&gt;
In the input script, there are the following lines describing the properties of the atoms:&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;
In the first line, we are setting the mass of type 1 atoms (which includes all of the atoms in our simulation box, as we have created only one type of atoms) as &amp;lt;math&amp;gt;1.0&amp;lt;/math&amp;gt;, in reduced units. The second line defines the interaction between the atoms as a Lenard-Jones interaction, with a cutoff distance of &amp;lt;math&amp;gt;3.0 \text{ units.}&amp;lt;/math&amp;gt; Finally, the last line defines the coefficient in the Lenard-Jones interaction; the asterisk tells LAMMPS that the coefficients apply to all atoms in our system; the first coefficient is &amp;lt;math&amp;gt;\epsilon=1.0&amp;lt;/math&amp;gt; and the second coefficient is &amp;lt;math&amp;gt;\sigma=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After setting the properties of the atoms, we also defined the initial positions and the initial velocities for the atoms in the input script. Since we have both the &amp;lt;math&amp;gt;\mathbf{x}_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, we can use the Velocity-Verlet integration algorithm that employs the half-step method.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
In the following lines from the input script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we created and reset a variable called timestep to equal 0.001, then used that value to calculate how many runs (${n_steps}) to carry out. This is more beneficial than simply setting&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;
as it allows us to only change the value of the timestep variable to alter the number of runs, rather than having to calculate ${n_steps} ourselves every time we change the timestep, especially in cases such as this computational experiment where the timestep was changed multiple times.&lt;br /&gt;
&lt;br /&gt;
=== Checking Equilibration ===&lt;br /&gt;
&lt;br /&gt;
[[File:TotalE at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Temp at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Press at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
&lt;br /&gt;
These graphs have been plotted to ensure that the simulation reaches equilibrium, and we can see that indeed, they do, and very quickly. Analysis of the graphs show that equilibrium is reached before 1 timestep.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
The following graph shows the total energy of the system against time at varying timestep values:&lt;br /&gt;
&lt;br /&gt;
[[File:Equil Energy.png|thumb|800px|none]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from the graphs that for timestep = 0.001, 0.0025 and 0.0075, the energy reaches a stable equilibrium but for timestep = 0.01 and timestep = 0.015, the energy slowly decreases and rapidly increases, respectively, indicating that the results of the simulation are not very accurate for these values of timestep. Timestep = 0.015 is especially bad as it very obviously does not reach an equilibrium.&lt;br /&gt;
&lt;br /&gt;
Therefore, timestep = 0.0075 would be the ideal value as it provides the highest accuracy, while running the simulation for a suitably long time to provide realistic results.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions (NpT) ==&lt;br /&gt;
&lt;br /&gt;
=== Temperature and Pressure Control ===&lt;br /&gt;
&lt;br /&gt;
Pressures chosen: 2.61, 2.63&lt;br /&gt;
&lt;br /&gt;
Temperatures chosen: 1.5, 1.6, 1.7, 1.8, 1.9&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 was chosen to provide the highest accuracy possible, without shortening the simulation time too much.&lt;br /&gt;
&lt;br /&gt;
In our simulation, the temperature was controlled by solving the two following equations for the instantaneous temperature &amp;lt;math&amp;gt;T,&amp;lt;/math&amp;gt; which fluctuates.&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 \qquad\qquad\qquad(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order for &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; to reach our target temperature &amp;lt;math&amp;gt;\mathfrak{T},&amp;lt;/math&amp;gt; we introduce a constant &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; to control the velocity such that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}\qquad\qquad(2)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can solve eq. &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt; to solve for &amp;lt;math&amp;gt;\gamma.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\sum_i m_i v_i^2 = 3N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substituting &amp;lt;math&amp;gt;\sum_i m_i v_i^2&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 3 N k_b T = 3N k_b \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\epsilon}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Examining the Input Script ===&lt;br /&gt;
&lt;br /&gt;
To calculate the average values for our simulation, we set certain parameters for LAMMPS in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time Nevery Nrepeat Nfreq&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Final averages are generated on timesteps that are multiples of Nevery, for Nrepeat number of times and an average is generated every Nfreq timesteps.&lt;br /&gt;
&lt;br /&gt;
In our script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The results are sampled at every 100 timesteps for 1000 times (100, 200, 300, etc.) Averages are generated every 100,000 timesteps, but our simulation runs for the same amount of time so only one average is generated from this code.&lt;br /&gt;
&lt;br /&gt;
The timestep chosen for this section of the experiment was 0.0025. Therefore, the simulation was run for &amp;lt;math&amp;gt;100000 \times 0.0025 = 250 \text{ unit time}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equations of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:Density Temp.png|700px]]&lt;br /&gt;
&lt;br /&gt;
The graph above shows the density of the simulated liquid against temperature, compared with the densities derived from the ideal gas law.&lt;br /&gt;
&lt;br /&gt;
It can be seen that within the ranges set for this simulation, the discrepancy between the simulated densities compared to the calculated densities are very high, to the point that the error bars for the y-axis is not even visible on the graph. Perhaps a more accurate simulation could have been run if a wider temperature and pressure ranges were selected.&lt;br /&gt;
&lt;br /&gt;
With the data range being one possible source of error between the simulation and the ideal gas law prediction, another possible factor is that the parameters set for this simulation are such that the repulsive force of the Lennard-Jones interaction is more significant than the attractive force. Since the ideal gas law assumes no electronic interaction between the particles, introducing a repulsive force would result in the density of the liquid being lower than the prediction.&lt;br /&gt;
&lt;br /&gt;
The most likely explanation, however, is that the ideal gas law, as its name suggests, is not very good at predicting the behavious of liquids. While both gas and liquid phases are fluids, there are major differences between them such as a much more prominent long-range order effect in liquids compared to gases.&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacity ==&lt;br /&gt;
&lt;br /&gt;
[[File:HeatCap vs Density.png|thumb|800px|Graph of &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; against Temperature|none]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From thermodynamics:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;dU = TdS - PdV&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = T\frac{\partial S}{\partial T}-P\frac{\partial V}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and since &amp;lt;math&amp;gt;\frac{\partial S}{\partial T}\geq 0,&amp;lt;/math&amp;gt; heat capacity should increase with increasing temperature.&lt;br /&gt;
&lt;br /&gt;
The fact that &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; decreases with increasing temperature suggests that either the increase in temperature is causing the internal energy to increase at a faster rate than itself, or that there are issues with the simulation originating from possible sources such as small sampling size (number of atoms generated) or short run time.&lt;br /&gt;
&lt;br /&gt;
== Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
[[File:RDF SHL.png|thumb|700px]]&lt;br /&gt;
&lt;br /&gt;
Looking at the graph on the right, it can be noticed that the three phases have clearly different Radial Distribution Functions (RDF) from each other. This can be attributed to the varying degrees of order each of the phases have: the atoms in the gas phase are completely free to move around, while atoms in the liquid phase have less freedom and in the solid phase, the atoms are set in a lattice, with only vibrational motion and no (or negligible) translational motion.&lt;br /&gt;
&lt;br /&gt;
In order to explain the graph, let us consider the RDF to be displaying the &amp;quot;effective density&amp;quot; of atoms in an area of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; at a distance &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; from a certain reference atom.&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf schematic.jpg|thumb|200px|Schematic of RDF|left]]&lt;br /&gt;
&lt;br /&gt;
There are three main parts to the RDF graphs: the region near the origin where the &amp;lt;math&amp;gt;\mathrm{RDF} = 0&amp;lt;/math&amp;gt;, the region after where there are big peaks and troughs, and the final region where the graphs have mostly reached equilibrium.&lt;br /&gt;
&lt;br /&gt;
First of all, the region near the origin is 0 for all three phases as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; is still within the volume (the hard sphere) of the reference atom, and hence there can be no other atoms in that radius.&lt;br /&gt;
&lt;br /&gt;
The peaks in the second region indicate that there is a higher &amp;quot;effective density&amp;quot; of atoms. The explanation for this is different for the lattice structure (solid) and the fluids (liquid and gas).&lt;br /&gt;
&lt;br /&gt;
For the liquid and gas phase, the peaks are due to the attractive force caused by the Lennard-Jones potential. We have calculated above [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:SUNG95#Lennard-Jones_Potential (1.2 LJ Potential)] that &amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}.&amp;lt;/math&amp;gt; Setting &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt; (as we have in our input file), we get &amp;lt;math&amp;gt;r_{eq} = 1.122&amp;lt;/math&amp;gt;, which is very close to where the largest peaks are for the two fluid phases.&lt;br /&gt;
&lt;br /&gt;
For the solid, where all the atoms are in a lattice structure, the effects due to the Lennard-Jones interaction becomes neglibigle. Instead, there will be certain values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where the effective density is higher than the overall density of the sample (the peaks), and some values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where it is lower than the density of the sample (the troughs). This is arisen from the fact that as the value of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the total volume covered by &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; also increases. But since all the atoms are set in place by the lattice, the number of atoms that &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; encompasses stays relatively constant. As a result, the peaks and the troughs tend to 1 with increasing &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the case of the gas phase, the atoms are completely free to move around and the RDF graph can be entirely attributed to the effects of the L-J interaction. This justifies the lack of troughs for this phase. Furthermore, as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the attractive part of the L-J interaction &amp;lt;math&amp;gt;\frac{1}{r^6}&amp;lt;/math&amp;gt; gets exponentially smaller and quickly becomes negligible - RDF reaches equilibrium.&lt;br /&gt;
&lt;br /&gt;
Finally, the liquid phase can be considered to act as a mix between the solid phase and the gas phase: the L-J interactions are significant enough to reach equilibrium at a rate similar to the gas phase, but there exists an ordering of the atoms such that there are values of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; where the effective density is lower than the overall density.&lt;br /&gt;
&lt;br /&gt;
From the RDF of the solid phase, each of the peaks point to a certain lattice point. Simple geometrical calculations can be done to indicate that the first peak, which is the lattice point (1) closest to the reference atom (O), is at a separation of &amp;lt;math&amp;gt;\mathrm{r}=1.056.&amp;lt;/math&amp;gt; Second closest point (2) is at a distance of &amp;lt;math&amp;gt;\mathrm{r}=1.4938&amp;lt;/math&amp;gt; and the third (3) at &amp;lt;math&amp;gt;\mathrm{r}=1.8295.&amp;lt;/math&amp;gt; These points agree with the x-axis on the RDF graphs.&lt;br /&gt;
&lt;br /&gt;
[[File:FCC-SHL.png|thumb|Face-centered cubic lattice|none]]&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
The Diffusion Coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; were calculated using several different methods:&lt;br /&gt;
&lt;br /&gt;
1) From the Mean Squared Displacement (MSD) of 8,000 simulated atoms, according to the equation &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) From the MSD of a million atoms&lt;br /&gt;
&lt;br /&gt;
3) From the Velocity Autocorrelation Function (VACF), by integration.&lt;br /&gt;
&lt;br /&gt;
4) From the VACF of a million atoms&lt;br /&gt;
&lt;br /&gt;
The results were as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Diffusion Coefficients (unit area/unit time)&lt;br /&gt;
! Phase !! From MSD !! From MSD (million atoms) !! From VCAF !! From VCAF (million atoms)&lt;br /&gt;
|-&lt;br /&gt;
| Gas || &amp;lt;math&amp;gt;6.05&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;3.22&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;6.32&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;3.27&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || &amp;lt;math&amp;gt;0.0855&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.0892&amp;lt;/math&amp;gt; ||&amp;lt;math&amp;gt;0.0979&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.09&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Solid || &amp;lt;math&amp;gt;0.000896&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;1.5 \times 10^{-5}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;-1.66 \times 10^{-5}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;4.55\times 10^{-5}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
We can see from the table that the diffusion coefficients calculated from the same number of atoms agree very well with each other, which suggests that the results are quite accurate. However, we can assume that the million atoms simulations inevitably provide more accurate data.&lt;br /&gt;
&lt;br /&gt;
=== Mean Squared Displacement ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The Mean Squared Displacement can be used to find the Diffusion Coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, via the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Plotting the mean squared displacement (MSD) against time, then finding the linear gradient would give us the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD-SHL.png|thumb|600px|none]][[File:MSD Mill SHL.png|thumb|600px|none]]&lt;br /&gt;
&lt;br /&gt;
Graphical analysis showed that the last 1,000 timesteps are suitably linear to apply this equation, and the Diffusion Coefficients for the three different phases were found from the last 1,000 timesteps.&lt;br /&gt;
&lt;br /&gt;
=== Velocity Autocorrelation Function ===&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;
From the 1D Harmonic Oscillator:&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;
Differentiating this gives the velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = -A\omega \sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting this into the integrated form of the VAFC:&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) \cdot A \omega \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(A \omega \sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, from the trigonometric identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin \left(\alpha + \beta \right)= \sin\alpha\cos\beta + \sin\beta\cos\alpha,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(\omega t + \phi + \omega\tau\right) = \sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \left(\sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\cos\left(\omega \tau\right) + \int_{-\infty}^{\infty} \sin \left(\omega \tau\right) \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt; is a constant so &amp;lt;math&amp;gt;\cos\left(\omega\tau\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sin\left(\omega\tau\right)&amp;lt;/math&amp;gt; can be taken out of the integral.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\cos\left(\omega \tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) + \sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; can cancel out:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\sin(x)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;\cos(x)&amp;lt;/math&amp;gt; is an even function, &amp;lt;math&amp;gt;\sin(x)\cos(x)&amp;lt;/math&amp;gt; is an odd function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; is an odd function (While the value of &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; can change whether or not the functions are even or odd, it shifts both functions by the same amount and the resulting &amp;lt;math&amp;gt;\cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; will still be odd)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}=\cos\left(\omega \tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\cos\left(\omega \tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF-SHL.png|thumb|800px|Comparison of Normalised VACF with VACF of Liquid and Solid|left]]&lt;br /&gt;
&lt;br /&gt;
We can see from this graph that while the liquid quickly decorrelates to 0, the solid still retains some minor fluctuations. This is due to the fact that liquids are more free to move around and collide with each other, &amp;quot;forgetting&amp;quot; what its initial velocity was, whereas for atoms in the solid state, they are already in a relatively stable position (similar to &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; in L-J interactions) and oscillate from positive to negative. Eventually, atoms in solids, too, will decay, but at a much slower rate than in liquids.&lt;br /&gt;
&lt;br /&gt;
The VACF for the harmonic oscillator does not decay at all since the decorrelation arises from the atoms exchanging energy with its neighbours, which does not occur in harmonic oscillators.&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560797</id>
		<title>Rep:Mod:SUNG95</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560797"/>
		<updated>2016-10-21T10:34:56Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: /* Dynamical Properties and the Diffusion Coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Theory ==&lt;br /&gt;
=== The Velocity-Verlet Algorithm ===&lt;br /&gt;
[[File:Verlet-Velocity.png|thumb|700px|x(t) derived from the velocity-Verlet algorithm compared with the position of the classical harmonic oscillator.|left]]&lt;br /&gt;
[[File:Verlet-Energy.png|thumb|700px|Total energy of the system with respect to time|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Verlet-Error.png|thumb|700px|The error derived by comparing the solution of the velocity-Verlet algorithm with the position of the classical harmonic oscillator|none]]&lt;br /&gt;
&lt;br /&gt;
The three graphs above display the position of an atom, the total energy of the system and the error between the two methods of calculating the atom position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Error wrt Time.png|thumb|600px|Maximum Error against Time|none]]&lt;br /&gt;
&lt;br /&gt;
From this graph of Maximum error vs Time, we can see that error increases with time at a stable linear rate.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Running the same calculations with varying timesteps show the importance of choosing the right value of the timestep:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Energy at t=0.05.png|Energy at timestep=0.05&lt;br /&gt;
Image:Energy at t=0.5.png|Energy at timestep=0.5&lt;br /&gt;
Image:Error at t=0.5.png|Error at timestep=0.5&lt;br /&gt;
Image:Error at t=0.05.png|Error at timestep=0.05&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examining the four additional graphs above, we can notice that a shorter timestep is able to provide a smaller value of error and that the energy fluctuates less than a bigger value of timestep. However, a shorter timestep results in a shorter simulation type, which can result in a less realistic simulation. It is therefore important to find the right balance between the two.&lt;br /&gt;
&lt;br /&gt;
Through trial and error, it has been found that timestep = 0.2850 or lower results in an energy fluctuation that is smaller than 1% over the course of the simulation. A small fluctuation in energy indicates higher resemblance to reality as technically the total energy should not fluctuate at all due to the Law of Conservation of Energy.&lt;br /&gt;
&lt;br /&gt;
=== Lennard-Jones Potential ===&lt;br /&gt;
The equation to calculate the Lennard-Jones potential is as follows:&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;
By equating this to 0, we find that the &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the separation at which the potential is 0, is &amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We can then find the force at this separation by differentiating the Lennard-Jones potential with respect to r, and substituting in &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}=\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24 \frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation (&amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;) is the separation of the particles at equilibrium, and represents the separation at which the potential energy is at a minimum. It can thus be found by setting &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}&amp;lt;/math&amp;gt;, (or &amp;lt;math&amp;gt;\mathbf{F}&amp;lt;/math&amp;gt;) to 0.&lt;br /&gt;
&lt;br /&gt;
Hence,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right) 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; gives us the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To put this equation into perspective, let us calculate the L-J potential for some realistic cutoff values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int 4\epsilon \left(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=4 \epsilon \left(\frac{\sigma^{12}}{11r^{11}}-\frac{\sigma^6}{5r^5}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\lim_{r\rightarrow \infty} 4 \left(\frac{1^{12}}{11r^{11}}-\frac{1^6}{5r^5}\right) - 4\left(\frac{1^{12}}{11\times 2^{11}}+\frac{1^6}{5\times 2^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=0-0.024822\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following the same calculations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0081767\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0032901\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
It is very difficult to simulate realistic volumes of liquid and in the scope of this experiment, we have simulated liquids with N (number of atoms) between 1,000 and 10,000. To demonstrate why simulating realistic volumes of liquid is difficult, let us first calculate the number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
(Assuming: Standard conditions; Density of water = 1.00 g/ml)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.00 \mathrm{ml} = 1.00 \mathrm{g}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;18.02 \mathrm{g/mol} = 0.0555 \text{ mols of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.0555 \times 6.022 \times 10^{23} = 3.34 \times 10^{22} \text{ molecules of water.}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the other hand, 10,000 water molecules is only &amp;lt;math&amp;gt;2.99 \times 10^{-19} \text{ ml of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus, in order to be able to complete the simulation in a practical amount of time, we place our atoms in a box that is repeated in all directions, similar to how unit cells repeat themselves in a lattice. When an atom crosses the boundary of the box, its replica enters the same box from the other side, thus keeping the total number of atoms in the box constant.&lt;br /&gt;
&lt;br /&gt;
For example, if an atom at position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a cubic box ranging from &amp;lt;math&amp;gt;(0, 0, 0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;, its final position would be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;, if the periodic boundary conditions have been applied.&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units ===&lt;br /&gt;
The LAMMPS calculations run in this experiment are all done in reduced units&lt;br /&gt;
&lt;br /&gt;
For example, the Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34 \mathrm{nm}&amp;lt;/math&amp;gt;; &amp;lt;math&amp;gt;\epsilon/k_B=120K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If we set the cutoff to be &amp;lt;math&amp;gt;r*=3.2,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=3.2\times0.34=1.088\mathrm{nm}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Well depth: &amp;lt;math&amp;gt;\epsilon=120K\times k_B \times 6.02 \times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon=0.998 \mathrm{kJ/mol}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and reduced temperature &amp;lt;math&amp;gt;T*=1.5&amp;lt;/math&amp;gt; would be &amp;lt;math&amp;gt;T=1.5 \times 120=180\mathrm{K}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
=== Creating Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
In order to simulate a liquid for this experiment, we first create a crystal lattice, then melt that lattice to create a liquid. This is preferable to generating a liquid since assigning a random position for each new atom could result in two or more atoms being generated in the same space, causing an error when running the simulation.&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is one lattice point per unit cell. Hence, if the number density is 0.8,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8 \text{ points/volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sqrt[3]{0.8}=0.9283\text{ points/length}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.9283^{-1}=1.0772 \text{ length/point}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is thus 1.0772 unit lengths of spacing between each point.&lt;br /&gt;
&lt;br /&gt;
Following the same logic, a face-centred cubic lattice (with 4 lattice points per unit cell) with a density of 1.2 would have a spacing of &amp;lt;math&amp;gt;0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\because \sqrt[3]{4.8^{-1}}=0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, the simple cubic lattice with a density of 0.8 would create 1,000 atoms in the given constraints of the box:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;region box block 0 10 0 10 0 10&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and a face centred cubic lattice with a density of 1.2 would create 4,000 atoms in the same box.&lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of the Atoms ===&lt;br /&gt;
In the input script, there are the following lines describing the properties of the atoms:&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;
In the first line, we are setting the mass of type 1 atoms (which includes all of the atoms in our simulation box, as we have created only one type of atoms) as &amp;lt;math&amp;gt;1.0&amp;lt;/math&amp;gt;, in reduced units. The second line defines the interaction between the atoms as a Lenard-Jones interaction, with a cutoff distance of &amp;lt;math&amp;gt;3.0 \text{ units.}&amp;lt;/math&amp;gt; Finally, the last line defines the coefficient in the Lenard-Jones interaction; the asterisk tells LAMMPS that the coefficients apply to all atoms in our system; the first coefficient is &amp;lt;math&amp;gt;\epsilon=1.0&amp;lt;/math&amp;gt; and the second coefficient is &amp;lt;math&amp;gt;\sigma=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After setting the properties of the atoms, we also defined the initial positions and the initial velocities for the atoms in the input script. Since we have both the &amp;lt;math&amp;gt;\mathbf{x}_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, we can use the Velocity-Verlet integration algorithm that employs the half-step method.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
In the following lines from the input script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we created and reset a variable called timestep to equal 0.001, then used that value to calculate how many runs (${n_steps}) to carry out. This is more beneficial than simply setting&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;
as it allows us to only change the value of the timestep variable to alter the number of runs, rather than having to calculate ${n_steps} ourselves every time we change the timestep, especially in cases such as this computational experiment where the timestep was changed multiple times.&lt;br /&gt;
&lt;br /&gt;
=== Checking Equilibration ===&lt;br /&gt;
&lt;br /&gt;
[[File:TotalE at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Temp at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Press at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
&lt;br /&gt;
These graphs have been plotted to ensure that the simulation reaches equilibrium, and we can see that indeed, they do, and very quickly. Analysis of the graphs show that equilibrium is reached before 1 timestep.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
The following graph shows the total energy of the system against time at varying timestep values:&lt;br /&gt;
&lt;br /&gt;
[[File:Equil Energy.png|thumb|800px|none]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from the graphs that for timestep = 0.001, 0.0025 and 0.0075, the energy reaches a stable equilibrium but for timestep = 0.01 and timestep = 0.015, the energy slowly decreases and rapidly increases, respectively, indicating that the results of the simulation are not very accurate for these values of timestep. Timestep = 0.015 is especially bad as it very obviously does not reach an equilibrium.&lt;br /&gt;
&lt;br /&gt;
Therefore, timestep = 0.0075 would be the ideal value as it provides the highest accuracy, while running the simulation for a suitably long time to provide realistic results.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions (NpT) ==&lt;br /&gt;
&lt;br /&gt;
=== Temperature and Pressure Control ===&lt;br /&gt;
&lt;br /&gt;
Pressures chosen: 2.61, 2.63&lt;br /&gt;
&lt;br /&gt;
Temperatures chosen: 1.5, 1.6, 1.7, 1.8, 1.9&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 was chosen to provide the highest accuracy possible, without shortening the simulation time too much.&lt;br /&gt;
&lt;br /&gt;
In our simulation, the temperature was controlled by solving the two following equations for the instantaneous temperature &amp;lt;math&amp;gt;T,&amp;lt;/math&amp;gt; which fluctuates.&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 \qquad\qquad\qquad(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order for &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; to reach our target temperature &amp;lt;math&amp;gt;\mathfrak{T},&amp;lt;/math&amp;gt; we introduce a constant &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; to control the velocity such that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}\qquad\qquad(2)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can solve eq. &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt; to solve for &amp;lt;math&amp;gt;\gamma.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\sum_i m_i v_i^2 = 3N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substituting &amp;lt;math&amp;gt;\sum_i m_i v_i^2&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 3 N k_b T = 3N k_b \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\epsilon}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Examining the Input Script ===&lt;br /&gt;
&lt;br /&gt;
To calculate the average values for our simulation, we set certain parameters for LAMMPS in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time Nevery Nrepeat Nfreq&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Final averages are generated on timesteps that are multiples of Nevery, for Nrepeat number of times and an average is generated every Nfreq timesteps.&lt;br /&gt;
&lt;br /&gt;
In our script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The results are sampled at every 100 timesteps for 1000 times (100, 200, 300, etc.) Averages are generated every 100,000 timesteps, but our simulation runs for the same amount of time so only one average is generated from this code.&lt;br /&gt;
&lt;br /&gt;
The timestep chosen for this section of the experiment was 0.0025. Therefore, the simulation was run for &amp;lt;math&amp;gt;100000 \times 0.0025 = 250 \text{ unit time}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equations of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:Density Temp.png|700px]]&lt;br /&gt;
&lt;br /&gt;
The graph above shows the density of the simulated liquid against temperature, compared with the densities derived from the ideal gas law.&lt;br /&gt;
&lt;br /&gt;
It can be seen that within the ranges set for this simulation, the discrepancy between the simulated densities compared to the calculated densities are very high, to the point that the error bars for the y-axis is not even visible on the graph. Perhaps a more accurate simulation could have been run if a wider temperature and pressure ranges were selected.&lt;br /&gt;
&lt;br /&gt;
With the data range being one possible source of error between the simulation and the ideal gas law prediction, another possible factor is that the parameters set for this simulation are such that the repulsive force of the Lennard-Jones interaction is more significant than the attractive force. Since the ideal gas law assumes no electronic interaction between the particles, introducing a repulsive force would result in the density of the liquid being lower than the prediction.&lt;br /&gt;
&lt;br /&gt;
The most likely explanation, however, is that the ideal gas law, as its name suggests, is not very good at predicting the behavious of liquids. While both gas and liquid phases are fluids, there are major differences between them such as a much more prominent long-range order effect in liquids compared to gases.&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacity ==&lt;br /&gt;
&lt;br /&gt;
[[File:HeatCap vs Density.png|thumb|800px|Graph of &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; against Temperature|none]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From thermodynamics:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;dU = TdS - PdV&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = T\frac{\partial S}{\partial T}-P\frac{\partial V}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and since &amp;lt;math&amp;gt;\frac{\partial S}{\partial T}\geq 0,&amp;lt;/math&amp;gt; heat capacity should increase with increasing temperature.&lt;br /&gt;
&lt;br /&gt;
The fact that &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; decreases with increasing temperature suggests that either the increase in temperature is causing the internal energy to increase at a faster rate than itself, or that there are issues with the simulation originating from possible sources such as small sampling size (number of atoms generated) or short run time.&lt;br /&gt;
&lt;br /&gt;
== Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
[[File:RDF SHL.png|thumb|700px]]&lt;br /&gt;
&lt;br /&gt;
Looking at the graph on the right, it can be noticed that the three phases have clearly different Radial Distribution Functions (RDF) from each other. This can be attributed to the varying degrees of order each of the phases have: the atoms in the gas phase are completely free to move around, while atoms in the liquid phase have less freedom and in the solid phase, the atoms are set in a lattice, with only vibrational motion and no (or negligible) translational motion.&lt;br /&gt;
&lt;br /&gt;
In order to explain the graph, let us consider the RDF to be displaying the &amp;quot;effective density&amp;quot; of atoms in an area of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; at a distance &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; from a certain reference atom.&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf schematic.jpg|thumb|200px|Schematic of RDF|left]]&lt;br /&gt;
&lt;br /&gt;
There are three main parts to the RDF graphs: the region near the origin where the &amp;lt;math&amp;gt;\mathrm{RDF} = 0&amp;lt;/math&amp;gt;, the region after where there are big peaks and troughs, and the final region where the graphs have mostly reached equilibrium.&lt;br /&gt;
&lt;br /&gt;
First of all, the region near the origin is 0 for all three phases as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; is still within the volume (the hard sphere) of the reference atom, and hence there can be no other atoms in that radius.&lt;br /&gt;
&lt;br /&gt;
The peaks in the second region indicate that there is a higher &amp;quot;effective density&amp;quot; of atoms. The explanation for this is different for the lattice structure (solid) and the fluids (liquid and gas).&lt;br /&gt;
&lt;br /&gt;
For the liquid and gas phase, the peaks are due to the attractive force caused by the Lennard-Jones potential. We have calculated above [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:SUNG95#Lennard-Jones_Potential (1.2 LJ Potential)] that &amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}.&amp;lt;/math&amp;gt; Setting &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt; (as we have in our input file), we get &amp;lt;math&amp;gt;r_{eq} = 1.122&amp;lt;/math&amp;gt;, which is very close to where the largest peaks are for the two fluid phases.&lt;br /&gt;
&lt;br /&gt;
For the solid, where all the atoms are in a lattice structure, the effects due to the Lennard-Jones interaction becomes neglibigle. Instead, there will be certain values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where the effective density is higher than the overall density of the sample (the peaks), and some values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where it is lower than the density of the sample (the troughs). This is arisen from the fact that as the value of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the total volume covered by &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; also increases. But since all the atoms are set in place by the lattice, the number of atoms that &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; encompasses stays relatively constant. As a result, the peaks and the troughs tend to 1 with increasing &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the case of the gas phase, the atoms are completely free to move around and the RDF graph can be entirely attributed to the effects of the L-J interaction. This justifies the lack of troughs for this phase. Furthermore, as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the attractive part of the L-J interaction &amp;lt;math&amp;gt;\frac{1}{r^6}&amp;lt;/math&amp;gt; gets exponentially smaller and quickly becomes negligible - RDF reaches equilibrium.&lt;br /&gt;
&lt;br /&gt;
Finally, the liquid phase can be considered to act as a mix between the solid phase and the gas phase: the L-J interactions are significant enough to reach equilibrium at a rate similar to the gas phase, but there exists an ordering of the atoms such that there are values of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; where the effective density is lower than the overall density.&lt;br /&gt;
&lt;br /&gt;
From the RDF of the solid phase, each of the peaks point to a certain lattice point. Simple geometrical calculations can be done to indicate that the first peak, which is the lattice point (1) closest to the reference atom (O), is at a separation of &amp;lt;math&amp;gt;\mathrm{r}=1.056.&amp;lt;/math&amp;gt; Second closest point (2) is at a distance of &amp;lt;math&amp;gt;\mathrm{r}=1.4938&amp;lt;/math&amp;gt; and the third (3) at &amp;lt;math&amp;gt;\mathrm{r}=1.8295.&amp;lt;/math&amp;gt; These points agree with the x-axis on the RDF graphs.&lt;br /&gt;
&lt;br /&gt;
[[File:FCC-SHL.png|thumb|Face-centered cubic lattice|none]]&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
The Diffusion Coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; were calculated using several different methods:&lt;br /&gt;
&lt;br /&gt;
1) From the Mean Squared Displacement (MSD) of 8,000 simulated atoms, according to the equation &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) From the MSD of a million atoms&lt;br /&gt;
&lt;br /&gt;
3) From the Velocity Autocorrelation Function (VACF), by integration.&lt;br /&gt;
&lt;br /&gt;
4) From the VACF of a million atoms&lt;br /&gt;
&lt;br /&gt;
The results were as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Diffusion Coefficients (unit area/unit time)&lt;br /&gt;
! Phase !! From MSD !! From MSD (million atoms) !! From VCAF !! From VCAF (million atoms)&lt;br /&gt;
|-&lt;br /&gt;
| Gas || &amp;lt;math&amp;gt;6.05&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;3.22&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;6.32&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;3.27&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || &amp;lt;math&amp;gt;0.0855&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.0892&amp;lt;/math&amp;gt; ||&amp;lt;math&amp;gt;0.0979&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.09&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Solid || &amp;lt;math&amp;gt;0.000896&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;1.5 \times 10^{-5}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;-1.66 \times 10^{-5}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;4.55\times 10^{-5}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
We can see from the table that the diffusion coefficients calculated from the same number of atoms agree very well with each other, which suggests that the results are quite accurate. However, we can assume that the million atoms simulations inevitably provide more accurate data.&lt;br /&gt;
&lt;br /&gt;
=== Mean Squared Displacement ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The Mean Squared Displacement can be used to find the Diffusion Coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, via the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Plotting the mean squared displacement (MSD) against time, then finding the linear gradient would give us the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD-SHL.png|thumb|600px|none]][[File:MSD Mill SHL.png|thumb|600px|none]]&lt;br /&gt;
&lt;br /&gt;
Graphical analysis showed that the last 1,000 timesteps are suitably linear to apply this equation, and the Diffusion Coefficients for the three different phases were found from the last 1,000 timesteps.&lt;br /&gt;
&lt;br /&gt;
=== Velocity Autocorrelation Function ===&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;
From the 1D Harmonic Oscillator:&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;
Differentiating this gives the velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = -A\omega \sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting this into the integrated form of the VAFC:&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) \cdot A \omega \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(A \omega \sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, from the trigonometric identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin \left(\alpha + \beta \right)= \sin\alpha\cos\beta + \sin\beta\cos\alpha,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(\omega t + \phi + \omega\tau\right) = \sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \left(\sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\cos\left(\omega \tau\right) + \int_{-\infty}^{\infty} \sin \left(\omega \tau\right) \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt; is a constant so &amp;lt;math&amp;gt;\cos\left(\omega\tau\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sin\left(\omega\tau\right)&amp;lt;/math&amp;gt; can be taken out of the integral.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\cos\left(\omega \tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) + \sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; can cancel out:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\sin(x)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;\cos(x)&amp;lt;/math&amp;gt; is an even function, &amp;lt;math&amp;gt;\sin(x)\cos(x)&amp;lt;/math&amp;gt; is an odd function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; is an odd function (While the value of &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; can change whether or not the functions are even or odd, it shifts both functions by the same amount and the resulting &amp;lt;math&amp;gt;\cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; will still be odd)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}=\cos\left(\omega \tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\cos\left(\omega \tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF-SHL.png|thumb|800px|Comparison of Normalised VACF with VACF of Liquid and Solid|left]]&lt;br /&gt;
&lt;br /&gt;
We can see from this graph that while the liquid quickly decorrelates to 0, the solid still retains some minor fluctuations. This is due to the fact that liquids are more free to move around and collide with each other, &amp;quot;forgetting&amp;quot; what its initial velocity was, whereas for atoms in the solid state, they are already in a relatively stable position (similar to &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; in L-J interactions) and oscillate from positive to negative. Eventually, atoms in solids, too, will decay, but at a much slower rate than in liquids.&lt;br /&gt;
&lt;br /&gt;
The VACF for the harmonic oscillator does not decay at all since the decorrelation arises from the atoms exchanging energy with its neighbours, which does not occur in harmonic oscillators.&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560787</id>
		<title>Rep:Mod:SUNG95</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560787"/>
		<updated>2016-10-21T10:25:52Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: /* Dynamical Properties and the Diffusion Coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Theory ==&lt;br /&gt;
=== The Velocity-Verlet Algorithm ===&lt;br /&gt;
[[File:Verlet-Velocity.png|thumb|700px|x(t) derived from the velocity-Verlet algorithm compared with the position of the classical harmonic oscillator.|left]]&lt;br /&gt;
[[File:Verlet-Energy.png|thumb|700px|Total energy of the system with respect to time|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Verlet-Error.png|thumb|700px|The error derived by comparing the solution of the velocity-Verlet algorithm with the position of the classical harmonic oscillator|none]]&lt;br /&gt;
&lt;br /&gt;
The three graphs above display the position of an atom, the total energy of the system and the error between the two methods of calculating the atom position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Error wrt Time.png|thumb|600px|Maximum Error against Time|none]]&lt;br /&gt;
&lt;br /&gt;
From this graph of Maximum error vs Time, we can see that error increases with time at a stable linear rate.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Running the same calculations with varying timesteps show the importance of choosing the right value of the timestep:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Energy at t=0.05.png|Energy at timestep=0.05&lt;br /&gt;
Image:Energy at t=0.5.png|Energy at timestep=0.5&lt;br /&gt;
Image:Error at t=0.5.png|Error at timestep=0.5&lt;br /&gt;
Image:Error at t=0.05.png|Error at timestep=0.05&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examining the four additional graphs above, we can notice that a shorter timestep is able to provide a smaller value of error and that the energy fluctuates less than a bigger value of timestep. However, a shorter timestep results in a shorter simulation type, which can result in a less realistic simulation. It is therefore important to find the right balance between the two.&lt;br /&gt;
&lt;br /&gt;
Through trial and error, it has been found that timestep = 0.2850 or lower results in an energy fluctuation that is smaller than 1% over the course of the simulation. A small fluctuation in energy indicates higher resemblance to reality as technically the total energy should not fluctuate at all due to the Law of Conservation of Energy.&lt;br /&gt;
&lt;br /&gt;
=== Lennard-Jones Potential ===&lt;br /&gt;
The equation to calculate the Lennard-Jones potential is as follows:&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;
By equating this to 0, we find that the &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the separation at which the potential is 0, is &amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We can then find the force at this separation by differentiating the Lennard-Jones potential with respect to r, and substituting in &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}=\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24 \frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation (&amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;) is the separation of the particles at equilibrium, and represents the separation at which the potential energy is at a minimum. It can thus be found by setting &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}&amp;lt;/math&amp;gt;, (or &amp;lt;math&amp;gt;\mathbf{F}&amp;lt;/math&amp;gt;) to 0.&lt;br /&gt;
&lt;br /&gt;
Hence,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right) 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; gives us the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To put this equation into perspective, let us calculate the L-J potential for some realistic cutoff values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int 4\epsilon \left(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=4 \epsilon \left(\frac{\sigma^{12}}{11r^{11}}-\frac{\sigma^6}{5r^5}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\lim_{r\rightarrow \infty} 4 \left(\frac{1^{12}}{11r^{11}}-\frac{1^6}{5r^5}\right) - 4\left(\frac{1^{12}}{11\times 2^{11}}+\frac{1^6}{5\times 2^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=0-0.024822\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following the same calculations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0081767\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0032901\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
It is very difficult to simulate realistic volumes of liquid and in the scope of this experiment, we have simulated liquids with N (number of atoms) between 1,000 and 10,000. To demonstrate why simulating realistic volumes of liquid is difficult, let us first calculate the number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
(Assuming: Standard conditions; Density of water = 1.00 g/ml)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.00 \mathrm{ml} = 1.00 \mathrm{g}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;18.02 \mathrm{g/mol} = 0.0555 \text{ mols of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.0555 \times 6.022 \times 10^{23} = 3.34 \times 10^{22} \text{ molecules of water.}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the other hand, 10,000 water molecules is only &amp;lt;math&amp;gt;2.99 \times 10^{-19} \text{ ml of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus, in order to be able to complete the simulation in a practical amount of time, we place our atoms in a box that is repeated in all directions, similar to how unit cells repeat themselves in a lattice. When an atom crosses the boundary of the box, its replica enters the same box from the other side, thus keeping the total number of atoms in the box constant.&lt;br /&gt;
&lt;br /&gt;
For example, if an atom at position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a cubic box ranging from &amp;lt;math&amp;gt;(0, 0, 0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;, its final position would be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;, if the periodic boundary conditions have been applied.&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units ===&lt;br /&gt;
The LAMMPS calculations run in this experiment are all done in reduced units&lt;br /&gt;
&lt;br /&gt;
For example, the Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34 \mathrm{nm}&amp;lt;/math&amp;gt;; &amp;lt;math&amp;gt;\epsilon/k_B=120K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If we set the cutoff to be &amp;lt;math&amp;gt;r*=3.2,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=3.2\times0.34=1.088\mathrm{nm}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Well depth: &amp;lt;math&amp;gt;\epsilon=120K\times k_B \times 6.02 \times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon=0.998 \mathrm{kJ/mol}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and reduced temperature &amp;lt;math&amp;gt;T*=1.5&amp;lt;/math&amp;gt; would be &amp;lt;math&amp;gt;T=1.5 \times 120=180\mathrm{K}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
=== Creating Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
In order to simulate a liquid for this experiment, we first create a crystal lattice, then melt that lattice to create a liquid. This is preferable to generating a liquid since assigning a random position for each new atom could result in two or more atoms being generated in the same space, causing an error when running the simulation.&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is one lattice point per unit cell. Hence, if the number density is 0.8,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8 \text{ points/volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sqrt[3]{0.8}=0.9283\text{ points/length}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.9283^{-1}=1.0772 \text{ length/point}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is thus 1.0772 unit lengths of spacing between each point.&lt;br /&gt;
&lt;br /&gt;
Following the same logic, a face-centred cubic lattice (with 4 lattice points per unit cell) with a density of 1.2 would have a spacing of &amp;lt;math&amp;gt;0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\because \sqrt[3]{4.8^{-1}}=0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, the simple cubic lattice with a density of 0.8 would create 1,000 atoms in the given constraints of the box:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;region box block 0 10 0 10 0 10&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and a face centred cubic lattice with a density of 1.2 would create 4,000 atoms in the same box.&lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of the Atoms ===&lt;br /&gt;
In the input script, there are the following lines describing the properties of the atoms:&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;
In the first line, we are setting the mass of type 1 atoms (which includes all of the atoms in our simulation box, as we have created only one type of atoms) as &amp;lt;math&amp;gt;1.0&amp;lt;/math&amp;gt;, in reduced units. The second line defines the interaction between the atoms as a Lenard-Jones interaction, with a cutoff distance of &amp;lt;math&amp;gt;3.0 \text{ units.}&amp;lt;/math&amp;gt; Finally, the last line defines the coefficient in the Lenard-Jones interaction; the asterisk tells LAMMPS that the coefficients apply to all atoms in our system; the first coefficient is &amp;lt;math&amp;gt;\epsilon=1.0&amp;lt;/math&amp;gt; and the second coefficient is &amp;lt;math&amp;gt;\sigma=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After setting the properties of the atoms, we also defined the initial positions and the initial velocities for the atoms in the input script. Since we have both the &amp;lt;math&amp;gt;\mathbf{x}_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, we can use the Velocity-Verlet integration algorithm that employs the half-step method.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
In the following lines from the input script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we created and reset a variable called timestep to equal 0.001, then used that value to calculate how many runs (${n_steps}) to carry out. This is more beneficial than simply setting&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;
as it allows us to only change the value of the timestep variable to alter the number of runs, rather than having to calculate ${n_steps} ourselves every time we change the timestep, especially in cases such as this computational experiment where the timestep was changed multiple times.&lt;br /&gt;
&lt;br /&gt;
=== Checking Equilibration ===&lt;br /&gt;
&lt;br /&gt;
[[File:TotalE at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Temp at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Press at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
&lt;br /&gt;
These graphs have been plotted to ensure that the simulation reaches equilibrium, and we can see that indeed, they do, and very quickly. Analysis of the graphs show that equilibrium is reached before 1 timestep.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
The following graph shows the total energy of the system against time at varying timestep values:&lt;br /&gt;
&lt;br /&gt;
[[File:Equil Energy.png|thumb|800px|none]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from the graphs that for timestep = 0.001, 0.0025 and 0.0075, the energy reaches a stable equilibrium but for timestep = 0.01 and timestep = 0.015, the energy slowly decreases and rapidly increases, respectively, indicating that the results of the simulation are not very accurate for these values of timestep. Timestep = 0.015 is especially bad as it very obviously does not reach an equilibrium.&lt;br /&gt;
&lt;br /&gt;
Therefore, timestep = 0.0075 would be the ideal value as it provides the highest accuracy, while running the simulation for a suitably long time to provide realistic results.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions (NpT) ==&lt;br /&gt;
&lt;br /&gt;
=== Temperature and Pressure Control ===&lt;br /&gt;
&lt;br /&gt;
Pressures chosen: 2.61, 2.63&lt;br /&gt;
&lt;br /&gt;
Temperatures chosen: 1.5, 1.6, 1.7, 1.8, 1.9&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 was chosen to provide the highest accuracy possible, without shortening the simulation time too much.&lt;br /&gt;
&lt;br /&gt;
In our simulation, the temperature was controlled by solving the two following equations for the instantaneous temperature &amp;lt;math&amp;gt;T,&amp;lt;/math&amp;gt; which fluctuates.&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 \qquad\qquad\qquad(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order for &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; to reach our target temperature &amp;lt;math&amp;gt;\mathfrak{T},&amp;lt;/math&amp;gt; we introduce a constant &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; to control the velocity such that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}\qquad\qquad(2)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can solve eq. &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt; to solve for &amp;lt;math&amp;gt;\gamma.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\sum_i m_i v_i^2 = 3N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substituting &amp;lt;math&amp;gt;\sum_i m_i v_i^2&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 3 N k_b T = 3N k_b \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\epsilon}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Examining the Input Script ===&lt;br /&gt;
&lt;br /&gt;
To calculate the average values for our simulation, we set certain parameters for LAMMPS in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time Nevery Nrepeat Nfreq&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Final averages are generated on timesteps that are multiples of Nevery, for Nrepeat number of times and an average is generated every Nfreq timesteps.&lt;br /&gt;
&lt;br /&gt;
In our script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The results are sampled at every 100 timesteps for 1000 times (100, 200, 300, etc.) Averages are generated every 100,000 timesteps, but our simulation runs for the same amount of time so only one average is generated from this code.&lt;br /&gt;
&lt;br /&gt;
The timestep chosen for this section of the experiment was 0.0025. Therefore, the simulation was run for &amp;lt;math&amp;gt;100000 \times 0.0025 = 250 \text{ unit time}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equations of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:Density Temp.png|700px]]&lt;br /&gt;
&lt;br /&gt;
The graph above shows the density of the simulated liquid against temperature, compared with the densities derived from the ideal gas law.&lt;br /&gt;
&lt;br /&gt;
It can be seen that within the ranges set for this simulation, the discrepancy between the simulated densities compared to the calculated densities are very high, to the point that the error bars for the y-axis is not even visible on the graph. Perhaps a more accurate simulation could have been run if a wider temperature and pressure ranges were selected.&lt;br /&gt;
&lt;br /&gt;
With the data range being one possible source of error between the simulation and the ideal gas law prediction, another possible factor is that the parameters set for this simulation are such that the repulsive force of the Lennard-Jones interaction is more significant than the attractive force. Since the ideal gas law assumes no electronic interaction between the particles, introducing a repulsive force would result in the density of the liquid being lower than the prediction.&lt;br /&gt;
&lt;br /&gt;
The most likely explanation, however, is that the ideal gas law, as its name suggests, is not very good at predicting the behavious of liquids. While both gas and liquid phases are fluids, there are major differences between them such as a much more prominent long-range order effect in liquids compared to gases.&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacity ==&lt;br /&gt;
&lt;br /&gt;
[[File:HeatCap vs Density.png|thumb|800px|Graph of &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; against Temperature|none]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From thermodynamics:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;dU = TdS - PdV&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = T\frac{\partial S}{\partial T}-P\frac{\partial V}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and since &amp;lt;math&amp;gt;\frac{\partial S}{\partial T}\geq 0,&amp;lt;/math&amp;gt; heat capacity should increase with increasing temperature.&lt;br /&gt;
&lt;br /&gt;
The fact that &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; decreases with increasing temperature suggests that either the increase in temperature is causing the internal energy to increase at a faster rate than itself, or that there are issues with the simulation originating from possible sources such as small sampling size (number of atoms generated) or short run time.&lt;br /&gt;
&lt;br /&gt;
== Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
[[File:RDF SHL.png|thumb|700px]]&lt;br /&gt;
&lt;br /&gt;
Looking at the graph on the right, it can be noticed that the three phases have clearly different Radial Distribution Functions (RDF) from each other. This can be attributed to the varying degrees of order each of the phases have: the atoms in the gas phase are completely free to move around, while atoms in the liquid phase have less freedom and in the solid phase, the atoms are set in a lattice, with only vibrational motion and no (or negligible) translational motion.&lt;br /&gt;
&lt;br /&gt;
In order to explain the graph, let us consider the RDF to be displaying the &amp;quot;effective density&amp;quot; of atoms in an area of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; at a distance &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; from a certain reference atom.&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf schematic.jpg|thumb|200px|Schematic of RDF|left]]&lt;br /&gt;
&lt;br /&gt;
There are three main parts to the RDF graphs: the region near the origin where the &amp;lt;math&amp;gt;\mathrm{RDF} = 0&amp;lt;/math&amp;gt;, the region after where there are big peaks and troughs, and the final region where the graphs have mostly reached equilibrium.&lt;br /&gt;
&lt;br /&gt;
First of all, the region near the origin is 0 for all three phases as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; is still within the volume (the hard sphere) of the reference atom, and hence there can be no other atoms in that radius.&lt;br /&gt;
&lt;br /&gt;
The peaks in the second region indicate that there is a higher &amp;quot;effective density&amp;quot; of atoms. The explanation for this is different for the lattice structure (solid) and the fluids (liquid and gas).&lt;br /&gt;
&lt;br /&gt;
For the liquid and gas phase, the peaks are due to the attractive force caused by the Lennard-Jones potential. We have calculated above [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:SUNG95#Lennard-Jones_Potential (1.2 LJ Potential)] that &amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}.&amp;lt;/math&amp;gt; Setting &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt; (as we have in our input file), we get &amp;lt;math&amp;gt;r_{eq} = 1.122&amp;lt;/math&amp;gt;, which is very close to where the largest peaks are for the two fluid phases.&lt;br /&gt;
&lt;br /&gt;
For the solid, where all the atoms are in a lattice structure, the effects due to the Lennard-Jones interaction becomes neglibigle. Instead, there will be certain values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where the effective density is higher than the overall density of the sample (the peaks), and some values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where it is lower than the density of the sample (the troughs). This is arisen from the fact that as the value of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the total volume covered by &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; also increases. But since all the atoms are set in place by the lattice, the number of atoms that &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; encompasses stays relatively constant. As a result, the peaks and the troughs tend to 1 with increasing &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the case of the gas phase, the atoms are completely free to move around and the RDF graph can be entirely attributed to the effects of the L-J interaction. This justifies the lack of troughs for this phase. Furthermore, as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the attractive part of the L-J interaction &amp;lt;math&amp;gt;\frac{1}{r^6}&amp;lt;/math&amp;gt; gets exponentially smaller and quickly becomes negligible - RDF reaches equilibrium.&lt;br /&gt;
&lt;br /&gt;
Finally, the liquid phase can be considered to act as a mix between the solid phase and the gas phase: the L-J interactions are significant enough to reach equilibrium at a rate similar to the gas phase, but there exists an ordering of the atoms such that there are values of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; where the effective density is lower than the overall density.&lt;br /&gt;
&lt;br /&gt;
From the RDF of the solid phase, each of the peaks point to a certain lattice point. Simple geometrical calculations can be done to indicate that the first peak, which is the lattice point (1) closest to the reference atom (O), is at a separation of &amp;lt;math&amp;gt;\mathrm{r}=1.056.&amp;lt;/math&amp;gt; Second closest point (2) is at a distance of &amp;lt;math&amp;gt;\mathrm{r}=1.4938&amp;lt;/math&amp;gt; and the third (3) at &amp;lt;math&amp;gt;\mathrm{r}=1.8295.&amp;lt;/math&amp;gt; These points agree with the x-axis on the RDF graphs.&lt;br /&gt;
&lt;br /&gt;
[[File:FCC-SHL.png|thumb|Face-centered cubic lattice|none]]&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
The Diffusion Coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; were calculated using several different methods:&lt;br /&gt;
&lt;br /&gt;
1) From the Mean Squared Displacement (MSD) of 8,000 simulated atoms, according to the equation &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) From the MSD of a million atoms&lt;br /&gt;
&lt;br /&gt;
3) From the Velocity Autocorrelation Function (VACF), by integration.&lt;br /&gt;
&lt;br /&gt;
4) From the VACF of a million atoms&lt;br /&gt;
&lt;br /&gt;
The results were as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Diffusion Coefficients&lt;br /&gt;
! Phase !! From MSD !! From MSD (million atoms) !! From VCAF !! From VCAF (million atoms)&lt;br /&gt;
|-&lt;br /&gt;
| Gas || &amp;lt;math&amp;gt;6.05&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;3.22&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;6.32&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;3.27&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || &amp;lt;math&amp;gt;0.0855&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.0892&amp;lt;/math&amp;gt; ||&amp;lt;math&amp;gt;0.0979&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.09&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Solid || &amp;lt;math&amp;gt;0.000896&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;1.5 \times 10^{-5}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;-1.66 \times 10^{-5}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;4.55\times 10^{-5}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
We can see from the table that the diffusion coefficients calculated from the same number of atoms agree very well with each other, which suggests that the results are quite accurate. However, we can assume that the million atoms simulations inevitably provide more accurate data.&lt;br /&gt;
&lt;br /&gt;
=== Mean Squared Displacement ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The Mean Squared Displacement can be used to find the Diffusion Coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, via the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Plotting the mean squared displacement (MSD) against time, then finding the linear gradient would give us the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD-SHL.png|thumb|600px|none]][[File:MSD Mill SHL.png|thumb|600px|none]]&lt;br /&gt;
&lt;br /&gt;
Graphical analysis showed that the last 1,000 timesteps are suitably linear to apply this equation, and the Diffusion Coefficients for the three different phases were found from the last 1,000 timesteps.&lt;br /&gt;
&lt;br /&gt;
=== Velocity Autocorrelation Function ===&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;
From the 1D Harmonic Oscillator:&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;
Differentiating this gives the velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = -A\omega \sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting this into the integrated form of the VAFC:&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) \cdot A \omega \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(A \omega \sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, from the trigonometric identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin \left(\alpha + \beta \right)= \sin\alpha\cos\beta + \sin\beta\cos\alpha,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(\omega t + \phi + \omega\tau\right) = \sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \left(\sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\cos\left(\omega \tau\right) + \int_{-\infty}^{\infty} \sin \left(\omega \tau\right) \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt; is a constant so &amp;lt;math&amp;gt;\cos\left(\omega\tau\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sin\left(\omega\tau\right)&amp;lt;/math&amp;gt; can be taken out of the integral.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\cos\left(\omega \tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) + \sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; can cancel out:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\sin(x)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;\cos(x)&amp;lt;/math&amp;gt; is an even function, &amp;lt;math&amp;gt;\sin(x)\cos(x)&amp;lt;/math&amp;gt; is an odd function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; is an odd function (While the value of &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; can change whether or not the functions are even or odd, it shifts both functions by the same amount and the resulting &amp;lt;math&amp;gt;\cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; will still be odd)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}=\cos\left(\omega \tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\cos\left(\omega \tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF-SHL.png|thumb|800px|Comparison of Normalised VACF with VACF of Liquid and Solid|left]]&lt;br /&gt;
&lt;br /&gt;
We can see from this graph that while the liquid quickly decorrelates to 0, the solid still retains some minor fluctuations. This is due to the fact that liquids are more free to move around and collide with each other, &amp;quot;forgetting&amp;quot; what its initial velocity was, whereas for atoms in the solid state, they are already in a relatively stable position (similar to &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; in L-J interactions) and oscillate from positive to negative. Eventually, atoms in solids, too, will decay, but at a much slower rate than in liquids.&lt;br /&gt;
&lt;br /&gt;
The VACF for the harmonic oscillator does not decay at all since the decorrelation arises from the atoms exchanging energy with its neighbours, which does not occur in harmonic oscillators.&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560777</id>
		<title>Rep:Mod:SUNG95</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560777"/>
		<updated>2016-10-21T10:10:51Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: /* Mean Squared Displacement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Theory ==&lt;br /&gt;
=== The Velocity-Verlet Algorithm ===&lt;br /&gt;
[[File:Verlet-Velocity.png|thumb|700px|x(t) derived from the velocity-Verlet algorithm compared with the position of the classical harmonic oscillator.|left]]&lt;br /&gt;
[[File:Verlet-Energy.png|thumb|700px|Total energy of the system with respect to time|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Verlet-Error.png|thumb|700px|The error derived by comparing the solution of the velocity-Verlet algorithm with the position of the classical harmonic oscillator|none]]&lt;br /&gt;
&lt;br /&gt;
The three graphs above display the position of an atom, the total energy of the system and the error between the two methods of calculating the atom position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Error wrt Time.png|thumb|600px|Maximum Error against Time|none]]&lt;br /&gt;
&lt;br /&gt;
From this graph of Maximum error vs Time, we can see that error increases with time at a stable linear rate.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Running the same calculations with varying timesteps show the importance of choosing the right value of the timestep:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Energy at t=0.05.png|Energy at timestep=0.05&lt;br /&gt;
Image:Energy at t=0.5.png|Energy at timestep=0.5&lt;br /&gt;
Image:Error at t=0.5.png|Error at timestep=0.5&lt;br /&gt;
Image:Error at t=0.05.png|Error at timestep=0.05&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examining the four additional graphs above, we can notice that a shorter timestep is able to provide a smaller value of error and that the energy fluctuates less than a bigger value of timestep. However, a shorter timestep results in a shorter simulation type, which can result in a less realistic simulation. It is therefore important to find the right balance between the two.&lt;br /&gt;
&lt;br /&gt;
Through trial and error, it has been found that timestep = 0.2850 or lower results in an energy fluctuation that is smaller than 1% over the course of the simulation. A small fluctuation in energy indicates higher resemblance to reality as technically the total energy should not fluctuate at all due to the Law of Conservation of Energy.&lt;br /&gt;
&lt;br /&gt;
=== Lennard-Jones Potential ===&lt;br /&gt;
The equation to calculate the Lennard-Jones potential is as follows:&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;
By equating this to 0, we find that the &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the separation at which the potential is 0, is &amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We can then find the force at this separation by differentiating the Lennard-Jones potential with respect to r, and substituting in &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}=\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24 \frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation (&amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;) is the separation of the particles at equilibrium, and represents the separation at which the potential energy is at a minimum. It can thus be found by setting &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}&amp;lt;/math&amp;gt;, (or &amp;lt;math&amp;gt;\mathbf{F}&amp;lt;/math&amp;gt;) to 0.&lt;br /&gt;
&lt;br /&gt;
Hence,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right) 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; gives us the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To put this equation into perspective, let us calculate the L-J potential for some realistic cutoff values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int 4\epsilon \left(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=4 \epsilon \left(\frac{\sigma^{12}}{11r^{11}}-\frac{\sigma^6}{5r^5}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\lim_{r\rightarrow \infty} 4 \left(\frac{1^{12}}{11r^{11}}-\frac{1^6}{5r^5}\right) - 4\left(\frac{1^{12}}{11\times 2^{11}}+\frac{1^6}{5\times 2^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=0-0.024822\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following the same calculations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0081767\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0032901\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
It is very difficult to simulate realistic volumes of liquid and in the scope of this experiment, we have simulated liquids with N (number of atoms) between 1,000 and 10,000. To demonstrate why simulating realistic volumes of liquid is difficult, let us first calculate the number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
(Assuming: Standard conditions; Density of water = 1.00 g/ml)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.00 \mathrm{ml} = 1.00 \mathrm{g}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;18.02 \mathrm{g/mol} = 0.0555 \text{ mols of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.0555 \times 6.022 \times 10^{23} = 3.34 \times 10^{22} \text{ molecules of water.}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the other hand, 10,000 water molecules is only &amp;lt;math&amp;gt;2.99 \times 10^{-19} \text{ ml of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus, in order to be able to complete the simulation in a practical amount of time, we place our atoms in a box that is repeated in all directions, similar to how unit cells repeat themselves in a lattice. When an atom crosses the boundary of the box, its replica enters the same box from the other side, thus keeping the total number of atoms in the box constant.&lt;br /&gt;
&lt;br /&gt;
For example, if an atom at position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a cubic box ranging from &amp;lt;math&amp;gt;(0, 0, 0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;, its final position would be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;, if the periodic boundary conditions have been applied.&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units ===&lt;br /&gt;
The LAMMPS calculations run in this experiment are all done in reduced units&lt;br /&gt;
&lt;br /&gt;
For example, the Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34 \mathrm{nm}&amp;lt;/math&amp;gt;; &amp;lt;math&amp;gt;\epsilon/k_B=120K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If we set the cutoff to be &amp;lt;math&amp;gt;r*=3.2,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=3.2\times0.34=1.088\mathrm{nm}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Well depth: &amp;lt;math&amp;gt;\epsilon=120K\times k_B \times 6.02 \times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon=0.998 \mathrm{kJ/mol}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and reduced temperature &amp;lt;math&amp;gt;T*=1.5&amp;lt;/math&amp;gt; would be &amp;lt;math&amp;gt;T=1.5 \times 120=180\mathrm{K}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
=== Creating Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
In order to simulate a liquid for this experiment, we first create a crystal lattice, then melt that lattice to create a liquid. This is preferable to generating a liquid since assigning a random position for each new atom could result in two or more atoms being generated in the same space, causing an error when running the simulation.&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is one lattice point per unit cell. Hence, if the number density is 0.8,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8 \text{ points/volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sqrt[3]{0.8}=0.9283\text{ points/length}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.9283^{-1}=1.0772 \text{ length/point}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is thus 1.0772 unit lengths of spacing between each point.&lt;br /&gt;
&lt;br /&gt;
Following the same logic, a face-centred cubic lattice (with 4 lattice points per unit cell) with a density of 1.2 would have a spacing of &amp;lt;math&amp;gt;0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\because \sqrt[3]{4.8^{-1}}=0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, the simple cubic lattice with a density of 0.8 would create 1,000 atoms in the given constraints of the box:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;region box block 0 10 0 10 0 10&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and a face centred cubic lattice with a density of 1.2 would create 4,000 atoms in the same box.&lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of the Atoms ===&lt;br /&gt;
In the input script, there are the following lines describing the properties of the atoms:&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;
In the first line, we are setting the mass of type 1 atoms (which includes all of the atoms in our simulation box, as we have created only one type of atoms) as &amp;lt;math&amp;gt;1.0&amp;lt;/math&amp;gt;, in reduced units. The second line defines the interaction between the atoms as a Lenard-Jones interaction, with a cutoff distance of &amp;lt;math&amp;gt;3.0 \text{ units.}&amp;lt;/math&amp;gt; Finally, the last line defines the coefficient in the Lenard-Jones interaction; the asterisk tells LAMMPS that the coefficients apply to all atoms in our system; the first coefficient is &amp;lt;math&amp;gt;\epsilon=1.0&amp;lt;/math&amp;gt; and the second coefficient is &amp;lt;math&amp;gt;\sigma=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After setting the properties of the atoms, we also defined the initial positions and the initial velocities for the atoms in the input script. Since we have both the &amp;lt;math&amp;gt;\mathbf{x}_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, we can use the Velocity-Verlet integration algorithm that employs the half-step method.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
In the following lines from the input script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we created and reset a variable called timestep to equal 0.001, then used that value to calculate how many runs (${n_steps}) to carry out. This is more beneficial than simply setting&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;
as it allows us to only change the value of the timestep variable to alter the number of runs, rather than having to calculate ${n_steps} ourselves every time we change the timestep, especially in cases such as this computational experiment where the timestep was changed multiple times.&lt;br /&gt;
&lt;br /&gt;
=== Checking Equilibration ===&lt;br /&gt;
&lt;br /&gt;
[[File:TotalE at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Temp at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Press at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
&lt;br /&gt;
These graphs have been plotted to ensure that the simulation reaches equilibrium, and we can see that indeed, they do, and very quickly. Analysis of the graphs show that equilibrium is reached before 1 timestep.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
The following graph shows the total energy of the system against time at varying timestep values:&lt;br /&gt;
&lt;br /&gt;
[[File:Equil Energy.png|thumb|800px|none]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from the graphs that for timestep = 0.001, 0.0025 and 0.0075, the energy reaches a stable equilibrium but for timestep = 0.01 and timestep = 0.015, the energy slowly decreases and rapidly increases, respectively, indicating that the results of the simulation are not very accurate for these values of timestep. Timestep = 0.015 is especially bad as it very obviously does not reach an equilibrium.&lt;br /&gt;
&lt;br /&gt;
Therefore, timestep = 0.0075 would be the ideal value as it provides the highest accuracy, while running the simulation for a suitably long time to provide realistic results.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions (NpT) ==&lt;br /&gt;
&lt;br /&gt;
=== Temperature and Pressure Control ===&lt;br /&gt;
&lt;br /&gt;
Pressures chosen: 2.61, 2.63&lt;br /&gt;
&lt;br /&gt;
Temperatures chosen: 1.5, 1.6, 1.7, 1.8, 1.9&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 was chosen to provide the highest accuracy possible, without shortening the simulation time too much.&lt;br /&gt;
&lt;br /&gt;
In our simulation, the temperature was controlled by solving the two following equations for the instantaneous temperature &amp;lt;math&amp;gt;T,&amp;lt;/math&amp;gt; which fluctuates.&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 \qquad\qquad\qquad(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order for &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; to reach our target temperature &amp;lt;math&amp;gt;\mathfrak{T},&amp;lt;/math&amp;gt; we introduce a constant &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; to control the velocity such that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}\qquad\qquad(2)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can solve eq. &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt; to solve for &amp;lt;math&amp;gt;\gamma.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\sum_i m_i v_i^2 = 3N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substituting &amp;lt;math&amp;gt;\sum_i m_i v_i^2&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 3 N k_b T = 3N k_b \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\epsilon}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Examining the Input Script ===&lt;br /&gt;
&lt;br /&gt;
To calculate the average values for our simulation, we set certain parameters for LAMMPS in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time Nevery Nrepeat Nfreq&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Final averages are generated on timesteps that are multiples of Nevery, for Nrepeat number of times and an average is generated every Nfreq timesteps.&lt;br /&gt;
&lt;br /&gt;
In our script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The results are sampled at every 100 timesteps for 1000 times (100, 200, 300, etc.) Averages are generated every 100,000 timesteps, but our simulation runs for the same amount of time so only one average is generated from this code.&lt;br /&gt;
&lt;br /&gt;
The timestep chosen for this section of the experiment was 0.0025. Therefore, the simulation was run for &amp;lt;math&amp;gt;100000 \times 0.0025 = 250 \text{ unit time}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equations of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:Density Temp.png|700px]]&lt;br /&gt;
&lt;br /&gt;
The graph above shows the density of the simulated liquid against temperature, compared with the densities derived from the ideal gas law.&lt;br /&gt;
&lt;br /&gt;
It can be seen that within the ranges set for this simulation, the discrepancy between the simulated densities compared to the calculated densities are very high, to the point that the error bars for the y-axis is not even visible on the graph. Perhaps a more accurate simulation could have been run if a wider temperature and pressure ranges were selected.&lt;br /&gt;
&lt;br /&gt;
With the data range being one possible source of error between the simulation and the ideal gas law prediction, another possible factor is that the parameters set for this simulation are such that the repulsive force of the Lennard-Jones interaction is more significant than the attractive force. Since the ideal gas law assumes no electronic interaction between the particles, introducing a repulsive force would result in the density of the liquid being lower than the prediction.&lt;br /&gt;
&lt;br /&gt;
The most likely explanation, however, is that the ideal gas law, as its name suggests, is not very good at predicting the behavious of liquids. While both gas and liquid phases are fluids, there are major differences between them such as a much more prominent long-range order effect in liquids compared to gases.&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacity ==&lt;br /&gt;
&lt;br /&gt;
[[File:HeatCap vs Density.png|thumb|800px|Graph of &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; against Temperature|none]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From thermodynamics:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;dU = TdS - PdV&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = T\frac{\partial S}{\partial T}-P\frac{\partial V}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and since &amp;lt;math&amp;gt;\frac{\partial S}{\partial T}\geq 0,&amp;lt;/math&amp;gt; heat capacity should increase with increasing temperature.&lt;br /&gt;
&lt;br /&gt;
The fact that &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; decreases with increasing temperature suggests that either the increase in temperature is causing the internal energy to increase at a faster rate than itself, or that there are issues with the simulation originating from possible sources such as small sampling size (number of atoms generated) or short run time.&lt;br /&gt;
&lt;br /&gt;
== Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
[[File:RDF SHL.png|thumb|700px]]&lt;br /&gt;
&lt;br /&gt;
Looking at the graph on the right, it can be noticed that the three phases have clearly different Radial Distribution Functions (RDF) from each other. This can be attributed to the varying degrees of order each of the phases have: the atoms in the gas phase are completely free to move around, while atoms in the liquid phase have less freedom and in the solid phase, the atoms are set in a lattice, with only vibrational motion and no (or negligible) translational motion.&lt;br /&gt;
&lt;br /&gt;
In order to explain the graph, let us consider the RDF to be displaying the &amp;quot;effective density&amp;quot; of atoms in an area of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; at a distance &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; from a certain reference atom.&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf schematic.jpg|thumb|200px|Schematic of RDF|left]]&lt;br /&gt;
&lt;br /&gt;
There are three main parts to the RDF graphs: the region near the origin where the &amp;lt;math&amp;gt;\mathrm{RDF} = 0&amp;lt;/math&amp;gt;, the region after where there are big peaks and troughs, and the final region where the graphs have mostly reached equilibrium.&lt;br /&gt;
&lt;br /&gt;
First of all, the region near the origin is 0 for all three phases as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; is still within the volume (the hard sphere) of the reference atom, and hence there can be no other atoms in that radius.&lt;br /&gt;
&lt;br /&gt;
The peaks in the second region indicate that there is a higher &amp;quot;effective density&amp;quot; of atoms. The explanation for this is different for the lattice structure (solid) and the fluids (liquid and gas).&lt;br /&gt;
&lt;br /&gt;
For the liquid and gas phase, the peaks are due to the attractive force caused by the Lennard-Jones potential. We have calculated above [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:SUNG95#Lennard-Jones_Potential (1.2 LJ Potential)] that &amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}.&amp;lt;/math&amp;gt; Setting &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt; (as we have in our input file), we get &amp;lt;math&amp;gt;r_{eq} = 1.122&amp;lt;/math&amp;gt;, which is very close to where the largest peaks are for the two fluid phases.&lt;br /&gt;
&lt;br /&gt;
For the solid, where all the atoms are in a lattice structure, the effects due to the Lennard-Jones interaction becomes neglibigle. Instead, there will be certain values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where the effective density is higher than the overall density of the sample (the peaks), and some values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where it is lower than the density of the sample (the troughs). This is arisen from the fact that as the value of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the total volume covered by &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; also increases. But since all the atoms are set in place by the lattice, the number of atoms that &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; encompasses stays relatively constant. As a result, the peaks and the troughs tend to 1 with increasing &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the case of the gas phase, the atoms are completely free to move around and the RDF graph can be entirely attributed to the effects of the L-J interaction. This justifies the lack of troughs for this phase. Furthermore, as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the attractive part of the L-J interaction &amp;lt;math&amp;gt;\frac{1}{r^6}&amp;lt;/math&amp;gt; gets exponentially smaller and quickly becomes negligible - RDF reaches equilibrium.&lt;br /&gt;
&lt;br /&gt;
Finally, the liquid phase can be considered to act as a mix between the solid phase and the gas phase: the L-J interactions are significant enough to reach equilibrium at a rate similar to the gas phase, but there exists an ordering of the atoms such that there are values of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; where the effective density is lower than the overall density.&lt;br /&gt;
&lt;br /&gt;
From the RDF of the solid phase, each of the peaks point to a certain lattice point. Simple geometrical calculations can be done to indicate that the first peak, which is the lattice point (1) closest to the reference atom (O), is at a separation of &amp;lt;math&amp;gt;\mathrm{r}=1.056.&amp;lt;/math&amp;gt; Second closest point (2) is at a distance of &amp;lt;math&amp;gt;\mathrm{r}=1.4938&amp;lt;/math&amp;gt; and the third (3) at &amp;lt;math&amp;gt;\mathrm{r}=1.8295.&amp;lt;/math&amp;gt; These points agree with the x-axis on the RDF graphs.&lt;br /&gt;
&lt;br /&gt;
[[File:FCC-SHL.png|thumb|Face-centered cubic lattice|none]]&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
=== Mean Squared Displacement ===&lt;br /&gt;
&lt;br /&gt;
The Mean Squared Displacement can be used to find the Diffusion Coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, via the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plotting the mean squared displacement (MSD) against time, then finding the linear gradient would give us the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:MSD-SHL.png|thumb|600px|none]][[File:MSD Mill SHL.png|thumb|600px|none]]&lt;br /&gt;
&lt;br /&gt;
Graphical analysis showed that the last 1,000 timesteps are suitably linear to apply this equation, and the Diffusion Coefficients for the three different phases were found from the last 1,000 timesteps. Results were as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Diffusion Coefficients&lt;br /&gt;
! Phase !! From MSD !! From MSD (million atoms) !! From VCAF&lt;br /&gt;
|-&lt;br /&gt;
| Gas || &amp;lt;math&amp;gt;6.05&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;3.22&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;6.32&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || &amp;lt;math&amp;gt;0.0855&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.0892&amp;lt;/math&amp;gt; ||&amp;lt;math&amp;gt;0.0979&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Solid || &amp;lt;math&amp;gt;0.000896&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;1.5 \times 10^{-5}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;-1.66 \times 10^{-5}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
We can see from the table that the diffusion coefficients calculated from the MSD method and the VCAF method agree quite well for simulations run with 8,000 atoms. On the other hand, while the MSD method with a million atoms do not quite correlate with the other two methods, it is likely providing the most accurate values for &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Velocity Autocorrelation Function ===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can also be calculated from the Velocity Autocorrelation Function, or VACF.&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;
From the 1D Harmonic Oscillator:&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;
Differentiating this gives the velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = -A\omega \sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting this into the integrated form of the VAFC:&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) \cdot A \omega \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(A \omega \sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, from the trigonometric identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin \left(\alpha + \beta \right)= \sin\alpha\cos\beta + \sin\beta\cos\alpha,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(\omega t + \phi + \omega\tau\right) = \sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \left(\sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\cos\left(\omega \tau\right) + \int_{-\infty}^{\infty} \sin \left(\omega \tau\right) \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt; is a constant so &amp;lt;math&amp;gt;\cos\left(\omega\tau\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sin\left(\omega\tau\right)&amp;lt;/math&amp;gt; can be taken out of the integral.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\cos\left(\omega \tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) + \sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; can cancel out:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\sin(x)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;\cos(x)&amp;lt;/math&amp;gt; is an even function, &amp;lt;math&amp;gt;\sin(x)\cos(x)&amp;lt;/math&amp;gt; is an odd function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; is an odd function (While the value of &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; can change whether or not the functions are even or odd, it shifts both functions by the same amount and the resulting &amp;lt;math&amp;gt;\cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; will still be odd)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}=\cos\left(\omega \tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\cos\left(\omega \tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF-SHL.png|thumb|800px|Comparison of Normalised VACF with VACF of Liquid and Solid|left]]&lt;br /&gt;
&lt;br /&gt;
We can see from this graph that while the liquid quickly decorrelates to 0, the solid still retains some minor fluctuations. This is due to the fact that liquids are more free to move around and collide with each other, &amp;quot;forgetting&amp;quot; what its initial velocity was, whereas for atoms in the solid state, they are already in a relatively stable position (similar to &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; in L-J interactions) and oscillate from positive to negative. Eventually, atoms in solids, too, will decay, but at a much slower rate than in liquids.&lt;br /&gt;
&lt;br /&gt;
The VACF for the harmonic oscillator does not decay at all since the decorrelation arises from the atoms exchanging energy with its neighbours, which does not occur in harmonic oscillators.&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560757</id>
		<title>Rep:Mod:SUNG95</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560757"/>
		<updated>2016-10-21T09:50:48Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: /* Velocity Autocorrelation Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Theory ==&lt;br /&gt;
=== The Velocity-Verlet Algorithm ===&lt;br /&gt;
[[File:Verlet-Velocity.png|thumb|700px|x(t) derived from the velocity-Verlet algorithm compared with the position of the classical harmonic oscillator.|left]]&lt;br /&gt;
[[File:Verlet-Energy.png|thumb|700px|Total energy of the system with respect to time|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Verlet-Error.png|thumb|700px|The error derived by comparing the solution of the velocity-Verlet algorithm with the position of the classical harmonic oscillator|none]]&lt;br /&gt;
&lt;br /&gt;
The three graphs above display the position of an atom, the total energy of the system and the error between the two methods of calculating the atom position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Error wrt Time.png|thumb|600px|Maximum Error against Time|none]]&lt;br /&gt;
&lt;br /&gt;
From this graph of Maximum error vs Time, we can see that error increases with time at a stable linear rate.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Running the same calculations with varying timesteps show the importance of choosing the right value of the timestep:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Energy at t=0.05.png|Energy at timestep=0.05&lt;br /&gt;
Image:Energy at t=0.5.png|Energy at timestep=0.5&lt;br /&gt;
Image:Error at t=0.5.png|Error at timestep=0.5&lt;br /&gt;
Image:Error at t=0.05.png|Error at timestep=0.05&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examining the four additional graphs above, we can notice that a shorter timestep is able to provide a smaller value of error and that the energy fluctuates less than a bigger value of timestep. However, a shorter timestep results in a shorter simulation type, which can result in a less realistic simulation. It is therefore important to find the right balance between the two.&lt;br /&gt;
&lt;br /&gt;
Through trial and error, it has been found that timestep = 0.2850 or lower results in an energy fluctuation that is smaller than 1% over the course of the simulation. A small fluctuation in energy indicates higher resemblance to reality as technically the total energy should not fluctuate at all due to the Law of Conservation of Energy.&lt;br /&gt;
&lt;br /&gt;
=== Lennard-Jones Potential ===&lt;br /&gt;
The equation to calculate the Lennard-Jones potential is as follows:&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;
By equating this to 0, we find that the &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the separation at which the potential is 0, is &amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We can then find the force at this separation by differentiating the Lennard-Jones potential with respect to r, and substituting in &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}=\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24 \frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation (&amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;) is the separation of the particles at equilibrium, and represents the separation at which the potential energy is at a minimum. It can thus be found by setting &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}&amp;lt;/math&amp;gt;, (or &amp;lt;math&amp;gt;\mathbf{F}&amp;lt;/math&amp;gt;) to 0.&lt;br /&gt;
&lt;br /&gt;
Hence,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right) 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; gives us the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To put this equation into perspective, let us calculate the L-J potential for some realistic cutoff values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int 4\epsilon \left(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=4 \epsilon \left(\frac{\sigma^{12}}{11r^{11}}-\frac{\sigma^6}{5r^5}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\lim_{r\rightarrow \infty} 4 \left(\frac{1^{12}}{11r^{11}}-\frac{1^6}{5r^5}\right) - 4\left(\frac{1^{12}}{11\times 2^{11}}+\frac{1^6}{5\times 2^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=0-0.024822\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following the same calculations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0081767\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0032901\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
It is very difficult to simulate realistic volumes of liquid and in the scope of this experiment, we have simulated liquids with N (number of atoms) between 1,000 and 10,000. To demonstrate why simulating realistic volumes of liquid is difficult, let us first calculate the number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
(Assuming: Standard conditions; Density of water = 1.00 g/ml)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.00 \mathrm{ml} = 1.00 \mathrm{g}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;18.02 \mathrm{g/mol} = 0.0555 \text{ mols of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.0555 \times 6.022 \times 10^{23} = 3.34 \times 10^{22} \text{ molecules of water.}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the other hand, 10,000 water molecules is only &amp;lt;math&amp;gt;2.99 \times 10^{-19} \text{ ml of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus, in order to be able to complete the simulation in a practical amount of time, we place our atoms in a box that is repeated in all directions, similar to how unit cells repeat themselves in a lattice. When an atom crosses the boundary of the box, its replica enters the same box from the other side, thus keeping the total number of atoms in the box constant.&lt;br /&gt;
&lt;br /&gt;
For example, if an atom at position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a cubic box ranging from &amp;lt;math&amp;gt;(0, 0, 0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;, its final position would be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;, if the periodic boundary conditions have been applied.&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units ===&lt;br /&gt;
The LAMMPS calculations run in this experiment are all done in reduced units&lt;br /&gt;
&lt;br /&gt;
For example, the Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34 \mathrm{nm}&amp;lt;/math&amp;gt;; &amp;lt;math&amp;gt;\epsilon/k_B=120K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If we set the cutoff to be &amp;lt;math&amp;gt;r*=3.2,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=3.2\times0.34=1.088\mathrm{nm}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Well depth: &amp;lt;math&amp;gt;\epsilon=120K\times k_B \times 6.02 \times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon=0.998 \mathrm{kJ/mol}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and reduced temperature &amp;lt;math&amp;gt;T*=1.5&amp;lt;/math&amp;gt; would be &amp;lt;math&amp;gt;T=1.5 \times 120=180\mathrm{K}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
=== Creating Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
In order to simulate a liquid for this experiment, we first create a crystal lattice, then melt that lattice to create a liquid. This is preferable to generating a liquid since assigning a random position for each new atom could result in two or more atoms being generated in the same space, causing an error when running the simulation.&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is one lattice point per unit cell. Hence, if the number density is 0.8,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8 \text{ points/volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sqrt[3]{0.8}=0.9283\text{ points/length}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.9283^{-1}=1.0772 \text{ length/point}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is thus 1.0772 unit lengths of spacing between each point.&lt;br /&gt;
&lt;br /&gt;
Following the same logic, a face-centred cubic lattice (with 4 lattice points per unit cell) with a density of 1.2 would have a spacing of &amp;lt;math&amp;gt;0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\because \sqrt[3]{4.8^{-1}}=0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, the simple cubic lattice with a density of 0.8 would create 1,000 atoms in the given constraints of the box:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;region box block 0 10 0 10 0 10&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and a face centred cubic lattice with a density of 1.2 would create 4,000 atoms in the same box.&lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of the Atoms ===&lt;br /&gt;
In the input script, there are the following lines describing the properties of the atoms:&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;
In the first line, we are setting the mass of type 1 atoms (which includes all of the atoms in our simulation box, as we have created only one type of atoms) as &amp;lt;math&amp;gt;1.0&amp;lt;/math&amp;gt;, in reduced units. The second line defines the interaction between the atoms as a Lenard-Jones interaction, with a cutoff distance of &amp;lt;math&amp;gt;3.0 \text{ units.}&amp;lt;/math&amp;gt; Finally, the last line defines the coefficient in the Lenard-Jones interaction; the asterisk tells LAMMPS that the coefficients apply to all atoms in our system; the first coefficient is &amp;lt;math&amp;gt;\epsilon=1.0&amp;lt;/math&amp;gt; and the second coefficient is &amp;lt;math&amp;gt;\sigma=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After setting the properties of the atoms, we also defined the initial positions and the initial velocities for the atoms in the input script. Since we have both the &amp;lt;math&amp;gt;\mathbf{x}_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, we can use the Velocity-Verlet integration algorithm that employs the half-step method.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
In the following lines from the input script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we created and reset a variable called timestep to equal 0.001, then used that value to calculate how many runs (${n_steps}) to carry out. This is more beneficial than simply setting&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;
as it allows us to only change the value of the timestep variable to alter the number of runs, rather than having to calculate ${n_steps} ourselves every time we change the timestep, especially in cases such as this computational experiment where the timestep was changed multiple times.&lt;br /&gt;
&lt;br /&gt;
=== Checking Equilibration ===&lt;br /&gt;
&lt;br /&gt;
[[File:TotalE at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Temp at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Press at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
&lt;br /&gt;
These graphs have been plotted to ensure that the simulation reaches equilibrium, and we can see that indeed, they do, and very quickly. Analysis of the graphs show that equilibrium is reached before 1 timestep.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
The following graph shows the total energy of the system against time at varying timestep values:&lt;br /&gt;
&lt;br /&gt;
[[File:Equil Energy.png|thumb|800px|none]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from the graphs that for timestep = 0.001, 0.0025 and 0.0075, the energy reaches a stable equilibrium but for timestep = 0.01 and timestep = 0.015, the energy slowly decreases and rapidly increases, respectively, indicating that the results of the simulation are not very accurate for these values of timestep. Timestep = 0.015 is especially bad as it very obviously does not reach an equilibrium.&lt;br /&gt;
&lt;br /&gt;
Therefore, timestep = 0.0075 would be the ideal value as it provides the highest accuracy, while running the simulation for a suitably long time to provide realistic results.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions (NpT) ==&lt;br /&gt;
&lt;br /&gt;
=== Temperature and Pressure Control ===&lt;br /&gt;
&lt;br /&gt;
Pressures chosen: 2.61, 2.63&lt;br /&gt;
&lt;br /&gt;
Temperatures chosen: 1.5, 1.6, 1.7, 1.8, 1.9&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 was chosen to provide the highest accuracy possible, without shortening the simulation time too much.&lt;br /&gt;
&lt;br /&gt;
In our simulation, the temperature was controlled by solving the two following equations for the instantaneous temperature &amp;lt;math&amp;gt;T,&amp;lt;/math&amp;gt; which fluctuates.&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 \qquad\qquad\qquad(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order for &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; to reach our target temperature &amp;lt;math&amp;gt;\mathfrak{T},&amp;lt;/math&amp;gt; we introduce a constant &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; to control the velocity such that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}\qquad\qquad(2)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can solve eq. &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt; to solve for &amp;lt;math&amp;gt;\gamma.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\sum_i m_i v_i^2 = 3N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substituting &amp;lt;math&amp;gt;\sum_i m_i v_i^2&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 3 N k_b T = 3N k_b \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\epsilon}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Examining the Input Script ===&lt;br /&gt;
&lt;br /&gt;
To calculate the average values for our simulation, we set certain parameters for LAMMPS in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time Nevery Nrepeat Nfreq&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Final averages are generated on timesteps that are multiples of Nevery, for Nrepeat number of times and an average is generated every Nfreq timesteps.&lt;br /&gt;
&lt;br /&gt;
In our script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The results are sampled at every 100 timesteps for 1000 times (100, 200, 300, etc.) Averages are generated every 100,000 timesteps, but our simulation runs for the same amount of time so only one average is generated from this code.&lt;br /&gt;
&lt;br /&gt;
The timestep chosen for this section of the experiment was 0.0025. Therefore, the simulation was run for &amp;lt;math&amp;gt;100000 \times 0.0025 = 250 \text{ unit time}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equations of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:Density Temp.png|700px]]&lt;br /&gt;
&lt;br /&gt;
The graph above shows the density of the simulated liquid against temperature, compared with the densities derived from the ideal gas law.&lt;br /&gt;
&lt;br /&gt;
It can be seen that within the ranges set for this simulation, the discrepancy between the simulated densities compared to the calculated densities are very high, to the point that the error bars for the y-axis is not even visible on the graph. Perhaps a more accurate simulation could have been run if a wider temperature and pressure ranges were selected.&lt;br /&gt;
&lt;br /&gt;
With the data range being one possible source of error between the simulation and the ideal gas law prediction, another possible factor is that the parameters set for this simulation are such that the repulsive force of the Lennard-Jones interaction is more significant than the attractive force. Since the ideal gas law assumes no electronic interaction between the particles, introducing a repulsive force would result in the density of the liquid being lower than the prediction.&lt;br /&gt;
&lt;br /&gt;
The most likely explanation, however, is that the ideal gas law, as its name suggests, is not very good at predicting the behavious of liquids. While both gas and liquid phases are fluids, there are major differences between them such as a much more prominent long-range order effect in liquids compared to gases.&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacity ==&lt;br /&gt;
&lt;br /&gt;
[[File:HeatCap vs Density.png|thumb|800px|Graph of &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; against Temperature|none]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From thermodynamics:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;dU = TdS - PdV&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = T\frac{\partial S}{\partial T}-P\frac{\partial V}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and since &amp;lt;math&amp;gt;\frac{\partial S}{\partial T}\geq 0,&amp;lt;/math&amp;gt; heat capacity should increase with increasing temperature.&lt;br /&gt;
&lt;br /&gt;
The fact that &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; decreases with increasing temperature suggests that either the increase in temperature is causing the internal energy to increase at a faster rate than itself, or that there are issues with the simulation originating from possible sources such as small sampling size (number of atoms generated) or short run time.&lt;br /&gt;
&lt;br /&gt;
== Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
[[File:RDF SHL.png|thumb|700px]]&lt;br /&gt;
&lt;br /&gt;
Looking at the graph on the right, it can be noticed that the three phases have clearly different Radial Distribution Functions (RDF) from each other. This can be attributed to the varying degrees of order each of the phases have: the atoms in the gas phase are completely free to move around, while atoms in the liquid phase have less freedom and in the solid phase, the atoms are set in a lattice, with only vibrational motion and no (or negligible) translational motion.&lt;br /&gt;
&lt;br /&gt;
In order to explain the graph, let us consider the RDF to be displaying the &amp;quot;effective density&amp;quot; of atoms in an area of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; at a distance &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; from a certain reference atom.&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf schematic.jpg|thumb|200px|Schematic of RDF|left]]&lt;br /&gt;
&lt;br /&gt;
There are three main parts to the RDF graphs: the region near the origin where the &amp;lt;math&amp;gt;\mathrm{RDF} = 0&amp;lt;/math&amp;gt;, the region after where there are big peaks and troughs, and the final region where the graphs have mostly reached equilibrium.&lt;br /&gt;
&lt;br /&gt;
First of all, the region near the origin is 0 for all three phases as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; is still within the volume (the hard sphere) of the reference atom, and hence there can be no other atoms in that radius.&lt;br /&gt;
&lt;br /&gt;
The peaks in the second region indicate that there is a higher &amp;quot;effective density&amp;quot; of atoms. The explanation for this is different for the lattice structure (solid) and the fluids (liquid and gas).&lt;br /&gt;
&lt;br /&gt;
For the liquid and gas phase, the peaks are due to the attractive force caused by the Lennard-Jones potential. We have calculated above [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:SUNG95#Lennard-Jones_Potential (1.2 LJ Potential)] that &amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}.&amp;lt;/math&amp;gt; Setting &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt; (as we have in our input file), we get &amp;lt;math&amp;gt;r_{eq} = 1.122&amp;lt;/math&amp;gt;, which is very close to where the largest peaks are for the two fluid phases.&lt;br /&gt;
&lt;br /&gt;
For the solid, where all the atoms are in a lattice structure, the effects due to the Lennard-Jones interaction becomes neglibigle. Instead, there will be certain values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where the effective density is higher than the overall density of the sample (the peaks), and some values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where it is lower than the density of the sample (the troughs). This is arisen from the fact that as the value of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the total volume covered by &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; also increases. But since all the atoms are set in place by the lattice, the number of atoms that &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; encompasses stays relatively constant. As a result, the peaks and the troughs tend to 1 with increasing &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the case of the gas phase, the atoms are completely free to move around and the RDF graph can be entirely attributed to the effects of the L-J interaction. This justifies the lack of troughs for this phase. Furthermore, as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the attractive part of the L-J interaction &amp;lt;math&amp;gt;\frac{1}{r^6}&amp;lt;/math&amp;gt; gets exponentially smaller and quickly becomes negligible - RDF reaches equilibrium.&lt;br /&gt;
&lt;br /&gt;
Finally, the liquid phase can be considered to act as a mix between the solid phase and the gas phase: the L-J interactions are significant enough to reach equilibrium at a rate similar to the gas phase, but there exists an ordering of the atoms such that there are values of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; where the effective density is lower than the overall density.&lt;br /&gt;
&lt;br /&gt;
From the RDF of the solid phase, each of the peaks point to a certain lattice point. Simple geometrical calculations can be done to indicate that the first peak, which is the lattice point (1) closest to the reference atom (O), is at a separation of &amp;lt;math&amp;gt;\mathrm{r}=1.056.&amp;lt;/math&amp;gt; Second closest point (2) is at a distance of &amp;lt;math&amp;gt;\mathrm{r}=1.4938&amp;lt;/math&amp;gt; and the third (3) at &amp;lt;math&amp;gt;\mathrm{r}=1.8295.&amp;lt;/math&amp;gt; These points agree with the x-axis on the RDF graphs.&lt;br /&gt;
&lt;br /&gt;
[[File:FCC-SHL.png|thumb|Face-centered cubic lattice|none]]&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
=== Mean Squared Displacement ===&lt;br /&gt;
&lt;br /&gt;
The Mean Squared Displacement can be used to find the Diffusion Coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, via the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plotting the mean squared displacement (MSD) against time, then finding the linear gradient would give us the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:MSD-SHL.png|thumb|600px|none]][[File:MSD Mill SHL.png|thumb|600px|none]]&lt;br /&gt;
&lt;br /&gt;
Graphical analysis showed that the last 1,000 timesteps are suitably linear to apply this equation, and the Diffusion Coefficients for the three different phases were found from the last 1,000 timesteps. Results were as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Diffusion Coefficients (8,000 atoms)&lt;br /&gt;
! Phase !! &amp;lt;math&amp;gt;D \text{ (unit area/unit time)}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Gas || &amp;lt;math&amp;gt;6.05&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || &amp;lt;math&amp;gt;0.0855&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Solid || &amp;lt;math&amp;gt;0.000896&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Diffusion Coefficients (1 million atoms)&lt;br /&gt;
! Phase !! &amp;lt;math&amp;gt;D \text{ (unit area/unit time)}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Gas || &amp;lt;math&amp;gt;3.22&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || &amp;lt;math&amp;gt;0.0892&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Solid || &amp;lt;math&amp;gt;1.15\times 10^{-5}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These values make sense logically since gases diffuse the easiest (highest diffusion coefficient), metals practically do not diffuse (very small diffusion coefficient) and liquid is somewhere in the middle.&lt;br /&gt;
&lt;br /&gt;
=== Velocity Autocorrelation Function ===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can also be calculated from the Velocity Autocorrelation Function, or VACF.&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;
From the 1D Harmonic Oscillator:&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;
Differentiating this gives the velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = -A\omega \sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting this into the integrated form of the VAFC:&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) \cdot A \omega \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(A \omega \sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, from the trigonometric identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin \left(\alpha + \beta \right)= \sin\alpha\cos\beta + \sin\beta\cos\alpha,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(\omega t + \phi + \omega\tau\right) = \sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \left(\sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\cos\left(\omega \tau\right) + \int_{-\infty}^{\infty} \sin \left(\omega \tau\right) \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt; is a constant so &amp;lt;math&amp;gt;\cos\left(\omega\tau\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sin\left(\omega\tau\right)&amp;lt;/math&amp;gt; can be taken out of the integral.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\cos\left(\omega \tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) + \sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; can cancel out:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\sin(x)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;\cos(x)&amp;lt;/math&amp;gt; is an even function, &amp;lt;math&amp;gt;\sin(x)\cos(x)&amp;lt;/math&amp;gt; is an odd function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; is an odd function (While the value of &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; can change whether or not the functions are even or odd, it shifts both functions by the same amount and the resulting &amp;lt;math&amp;gt;\cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; will still be odd)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}=\cos\left(\omega \tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\cos\left(\omega \tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF-SHL.png|thumb|800px|Comparison of Normalised VACF with VACF of Liquid and Solid|left]]&lt;br /&gt;
&lt;br /&gt;
We can see from this graph that while the liquid quickly decorrelates to 0, the solid still retains some minor fluctuations. This is due to the fact that liquids are more free to move around and collide with each other, &amp;quot;forgetting&amp;quot; what its initial velocity was, whereas for atoms in the solid state, they are already in a relatively stable position (similar to &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; in L-J interactions) and oscillate from positive to negative. Eventually, atoms in solids, too, will decay, but at a much slower rate than in liquids.&lt;br /&gt;
&lt;br /&gt;
The VACF for the harmonic oscillator does not decay at all since the decorrelation arises from the atoms exchanging energy with its neighbours, which does not occur in harmonic oscillators.&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560697</id>
		<title>Rep:Mod:SUNG95</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560697"/>
		<updated>2016-10-21T09:00:10Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: /* Radial Distribution Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Theory ==&lt;br /&gt;
=== The Velocity-Verlet Algorithm ===&lt;br /&gt;
[[File:Verlet-Velocity.png|thumb|700px|x(t) derived from the velocity-Verlet algorithm compared with the position of the classical harmonic oscillator.|left]]&lt;br /&gt;
[[File:Verlet-Energy.png|thumb|700px|Total energy of the system with respect to time|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Verlet-Error.png|thumb|700px|The error derived by comparing the solution of the velocity-Verlet algorithm with the position of the classical harmonic oscillator|none]]&lt;br /&gt;
&lt;br /&gt;
The three graphs above display the position of an atom, the total energy of the system and the error between the two methods of calculating the atom position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Error wrt Time.png|thumb|600px|Maximum Error against Time|none]]&lt;br /&gt;
&lt;br /&gt;
From this graph of Maximum error vs Time, we can see that error increases with time at a stable linear rate.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Running the same calculations with varying timesteps show the importance of choosing the right value of the timestep:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Energy at t=0.05.png|Energy at timestep=0.05&lt;br /&gt;
Image:Energy at t=0.5.png|Energy at timestep=0.5&lt;br /&gt;
Image:Error at t=0.5.png|Error at timestep=0.5&lt;br /&gt;
Image:Error at t=0.05.png|Error at timestep=0.05&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examining the four additional graphs above, we can notice that a shorter timestep is able to provide a smaller value of error and that the energy fluctuates less than a bigger value of timestep. However, a shorter timestep results in a shorter simulation type, which can result in a less realistic simulation. It is therefore important to find the right balance between the two.&lt;br /&gt;
&lt;br /&gt;
Through trial and error, it has been found that timestep = 0.2850 or lower results in an energy fluctuation that is smaller than 1% over the course of the simulation. A small fluctuation in energy indicates higher resemblance to reality as technically the total energy should not fluctuate at all due to the Law of Conservation of Energy.&lt;br /&gt;
&lt;br /&gt;
=== Lennard-Jones Potential ===&lt;br /&gt;
The equation to calculate the Lennard-Jones potential is as follows:&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;
By equating this to 0, we find that the &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the separation at which the potential is 0, is &amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We can then find the force at this separation by differentiating the Lennard-Jones potential with respect to r, and substituting in &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}=\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24 \frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation (&amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;) is the separation of the particles at equilibrium, and represents the separation at which the potential energy is at a minimum. It can thus be found by setting &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}&amp;lt;/math&amp;gt;, (or &amp;lt;math&amp;gt;\mathbf{F}&amp;lt;/math&amp;gt;) to 0.&lt;br /&gt;
&lt;br /&gt;
Hence,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right) 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; gives us the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To put this equation into perspective, let us calculate the L-J potential for some realistic cutoff values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int 4\epsilon \left(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=4 \epsilon \left(\frac{\sigma^{12}}{11r^{11}}-\frac{\sigma^6}{5r^5}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\lim_{r\rightarrow \infty} 4 \left(\frac{1^{12}}{11r^{11}}-\frac{1^6}{5r^5}\right) - 4\left(\frac{1^{12}}{11\times 2^{11}}+\frac{1^6}{5\times 2^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=0-0.024822\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following the same calculations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0081767\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0032901\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
It is very difficult to simulate realistic volumes of liquid and in the scope of this experiment, we have simulated liquids with N (number of atoms) between 1,000 and 10,000. To demonstrate why simulating realistic volumes of liquid is difficult, let us first calculate the number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
(Assuming: Standard conditions; Density of water = 1.00 g/ml)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.00 \mathrm{ml} = 1.00 \mathrm{g}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;18.02 \mathrm{g/mol} = 0.0555 \text{ mols of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.0555 \times 6.022 \times 10^{23} = 3.34 \times 10^{22} \text{ molecules of water.}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the other hand, 10,000 water molecules is only &amp;lt;math&amp;gt;2.99 \times 10^{-19} \text{ ml of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus, in order to be able to complete the simulation in a practical amount of time, we place our atoms in a box that is repeated in all directions, similar to how unit cells repeat themselves in a lattice. When an atom crosses the boundary of the box, its replica enters the same box from the other side, thus keeping the total number of atoms in the box constant.&lt;br /&gt;
&lt;br /&gt;
For example, if an atom at position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a cubic box ranging from &amp;lt;math&amp;gt;(0, 0, 0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;, its final position would be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;, if the periodic boundary conditions have been applied.&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units ===&lt;br /&gt;
The LAMMPS calculations run in this experiment are all done in reduced units&lt;br /&gt;
&lt;br /&gt;
For example, the Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34 \mathrm{nm}&amp;lt;/math&amp;gt;; &amp;lt;math&amp;gt;\epsilon/k_B=120K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If we set the cutoff to be &amp;lt;math&amp;gt;r*=3.2,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=3.2\times0.34=1.088\mathrm{nm}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Well depth: &amp;lt;math&amp;gt;\epsilon=120K\times k_B \times 6.02 \times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon=0.998 \mathrm{kJ/mol}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and reduced temperature &amp;lt;math&amp;gt;T*=1.5&amp;lt;/math&amp;gt; would be &amp;lt;math&amp;gt;T=1.5 \times 120=180\mathrm{K}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
=== Creating Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
In order to simulate a liquid for this experiment, we first create a crystal lattice, then melt that lattice to create a liquid. This is preferable to generating a liquid since assigning a random position for each new atom could result in two or more atoms being generated in the same space, causing an error when running the simulation.&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is one lattice point per unit cell. Hence, if the number density is 0.8,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8 \text{ points/volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sqrt[3]{0.8}=0.9283\text{ points/length}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.9283^{-1}=1.0772 \text{ length/point}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is thus 1.0772 unit lengths of spacing between each point.&lt;br /&gt;
&lt;br /&gt;
Following the same logic, a face-centred cubic lattice (with 4 lattice points per unit cell) with a density of 1.2 would have a spacing of &amp;lt;math&amp;gt;0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\because \sqrt[3]{4.8^{-1}}=0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, the simple cubic lattice with a density of 0.8 would create 1,000 atoms in the given constraints of the box:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;region box block 0 10 0 10 0 10&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and a face centred cubic lattice with a density of 1.2 would create 4,000 atoms in the same box.&lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of the Atoms ===&lt;br /&gt;
In the input script, there are the following lines describing the properties of the atoms:&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;
In the first line, we are setting the mass of type 1 atoms (which includes all of the atoms in our simulation box, as we have created only one type of atoms) as &amp;lt;math&amp;gt;1.0&amp;lt;/math&amp;gt;, in reduced units. The second line defines the interaction between the atoms as a Lenard-Jones interaction, with a cutoff distance of &amp;lt;math&amp;gt;3.0 \text{ units.}&amp;lt;/math&amp;gt; Finally, the last line defines the coefficient in the Lenard-Jones interaction; the asterisk tells LAMMPS that the coefficients apply to all atoms in our system; the first coefficient is &amp;lt;math&amp;gt;\epsilon=1.0&amp;lt;/math&amp;gt; and the second coefficient is &amp;lt;math&amp;gt;\sigma=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After setting the properties of the atoms, we also defined the initial positions and the initial velocities for the atoms in the input script. Since we have both the &amp;lt;math&amp;gt;\mathbf{x}_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, we can use the Velocity-Verlet integration algorithm that employs the half-step method.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
In the following lines from the input script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we created and reset a variable called timestep to equal 0.001, then used that value to calculate how many runs (${n_steps}) to carry out. This is more beneficial than simply setting&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;
as it allows us to only change the value of the timestep variable to alter the number of runs, rather than having to calculate ${n_steps} ourselves every time we change the timestep, especially in cases such as this computational experiment where the timestep was changed multiple times.&lt;br /&gt;
&lt;br /&gt;
=== Checking Equilibration ===&lt;br /&gt;
&lt;br /&gt;
[[File:TotalE at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Temp at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Press at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
&lt;br /&gt;
These graphs have been plotted to ensure that the simulation reaches equilibrium, and we can see that indeed, they do, and very quickly. Analysis of the graphs show that equilibrium is reached before 1 timestep.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
The following graph shows the total energy of the system against time at varying timestep values:&lt;br /&gt;
&lt;br /&gt;
[[File:Equil Energy.png|thumb|800px|none]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from the graphs that for timestep = 0.001, 0.0025 and 0.0075, the energy reaches a stable equilibrium but for timestep = 0.01 and timestep = 0.015, the energy slowly decreases and rapidly increases, respectively, indicating that the results of the simulation are not very accurate for these values of timestep. Timestep = 0.015 is especially bad as it very obviously does not reach an equilibrium.&lt;br /&gt;
&lt;br /&gt;
Therefore, timestep = 0.0075 would be the ideal value as it provides the highest accuracy, while running the simulation for a suitably long time to provide realistic results.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions (NpT) ==&lt;br /&gt;
&lt;br /&gt;
=== Temperature and Pressure Control ===&lt;br /&gt;
&lt;br /&gt;
Pressures chosen: 2.61, 2.63&lt;br /&gt;
&lt;br /&gt;
Temperatures chosen: 1.5, 1.6, 1.7, 1.8, 1.9&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 was chosen to provide the highest accuracy possible, without shortening the simulation time too much.&lt;br /&gt;
&lt;br /&gt;
In our simulation, the temperature was controlled by solving the two following equations for the instantaneous temperature &amp;lt;math&amp;gt;T,&amp;lt;/math&amp;gt; which fluctuates.&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 \qquad\qquad\qquad(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order for &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; to reach our target temperature &amp;lt;math&amp;gt;\mathfrak{T},&amp;lt;/math&amp;gt; we introduce a constant &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; to control the velocity such that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}\qquad\qquad(2)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can solve eq. &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt; to solve for &amp;lt;math&amp;gt;\gamma.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\sum_i m_i v_i^2 = 3N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substituting &amp;lt;math&amp;gt;\sum_i m_i v_i^2&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 3 N k_b T = 3N k_b \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\epsilon}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Examining the Input Script ===&lt;br /&gt;
&lt;br /&gt;
To calculate the average values for our simulation, we set certain parameters for LAMMPS in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time Nevery Nrepeat Nfreq&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Final averages are generated on timesteps that are multiples of Nevery, for Nrepeat number of times and an average is generated every Nfreq timesteps.&lt;br /&gt;
&lt;br /&gt;
In our script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The results are sampled at every 100 timesteps for 1000 times (100, 200, 300, etc.) Averages are generated every 100,000 timesteps, but our simulation runs for the same amount of time so only one average is generated from this code.&lt;br /&gt;
&lt;br /&gt;
The timestep chosen for this section of the experiment was 0.0025. Therefore, the simulation was run for &amp;lt;math&amp;gt;100000 \times 0.0025 = 250 \text{ unit time}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equations of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:Density Temp.png|700px]]&lt;br /&gt;
&lt;br /&gt;
The graph above shows the density of the simulated liquid against temperature, compared with the densities derived from the ideal gas law.&lt;br /&gt;
&lt;br /&gt;
It can be seen that within the ranges set for this simulation, the discrepancy between the simulated densities compared to the calculated densities are very high, to the point that the error bars for the y-axis is not even visible on the graph. Perhaps a more accurate simulation could have been run if a wider temperature and pressure ranges were selected.&lt;br /&gt;
&lt;br /&gt;
With the data range being one possible source of error between the simulation and the ideal gas law prediction, another possible factor is that the parameters set for this simulation are such that the repulsive force of the Lennard-Jones interaction is more significant than the attractive force. Since the ideal gas law assumes no electronic interaction between the particles, introducing a repulsive force would result in the density of the liquid being lower than the prediction.&lt;br /&gt;
&lt;br /&gt;
The most likely explanation, however, is that the ideal gas law, as its name suggests, is not very good at predicting the behavious of liquids. While both gas and liquid phases are fluids, there are major differences between them such as a much more prominent long-range order effect in liquids compared to gases.&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacity ==&lt;br /&gt;
&lt;br /&gt;
[[File:HeatCap vs Density.png|thumb|800px|Graph of &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; against Temperature|none]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From thermodynamics:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;dU = TdS - PdV&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = T\frac{\partial S}{\partial T}-P\frac{\partial V}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and since &amp;lt;math&amp;gt;\frac{\partial S}{\partial T}\geq 0,&amp;lt;/math&amp;gt; heat capacity should increase with increasing temperature.&lt;br /&gt;
&lt;br /&gt;
The fact that &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; decreases with increasing temperature suggests that either the increase in temperature is causing the internal energy to increase at a faster rate than itself, or that there are issues with the simulation originating from possible sources such as small sampling size (number of atoms generated) or short run time.&lt;br /&gt;
&lt;br /&gt;
== Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
[[File:RDF SHL.png|thumb|700px]]&lt;br /&gt;
&lt;br /&gt;
Looking at the graph on the right, it can be noticed that the three phases have clearly different Radial Distribution Functions (RDF) from each other. This can be attributed to the varying degrees of order each of the phases have: the atoms in the gas phase are completely free to move around, while atoms in the liquid phase have less freedom and in the solid phase, the atoms are set in a lattice, with only vibrational motion and no (or negligible) translational motion.&lt;br /&gt;
&lt;br /&gt;
In order to explain the graph, let us consider the RDF to be displaying the &amp;quot;effective density&amp;quot; of atoms in an area of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; at a distance &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; from a certain reference atom.&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf schematic.jpg|thumb|200px|Schematic of RDF|left]]&lt;br /&gt;
&lt;br /&gt;
There are three main parts to the RDF graphs: the region near the origin where the &amp;lt;math&amp;gt;\mathrm{RDF} = 0&amp;lt;/math&amp;gt;, the region after where there are big peaks and troughs, and the final region where the graphs have mostly reached equilibrium.&lt;br /&gt;
&lt;br /&gt;
First of all, the region near the origin is 0 for all three phases as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; is still within the volume (the hard sphere) of the reference atom, and hence there can be no other atoms in that radius.&lt;br /&gt;
&lt;br /&gt;
The peaks in the second region indicate that there is a higher &amp;quot;effective density&amp;quot; of atoms. The explanation for this is different for the lattice structure (solid) and the fluids (liquid and gas).&lt;br /&gt;
&lt;br /&gt;
For the liquid and gas phase, the peaks are due to the attractive force caused by the Lennard-Jones potential. We have calculated above [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:SUNG95#Lennard-Jones_Potential (1.2 LJ Potential)] that &amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}.&amp;lt;/math&amp;gt; Setting &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt; (as we have in our input file), we get &amp;lt;math&amp;gt;r_{eq} = 1.122&amp;lt;/math&amp;gt;, which is very close to where the largest peaks are for the two fluid phases.&lt;br /&gt;
&lt;br /&gt;
For the solid, where all the atoms are in a lattice structure, the effects due to the Lennard-Jones interaction becomes neglibigle. Instead, there will be certain values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where the effective density is higher than the overall density of the sample (the peaks), and some values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where it is lower than the density of the sample (the troughs). This is arisen from the fact that as the value of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the total volume covered by &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; also increases. But since all the atoms are set in place by the lattice, the number of atoms that &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; encompasses stays relatively constant. As a result, the peaks and the troughs tend to 1 with increasing &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the case of the gas phase, the atoms are completely free to move around and the RDF graph can be entirely attributed to the effects of the L-J interaction. This justifies the lack of troughs for this phase. Furthermore, as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the attractive part of the L-J interaction &amp;lt;math&amp;gt;\frac{1}{r^6}&amp;lt;/math&amp;gt; gets exponentially smaller and quickly becomes negligible - RDF reaches equilibrium.&lt;br /&gt;
&lt;br /&gt;
Finally, the liquid phase can be considered to act as a mix between the solid phase and the gas phase: the L-J interactions are significant enough to reach equilibrium at a rate similar to the gas phase, but there exists an ordering of the atoms such that there are values of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; where the effective density is lower than the overall density.&lt;br /&gt;
&lt;br /&gt;
From the RDF of the solid phase, each of the peaks point to a certain lattice point. Simple geometrical calculations can be done to indicate that the first peak, which is the lattice point (1) closest to the reference atom (O), is at a separation of &amp;lt;math&amp;gt;\mathrm{r}=1.056.&amp;lt;/math&amp;gt; Second closest point (2) is at a distance of &amp;lt;math&amp;gt;\mathrm{r}=1.4938&amp;lt;/math&amp;gt; and the third (3) at &amp;lt;math&amp;gt;\mathrm{r}=1.8295.&amp;lt;/math&amp;gt; These points agree with the x-axis on the RDF graphs.&lt;br /&gt;
&lt;br /&gt;
[[File:FCC-SHL.png|thumb|Face-centered cubic lattice|none]]&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
=== Mean Squared Displacement ===&lt;br /&gt;
&lt;br /&gt;
The Mean Squared Displacement can be used to find the Diffusion Coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, via the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plotting the mean squared displacement (MSD) against time, then finding the linear gradient would give us the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:MSD-SHL.png|thumb|600px|none]][[File:MSD Mill SHL.png|thumb|600px|none]]&lt;br /&gt;
&lt;br /&gt;
Graphical analysis showed that the last 1,000 timesteps are suitably linear to apply this equation, and the Diffusion Coefficients for the three different phases were found from the last 1,000 timesteps. Results were as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Diffusion Coefficients (8,000 atoms)&lt;br /&gt;
! Phase !! &amp;lt;math&amp;gt;D \text{ (unit area/unit time)}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Gas || &amp;lt;math&amp;gt;6.05&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || &amp;lt;math&amp;gt;0.0855&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Solid || &amp;lt;math&amp;gt;0.000896&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Diffusion Coefficients (1 million atoms)&lt;br /&gt;
! Phase !! &amp;lt;math&amp;gt;D \text{ (unit area/unit time)}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Gas || &amp;lt;math&amp;gt;3.22&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || &amp;lt;math&amp;gt;0.0892&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Solid || &amp;lt;math&amp;gt;1.15\times 10^{-5}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These values make sense logically since gases diffuse the easiest (highest diffusion coefficient), metals practically do not diffuse (very small diffusion coefficient) and liquid is somewhere in the middle.&lt;br /&gt;
&lt;br /&gt;
=== Velocity Autocorrelation Function ===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can also be calculated from the Velocity Autocorrelation Function, or VACF.&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;
From the 1D Harmonic Oscillator:&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;
Differentiating this gives the velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = -A\omega \sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting this into the integrated form of the VAFC:&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) \cdot A \omega \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(A \omega \sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, from the trigonometric identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin \left(\alpha + \beta \right)= \sin\alpha\cos\beta + \sin\beta\cos\alpha,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(\omega t + \phi + \omega\tau\right) = \sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \left(\sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\cos\left(\omega \tau\right) + \int_{-\infty}^{\infty} \sin \left(\omega \tau\right) \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt; is a constant so &amp;lt;math&amp;gt;\cos\left(\omega\tau\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sin\left(\omega\tau\right)&amp;lt;/math&amp;gt; can be taken out of the integral.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\cos\left(\omega \tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) + \sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; can cancel out:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\sin(x)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;\cos(x)&amp;lt;/math&amp;gt; is an even function, &amp;lt;math&amp;gt;\sin(x)\cos(x)&amp;lt;/math&amp;gt; is an odd function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; is an odd function (While the value of &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; can change whether or not the functions are even or odd, it shifts both functions by the same amount and the resulting &amp;lt;math&amp;gt;\cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; will still be odd)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}=\cos\left(\omega \tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\cos\left(\omega \tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF-SHL.png|thumb|800px|Comparison of Normalised VACF with VACF of Liquid and Solid|left]]&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560685</id>
		<title>Rep:Mod:SUNG95</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560685"/>
		<updated>2016-10-21T08:46:16Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: /* Mean Squared Displacement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Theory ==&lt;br /&gt;
=== The Velocity-Verlet Algorithm ===&lt;br /&gt;
[[File:Verlet-Velocity.png|thumb|700px|x(t) derived from the velocity-Verlet algorithm compared with the position of the classical harmonic oscillator.|left]]&lt;br /&gt;
[[File:Verlet-Energy.png|thumb|700px|Total energy of the system with respect to time|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Verlet-Error.png|thumb|700px|The error derived by comparing the solution of the velocity-Verlet algorithm with the position of the classical harmonic oscillator|none]]&lt;br /&gt;
&lt;br /&gt;
The three graphs above display the position of an atom, the total energy of the system and the error between the two methods of calculating the atom position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Error wrt Time.png|thumb|600px|Maximum Error against Time|none]]&lt;br /&gt;
&lt;br /&gt;
From this graph of Maximum error vs Time, we can see that error increases with time at a stable linear rate.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Running the same calculations with varying timesteps show the importance of choosing the right value of the timestep:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Energy at t=0.05.png|Energy at timestep=0.05&lt;br /&gt;
Image:Energy at t=0.5.png|Energy at timestep=0.5&lt;br /&gt;
Image:Error at t=0.5.png|Error at timestep=0.5&lt;br /&gt;
Image:Error at t=0.05.png|Error at timestep=0.05&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examining the four additional graphs above, we can notice that a shorter timestep is able to provide a smaller value of error and that the energy fluctuates less than a bigger value of timestep. However, a shorter timestep results in a shorter simulation type, which can result in a less realistic simulation. It is therefore important to find the right balance between the two.&lt;br /&gt;
&lt;br /&gt;
Through trial and error, it has been found that timestep = 0.2850 or lower results in an energy fluctuation that is smaller than 1% over the course of the simulation. A small fluctuation in energy indicates higher resemblance to reality as technically the total energy should not fluctuate at all due to the Law of Conservation of Energy.&lt;br /&gt;
&lt;br /&gt;
=== Lennard-Jones Potential ===&lt;br /&gt;
The equation to calculate the Lennard-Jones potential is as follows:&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;
By equating this to 0, we find that the &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the separation at which the potential is 0, is &amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We can then find the force at this separation by differentiating the Lennard-Jones potential with respect to r, and substituting in &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}=\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24 \frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation (&amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;) is the separation of the particles at equilibrium, and represents the separation at which the potential energy is at a minimum. It can thus be found by setting &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}&amp;lt;/math&amp;gt;, (or &amp;lt;math&amp;gt;\mathbf{F}&amp;lt;/math&amp;gt;) to 0.&lt;br /&gt;
&lt;br /&gt;
Hence,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right) 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; gives us the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To put this equation into perspective, let us calculate the L-J potential for some realistic cutoff values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int 4\epsilon \left(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=4 \epsilon \left(\frac{\sigma^{12}}{11r^{11}}-\frac{\sigma^6}{5r^5}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\lim_{r\rightarrow \infty} 4 \left(\frac{1^{12}}{11r^{11}}-\frac{1^6}{5r^5}\right) - 4\left(\frac{1^{12}}{11\times 2^{11}}+\frac{1^6}{5\times 2^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=0-0.024822\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following the same calculations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0081767\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0032901\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
It is very difficult to simulate realistic volumes of liquid and in the scope of this experiment, we have simulated liquids with N (number of atoms) between 1,000 and 10,000. To demonstrate why simulating realistic volumes of liquid is difficult, let us first calculate the number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
(Assuming: Standard conditions; Density of water = 1.00 g/ml)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.00 \mathrm{ml} = 1.00 \mathrm{g}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;18.02 \mathrm{g/mol} = 0.0555 \text{ mols of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.0555 \times 6.022 \times 10^{23} = 3.34 \times 10^{22} \text{ molecules of water.}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the other hand, 10,000 water molecules is only &amp;lt;math&amp;gt;2.99 \times 10^{-19} \text{ ml of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus, in order to be able to complete the simulation in a practical amount of time, we place our atoms in a box that is repeated in all directions, similar to how unit cells repeat themselves in a lattice. When an atom crosses the boundary of the box, its replica enters the same box from the other side, thus keeping the total number of atoms in the box constant.&lt;br /&gt;
&lt;br /&gt;
For example, if an atom at position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a cubic box ranging from &amp;lt;math&amp;gt;(0, 0, 0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;, its final position would be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;, if the periodic boundary conditions have been applied.&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units ===&lt;br /&gt;
The LAMMPS calculations run in this experiment are all done in reduced units&lt;br /&gt;
&lt;br /&gt;
For example, the Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34 \mathrm{nm}&amp;lt;/math&amp;gt;; &amp;lt;math&amp;gt;\epsilon/k_B=120K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If we set the cutoff to be &amp;lt;math&amp;gt;r*=3.2,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=3.2\times0.34=1.088\mathrm{nm}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Well depth: &amp;lt;math&amp;gt;\epsilon=120K\times k_B \times 6.02 \times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon=0.998 \mathrm{kJ/mol}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and reduced temperature &amp;lt;math&amp;gt;T*=1.5&amp;lt;/math&amp;gt; would be &amp;lt;math&amp;gt;T=1.5 \times 120=180\mathrm{K}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
=== Creating Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
In order to simulate a liquid for this experiment, we first create a crystal lattice, then melt that lattice to create a liquid. This is preferable to generating a liquid since assigning a random position for each new atom could result in two or more atoms being generated in the same space, causing an error when running the simulation.&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is one lattice point per unit cell. Hence, if the number density is 0.8,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8 \text{ points/volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sqrt[3]{0.8}=0.9283\text{ points/length}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.9283^{-1}=1.0772 \text{ length/point}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is thus 1.0772 unit lengths of spacing between each point.&lt;br /&gt;
&lt;br /&gt;
Following the same logic, a face-centred cubic lattice (with 4 lattice points per unit cell) with a density of 1.2 would have a spacing of &amp;lt;math&amp;gt;0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\because \sqrt[3]{4.8^{-1}}=0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, the simple cubic lattice with a density of 0.8 would create 1,000 atoms in the given constraints of the box:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;region box block 0 10 0 10 0 10&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and a face centred cubic lattice with a density of 1.2 would create 4,000 atoms in the same box.&lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of the Atoms ===&lt;br /&gt;
In the input script, there are the following lines describing the properties of the atoms:&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;
In the first line, we are setting the mass of type 1 atoms (which includes all of the atoms in our simulation box, as we have created only one type of atoms) as &amp;lt;math&amp;gt;1.0&amp;lt;/math&amp;gt;, in reduced units. The second line defines the interaction between the atoms as a Lenard-Jones interaction, with a cutoff distance of &amp;lt;math&amp;gt;3.0 \text{ units.}&amp;lt;/math&amp;gt; Finally, the last line defines the coefficient in the Lenard-Jones interaction; the asterisk tells LAMMPS that the coefficients apply to all atoms in our system; the first coefficient is &amp;lt;math&amp;gt;\epsilon=1.0&amp;lt;/math&amp;gt; and the second coefficient is &amp;lt;math&amp;gt;\sigma=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After setting the properties of the atoms, we also defined the initial positions and the initial velocities for the atoms in the input script. Since we have both the &amp;lt;math&amp;gt;\mathbf{x}_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, we can use the Velocity-Verlet integration algorithm that employs the half-step method.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
In the following lines from the input script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we created and reset a variable called timestep to equal 0.001, then used that value to calculate how many runs (${n_steps}) to carry out. This is more beneficial than simply setting&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;
as it allows us to only change the value of the timestep variable to alter the number of runs, rather than having to calculate ${n_steps} ourselves every time we change the timestep, especially in cases such as this computational experiment where the timestep was changed multiple times.&lt;br /&gt;
&lt;br /&gt;
=== Checking Equilibration ===&lt;br /&gt;
&lt;br /&gt;
[[File:TotalE at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Temp at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Press at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
&lt;br /&gt;
These graphs have been plotted to ensure that the simulation reaches equilibrium, and we can see that indeed, they do, and very quickly. Analysis of the graphs show that equilibrium is reached before 1 timestep.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
The following graph shows the total energy of the system against time at varying timestep values:&lt;br /&gt;
&lt;br /&gt;
[[File:Equil Energy.png|thumb|800px|none]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from the graphs that for timestep = 0.001, 0.0025 and 0.0075, the energy reaches a stable equilibrium but for timestep = 0.01 and timestep = 0.015, the energy slowly decreases and rapidly increases, respectively, indicating that the results of the simulation are not very accurate for these values of timestep. Timestep = 0.015 is especially bad as it very obviously does not reach an equilibrium.&lt;br /&gt;
&lt;br /&gt;
Therefore, timestep = 0.0075 would be the ideal value as it provides the highest accuracy, while running the simulation for a suitably long time to provide realistic results.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions (NpT) ==&lt;br /&gt;
&lt;br /&gt;
=== Temperature and Pressure Control ===&lt;br /&gt;
&lt;br /&gt;
Pressures chosen: 2.61, 2.63&lt;br /&gt;
&lt;br /&gt;
Temperatures chosen: 1.5, 1.6, 1.7, 1.8, 1.9&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 was chosen to provide the highest accuracy possible, without shortening the simulation time too much.&lt;br /&gt;
&lt;br /&gt;
In our simulation, the temperature was controlled by solving the two following equations for the instantaneous temperature &amp;lt;math&amp;gt;T,&amp;lt;/math&amp;gt; which fluctuates.&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 \qquad\qquad\qquad(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order for &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; to reach our target temperature &amp;lt;math&amp;gt;\mathfrak{T},&amp;lt;/math&amp;gt; we introduce a constant &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; to control the velocity such that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}\qquad\qquad(2)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can solve eq. &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt; to solve for &amp;lt;math&amp;gt;\gamma.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\sum_i m_i v_i^2 = 3N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substituting &amp;lt;math&amp;gt;\sum_i m_i v_i^2&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 3 N k_b T = 3N k_b \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\epsilon}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Examining the Input Script ===&lt;br /&gt;
&lt;br /&gt;
To calculate the average values for our simulation, we set certain parameters for LAMMPS in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time Nevery Nrepeat Nfreq&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Final averages are generated on timesteps that are multiples of Nevery, for Nrepeat number of times and an average is generated every Nfreq timesteps.&lt;br /&gt;
&lt;br /&gt;
In our script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The results are sampled at every 100 timesteps for 1000 times (100, 200, 300, etc.) Averages are generated every 100,000 timesteps, but our simulation runs for the same amount of time so only one average is generated from this code.&lt;br /&gt;
&lt;br /&gt;
The timestep chosen for this section of the experiment was 0.0025. Therefore, the simulation was run for &amp;lt;math&amp;gt;100000 \times 0.0025 = 250 \text{ unit time}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equations of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:Density Temp.png|700px]]&lt;br /&gt;
&lt;br /&gt;
The graph above shows the density of the simulated liquid against temperature, compared with the densities derived from the ideal gas law.&lt;br /&gt;
&lt;br /&gt;
It can be seen that within the ranges set for this simulation, the discrepancy between the simulated densities compared to the calculated densities are very high, to the point that the error bars for the y-axis is not even visible on the graph. Perhaps a more accurate simulation could have been run if a wider temperature and pressure ranges were selected.&lt;br /&gt;
&lt;br /&gt;
With the data range being one possible source of error between the simulation and the ideal gas law prediction, another possible factor is that the parameters set for this simulation are such that the repulsive force of the Lennard-Jones interaction is more significant than the attractive force. Since the ideal gas law assumes no electronic interaction between the particles, introducing a repulsive force would result in the density of the liquid being lower than the prediction.&lt;br /&gt;
&lt;br /&gt;
The most likely explanation, however, is that the ideal gas law, as its name suggests, is not very good at predicting the behavious of liquids. While both gas and liquid phases are fluids, there are major differences between them such as a much more prominent long-range order effect in liquids compared to gases.&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacity ==&lt;br /&gt;
&lt;br /&gt;
[[File:HeatCap vs Density.png|thumb|800px|Graph of &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; against Temperature|none]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From thermodynamics:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;dU = TdS - PdV&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = T\frac{\partial S}{\partial T}-P\frac{\partial V}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and since &amp;lt;math&amp;gt;\frac{\partial S}{\partial T}\geq 0,&amp;lt;/math&amp;gt; heat capacity should increase with increasing temperature.&lt;br /&gt;
&lt;br /&gt;
The fact that &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; decreases with increasing temperature suggests that either the increase in temperature is causing the internal energy to increase at a faster rate than itself, or that there are issues with the simulation originating from possible sources such as small sampling size (number of atoms generated) or short run time.&lt;br /&gt;
&lt;br /&gt;
== Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
[[File:RDF SHL.png|thumb|700px]]&lt;br /&gt;
&lt;br /&gt;
It can be noticed that the three phases have clearly different Radial Distribution Functions (RDF) from each other and this can be attributed to the varying degrees of order each of the phases have: the atoms in the gas phase are completely free to move around, while atoms in the liquid phase have less freedom and in the solid phase, the atoms are set in a lattice, with only vibrational motion and no (or negligible) translational motion.&lt;br /&gt;
&lt;br /&gt;
In order to explain the graph, let us consider the RDF to be displaying the &amp;quot;effective density&amp;quot; of atoms in an area of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; at a distance &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; from a certain reference atom.&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf schematic.jpg|thumb|200px|Schematic of RDF|left]]&lt;br /&gt;
&lt;br /&gt;
There are three main parts to the RDF graphs: the region near the origin where the &amp;lt;math&amp;gt;\mathrm{RDF} = 0&amp;lt;/math&amp;gt;, the region after where there are big peaks and troughs, and the final region where the graphs have mostly reached equilibrium.&lt;br /&gt;
&lt;br /&gt;
First of all, the region near the origin is 0 for all three phases as that is still within the volume of the reference atom, and hence there are no other atoms in that radius.&lt;br /&gt;
&lt;br /&gt;
The peaks in the second region indicate that there is a higher &amp;quot;effective density&amp;quot; of atoms. The explanation for this is different for the lattice structure (solid) and the fluids (liquid and gas).&lt;br /&gt;
&lt;br /&gt;
For the liquid and gas phase, the peaks are due to the attractive force caused by the Lennard-Jones potential. We have calculated above [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:SUNG95#Lennard-Jones_Potential (1.2 LJ Potential)] that &amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}.&amp;lt;/math&amp;gt; Setting &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt; (as we have in our input file), we get &amp;lt;math&amp;gt;r_{eq} = 1.122&amp;lt;/math&amp;gt;, which is very close to where the largest peaks are for the two fluid phases.&lt;br /&gt;
&lt;br /&gt;
Then for the solid, where all the atoms are in a lattice structure, the effects due to the Lennard-Jones interaction becomes neglibigle. Instead, there will be certain values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where the effective density is higher than the overall density of the sample (the peaks), and some values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where it is lower than the density of the sample (the troughs). This is arisen from the fact that as the value of in a similar fashion to the schematic on the left.&lt;br /&gt;
&lt;br /&gt;
As the value of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the total volume covered by &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; also increases. But since all the atoms are set in place by the lattice, the number of atoms that &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; encompasses stays relatively constant. As a result, the peaks and the troughs tend 1 with increasing &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the case of the gas phase, the atoms are completely free to move around and the RDF graph can be entirely attributed to the effects of the L-J interaction. This justifies the lack of troughs for this phase. Furthermore, as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the attractive part of the L-J interaction &amp;lt;math&amp;gt;\frac{1}{r^6}&amp;lt;/math&amp;gt; gets exponentially smaller and quickly becomes negligible - RDF reaches equilibrium.&lt;br /&gt;
&lt;br /&gt;
Finally, the liquid phase can be considered to act as a mix between the solid phase and the gas phase: the L-J interactions are significant enough to reach equilibrium at a rate similar to the gas phase, but there exists an ordering of the atoms such that there are values of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; where the effective density is lower than the overall density.&lt;br /&gt;
&lt;br /&gt;
From the RDF of the solid phase, each of the peaks point to a certain lattice point. Simple geometrical calculations can be done to indicate that the first peak, which is the lattice point (1) closest to the reference atom (O), is at a separation of &amp;lt;math&amp;gt;\mathrm{r}=1.056.&amp;lt;/math&amp;gt; Second closest point (2) is at a distance of &amp;lt;math&amp;gt;\mathrm{r}=1.4938&amp;lt;/math&amp;gt; and the third (3) at &amp;lt;math&amp;gt;\mathrm{r}=1.8295.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:FCC-SHL.png|thumb|Face-centered cubic lattice|none]]&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
=== Mean Squared Displacement ===&lt;br /&gt;
&lt;br /&gt;
The Mean Squared Displacement can be used to find the Diffusion Coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, via the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plotting the mean squared displacement (MSD) against time, then finding the linear gradient would give us the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:MSD-SHL.png|thumb|600px|none]][[File:MSD Mill SHL.png|thumb|600px|none]]&lt;br /&gt;
&lt;br /&gt;
Graphical analysis showed that the last 1,000 timesteps are suitably linear to apply this equation, and the Diffusion Coefficients for the three different phases were found from the last 1,000 timesteps. Results were as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Diffusion Coefficients (8,000 atoms)&lt;br /&gt;
! Phase !! &amp;lt;math&amp;gt;D \text{ (unit area/unit time)}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Gas || &amp;lt;math&amp;gt;6.05&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || &amp;lt;math&amp;gt;0.0855&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Solid || &amp;lt;math&amp;gt;0.000896&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Diffusion Coefficients (1 million atoms)&lt;br /&gt;
! Phase !! &amp;lt;math&amp;gt;D \text{ (unit area/unit time)}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Gas || &amp;lt;math&amp;gt;3.22&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || &amp;lt;math&amp;gt;0.0892&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Solid || &amp;lt;math&amp;gt;1.15\times 10^{-5}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These values make sense logically since gases diffuse the easiest (highest diffusion coefficient), metals practically do not diffuse (very small diffusion coefficient) and liquid is somewhere in the middle.&lt;br /&gt;
&lt;br /&gt;
=== Velocity Autocorrelation Function ===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can also be calculated from the Velocity Autocorrelation Function, or VACF.&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;
From the 1D Harmonic Oscillator:&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;
Differentiating this gives the velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = -A\omega \sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting this into the integrated form of the VAFC:&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) \cdot A \omega \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(A \omega \sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, from the trigonometric identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin \left(\alpha + \beta \right)= \sin\alpha\cos\beta + \sin\beta\cos\alpha,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(\omega t + \phi + \omega\tau\right) = \sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \left(\sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\cos\left(\omega \tau\right) + \int_{-\infty}^{\infty} \sin \left(\omega \tau\right) \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt; is a constant so &amp;lt;math&amp;gt;\cos\left(\omega\tau\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sin\left(\omega\tau\right)&amp;lt;/math&amp;gt; can be taken out of the integral.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\cos\left(\omega \tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) + \sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; can cancel out:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\sin(x)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;\cos(x)&amp;lt;/math&amp;gt; is an even function, &amp;lt;math&amp;gt;\sin(x)\cos(x)&amp;lt;/math&amp;gt; is an odd function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; is an odd function (While the value of &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; can change whether or not the functions are even or odd, it shifts both functions by the same amount and the resulting &amp;lt;math&amp;gt;\cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; will still be odd)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}=\cos\left(\omega \tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\cos\left(\omega \tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF-SHL.png|thumb|800px|Comparison of Normalised VACF with VACF of Liquid and Solid|left]]&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560650</id>
		<title>Rep:Mod:SUNG95</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560650"/>
		<updated>2016-10-21T08:30:15Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: /* Mean Squared Displacement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Theory ==&lt;br /&gt;
=== The Velocity-Verlet Algorithm ===&lt;br /&gt;
[[File:Verlet-Velocity.png|thumb|700px|x(t) derived from the velocity-Verlet algorithm compared with the position of the classical harmonic oscillator.|left]]&lt;br /&gt;
[[File:Verlet-Energy.png|thumb|700px|Total energy of the system with respect to time|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Verlet-Error.png|thumb|700px|The error derived by comparing the solution of the velocity-Verlet algorithm with the position of the classical harmonic oscillator|none]]&lt;br /&gt;
&lt;br /&gt;
The three graphs above display the position of an atom, the total energy of the system and the error between the two methods of calculating the atom position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Error wrt Time.png|thumb|600px|Maximum Error against Time|none]]&lt;br /&gt;
&lt;br /&gt;
From this graph of Maximum error vs Time, we can see that error increases with time at a stable linear rate.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Running the same calculations with varying timesteps show the importance of choosing the right value of the timestep:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Energy at t=0.05.png|Energy at timestep=0.05&lt;br /&gt;
Image:Energy at t=0.5.png|Energy at timestep=0.5&lt;br /&gt;
Image:Error at t=0.5.png|Error at timestep=0.5&lt;br /&gt;
Image:Error at t=0.05.png|Error at timestep=0.05&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examining the four additional graphs above, we can notice that a shorter timestep is able to provide a smaller value of error and that the energy fluctuates less than a bigger value of timestep. However, a shorter timestep results in a shorter simulation type, which can result in a less realistic simulation. It is therefore important to find the right balance between the two.&lt;br /&gt;
&lt;br /&gt;
Through trial and error, it has been found that timestep = 0.2850 or lower results in an energy fluctuation that is smaller than 1% over the course of the simulation. A small fluctuation in energy indicates higher resemblance to reality as technically the total energy should not fluctuate at all due to the Law of Conservation of Energy.&lt;br /&gt;
&lt;br /&gt;
=== Lennard-Jones Potential ===&lt;br /&gt;
The equation to calculate the Lennard-Jones potential is as follows:&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;
By equating this to 0, we find that the &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the separation at which the potential is 0, is &amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We can then find the force at this separation by differentiating the Lennard-Jones potential with respect to r, and substituting in &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}=\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24 \frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation (&amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;) is the separation of the particles at equilibrium, and represents the separation at which the potential energy is at a minimum. It can thus be found by setting &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}&amp;lt;/math&amp;gt;, (or &amp;lt;math&amp;gt;\mathbf{F}&amp;lt;/math&amp;gt;) to 0.&lt;br /&gt;
&lt;br /&gt;
Hence,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right) 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; gives us the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To put this equation into perspective, let us calculate the L-J potential for some realistic cutoff values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int 4\epsilon \left(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=4 \epsilon \left(\frac{\sigma^{12}}{11r^{11}}-\frac{\sigma^6}{5r^5}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\lim_{r\rightarrow \infty} 4 \left(\frac{1^{12}}{11r^{11}}-\frac{1^6}{5r^5}\right) - 4\left(\frac{1^{12}}{11\times 2^{11}}+\frac{1^6}{5\times 2^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=0-0.024822\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following the same calculations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0081767\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0032901\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
It is very difficult to simulate realistic volumes of liquid and in the scope of this experiment, we have simulated liquids with N (number of atoms) between 1,000 and 10,000. To demonstrate why simulating realistic volumes of liquid is difficult, let us first calculate the number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
(Assuming: Standard conditions; Density of water = 1.00 g/ml)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.00 \mathrm{ml} = 1.00 \mathrm{g}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;18.02 \mathrm{g/mol} = 0.0555 \text{ mols of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.0555 \times 6.022 \times 10^{23} = 3.34 \times 10^{22} \text{ molecules of water.}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the other hand, 10,000 water molecules is only &amp;lt;math&amp;gt;2.99 \times 10^{-19} \text{ ml of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus, in order to be able to complete the simulation in a practical amount of time, we place our atoms in a box that is repeated in all directions, similar to how unit cells repeat themselves in a lattice. When an atom crosses the boundary of the box, its replica enters the same box from the other side, thus keeping the total number of atoms in the box constant.&lt;br /&gt;
&lt;br /&gt;
For example, if an atom at position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a cubic box ranging from &amp;lt;math&amp;gt;(0, 0, 0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;, its final position would be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;, if the periodic boundary conditions have been applied.&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units ===&lt;br /&gt;
The LAMMPS calculations run in this experiment are all done in reduced units&lt;br /&gt;
&lt;br /&gt;
For example, the Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34 \mathrm{nm}&amp;lt;/math&amp;gt;; &amp;lt;math&amp;gt;\epsilon/k_B=120K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If we set the cutoff to be &amp;lt;math&amp;gt;r*=3.2,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=3.2\times0.34=1.088\mathrm{nm}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Well depth: &amp;lt;math&amp;gt;\epsilon=120K\times k_B \times 6.02 \times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon=0.998 \mathrm{kJ/mol}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and reduced temperature &amp;lt;math&amp;gt;T*=1.5&amp;lt;/math&amp;gt; would be &amp;lt;math&amp;gt;T=1.5 \times 120=180\mathrm{K}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
=== Creating Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
In order to simulate a liquid for this experiment, we first create a crystal lattice, then melt that lattice to create a liquid. This is preferable to generating a liquid since assigning a random position for each new atom could result in two or more atoms being generated in the same space, causing an error when running the simulation.&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is one lattice point per unit cell. Hence, if the number density is 0.8,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8 \text{ points/volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sqrt[3]{0.8}=0.9283\text{ points/length}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.9283^{-1}=1.0772 \text{ length/point}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is thus 1.0772 unit lengths of spacing between each point.&lt;br /&gt;
&lt;br /&gt;
Following the same logic, a face-centred cubic lattice (with 4 lattice points per unit cell) with a density of 1.2 would have a spacing of &amp;lt;math&amp;gt;0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\because \sqrt[3]{4.8^{-1}}=0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, the simple cubic lattice with a density of 0.8 would create 1,000 atoms in the given constraints of the box:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;region box block 0 10 0 10 0 10&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and a face centred cubic lattice with a density of 1.2 would create 4,000 atoms in the same box.&lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of the Atoms ===&lt;br /&gt;
In the input script, there are the following lines describing the properties of the atoms:&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;
In the first line, we are setting the mass of type 1 atoms (which includes all of the atoms in our simulation box, as we have created only one type of atoms) as &amp;lt;math&amp;gt;1.0&amp;lt;/math&amp;gt;, in reduced units. The second line defines the interaction between the atoms as a Lenard-Jones interaction, with a cutoff distance of &amp;lt;math&amp;gt;3.0 \text{ units.}&amp;lt;/math&amp;gt; Finally, the last line defines the coefficient in the Lenard-Jones interaction; the asterisk tells LAMMPS that the coefficients apply to all atoms in our system; the first coefficient is &amp;lt;math&amp;gt;\epsilon=1.0&amp;lt;/math&amp;gt; and the second coefficient is &amp;lt;math&amp;gt;\sigma=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After setting the properties of the atoms, we also defined the initial positions and the initial velocities for the atoms in the input script. Since we have both the &amp;lt;math&amp;gt;\mathbf{x}_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, we can use the Velocity-Verlet integration algorithm that employs the half-step method.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
In the following lines from the input script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we created and reset a variable called timestep to equal 0.001, then used that value to calculate how many runs (${n_steps}) to carry out. This is more beneficial than simply setting&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;
as it allows us to only change the value of the timestep variable to alter the number of runs, rather than having to calculate ${n_steps} ourselves every time we change the timestep, especially in cases such as this computational experiment where the timestep was changed multiple times.&lt;br /&gt;
&lt;br /&gt;
=== Checking Equilibration ===&lt;br /&gt;
&lt;br /&gt;
[[File:TotalE at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Temp at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Press at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
&lt;br /&gt;
These graphs have been plotted to ensure that the simulation reaches equilibrium, and we can see that indeed, they do, and very quickly. Analysis of the graphs show that equilibrium is reached before 1 timestep.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
The following graph shows the total energy of the system against time at varying timestep values:&lt;br /&gt;
&lt;br /&gt;
[[File:Equil Energy.png|thumb|800px|none]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from the graphs that for timestep = 0.001, 0.0025 and 0.0075, the energy reaches a stable equilibrium but for timestep = 0.01 and timestep = 0.015, the energy slowly decreases and rapidly increases, respectively, indicating that the results of the simulation are not very accurate for these values of timestep. Timestep = 0.015 is especially bad as it very obviously does not reach an equilibrium.&lt;br /&gt;
&lt;br /&gt;
Therefore, timestep = 0.0075 would be the ideal value as it provides the highest accuracy, while running the simulation for a suitably long time to provide realistic results.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions (NpT) ==&lt;br /&gt;
&lt;br /&gt;
=== Temperature and Pressure Control ===&lt;br /&gt;
&lt;br /&gt;
Pressures chosen: 2.61, 2.63&lt;br /&gt;
&lt;br /&gt;
Temperatures chosen: 1.5, 1.6, 1.7, 1.8, 1.9&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 was chosen to provide the highest accuracy possible, without shortening the simulation time too much.&lt;br /&gt;
&lt;br /&gt;
In our simulation, the temperature was controlled by solving the two following equations for the instantaneous temperature &amp;lt;math&amp;gt;T,&amp;lt;/math&amp;gt; which fluctuates.&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 \qquad\qquad\qquad(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order for &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; to reach our target temperature &amp;lt;math&amp;gt;\mathfrak{T},&amp;lt;/math&amp;gt; we introduce a constant &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; to control the velocity such that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}\qquad\qquad(2)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can solve eq. &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt; to solve for &amp;lt;math&amp;gt;\gamma.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\sum_i m_i v_i^2 = 3N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substituting &amp;lt;math&amp;gt;\sum_i m_i v_i^2&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 3 N k_b T = 3N k_b \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\epsilon}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Examining the Input Script ===&lt;br /&gt;
&lt;br /&gt;
To calculate the average values for our simulation, we set certain parameters for LAMMPS in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time Nevery Nrepeat Nfreq&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Final averages are generated on timesteps that are multiples of Nevery, for Nrepeat number of times and an average is generated every Nfreq timesteps.&lt;br /&gt;
&lt;br /&gt;
In our script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The results are sampled at every 100 timesteps for 1000 times (100, 200, 300, etc.) Averages are generated every 100,000 timesteps, but our simulation runs for the same amount of time so only one average is generated from this code.&lt;br /&gt;
&lt;br /&gt;
The timestep chosen for this section of the experiment was 0.0025. Therefore, the simulation was run for &amp;lt;math&amp;gt;100000 \times 0.0025 = 250 \text{ unit time}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equations of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:Density Temp.png|700px]]&lt;br /&gt;
&lt;br /&gt;
The graph above shows the density of the simulated liquid against temperature, compared with the densities derived from the ideal gas law.&lt;br /&gt;
&lt;br /&gt;
It can be seen that within the ranges set for this simulation, the discrepancy between the simulated densities compared to the calculated densities are very high, to the point that the error bars for the y-axis is not even visible on the graph. Perhaps a more accurate simulation could have been run if a wider temperature and pressure ranges were selected.&lt;br /&gt;
&lt;br /&gt;
With the data range being one possible source of error between the simulation and the ideal gas law prediction, another possible factor is that the parameters set for this simulation are such that the repulsive force of the Lennard-Jones interaction is more significant than the attractive force. Since the ideal gas law assumes no electronic interaction between the particles, introducing a repulsive force would result in the density of the liquid being lower than the prediction.&lt;br /&gt;
&lt;br /&gt;
The most likely explanation, however, is that the ideal gas law, as its name suggests, is not very good at predicting the behavious of liquids. While both gas and liquid phases are fluids, there are major differences between them such as a much more prominent long-range order effect in liquids compared to gases.&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacity ==&lt;br /&gt;
&lt;br /&gt;
[[File:HeatCap vs Density.png|thumb|800px|Graph of &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; against Temperature|none]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From thermodynamics:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;dU = TdS - PdV&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = T\frac{\partial S}{\partial T}-P\frac{\partial V}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and since &amp;lt;math&amp;gt;\frac{\partial S}{\partial T}\geq 0,&amp;lt;/math&amp;gt; heat capacity should increase with increasing temperature.&lt;br /&gt;
&lt;br /&gt;
The fact that &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; decreases with increasing temperature suggests that either the increase in temperature is causing the internal energy to increase at a faster rate than itself, or that there are issues with the simulation originating from possible sources such as small sampling size (number of atoms generated) or short run time.&lt;br /&gt;
&lt;br /&gt;
== Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
[[File:RDF SHL.png|thumb|700px]]&lt;br /&gt;
&lt;br /&gt;
It can be noticed that the three phases have clearly different Radial Distribution Functions (RDF) from each other and this can be attributed to the varying degrees of order each of the phases have: the atoms in the gas phase are completely free to move around, while atoms in the liquid phase have less freedom and in the solid phase, the atoms are set in a lattice, with only vibrational motion and no (or negligible) translational motion.&lt;br /&gt;
&lt;br /&gt;
In order to explain the graph, let us consider the RDF to be displaying the &amp;quot;effective density&amp;quot; of atoms in an area of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; at a distance &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; from a certain reference atom.&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf schematic.jpg|thumb|200px|Schematic of RDF|left]]&lt;br /&gt;
&lt;br /&gt;
There are three main parts to the RDF graphs: the region near the origin where the &amp;lt;math&amp;gt;\mathrm{RDF} = 0&amp;lt;/math&amp;gt;, the region after where there are big peaks and troughs, and the final region where the graphs have mostly reached equilibrium.&lt;br /&gt;
&lt;br /&gt;
First of all, the region near the origin is 0 for all three phases as that is still within the volume of the reference atom, and hence there are no other atoms in that radius.&lt;br /&gt;
&lt;br /&gt;
The peaks in the second region indicate that there is a higher &amp;quot;effective density&amp;quot; of atoms. The explanation for this is different for the lattice structure (solid) and the fluids (liquid and gas).&lt;br /&gt;
&lt;br /&gt;
For the liquid and gas phase, the peaks are due to the attractive force caused by the Lennard-Jones potential. We have calculated above [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:SUNG95#Lennard-Jones_Potential (1.2 LJ Potential)] that &amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}.&amp;lt;/math&amp;gt; Setting &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt; (as we have in our input file), we get &amp;lt;math&amp;gt;r_{eq} = 1.122&amp;lt;/math&amp;gt;, which is very close to where the largest peaks are for the two fluid phases.&lt;br /&gt;
&lt;br /&gt;
Then for the solid, where all the atoms are in a lattice structure, the effects due to the Lennard-Jones interaction becomes neglibigle. Instead, there will be certain values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where the effective density is higher than the overall density of the sample (the peaks), and some values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where it is lower than the density of the sample (the troughs). This is arisen from the fact that as the value of in a similar fashion to the schematic on the left.&lt;br /&gt;
&lt;br /&gt;
As the value of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the total volume covered by &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; also increases. But since all the atoms are set in place by the lattice, the number of atoms that &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; encompasses stays relatively constant. As a result, the peaks and the troughs tend 1 with increasing &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the case of the gas phase, the atoms are completely free to move around and the RDF graph can be entirely attributed to the effects of the L-J interaction. This justifies the lack of troughs for this phase. Furthermore, as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the attractive part of the L-J interaction &amp;lt;math&amp;gt;\frac{1}{r^6}&amp;lt;/math&amp;gt; gets exponentially smaller and quickly becomes negligible - RDF reaches equilibrium.&lt;br /&gt;
&lt;br /&gt;
Finally, the liquid phase can be considered to act as a mix between the solid phase and the gas phase: the L-J interactions are significant enough to reach equilibrium at a rate similar to the gas phase, but there exists an ordering of the atoms such that there are values of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; where the effective density is lower than the overall density.&lt;br /&gt;
&lt;br /&gt;
From the RDF of the solid phase, each of the peaks point to a certain lattice point. Simple geometrical calculations can be done to indicate that the first peak, which is the lattice point (1) closest to the reference atom (O), is at a separation of &amp;lt;math&amp;gt;\mathrm{r}=1.056.&amp;lt;/math&amp;gt; Second closest point (2) is at a distance of &amp;lt;math&amp;gt;\mathrm{r}=1.4938&amp;lt;/math&amp;gt; and the third (3) at &amp;lt;math&amp;gt;\mathrm{r}=1.8295.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:FCC-SHL.png|thumb|Face-centered cubic lattice|none]]&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
=== Mean Squared Displacement ===&lt;br /&gt;
&lt;br /&gt;
The Mean Squared Displacement can be used to find the Diffusion Coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, via the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plotting the mean squared displacement (MSD) against time, then finding the linear gradient would give us the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:MSD-SHL.png|thumb|600px|none]][[File:MSD Mill SHL.png|thumb|600px|none]]&lt;br /&gt;
&lt;br /&gt;
Graphical analysis showed that the last 1,000 timesteps are suitably linear to apply this equation, and the Diffusion Coefficients for the three different phases were found from the last 1,000 timesteps. Results were as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Diffusion Coefficients&lt;br /&gt;
! Phase !! &amp;lt;math&amp;gt;D \text{ (unit area/unit time)}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Gas || 6.05&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 0.0855&lt;br /&gt;
|-&lt;br /&gt;
| Solid || 0.000896&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These values make sense logically since gases diffuse the easiest (highest diffusion coefficient), metals practically do not diffuse (very small diffusion coefficient) and liquid is somewhere in the middle.&lt;br /&gt;
&lt;br /&gt;
=== Velocity Autocorrelation Function ===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can also be calculated from the Velocity Autocorrelation Function, or VACF.&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;
From the 1D Harmonic Oscillator:&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;
Differentiating this gives the velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = -A\omega \sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting this into the integrated form of the VAFC:&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) \cdot A \omega \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(A \omega \sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, from the trigonometric identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin \left(\alpha + \beta \right)= \sin\alpha\cos\beta + \sin\beta\cos\alpha,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(\omega t + \phi + \omega\tau\right) = \sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \left(\sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\cos\left(\omega \tau\right) + \int_{-\infty}^{\infty} \sin \left(\omega \tau\right) \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt; is a constant so &amp;lt;math&amp;gt;\cos\left(\omega\tau\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sin\left(\omega\tau\right)&amp;lt;/math&amp;gt; can be taken out of the integral.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\cos\left(\omega \tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) + \sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; can cancel out:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\sin(x)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;\cos(x)&amp;lt;/math&amp;gt; is an even function, &amp;lt;math&amp;gt;\sin(x)\cos(x)&amp;lt;/math&amp;gt; is an odd function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; is an odd function (While the value of &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; can change whether or not the functions are even or odd, it shifts both functions by the same amount and the resulting &amp;lt;math&amp;gt;\cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; will still be odd)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}=\cos\left(\omega \tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\cos\left(\omega \tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF-SHL.png|thumb|800px|Comparison of Normalised VACF with VACF of Liquid and Solid|left]]&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:MSD_Mill_SHL.png&amp;diff=560636</id>
		<title>File:MSD Mill SHL.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:MSD_Mill_SHL.png&amp;diff=560636"/>
		<updated>2016-10-21T08:20:04Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:MSD-SHL.png&amp;diff=560634</id>
		<title>File:MSD-SHL.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:MSD-SHL.png&amp;diff=560634"/>
		<updated>2016-10-21T08:19:44Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560571</id>
		<title>Rep:Mod:SUNG95</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560571"/>
		<updated>2016-10-21T07:29:41Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: /* The Velocity-Verlet Algorithm */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Theory ==&lt;br /&gt;
=== The Velocity-Verlet Algorithm ===&lt;br /&gt;
[[File:Verlet-Velocity.png|thumb|700px|x(t) derived from the velocity-Verlet algorithm compared with the position of the classical harmonic oscillator.|left]]&lt;br /&gt;
[[File:Verlet-Energy.png|thumb|700px|Total energy of the system with respect to time|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Verlet-Error.png|thumb|700px|The error derived by comparing the solution of the velocity-Verlet algorithm with the position of the classical harmonic oscillator|none]]&lt;br /&gt;
&lt;br /&gt;
The three graphs above display the position of an atom, the total energy of the system and the error between the two methods of calculating the atom position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Error wrt Time.png|thumb|600px|Maximum Error against Time|none]]&lt;br /&gt;
&lt;br /&gt;
From this graph of Maximum error vs Time, we can see that error increases with time at a stable linear rate.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Running the same calculations with varying timesteps show the importance of choosing the right value of the timestep:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Energy at t=0.05.png|Energy at timestep=0.05&lt;br /&gt;
Image:Energy at t=0.5.png|Energy at timestep=0.5&lt;br /&gt;
Image:Error at t=0.5.png|Error at timestep=0.5&lt;br /&gt;
Image:Error at t=0.05.png|Error at timestep=0.05&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examining the four additional graphs above, we can notice that a shorter timestep is able to provide a smaller value of error and that the energy fluctuates less than a bigger value of timestep. However, a shorter timestep results in a shorter simulation type, which can result in a less realistic simulation. It is therefore important to find the right balance between the two.&lt;br /&gt;
&lt;br /&gt;
Through trial and error, it has been found that timestep = 0.2850 or lower results in an energy fluctuation that is smaller than 1% over the course of the simulation. A small fluctuation in energy indicates higher resemblance to reality as technically the total energy should not fluctuate at all due to the Law of Conservation of Energy.&lt;br /&gt;
&lt;br /&gt;
=== Lennard-Jones Potential ===&lt;br /&gt;
The equation to calculate the Lennard-Jones potential is as follows:&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;
By equating this to 0, we find that the &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the separation at which the potential is 0, is &amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We can then find the force at this separation by differentiating the Lennard-Jones potential with respect to r, and substituting in &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}=\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24 \frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation (&amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;) is the separation of the particles at equilibrium, and represents the separation at which the potential energy is at a minimum. It can thus be found by setting &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}&amp;lt;/math&amp;gt;, (or &amp;lt;math&amp;gt;\mathbf{F}&amp;lt;/math&amp;gt;) to 0.&lt;br /&gt;
&lt;br /&gt;
Hence,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right) 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; gives us the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To put this equation into perspective, let us calculate the L-J potential for some realistic cutoff values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int 4\epsilon \left(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=4 \epsilon \left(\frac{\sigma^{12}}{11r^{11}}-\frac{\sigma^6}{5r^5}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\lim_{r\rightarrow \infty} 4 \left(\frac{1^{12}}{11r^{11}}-\frac{1^6}{5r^5}\right) - 4\left(\frac{1^{12}}{11\times 2^{11}}+\frac{1^6}{5\times 2^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=0-0.024822\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following the same calculations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0081767\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0032901\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
It is very difficult to simulate realistic volumes of liquid and in the scope of this experiment, we have simulated liquids with N (number of atoms) between 1,000 and 10,000. To demonstrate why simulating realistic volumes of liquid is difficult, let us first calculate the number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
(Assuming: Standard conditions; Density of water = 1.00 g/ml)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.00 \mathrm{ml} = 1.00 \mathrm{g}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;18.02 \mathrm{g/mol} = 0.0555 \text{ mols of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.0555 \times 6.022 \times 10^{23} = 3.34 \times 10^{22} \text{ molecules of water.}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the other hand, 10,000 water molecules is only &amp;lt;math&amp;gt;2.99 \times 10^{-19} \text{ ml of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus, in order to be able to complete the simulation in a practical amount of time, we place our atoms in a box that is repeated in all directions, similar to how unit cells repeat themselves in a lattice. When an atom crosses the boundary of the box, its replica enters the same box from the other side, thus keeping the total number of atoms in the box constant.&lt;br /&gt;
&lt;br /&gt;
For example, if an atom at position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a cubic box ranging from &amp;lt;math&amp;gt;(0, 0, 0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;, its final position would be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;, if the periodic boundary conditions have been applied.&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units ===&lt;br /&gt;
The LAMMPS calculations run in this experiment are all done in reduced units&lt;br /&gt;
&lt;br /&gt;
For example, the Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34 \mathrm{nm}&amp;lt;/math&amp;gt;; &amp;lt;math&amp;gt;\epsilon/k_B=120K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If we set the cutoff to be &amp;lt;math&amp;gt;r*=3.2,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=3.2\times0.34=1.088\mathrm{nm}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Well depth: &amp;lt;math&amp;gt;\epsilon=120K\times k_B \times 6.02 \times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon=0.998 \mathrm{kJ/mol}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and reduced temperature &amp;lt;math&amp;gt;T*=1.5&amp;lt;/math&amp;gt; would be &amp;lt;math&amp;gt;T=1.5 \times 120=180\mathrm{K}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
=== Creating Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
In order to simulate a liquid for this experiment, we first create a crystal lattice, then melt that lattice to create a liquid. This is preferable to generating a liquid since assigning a random position for each new atom could result in two or more atoms being generated in the same space, causing an error when running the simulation.&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is one lattice point per unit cell. Hence, if the number density is 0.8,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8 \text{ points/volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sqrt[3]{0.8}=0.9283\text{ points/length}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.9283^{-1}=1.0772 \text{ length/point}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is thus 1.0772 unit lengths of spacing between each point.&lt;br /&gt;
&lt;br /&gt;
Following the same logic, a face-centred cubic lattice (with 4 lattice points per unit cell) with a density of 1.2 would have a spacing of &amp;lt;math&amp;gt;0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\because \sqrt[3]{4.8^{-1}}=0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, the simple cubic lattice with a density of 0.8 would create 1,000 atoms in the given constraints of the box:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;region box block 0 10 0 10 0 10&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and a face centred cubic lattice with a density of 1.2 would create 4,000 atoms in the same box.&lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of the Atoms ===&lt;br /&gt;
In the input script, there are the following lines describing the properties of the atoms:&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;
In the first line, we are setting the mass of type 1 atoms (which includes all of the atoms in our simulation box, as we have created only one type of atoms) as &amp;lt;math&amp;gt;1.0&amp;lt;/math&amp;gt;, in reduced units. The second line defines the interaction between the atoms as a Lenard-Jones interaction, with a cutoff distance of &amp;lt;math&amp;gt;3.0 \text{ units.}&amp;lt;/math&amp;gt; Finally, the last line defines the coefficient in the Lenard-Jones interaction; the asterisk tells LAMMPS that the coefficients apply to all atoms in our system; the first coefficient is &amp;lt;math&amp;gt;\epsilon=1.0&amp;lt;/math&amp;gt; and the second coefficient is &amp;lt;math&amp;gt;\sigma=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After setting the properties of the atoms, we also defined the initial positions and the initial velocities for the atoms in the input script. Since we have both the &amp;lt;math&amp;gt;\mathbf{x}_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, we can use the Velocity-Verlet integration algorithm that employs the half-step method.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
In the following lines from the input script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we created and reset a variable called timestep to equal 0.001, then used that value to calculate how many runs (${n_steps}) to carry out. This is more beneficial than simply setting&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;
as it allows us to only change the value of the timestep variable to alter the number of runs, rather than having to calculate ${n_steps} ourselves every time we change the timestep, especially in cases such as this computational experiment where the timestep was changed multiple times.&lt;br /&gt;
&lt;br /&gt;
=== Checking Equilibration ===&lt;br /&gt;
&lt;br /&gt;
[[File:TotalE at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Temp at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Press at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
&lt;br /&gt;
These graphs have been plotted to ensure that the simulation reaches equilibrium, and we can see that indeed, they do, and very quickly. Analysis of the graphs show that equilibrium is reached before 1 timestep.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
The following graph shows the total energy of the system against time at varying timestep values:&lt;br /&gt;
&lt;br /&gt;
[[File:Equil Energy.png|thumb|800px|none]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from the graphs that for timestep = 0.001, 0.0025 and 0.0075, the energy reaches a stable equilibrium but for timestep = 0.01 and timestep = 0.015, the energy slowly decreases and rapidly increases, respectively, indicating that the results of the simulation are not very accurate for these values of timestep. Timestep = 0.015 is especially bad as it very obviously does not reach an equilibrium.&lt;br /&gt;
&lt;br /&gt;
Therefore, timestep = 0.0075 would be the ideal value as it provides the highest accuracy, while running the simulation for a suitably long time to provide realistic results.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions (NpT) ==&lt;br /&gt;
&lt;br /&gt;
=== Temperature and Pressure Control ===&lt;br /&gt;
&lt;br /&gt;
Pressures chosen: 2.61, 2.63&lt;br /&gt;
&lt;br /&gt;
Temperatures chosen: 1.5, 1.6, 1.7, 1.8, 1.9&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 was chosen to provide the highest accuracy possible, without shortening the simulation time too much.&lt;br /&gt;
&lt;br /&gt;
In our simulation, the temperature was controlled by solving the two following equations for the instantaneous temperature &amp;lt;math&amp;gt;T,&amp;lt;/math&amp;gt; which fluctuates.&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 \qquad\qquad\qquad(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order for &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; to reach our target temperature &amp;lt;math&amp;gt;\mathfrak{T},&amp;lt;/math&amp;gt; we introduce a constant &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; to control the velocity such that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}\qquad\qquad(2)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can solve eq. &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt; to solve for &amp;lt;math&amp;gt;\gamma.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\sum_i m_i v_i^2 = 3N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substituting &amp;lt;math&amp;gt;\sum_i m_i v_i^2&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 3 N k_b T = 3N k_b \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\epsilon}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Examining the Input Script ===&lt;br /&gt;
&lt;br /&gt;
To calculate the average values for our simulation, we set certain parameters for LAMMPS in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time Nevery Nrepeat Nfreq&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Final averages are generated on timesteps that are multiples of Nevery, for Nrepeat number of times and an average is generated every Nfreq timesteps.&lt;br /&gt;
&lt;br /&gt;
In our script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The results are sampled at every 100 timesteps for 1000 times (100, 200, 300, etc.) Averages are generated every 100,000 timesteps, but our simulation runs for the same amount of time so only one average is generated from this code.&lt;br /&gt;
&lt;br /&gt;
The timestep chosen for this section of the experiment was 0.0025. Therefore, the simulation was run for &amp;lt;math&amp;gt;100000 \times 0.0025 = 250 \text{ unit time}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equations of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:Density Temp.png|700px]]&lt;br /&gt;
&lt;br /&gt;
The graph above shows the density of the simulated liquid against temperature, compared with the densities derived from the ideal gas law.&lt;br /&gt;
&lt;br /&gt;
It can be seen that within the ranges set for this simulation, the discrepancy between the simulated densities compared to the calculated densities are very high, to the point that the error bars for the y-axis is not even visible on the graph. Perhaps a more accurate simulation could have been run if a wider temperature and pressure ranges were selected.&lt;br /&gt;
&lt;br /&gt;
With the data range being one possible source of error between the simulation and the ideal gas law prediction, another possible factor is that the parameters set for this simulation are such that the repulsive force of the Lennard-Jones interaction is more significant than the attractive force. Since the ideal gas law assumes no electronic interaction between the particles, introducing a repulsive force would result in the density of the liquid being lower than the prediction.&lt;br /&gt;
&lt;br /&gt;
The most likely explanation, however, is that the ideal gas law, as its name suggests, is not very good at predicting the behavious of liquids. While both gas and liquid phases are fluids, there are major differences between them such as a much more prominent long-range order effect in liquids compared to gases.&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacity ==&lt;br /&gt;
&lt;br /&gt;
[[File:HeatCap vs Density.png|thumb|800px|Graph of &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; against Temperature|none]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From thermodynamics:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;dU = TdS - PdV&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = T\frac{\partial S}{\partial T}-P\frac{\partial V}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and since &amp;lt;math&amp;gt;\frac{\partial S}{\partial T}\geq 0,&amp;lt;/math&amp;gt; heat capacity should increase with increasing temperature.&lt;br /&gt;
&lt;br /&gt;
The fact that &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; decreases with increasing temperature suggests that either the increase in temperature is causing the internal energy to increase at a faster rate than itself, or that there are issues with the simulation originating from possible sources such as small sampling size (number of atoms generated) or short run time.&lt;br /&gt;
&lt;br /&gt;
== Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
[[File:RDF SHL.png|thumb|700px]]&lt;br /&gt;
&lt;br /&gt;
It can be noticed that the three phases have clearly different Radial Distribution Functions (RDF) from each other and this can be attributed to the varying degrees of order each of the phases have: the atoms in the gas phase are completely free to move around, while atoms in the liquid phase have less freedom and in the solid phase, the atoms are set in a lattice, with only vibrational motion and no (or negligible) translational motion.&lt;br /&gt;
&lt;br /&gt;
In order to explain the graph, let us consider the RDF to be displaying the &amp;quot;effective density&amp;quot; of atoms in an area of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; at a distance &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; from a certain reference atom.&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf schematic.jpg|thumb|200px|Schematic of RDF|left]]&lt;br /&gt;
&lt;br /&gt;
There are three main parts to the RDF graphs: the region near the origin where the &amp;lt;math&amp;gt;\mathrm{RDF} = 0&amp;lt;/math&amp;gt;, the region after where there are big peaks and troughs, and the final region where the graphs have mostly reached equilibrium.&lt;br /&gt;
&lt;br /&gt;
First of all, the region near the origin is 0 for all three phases as that is still within the volume of the reference atom, and hence there are no other atoms in that radius.&lt;br /&gt;
&lt;br /&gt;
The peaks in the second region indicate that there is a higher &amp;quot;effective density&amp;quot; of atoms. The explanation for this is different for the lattice structure (solid) and the fluids (liquid and gas).&lt;br /&gt;
&lt;br /&gt;
For the liquid and gas phase, the peaks are due to the attractive force caused by the Lennard-Jones potential. We have calculated above [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:SUNG95#Lennard-Jones_Potential (1.2 LJ Potential)] that &amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}.&amp;lt;/math&amp;gt; Setting &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt; (as we have in our input file), we get &amp;lt;math&amp;gt;r_{eq} = 1.122&amp;lt;/math&amp;gt;, which is very close to where the largest peaks are for the two fluid phases.&lt;br /&gt;
&lt;br /&gt;
Then for the solid, where all the atoms are in a lattice structure, the effects due to the Lennard-Jones interaction becomes neglibigle. Instead, there will be certain values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where the effective density is higher than the overall density of the sample (the peaks), and some values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where it is lower than the density of the sample (the troughs). This is arisen from the fact that as the value of in a similar fashion to the schematic on the left.&lt;br /&gt;
&lt;br /&gt;
As the value of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the total volume covered by &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; also increases. But since all the atoms are set in place by the lattice, the number of atoms that &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; encompasses stays relatively constant. As a result, the peaks and the troughs tend 1 with increasing &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the case of the gas phase, the atoms are completely free to move around and the RDF graph can be entirely attributed to the effects of the L-J interaction. This justifies the lack of troughs for this phase. Furthermore, as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the attractive part of the L-J interaction &amp;lt;math&amp;gt;\frac{1}{r^6}&amp;lt;/math&amp;gt; gets exponentially smaller and quickly becomes negligible - RDF reaches equilibrium.&lt;br /&gt;
&lt;br /&gt;
Finally, the liquid phase can be considered to act as a mix between the solid phase and the gas phase: the L-J interactions are significant enough to reach equilibrium at a rate similar to the gas phase, but there exists an ordering of the atoms such that there are values of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; where the effective density is lower than the overall density.&lt;br /&gt;
&lt;br /&gt;
From the RDF of the solid phase, each of the peaks point to a certain lattice point. Simple geometrical calculations can be done to indicate that the first peak, which is the lattice point (1) closest to the reference atom (O), is at a separation of &amp;lt;math&amp;gt;\mathrm{r}=1.056.&amp;lt;/math&amp;gt; Second closest point (2) is at a distance of &amp;lt;math&amp;gt;\mathrm{r}=1.4938&amp;lt;/math&amp;gt; and the third (3) at &amp;lt;math&amp;gt;\mathrm{r}=1.8295.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:FCC-SHL.png|thumb|Face-centered cubic lattice|none]]&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
=== Mean Squared Displacement ===&lt;br /&gt;
&lt;br /&gt;
=== Velocity Autocorrelation Function ===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can also be calculated from the Velocity Autocorrelation Function, or VACF.&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;
From the 1D Harmonic Oscillator:&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;
Differentiating this gives the velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = -A\omega \sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting this into the integrated form of the VAFC:&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) \cdot A \omega \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(A \omega \sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, from the trigonometric identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin \left(\alpha + \beta \right)= \sin\alpha\cos\beta + \sin\beta\cos\alpha,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(\omega t + \phi + \omega\tau\right) = \sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \left(\sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\cos\left(\omega \tau\right) + \int_{-\infty}^{\infty} \sin \left(\omega \tau\right) \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt; is a constant so &amp;lt;math&amp;gt;\cos\left(\omega\tau\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sin\left(\omega\tau\right)&amp;lt;/math&amp;gt; can be taken out of the integral.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\cos\left(\omega \tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) + \sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; can cancel out:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\sin(x)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;\cos(x)&amp;lt;/math&amp;gt; is an even function, &amp;lt;math&amp;gt;\sin(x)\cos(x)&amp;lt;/math&amp;gt; is an odd function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; is an odd function (While the value of &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; can change whether or not the functions are even or odd, it shifts both functions by the same amount and the resulting &amp;lt;math&amp;gt;\cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; will still be odd)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}=\cos\left(\omega \tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\cos\left(\omega \tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF-SHL.png|thumb|800px|Comparison of Normalised VACF with VACF of Liquid and Solid|left]]&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560568</id>
		<title>Rep:Mod:SUNG95</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560568"/>
		<updated>2016-10-21T07:25:59Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: /* Velocity Autocorrelation Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Theory ==&lt;br /&gt;
=== The Velocity-Verlet Algorithm ===&lt;br /&gt;
[[File:Verlet-Velocity.png|thumb|700px|x(t) derived from the velocity-Verlet algorithm compared with the position of the classical harmonic oscillator.|left]]&lt;br /&gt;
[[File:Verlet-Energy.png|thumb|700px|Total energy of the system with respect to time|right]]&lt;br /&gt;
[[File:Verlet-Error.png|thumb|700px|The error derived by comparing the solution of the velocity-Verlet algorithm with the position of the classical harmonic oscillator|none]]&lt;br /&gt;
&lt;br /&gt;
The three graphs above display the position of an atom, the total energy of the system and the error between the two methods of calculating the atom position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Error wrt Time.png|thumb|600px|Maximum Error against Time|none]]&lt;br /&gt;
&lt;br /&gt;
From this graph of Maximum error vs Time, we can see that error increases with time at a stable linear rate.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Running the same calculations with varying timesteps show the importance of choosing the right value of the timestep:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Energy at t=0.05.png|Energy at timestep=0.05&lt;br /&gt;
Image:Energy at t=0.5.png|Energy at timestep=0.5&lt;br /&gt;
Image:Error at t=0.5.png|Error at timestep=0.5&lt;br /&gt;
Image:Error at t=0.05.png|Error at timestep=0.05&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examining the four additional graphs above, we can notice that a shorter timestep is able to provide a smaller value of error and that the energy fluctuates less than a bigger value of timestep. However, a shorter timestep results in a shorter simulation type, which can result in a less realistic simulation. It is therefore important to find the right balance between the two.&lt;br /&gt;
&lt;br /&gt;
Through trial and error, it has been found that timestep = 0.2850 or lower results in an energy fluctuation that is smaller than 1% over the course of the simulation. A small fluctuation in energy indicates higher resemblance to reality as technically the total energy should not fluctuate at all due to the Law of Conservation of Energy.&lt;br /&gt;
&lt;br /&gt;
=== Lennard-Jones Potential ===&lt;br /&gt;
The equation to calculate the Lennard-Jones potential is as follows:&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;
By equating this to 0, we find that the &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the separation at which the potential is 0, is &amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We can then find the force at this separation by differentiating the Lennard-Jones potential with respect to r, and substituting in &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}=\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24 \frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation (&amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;) is the separation of the particles at equilibrium, and represents the separation at which the potential energy is at a minimum. It can thus be found by setting &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}&amp;lt;/math&amp;gt;, (or &amp;lt;math&amp;gt;\mathbf{F}&amp;lt;/math&amp;gt;) to 0.&lt;br /&gt;
&lt;br /&gt;
Hence,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right) 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; gives us the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To put this equation into perspective, let us calculate the L-J potential for some realistic cutoff values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int 4\epsilon \left(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=4 \epsilon \left(\frac{\sigma^{12}}{11r^{11}}-\frac{\sigma^6}{5r^5}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\lim_{r\rightarrow \infty} 4 \left(\frac{1^{12}}{11r^{11}}-\frac{1^6}{5r^5}\right) - 4\left(\frac{1^{12}}{11\times 2^{11}}+\frac{1^6}{5\times 2^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=0-0.024822\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following the same calculations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0081767\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0032901\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
It is very difficult to simulate realistic volumes of liquid and in the scope of this experiment, we have simulated liquids with N (number of atoms) between 1,000 and 10,000. To demonstrate why simulating realistic volumes of liquid is difficult, let us first calculate the number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
(Assuming: Standard conditions; Density of water = 1.00 g/ml)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.00 \mathrm{ml} = 1.00 \mathrm{g}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;18.02 \mathrm{g/mol} = 0.0555 \text{ mols of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.0555 \times 6.022 \times 10^{23} = 3.34 \times 10^{22} \text{ molecules of water.}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the other hand, 10,000 water molecules is only &amp;lt;math&amp;gt;2.99 \times 10^{-19} \text{ ml of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus, in order to be able to complete the simulation in a practical amount of time, we place our atoms in a box that is repeated in all directions, similar to how unit cells repeat themselves in a lattice. When an atom crosses the boundary of the box, its replica enters the same box from the other side, thus keeping the total number of atoms in the box constant.&lt;br /&gt;
&lt;br /&gt;
For example, if an atom at position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a cubic box ranging from &amp;lt;math&amp;gt;(0, 0, 0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;, its final position would be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;, if the periodic boundary conditions have been applied.&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units ===&lt;br /&gt;
The LAMMPS calculations run in this experiment are all done in reduced units&lt;br /&gt;
&lt;br /&gt;
For example, the Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34 \mathrm{nm}&amp;lt;/math&amp;gt;; &amp;lt;math&amp;gt;\epsilon/k_B=120K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If we set the cutoff to be &amp;lt;math&amp;gt;r*=3.2,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=3.2\times0.34=1.088\mathrm{nm}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Well depth: &amp;lt;math&amp;gt;\epsilon=120K\times k_B \times 6.02 \times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon=0.998 \mathrm{kJ/mol}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and reduced temperature &amp;lt;math&amp;gt;T*=1.5&amp;lt;/math&amp;gt; would be &amp;lt;math&amp;gt;T=1.5 \times 120=180\mathrm{K}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
=== Creating Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
In order to simulate a liquid for this experiment, we first create a crystal lattice, then melt that lattice to create a liquid. This is preferable to generating a liquid since assigning a random position for each new atom could result in two or more atoms being generated in the same space, causing an error when running the simulation.&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is one lattice point per unit cell. Hence, if the number density is 0.8,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8 \text{ points/volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sqrt[3]{0.8}=0.9283\text{ points/length}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.9283^{-1}=1.0772 \text{ length/point}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is thus 1.0772 unit lengths of spacing between each point.&lt;br /&gt;
&lt;br /&gt;
Following the same logic, a face-centred cubic lattice (with 4 lattice points per unit cell) with a density of 1.2 would have a spacing of &amp;lt;math&amp;gt;0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\because \sqrt[3]{4.8^{-1}}=0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, the simple cubic lattice with a density of 0.8 would create 1,000 atoms in the given constraints of the box:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;region box block 0 10 0 10 0 10&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and a face centred cubic lattice with a density of 1.2 would create 4,000 atoms in the same box.&lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of the Atoms ===&lt;br /&gt;
In the input script, there are the following lines describing the properties of the atoms:&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;
In the first line, we are setting the mass of type 1 atoms (which includes all of the atoms in our simulation box, as we have created only one type of atoms) as &amp;lt;math&amp;gt;1.0&amp;lt;/math&amp;gt;, in reduced units. The second line defines the interaction between the atoms as a Lenard-Jones interaction, with a cutoff distance of &amp;lt;math&amp;gt;3.0 \text{ units.}&amp;lt;/math&amp;gt; Finally, the last line defines the coefficient in the Lenard-Jones interaction; the asterisk tells LAMMPS that the coefficients apply to all atoms in our system; the first coefficient is &amp;lt;math&amp;gt;\epsilon=1.0&amp;lt;/math&amp;gt; and the second coefficient is &amp;lt;math&amp;gt;\sigma=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After setting the properties of the atoms, we also defined the initial positions and the initial velocities for the atoms in the input script. Since we have both the &amp;lt;math&amp;gt;\mathbf{x}_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, we can use the Velocity-Verlet integration algorithm that employs the half-step method.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
In the following lines from the input script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we created and reset a variable called timestep to equal 0.001, then used that value to calculate how many runs (${n_steps}) to carry out. This is more beneficial than simply setting&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;
as it allows us to only change the value of the timestep variable to alter the number of runs, rather than having to calculate ${n_steps} ourselves every time we change the timestep, especially in cases such as this computational experiment where the timestep was changed multiple times.&lt;br /&gt;
&lt;br /&gt;
=== Checking Equilibration ===&lt;br /&gt;
&lt;br /&gt;
[[File:TotalE at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Temp at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Press at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
&lt;br /&gt;
These graphs have been plotted to ensure that the simulation reaches equilibrium, and we can see that indeed, they do, and very quickly. Analysis of the graphs show that equilibrium is reached before 1 timestep.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
The following graph shows the total energy of the system against time at varying timestep values:&lt;br /&gt;
&lt;br /&gt;
[[File:Equil Energy.png|thumb|800px|none]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from the graphs that for timestep = 0.001, 0.0025 and 0.0075, the energy reaches a stable equilibrium but for timestep = 0.01 and timestep = 0.015, the energy slowly decreases and rapidly increases, respectively, indicating that the results of the simulation are not very accurate for these values of timestep. Timestep = 0.015 is especially bad as it very obviously does not reach an equilibrium.&lt;br /&gt;
&lt;br /&gt;
Therefore, timestep = 0.0075 would be the ideal value as it provides the highest accuracy, while running the simulation for a suitably long time to provide realistic results.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions (NpT) ==&lt;br /&gt;
&lt;br /&gt;
=== Temperature and Pressure Control ===&lt;br /&gt;
&lt;br /&gt;
Pressures chosen: 2.61, 2.63&lt;br /&gt;
&lt;br /&gt;
Temperatures chosen: 1.5, 1.6, 1.7, 1.8, 1.9&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 was chosen to provide the highest accuracy possible, without shortening the simulation time too much.&lt;br /&gt;
&lt;br /&gt;
In our simulation, the temperature was controlled by solving the two following equations for the instantaneous temperature &amp;lt;math&amp;gt;T,&amp;lt;/math&amp;gt; which fluctuates.&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 \qquad\qquad\qquad(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order for &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; to reach our target temperature &amp;lt;math&amp;gt;\mathfrak{T},&amp;lt;/math&amp;gt; we introduce a constant &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; to control the velocity such that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}\qquad\qquad(2)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can solve eq. &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt; to solve for &amp;lt;math&amp;gt;\gamma.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\sum_i m_i v_i^2 = 3N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substituting &amp;lt;math&amp;gt;\sum_i m_i v_i^2&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 3 N k_b T = 3N k_b \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\epsilon}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Examining the Input Script ===&lt;br /&gt;
&lt;br /&gt;
To calculate the average values for our simulation, we set certain parameters for LAMMPS in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time Nevery Nrepeat Nfreq&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Final averages are generated on timesteps that are multiples of Nevery, for Nrepeat number of times and an average is generated every Nfreq timesteps.&lt;br /&gt;
&lt;br /&gt;
In our script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The results are sampled at every 100 timesteps for 1000 times (100, 200, 300, etc.) Averages are generated every 100,000 timesteps, but our simulation runs for the same amount of time so only one average is generated from this code.&lt;br /&gt;
&lt;br /&gt;
The timestep chosen for this section of the experiment was 0.0025. Therefore, the simulation was run for &amp;lt;math&amp;gt;100000 \times 0.0025 = 250 \text{ unit time}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equations of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:Density Temp.png|700px]]&lt;br /&gt;
&lt;br /&gt;
The graph above shows the density of the simulated liquid against temperature, compared with the densities derived from the ideal gas law.&lt;br /&gt;
&lt;br /&gt;
It can be seen that within the ranges set for this simulation, the discrepancy between the simulated densities compared to the calculated densities are very high, to the point that the error bars for the y-axis is not even visible on the graph. Perhaps a more accurate simulation could have been run if a wider temperature and pressure ranges were selected.&lt;br /&gt;
&lt;br /&gt;
With the data range being one possible source of error between the simulation and the ideal gas law prediction, another possible factor is that the parameters set for this simulation are such that the repulsive force of the Lennard-Jones interaction is more significant than the attractive force. Since the ideal gas law assumes no electronic interaction between the particles, introducing a repulsive force would result in the density of the liquid being lower than the prediction.&lt;br /&gt;
&lt;br /&gt;
The most likely explanation, however, is that the ideal gas law, as its name suggests, is not very good at predicting the behavious of liquids. While both gas and liquid phases are fluids, there are major differences between them such as a much more prominent long-range order effect in liquids compared to gases.&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacity ==&lt;br /&gt;
&lt;br /&gt;
[[File:HeatCap vs Density.png|thumb|800px|Graph of &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; against Temperature|none]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From thermodynamics:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;dU = TdS - PdV&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = T\frac{\partial S}{\partial T}-P\frac{\partial V}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and since &amp;lt;math&amp;gt;\frac{\partial S}{\partial T}\geq 0,&amp;lt;/math&amp;gt; heat capacity should increase with increasing temperature.&lt;br /&gt;
&lt;br /&gt;
The fact that &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; decreases with increasing temperature suggests that either the increase in temperature is causing the internal energy to increase at a faster rate than itself, or that there are issues with the simulation originating from possible sources such as small sampling size (number of atoms generated) or short run time.&lt;br /&gt;
&lt;br /&gt;
== Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
[[File:RDF SHL.png|thumb|700px]]&lt;br /&gt;
&lt;br /&gt;
It can be noticed that the three phases have clearly different Radial Distribution Functions (RDF) from each other and this can be attributed to the varying degrees of order each of the phases have: the atoms in the gas phase are completely free to move around, while atoms in the liquid phase have less freedom and in the solid phase, the atoms are set in a lattice, with only vibrational motion and no (or negligible) translational motion.&lt;br /&gt;
&lt;br /&gt;
In order to explain the graph, let us consider the RDF to be displaying the &amp;quot;effective density&amp;quot; of atoms in an area of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; at a distance &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; from a certain reference atom.&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf schematic.jpg|thumb|200px|Schematic of RDF|left]]&lt;br /&gt;
&lt;br /&gt;
There are three main parts to the RDF graphs: the region near the origin where the &amp;lt;math&amp;gt;\mathrm{RDF} = 0&amp;lt;/math&amp;gt;, the region after where there are big peaks and troughs, and the final region where the graphs have mostly reached equilibrium.&lt;br /&gt;
&lt;br /&gt;
First of all, the region near the origin is 0 for all three phases as that is still within the volume of the reference atom, and hence there are no other atoms in that radius.&lt;br /&gt;
&lt;br /&gt;
The peaks in the second region indicate that there is a higher &amp;quot;effective density&amp;quot; of atoms. The explanation for this is different for the lattice structure (solid) and the fluids (liquid and gas).&lt;br /&gt;
&lt;br /&gt;
For the liquid and gas phase, the peaks are due to the attractive force caused by the Lennard-Jones potential. We have calculated above [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:SUNG95#Lennard-Jones_Potential (1.2 LJ Potential)] that &amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}.&amp;lt;/math&amp;gt; Setting &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt; (as we have in our input file), we get &amp;lt;math&amp;gt;r_{eq} = 1.122&amp;lt;/math&amp;gt;, which is very close to where the largest peaks are for the two fluid phases.&lt;br /&gt;
&lt;br /&gt;
Then for the solid, where all the atoms are in a lattice structure, the effects due to the Lennard-Jones interaction becomes neglibigle. Instead, there will be certain values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where the effective density is higher than the overall density of the sample (the peaks), and some values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where it is lower than the density of the sample (the troughs). This is arisen from the fact that as the value of in a similar fashion to the schematic on the left.&lt;br /&gt;
&lt;br /&gt;
As the value of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the total volume covered by &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; also increases. But since all the atoms are set in place by the lattice, the number of atoms that &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; encompasses stays relatively constant. As a result, the peaks and the troughs tend 1 with increasing &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the case of the gas phase, the atoms are completely free to move around and the RDF graph can be entirely attributed to the effects of the L-J interaction. This justifies the lack of troughs for this phase. Furthermore, as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the attractive part of the L-J interaction &amp;lt;math&amp;gt;\frac{1}{r^6}&amp;lt;/math&amp;gt; gets exponentially smaller and quickly becomes negligible - RDF reaches equilibrium.&lt;br /&gt;
&lt;br /&gt;
Finally, the liquid phase can be considered to act as a mix between the solid phase and the gas phase: the L-J interactions are significant enough to reach equilibrium at a rate similar to the gas phase, but there exists an ordering of the atoms such that there are values of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; where the effective density is lower than the overall density.&lt;br /&gt;
&lt;br /&gt;
From the RDF of the solid phase, each of the peaks point to a certain lattice point. Simple geometrical calculations can be done to indicate that the first peak, which is the lattice point (1) closest to the reference atom (O), is at a separation of &amp;lt;math&amp;gt;\mathrm{r}=1.056.&amp;lt;/math&amp;gt; Second closest point (2) is at a distance of &amp;lt;math&amp;gt;\mathrm{r}=1.4938&amp;lt;/math&amp;gt; and the third (3) at &amp;lt;math&amp;gt;\mathrm{r}=1.8295.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:FCC-SHL.png|thumb|Face-centered cubic lattice|none]]&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
=== Mean Squared Displacement ===&lt;br /&gt;
&lt;br /&gt;
=== Velocity Autocorrelation Function ===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can also be calculated from the Velocity Autocorrelation Function, or VACF.&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;
From the 1D Harmonic Oscillator:&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;
Differentiating this gives the velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = -A\omega \sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting this into the integrated form of the VAFC:&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) \cdot A \omega \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(A \omega \sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, from the trigonometric identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin \left(\alpha + \beta \right)= \sin\alpha\cos\beta + \sin\beta\cos\alpha,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(\omega t + \phi + \omega\tau\right) = \sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \left(\sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\cos\left(\omega \tau\right) + \int_{-\infty}^{\infty} \sin \left(\omega \tau\right) \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt; is a constant so &amp;lt;math&amp;gt;\cos\left(\omega\tau\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sin\left(\omega\tau\right)&amp;lt;/math&amp;gt; can be taken out of the integral.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\cos\left(\omega \tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) + \sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; can cancel out:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\sin(x)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;\cos(x)&amp;lt;/math&amp;gt; is an even function, &amp;lt;math&amp;gt;\sin(x)\cos(x)&amp;lt;/math&amp;gt; is an odd function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; is an odd function (While the value of &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; can change whether or not the functions are even or odd, it shifts both functions by the same amount and the resulting &amp;lt;math&amp;gt;\cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; will still be odd)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}=\cos\left(\omega \tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\cos\left(\omega \tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF-SHL.png|thumb|800px|Comparison of Normalised VACF with VACF of Liquid and Solid|left]]&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:VACF-SHL.png&amp;diff=560567</id>
		<title>File:VACF-SHL.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:VACF-SHL.png&amp;diff=560567"/>
		<updated>2016-10-21T07:24:19Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560563</id>
		<title>Rep:Mod:SUNG95</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560563"/>
		<updated>2016-10-21T07:18:26Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: /* Calculating Heat Capacity */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Theory ==&lt;br /&gt;
=== The Velocity-Verlet Algorithm ===&lt;br /&gt;
[[File:Verlet-Velocity.png|thumb|700px|x(t) derived from the velocity-Verlet algorithm compared with the position of the classical harmonic oscillator.|left]]&lt;br /&gt;
[[File:Verlet-Energy.png|thumb|700px|Total energy of the system with respect to time|right]]&lt;br /&gt;
[[File:Verlet-Error.png|thumb|700px|The error derived by comparing the solution of the velocity-Verlet algorithm with the position of the classical harmonic oscillator|none]]&lt;br /&gt;
&lt;br /&gt;
The three graphs above display the position of an atom, the total energy of the system and the error between the two methods of calculating the atom position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Error wrt Time.png|thumb|600px|Maximum Error against Time|none]]&lt;br /&gt;
&lt;br /&gt;
From this graph of Maximum error vs Time, we can see that error increases with time at a stable linear rate.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Running the same calculations with varying timesteps show the importance of choosing the right value of the timestep:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Energy at t=0.05.png|Energy at timestep=0.05&lt;br /&gt;
Image:Energy at t=0.5.png|Energy at timestep=0.5&lt;br /&gt;
Image:Error at t=0.5.png|Error at timestep=0.5&lt;br /&gt;
Image:Error at t=0.05.png|Error at timestep=0.05&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examining the four additional graphs above, we can notice that a shorter timestep is able to provide a smaller value of error and that the energy fluctuates less than a bigger value of timestep. However, a shorter timestep results in a shorter simulation type, which can result in a less realistic simulation. It is therefore important to find the right balance between the two.&lt;br /&gt;
&lt;br /&gt;
Through trial and error, it has been found that timestep = 0.2850 or lower results in an energy fluctuation that is smaller than 1% over the course of the simulation. A small fluctuation in energy indicates higher resemblance to reality as technically the total energy should not fluctuate at all due to the Law of Conservation of Energy.&lt;br /&gt;
&lt;br /&gt;
=== Lennard-Jones Potential ===&lt;br /&gt;
The equation to calculate the Lennard-Jones potential is as follows:&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;
By equating this to 0, we find that the &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the separation at which the potential is 0, is &amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We can then find the force at this separation by differentiating the Lennard-Jones potential with respect to r, and substituting in &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}=\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24 \frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation (&amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;) is the separation of the particles at equilibrium, and represents the separation at which the potential energy is at a minimum. It can thus be found by setting &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}&amp;lt;/math&amp;gt;, (or &amp;lt;math&amp;gt;\mathbf{F}&amp;lt;/math&amp;gt;) to 0.&lt;br /&gt;
&lt;br /&gt;
Hence,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right) 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; gives us the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To put this equation into perspective, let us calculate the L-J potential for some realistic cutoff values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int 4\epsilon \left(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=4 \epsilon \left(\frac{\sigma^{12}}{11r^{11}}-\frac{\sigma^6}{5r^5}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\lim_{r\rightarrow \infty} 4 \left(\frac{1^{12}}{11r^{11}}-\frac{1^6}{5r^5}\right) - 4\left(\frac{1^{12}}{11\times 2^{11}}+\frac{1^6}{5\times 2^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=0-0.024822\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following the same calculations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0081767\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0032901\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
It is very difficult to simulate realistic volumes of liquid and in the scope of this experiment, we have simulated liquids with N (number of atoms) between 1,000 and 10,000. To demonstrate why simulating realistic volumes of liquid is difficult, let us first calculate the number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
(Assuming: Standard conditions; Density of water = 1.00 g/ml)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.00 \mathrm{ml} = 1.00 \mathrm{g}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;18.02 \mathrm{g/mol} = 0.0555 \text{ mols of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.0555 \times 6.022 \times 10^{23} = 3.34 \times 10^{22} \text{ molecules of water.}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the other hand, 10,000 water molecules is only &amp;lt;math&amp;gt;2.99 \times 10^{-19} \text{ ml of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus, in order to be able to complete the simulation in a practical amount of time, we place our atoms in a box that is repeated in all directions, similar to how unit cells repeat themselves in a lattice. When an atom crosses the boundary of the box, its replica enters the same box from the other side, thus keeping the total number of atoms in the box constant.&lt;br /&gt;
&lt;br /&gt;
For example, if an atom at position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a cubic box ranging from &amp;lt;math&amp;gt;(0, 0, 0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;, its final position would be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;, if the periodic boundary conditions have been applied.&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units ===&lt;br /&gt;
The LAMMPS calculations run in this experiment are all done in reduced units&lt;br /&gt;
&lt;br /&gt;
For example, the Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34 \mathrm{nm}&amp;lt;/math&amp;gt;; &amp;lt;math&amp;gt;\epsilon/k_B=120K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If we set the cutoff to be &amp;lt;math&amp;gt;r*=3.2,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=3.2\times0.34=1.088\mathrm{nm}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Well depth: &amp;lt;math&amp;gt;\epsilon=120K\times k_B \times 6.02 \times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon=0.998 \mathrm{kJ/mol}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and reduced temperature &amp;lt;math&amp;gt;T*=1.5&amp;lt;/math&amp;gt; would be &amp;lt;math&amp;gt;T=1.5 \times 120=180\mathrm{K}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
=== Creating Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
In order to simulate a liquid for this experiment, we first create a crystal lattice, then melt that lattice to create a liquid. This is preferable to generating a liquid since assigning a random position for each new atom could result in two or more atoms being generated in the same space, causing an error when running the simulation.&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is one lattice point per unit cell. Hence, if the number density is 0.8,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8 \text{ points/volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sqrt[3]{0.8}=0.9283\text{ points/length}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.9283^{-1}=1.0772 \text{ length/point}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is thus 1.0772 unit lengths of spacing between each point.&lt;br /&gt;
&lt;br /&gt;
Following the same logic, a face-centred cubic lattice (with 4 lattice points per unit cell) with a density of 1.2 would have a spacing of &amp;lt;math&amp;gt;0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\because \sqrt[3]{4.8^{-1}}=0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, the simple cubic lattice with a density of 0.8 would create 1,000 atoms in the given constraints of the box:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;region box block 0 10 0 10 0 10&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and a face centred cubic lattice with a density of 1.2 would create 4,000 atoms in the same box.&lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of the Atoms ===&lt;br /&gt;
In the input script, there are the following lines describing the properties of the atoms:&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;
In the first line, we are setting the mass of type 1 atoms (which includes all of the atoms in our simulation box, as we have created only one type of atoms) as &amp;lt;math&amp;gt;1.0&amp;lt;/math&amp;gt;, in reduced units. The second line defines the interaction between the atoms as a Lenard-Jones interaction, with a cutoff distance of &amp;lt;math&amp;gt;3.0 \text{ units.}&amp;lt;/math&amp;gt; Finally, the last line defines the coefficient in the Lenard-Jones interaction; the asterisk tells LAMMPS that the coefficients apply to all atoms in our system; the first coefficient is &amp;lt;math&amp;gt;\epsilon=1.0&amp;lt;/math&amp;gt; and the second coefficient is &amp;lt;math&amp;gt;\sigma=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After setting the properties of the atoms, we also defined the initial positions and the initial velocities for the atoms in the input script. Since we have both the &amp;lt;math&amp;gt;\mathbf{x}_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, we can use the Velocity-Verlet integration algorithm that employs the half-step method.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
In the following lines from the input script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we created and reset a variable called timestep to equal 0.001, then used that value to calculate how many runs (${n_steps}) to carry out. This is more beneficial than simply setting&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;
as it allows us to only change the value of the timestep variable to alter the number of runs, rather than having to calculate ${n_steps} ourselves every time we change the timestep, especially in cases such as this computational experiment where the timestep was changed multiple times.&lt;br /&gt;
&lt;br /&gt;
=== Checking Equilibration ===&lt;br /&gt;
&lt;br /&gt;
[[File:TotalE at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Temp at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Press at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
&lt;br /&gt;
These graphs have been plotted to ensure that the simulation reaches equilibrium, and we can see that indeed, they do, and very quickly. Analysis of the graphs show that equilibrium is reached before 1 timestep.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
The following graph shows the total energy of the system against time at varying timestep values:&lt;br /&gt;
&lt;br /&gt;
[[File:Equil Energy.png|thumb|800px|none]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from the graphs that for timestep = 0.001, 0.0025 and 0.0075, the energy reaches a stable equilibrium but for timestep = 0.01 and timestep = 0.015, the energy slowly decreases and rapidly increases, respectively, indicating that the results of the simulation are not very accurate for these values of timestep. Timestep = 0.015 is especially bad as it very obviously does not reach an equilibrium.&lt;br /&gt;
&lt;br /&gt;
Therefore, timestep = 0.0075 would be the ideal value as it provides the highest accuracy, while running the simulation for a suitably long time to provide realistic results.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions (NpT) ==&lt;br /&gt;
&lt;br /&gt;
=== Temperature and Pressure Control ===&lt;br /&gt;
&lt;br /&gt;
Pressures chosen: 2.61, 2.63&lt;br /&gt;
&lt;br /&gt;
Temperatures chosen: 1.5, 1.6, 1.7, 1.8, 1.9&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 was chosen to provide the highest accuracy possible, without shortening the simulation time too much.&lt;br /&gt;
&lt;br /&gt;
In our simulation, the temperature was controlled by solving the two following equations for the instantaneous temperature &amp;lt;math&amp;gt;T,&amp;lt;/math&amp;gt; which fluctuates.&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 \qquad\qquad\qquad(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order for &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; to reach our target temperature &amp;lt;math&amp;gt;\mathfrak{T},&amp;lt;/math&amp;gt; we introduce a constant &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; to control the velocity such that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}\qquad\qquad(2)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can solve eq. &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt; to solve for &amp;lt;math&amp;gt;\gamma.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\sum_i m_i v_i^2 = 3N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substituting &amp;lt;math&amp;gt;\sum_i m_i v_i^2&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 3 N k_b T = 3N k_b \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\epsilon}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Examining the Input Script ===&lt;br /&gt;
&lt;br /&gt;
To calculate the average values for our simulation, we set certain parameters for LAMMPS in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time Nevery Nrepeat Nfreq&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Final averages are generated on timesteps that are multiples of Nevery, for Nrepeat number of times and an average is generated every Nfreq timesteps.&lt;br /&gt;
&lt;br /&gt;
In our script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The results are sampled at every 100 timesteps for 1000 times (100, 200, 300, etc.) Averages are generated every 100,000 timesteps, but our simulation runs for the same amount of time so only one average is generated from this code.&lt;br /&gt;
&lt;br /&gt;
The timestep chosen for this section of the experiment was 0.0025. Therefore, the simulation was run for &amp;lt;math&amp;gt;100000 \times 0.0025 = 250 \text{ unit time}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equations of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:Density Temp.png|700px]]&lt;br /&gt;
&lt;br /&gt;
The graph above shows the density of the simulated liquid against temperature, compared with the densities derived from the ideal gas law.&lt;br /&gt;
&lt;br /&gt;
It can be seen that within the ranges set for this simulation, the discrepancy between the simulated densities compared to the calculated densities are very high, to the point that the error bars for the y-axis is not even visible on the graph. Perhaps a more accurate simulation could have been run if a wider temperature and pressure ranges were selected.&lt;br /&gt;
&lt;br /&gt;
With the data range being one possible source of error between the simulation and the ideal gas law prediction, another possible factor is that the parameters set for this simulation are such that the repulsive force of the Lennard-Jones interaction is more significant than the attractive force. Since the ideal gas law assumes no electronic interaction between the particles, introducing a repulsive force would result in the density of the liquid being lower than the prediction.&lt;br /&gt;
&lt;br /&gt;
The most likely explanation, however, is that the ideal gas law, as its name suggests, is not very good at predicting the behavious of liquids. While both gas and liquid phases are fluids, there are major differences between them such as a much more prominent long-range order effect in liquids compared to gases.&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacity ==&lt;br /&gt;
&lt;br /&gt;
[[File:HeatCap vs Density.png|thumb|800px|Graph of &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; against Temperature|none]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From thermodynamics:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;dU = TdS - PdV&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = T\frac{\partial S}{\partial T}-P\frac{\partial V}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and since &amp;lt;math&amp;gt;\frac{\partial S}{\partial T}\geq 0,&amp;lt;/math&amp;gt; heat capacity should increase with increasing temperature.&lt;br /&gt;
&lt;br /&gt;
The fact that &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; decreases with increasing temperature suggests that either the increase in temperature is causing the internal energy to increase at a faster rate than itself, or that there are issues with the simulation originating from possible sources such as small sampling size (number of atoms generated) or short run time.&lt;br /&gt;
&lt;br /&gt;
== Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
[[File:RDF SHL.png|thumb|700px]]&lt;br /&gt;
&lt;br /&gt;
It can be noticed that the three phases have clearly different Radial Distribution Functions (RDF) from each other and this can be attributed to the varying degrees of order each of the phases have: the atoms in the gas phase are completely free to move around, while atoms in the liquid phase have less freedom and in the solid phase, the atoms are set in a lattice, with only vibrational motion and no (or negligible) translational motion.&lt;br /&gt;
&lt;br /&gt;
In order to explain the graph, let us consider the RDF to be displaying the &amp;quot;effective density&amp;quot; of atoms in an area of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; at a distance &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; from a certain reference atom.&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf schematic.jpg|thumb|200px|Schematic of RDF|left]]&lt;br /&gt;
&lt;br /&gt;
There are three main parts to the RDF graphs: the region near the origin where the &amp;lt;math&amp;gt;\mathrm{RDF} = 0&amp;lt;/math&amp;gt;, the region after where there are big peaks and troughs, and the final region where the graphs have mostly reached equilibrium.&lt;br /&gt;
&lt;br /&gt;
First of all, the region near the origin is 0 for all three phases as that is still within the volume of the reference atom, and hence there are no other atoms in that radius.&lt;br /&gt;
&lt;br /&gt;
The peaks in the second region indicate that there is a higher &amp;quot;effective density&amp;quot; of atoms. The explanation for this is different for the lattice structure (solid) and the fluids (liquid and gas).&lt;br /&gt;
&lt;br /&gt;
For the liquid and gas phase, the peaks are due to the attractive force caused by the Lennard-Jones potential. We have calculated above [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:SUNG95#Lennard-Jones_Potential (1.2 LJ Potential)] that &amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}.&amp;lt;/math&amp;gt; Setting &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt; (as we have in our input file), we get &amp;lt;math&amp;gt;r_{eq} = 1.122&amp;lt;/math&amp;gt;, which is very close to where the largest peaks are for the two fluid phases.&lt;br /&gt;
&lt;br /&gt;
Then for the solid, where all the atoms are in a lattice structure, the effects due to the Lennard-Jones interaction becomes neglibigle. Instead, there will be certain values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where the effective density is higher than the overall density of the sample (the peaks), and some values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where it is lower than the density of the sample (the troughs). This is arisen from the fact that as the value of in a similar fashion to the schematic on the left.&lt;br /&gt;
&lt;br /&gt;
As the value of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the total volume covered by &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; also increases. But since all the atoms are set in place by the lattice, the number of atoms that &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; encompasses stays relatively constant. As a result, the peaks and the troughs tend 1 with increasing &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the case of the gas phase, the atoms are completely free to move around and the RDF graph can be entirely attributed to the effects of the L-J interaction. This justifies the lack of troughs for this phase. Furthermore, as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the attractive part of the L-J interaction &amp;lt;math&amp;gt;\frac{1}{r^6}&amp;lt;/math&amp;gt; gets exponentially smaller and quickly becomes negligible - RDF reaches equilibrium.&lt;br /&gt;
&lt;br /&gt;
Finally, the liquid phase can be considered to act as a mix between the solid phase and the gas phase: the L-J interactions are significant enough to reach equilibrium at a rate similar to the gas phase, but there exists an ordering of the atoms such that there are values of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; where the effective density is lower than the overall density.&lt;br /&gt;
&lt;br /&gt;
From the RDF of the solid phase, each of the peaks point to a certain lattice point. Simple geometrical calculations can be done to indicate that the first peak, which is the lattice point (1) closest to the reference atom (O), is at a separation of &amp;lt;math&amp;gt;\mathrm{r}=1.056.&amp;lt;/math&amp;gt; Second closest point (2) is at a distance of &amp;lt;math&amp;gt;\mathrm{r}=1.4938&amp;lt;/math&amp;gt; and the third (3) at &amp;lt;math&amp;gt;\mathrm{r}=1.8295.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:FCC-SHL.png|thumb|Face-centered cubic lattice|none]]&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
=== Mean Squared Displacement ===&lt;br /&gt;
&lt;br /&gt;
=== Velocity Autocorrelation Function ===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can also be calculated from the Velocity Autocorrelation Function, or VACF.&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;
From the 1D Harmonic Oscillator:&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;
Differentiating this gives the velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = -A\omega \sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting this into the integrated form of the VAFC:&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) \cdot A \omega \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(A \omega \sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, from the trigonometric identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin \left(\alpha + \beta \right)= \sin\alpha\cos\beta + \sin\beta\cos\alpha,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(\omega t + \phi + \omega\tau\right) = \sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \left(\sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\cos\left(\omega \tau\right) + \int_{-\infty}^{\infty} \sin \left(\omega \tau\right) \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt; is a constant so &amp;lt;math&amp;gt;\cos\left(\omega\tau\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sin\left(\omega\tau\right)&amp;lt;/math&amp;gt; can be taken out of the integral.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\cos\left(\omega \tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) + \sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; can cancel out:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\sin(x)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;\cos(x)&amp;lt;/math&amp;gt; is an even function, &amp;lt;math&amp;gt;\sin(x)\cos(x)&amp;lt;/math&amp;gt; is an odd function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; is an odd function (While the value of &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; can change whether or not the functions are even or odd, it shifts both functions by the same amount and the resulting &amp;lt;math&amp;gt;\cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; will still be odd)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}=\cos\left(\omega \tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\cos\left(\omega \tau\right)&amp;lt;/math&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560562</id>
		<title>Rep:Mod:SUNG95</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560562"/>
		<updated>2016-10-21T07:17:32Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: /* Checking Equilibration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Theory ==&lt;br /&gt;
=== The Velocity-Verlet Algorithm ===&lt;br /&gt;
[[File:Verlet-Velocity.png|thumb|700px|x(t) derived from the velocity-Verlet algorithm compared with the position of the classical harmonic oscillator.|left]]&lt;br /&gt;
[[File:Verlet-Energy.png|thumb|700px|Total energy of the system with respect to time|right]]&lt;br /&gt;
[[File:Verlet-Error.png|thumb|700px|The error derived by comparing the solution of the velocity-Verlet algorithm with the position of the classical harmonic oscillator|none]]&lt;br /&gt;
&lt;br /&gt;
The three graphs above display the position of an atom, the total energy of the system and the error between the two methods of calculating the atom position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Error wrt Time.png|thumb|600px|Maximum Error against Time|none]]&lt;br /&gt;
&lt;br /&gt;
From this graph of Maximum error vs Time, we can see that error increases with time at a stable linear rate.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Running the same calculations with varying timesteps show the importance of choosing the right value of the timestep:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Energy at t=0.05.png|Energy at timestep=0.05&lt;br /&gt;
Image:Energy at t=0.5.png|Energy at timestep=0.5&lt;br /&gt;
Image:Error at t=0.5.png|Error at timestep=0.5&lt;br /&gt;
Image:Error at t=0.05.png|Error at timestep=0.05&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examining the four additional graphs above, we can notice that a shorter timestep is able to provide a smaller value of error and that the energy fluctuates less than a bigger value of timestep. However, a shorter timestep results in a shorter simulation type, which can result in a less realistic simulation. It is therefore important to find the right balance between the two.&lt;br /&gt;
&lt;br /&gt;
Through trial and error, it has been found that timestep = 0.2850 or lower results in an energy fluctuation that is smaller than 1% over the course of the simulation. A small fluctuation in energy indicates higher resemblance to reality as technically the total energy should not fluctuate at all due to the Law of Conservation of Energy.&lt;br /&gt;
&lt;br /&gt;
=== Lennard-Jones Potential ===&lt;br /&gt;
The equation to calculate the Lennard-Jones potential is as follows:&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;
By equating this to 0, we find that the &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the separation at which the potential is 0, is &amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We can then find the force at this separation by differentiating the Lennard-Jones potential with respect to r, and substituting in &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}=\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24 \frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation (&amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;) is the separation of the particles at equilibrium, and represents the separation at which the potential energy is at a minimum. It can thus be found by setting &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}&amp;lt;/math&amp;gt;, (or &amp;lt;math&amp;gt;\mathbf{F}&amp;lt;/math&amp;gt;) to 0.&lt;br /&gt;
&lt;br /&gt;
Hence,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right) 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; gives us the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To put this equation into perspective, let us calculate the L-J potential for some realistic cutoff values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int 4\epsilon \left(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=4 \epsilon \left(\frac{\sigma^{12}}{11r^{11}}-\frac{\sigma^6}{5r^5}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\lim_{r\rightarrow \infty} 4 \left(\frac{1^{12}}{11r^{11}}-\frac{1^6}{5r^5}\right) - 4\left(\frac{1^{12}}{11\times 2^{11}}+\frac{1^6}{5\times 2^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=0-0.024822\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following the same calculations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0081767\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0032901\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
It is very difficult to simulate realistic volumes of liquid and in the scope of this experiment, we have simulated liquids with N (number of atoms) between 1,000 and 10,000. To demonstrate why simulating realistic volumes of liquid is difficult, let us first calculate the number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
(Assuming: Standard conditions; Density of water = 1.00 g/ml)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.00 \mathrm{ml} = 1.00 \mathrm{g}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;18.02 \mathrm{g/mol} = 0.0555 \text{ mols of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.0555 \times 6.022 \times 10^{23} = 3.34 \times 10^{22} \text{ molecules of water.}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the other hand, 10,000 water molecules is only &amp;lt;math&amp;gt;2.99 \times 10^{-19} \text{ ml of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus, in order to be able to complete the simulation in a practical amount of time, we place our atoms in a box that is repeated in all directions, similar to how unit cells repeat themselves in a lattice. When an atom crosses the boundary of the box, its replica enters the same box from the other side, thus keeping the total number of atoms in the box constant.&lt;br /&gt;
&lt;br /&gt;
For example, if an atom at position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a cubic box ranging from &amp;lt;math&amp;gt;(0, 0, 0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;, its final position would be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;, if the periodic boundary conditions have been applied.&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units ===&lt;br /&gt;
The LAMMPS calculations run in this experiment are all done in reduced units&lt;br /&gt;
&lt;br /&gt;
For example, the Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34 \mathrm{nm}&amp;lt;/math&amp;gt;; &amp;lt;math&amp;gt;\epsilon/k_B=120K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If we set the cutoff to be &amp;lt;math&amp;gt;r*=3.2,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=3.2\times0.34=1.088\mathrm{nm}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Well depth: &amp;lt;math&amp;gt;\epsilon=120K\times k_B \times 6.02 \times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon=0.998 \mathrm{kJ/mol}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and reduced temperature &amp;lt;math&amp;gt;T*=1.5&amp;lt;/math&amp;gt; would be &amp;lt;math&amp;gt;T=1.5 \times 120=180\mathrm{K}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
=== Creating Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
In order to simulate a liquid for this experiment, we first create a crystal lattice, then melt that lattice to create a liquid. This is preferable to generating a liquid since assigning a random position for each new atom could result in two or more atoms being generated in the same space, causing an error when running the simulation.&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is one lattice point per unit cell. Hence, if the number density is 0.8,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8 \text{ points/volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sqrt[3]{0.8}=0.9283\text{ points/length}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.9283^{-1}=1.0772 \text{ length/point}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is thus 1.0772 unit lengths of spacing between each point.&lt;br /&gt;
&lt;br /&gt;
Following the same logic, a face-centred cubic lattice (with 4 lattice points per unit cell) with a density of 1.2 would have a spacing of &amp;lt;math&amp;gt;0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\because \sqrt[3]{4.8^{-1}}=0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, the simple cubic lattice with a density of 0.8 would create 1,000 atoms in the given constraints of the box:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;region box block 0 10 0 10 0 10&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and a face centred cubic lattice with a density of 1.2 would create 4,000 atoms in the same box.&lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of the Atoms ===&lt;br /&gt;
In the input script, there are the following lines describing the properties of the atoms:&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;
In the first line, we are setting the mass of type 1 atoms (which includes all of the atoms in our simulation box, as we have created only one type of atoms) as &amp;lt;math&amp;gt;1.0&amp;lt;/math&amp;gt;, in reduced units. The second line defines the interaction between the atoms as a Lenard-Jones interaction, with a cutoff distance of &amp;lt;math&amp;gt;3.0 \text{ units.}&amp;lt;/math&amp;gt; Finally, the last line defines the coefficient in the Lenard-Jones interaction; the asterisk tells LAMMPS that the coefficients apply to all atoms in our system; the first coefficient is &amp;lt;math&amp;gt;\epsilon=1.0&amp;lt;/math&amp;gt; and the second coefficient is &amp;lt;math&amp;gt;\sigma=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After setting the properties of the atoms, we also defined the initial positions and the initial velocities for the atoms in the input script. Since we have both the &amp;lt;math&amp;gt;\mathbf{x}_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, we can use the Velocity-Verlet integration algorithm that employs the half-step method.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
In the following lines from the input script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we created and reset a variable called timestep to equal 0.001, then used that value to calculate how many runs (${n_steps}) to carry out. This is more beneficial than simply setting&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;
as it allows us to only change the value of the timestep variable to alter the number of runs, rather than having to calculate ${n_steps} ourselves every time we change the timestep, especially in cases such as this computational experiment where the timestep was changed multiple times.&lt;br /&gt;
&lt;br /&gt;
=== Checking Equilibration ===&lt;br /&gt;
&lt;br /&gt;
[[File:TotalE at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Temp at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Press at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
&lt;br /&gt;
These graphs have been plotted to ensure that the simulation reaches equilibrium, and we can see that indeed, they do, and very quickly. Analysis of the graphs show that equilibrium is reached before 1 timestep.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
The following graph shows the total energy of the system against time at varying timestep values:&lt;br /&gt;
&lt;br /&gt;
[[File:Equil Energy.png|thumb|800px|none]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from the graphs that for timestep = 0.001, 0.0025 and 0.0075, the energy reaches a stable equilibrium but for timestep = 0.01 and timestep = 0.015, the energy slowly decreases and rapidly increases, respectively, indicating that the results of the simulation are not very accurate for these values of timestep. Timestep = 0.015 is especially bad as it very obviously does not reach an equilibrium.&lt;br /&gt;
&lt;br /&gt;
Therefore, timestep = 0.0075 would be the ideal value as it provides the highest accuracy, while running the simulation for a suitably long time to provide realistic results.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions (NpT) ==&lt;br /&gt;
&lt;br /&gt;
=== Temperature and Pressure Control ===&lt;br /&gt;
&lt;br /&gt;
Pressures chosen: 2.61, 2.63&lt;br /&gt;
&lt;br /&gt;
Temperatures chosen: 1.5, 1.6, 1.7, 1.8, 1.9&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 was chosen to provide the highest accuracy possible, without shortening the simulation time too much.&lt;br /&gt;
&lt;br /&gt;
In our simulation, the temperature was controlled by solving the two following equations for the instantaneous temperature &amp;lt;math&amp;gt;T,&amp;lt;/math&amp;gt; which fluctuates.&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 \qquad\qquad\qquad(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order for &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; to reach our target temperature &amp;lt;math&amp;gt;\mathfrak{T},&amp;lt;/math&amp;gt; we introduce a constant &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; to control the velocity such that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}\qquad\qquad(2)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can solve eq. &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt; to solve for &amp;lt;math&amp;gt;\gamma.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\sum_i m_i v_i^2 = 3N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substituting &amp;lt;math&amp;gt;\sum_i m_i v_i^2&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 3 N k_b T = 3N k_b \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\epsilon}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Examining the Input Script ===&lt;br /&gt;
&lt;br /&gt;
To calculate the average values for our simulation, we set certain parameters for LAMMPS in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time Nevery Nrepeat Nfreq&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Final averages are generated on timesteps that are multiples of Nevery, for Nrepeat number of times and an average is generated every Nfreq timesteps.&lt;br /&gt;
&lt;br /&gt;
In our script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The results are sampled at every 100 timesteps for 1000 times (100, 200, 300, etc.) Averages are generated every 100,000 timesteps, but our simulation runs for the same amount of time so only one average is generated from this code.&lt;br /&gt;
&lt;br /&gt;
The timestep chosen for this section of the experiment was 0.0025. Therefore, the simulation was run for &amp;lt;math&amp;gt;100000 \times 0.0025 = 250 \text{ unit time}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equations of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:Density Temp.png|700px]]&lt;br /&gt;
&lt;br /&gt;
The graph above shows the density of the simulated liquid against temperature, compared with the densities derived from the ideal gas law.&lt;br /&gt;
&lt;br /&gt;
It can be seen that within the ranges set for this simulation, the discrepancy between the simulated densities compared to the calculated densities are very high, to the point that the error bars for the y-axis is not even visible on the graph. Perhaps a more accurate simulation could have been run if a wider temperature and pressure ranges were selected.&lt;br /&gt;
&lt;br /&gt;
With the data range being one possible source of error between the simulation and the ideal gas law prediction, another possible factor is that the parameters set for this simulation are such that the repulsive force of the Lennard-Jones interaction is more significant than the attractive force. Since the ideal gas law assumes no electronic interaction between the particles, introducing a repulsive force would result in the density of the liquid being lower than the prediction.&lt;br /&gt;
&lt;br /&gt;
The most likely explanation, however, is that the ideal gas law, as its name suggests, is not very good at predicting the behavious of liquids. While both gas and liquid phases are fluids, there are major differences between them such as a much more prominent long-range order effect in liquids compared to gases.&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacity ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--To calculate the heat capacity of our simulated liquid, we investigated how much the energy of our system fluctuates with respect to temperature, according to the equation &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variance in energy can be derived from statistical thermodynamics: &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:HeatCap vs Density.png|thumb|800px|Graph of &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; against Temperature|none]]&lt;br /&gt;
&lt;br /&gt;
From thermodynamics:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;dU = TdS - PdV&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = T\frac{\partial S}{\partial T}-P\frac{\partial V}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and since &amp;lt;math&amp;gt;\frac{\partial S}{\partial T}\geq 0,&amp;lt;/math&amp;gt; heat capacity should increase with increasing temperature.&lt;br /&gt;
&lt;br /&gt;
The fact that &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; decreases with increasing temperature suggests that either the increase in temperature is causing the internal energy to increase at a faster rate than itself, or that there are issues with the simulation originating from possible sources such as small sampling size (number of atoms generated) or short run time.&lt;br /&gt;
&lt;br /&gt;
== Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
[[File:RDF SHL.png|thumb|700px]]&lt;br /&gt;
&lt;br /&gt;
It can be noticed that the three phases have clearly different Radial Distribution Functions (RDF) from each other and this can be attributed to the varying degrees of order each of the phases have: the atoms in the gas phase are completely free to move around, while atoms in the liquid phase have less freedom and in the solid phase, the atoms are set in a lattice, with only vibrational motion and no (or negligible) translational motion.&lt;br /&gt;
&lt;br /&gt;
In order to explain the graph, let us consider the RDF to be displaying the &amp;quot;effective density&amp;quot; of atoms in an area of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; at a distance &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; from a certain reference atom.&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf schematic.jpg|thumb|200px|Schematic of RDF|left]]&lt;br /&gt;
&lt;br /&gt;
There are three main parts to the RDF graphs: the region near the origin where the &amp;lt;math&amp;gt;\mathrm{RDF} = 0&amp;lt;/math&amp;gt;, the region after where there are big peaks and troughs, and the final region where the graphs have mostly reached equilibrium.&lt;br /&gt;
&lt;br /&gt;
First of all, the region near the origin is 0 for all three phases as that is still within the volume of the reference atom, and hence there are no other atoms in that radius.&lt;br /&gt;
&lt;br /&gt;
The peaks in the second region indicate that there is a higher &amp;quot;effective density&amp;quot; of atoms. The explanation for this is different for the lattice structure (solid) and the fluids (liquid and gas).&lt;br /&gt;
&lt;br /&gt;
For the liquid and gas phase, the peaks are due to the attractive force caused by the Lennard-Jones potential. We have calculated above [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:SUNG95#Lennard-Jones_Potential (1.2 LJ Potential)] that &amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}.&amp;lt;/math&amp;gt; Setting &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt; (as we have in our input file), we get &amp;lt;math&amp;gt;r_{eq} = 1.122&amp;lt;/math&amp;gt;, which is very close to where the largest peaks are for the two fluid phases.&lt;br /&gt;
&lt;br /&gt;
Then for the solid, where all the atoms are in a lattice structure, the effects due to the Lennard-Jones interaction becomes neglibigle. Instead, there will be certain values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where the effective density is higher than the overall density of the sample (the peaks), and some values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where it is lower than the density of the sample (the troughs). This is arisen from the fact that as the value of in a similar fashion to the schematic on the left.&lt;br /&gt;
&lt;br /&gt;
As the value of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the total volume covered by &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; also increases. But since all the atoms are set in place by the lattice, the number of atoms that &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; encompasses stays relatively constant. As a result, the peaks and the troughs tend 1 with increasing &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the case of the gas phase, the atoms are completely free to move around and the RDF graph can be entirely attributed to the effects of the L-J interaction. This justifies the lack of troughs for this phase. Furthermore, as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the attractive part of the L-J interaction &amp;lt;math&amp;gt;\frac{1}{r^6}&amp;lt;/math&amp;gt; gets exponentially smaller and quickly becomes negligible - RDF reaches equilibrium.&lt;br /&gt;
&lt;br /&gt;
Finally, the liquid phase can be considered to act as a mix between the solid phase and the gas phase: the L-J interactions are significant enough to reach equilibrium at a rate similar to the gas phase, but there exists an ordering of the atoms such that there are values of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; where the effective density is lower than the overall density.&lt;br /&gt;
&lt;br /&gt;
From the RDF of the solid phase, each of the peaks point to a certain lattice point. Simple geometrical calculations can be done to indicate that the first peak, which is the lattice point (1) closest to the reference atom (O), is at a separation of &amp;lt;math&amp;gt;\mathrm{r}=1.056.&amp;lt;/math&amp;gt; Second closest point (2) is at a distance of &amp;lt;math&amp;gt;\mathrm{r}=1.4938&amp;lt;/math&amp;gt; and the third (3) at &amp;lt;math&amp;gt;\mathrm{r}=1.8295.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:FCC-SHL.png|thumb|Face-centered cubic lattice|none]]&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
=== Mean Squared Displacement ===&lt;br /&gt;
&lt;br /&gt;
=== Velocity Autocorrelation Function ===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can also be calculated from the Velocity Autocorrelation Function, or VACF.&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;
From the 1D Harmonic Oscillator:&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;
Differentiating this gives the velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = -A\omega \sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting this into the integrated form of the VAFC:&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) \cdot A \omega \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(A \omega \sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, from the trigonometric identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin \left(\alpha + \beta \right)= \sin\alpha\cos\beta + \sin\beta\cos\alpha,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(\omega t + \phi + \omega\tau\right) = \sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \left(\sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\cos\left(\omega \tau\right) + \int_{-\infty}^{\infty} \sin \left(\omega \tau\right) \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt; is a constant so &amp;lt;math&amp;gt;\cos\left(\omega\tau\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sin\left(\omega\tau\right)&amp;lt;/math&amp;gt; can be taken out of the integral.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\cos\left(\omega \tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) + \sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; can cancel out:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\sin(x)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;\cos(x)&amp;lt;/math&amp;gt; is an even function, &amp;lt;math&amp;gt;\sin(x)\cos(x)&amp;lt;/math&amp;gt; is an odd function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; is an odd function (While the value of &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; can change whether or not the functions are even or odd, it shifts both functions by the same amount and the resulting &amp;lt;math&amp;gt;\cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; will still be odd)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}=\cos\left(\omega \tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\cos\left(\omega \tau\right)&amp;lt;/math&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560561</id>
		<title>Rep:Mod:SUNG95</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560561"/>
		<updated>2016-10-21T07:16:48Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: /* Checking Equilibration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Theory ==&lt;br /&gt;
=== The Velocity-Verlet Algorithm ===&lt;br /&gt;
[[File:Verlet-Velocity.png|thumb|700px|x(t) derived from the velocity-Verlet algorithm compared with the position of the classical harmonic oscillator.|left]]&lt;br /&gt;
[[File:Verlet-Energy.png|thumb|700px|Total energy of the system with respect to time|right]]&lt;br /&gt;
[[File:Verlet-Error.png|thumb|700px|The error derived by comparing the solution of the velocity-Verlet algorithm with the position of the classical harmonic oscillator|none]]&lt;br /&gt;
&lt;br /&gt;
The three graphs above display the position of an atom, the total energy of the system and the error between the two methods of calculating the atom position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Error wrt Time.png|thumb|600px|Maximum Error against Time|none]]&lt;br /&gt;
&lt;br /&gt;
From this graph of Maximum error vs Time, we can see that error increases with time at a stable linear rate.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Running the same calculations with varying timesteps show the importance of choosing the right value of the timestep:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Energy at t=0.05.png|Energy at timestep=0.05&lt;br /&gt;
Image:Energy at t=0.5.png|Energy at timestep=0.5&lt;br /&gt;
Image:Error at t=0.5.png|Error at timestep=0.5&lt;br /&gt;
Image:Error at t=0.05.png|Error at timestep=0.05&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examining the four additional graphs above, we can notice that a shorter timestep is able to provide a smaller value of error and that the energy fluctuates less than a bigger value of timestep. However, a shorter timestep results in a shorter simulation type, which can result in a less realistic simulation. It is therefore important to find the right balance between the two.&lt;br /&gt;
&lt;br /&gt;
Through trial and error, it has been found that timestep = 0.2850 or lower results in an energy fluctuation that is smaller than 1% over the course of the simulation. A small fluctuation in energy indicates higher resemblance to reality as technically the total energy should not fluctuate at all due to the Law of Conservation of Energy.&lt;br /&gt;
&lt;br /&gt;
=== Lennard-Jones Potential ===&lt;br /&gt;
The equation to calculate the Lennard-Jones potential is as follows:&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;
By equating this to 0, we find that the &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the separation at which the potential is 0, is &amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We can then find the force at this separation by differentiating the Lennard-Jones potential with respect to r, and substituting in &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}=\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24 \frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation (&amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;) is the separation of the particles at equilibrium, and represents the separation at which the potential energy is at a minimum. It can thus be found by setting &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}&amp;lt;/math&amp;gt;, (or &amp;lt;math&amp;gt;\mathbf{F}&amp;lt;/math&amp;gt;) to 0.&lt;br /&gt;
&lt;br /&gt;
Hence,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right) 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; gives us the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To put this equation into perspective, let us calculate the L-J potential for some realistic cutoff values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int 4\epsilon \left(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=4 \epsilon \left(\frac{\sigma^{12}}{11r^{11}}-\frac{\sigma^6}{5r^5}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\lim_{r\rightarrow \infty} 4 \left(\frac{1^{12}}{11r^{11}}-\frac{1^6}{5r^5}\right) - 4\left(\frac{1^{12}}{11\times 2^{11}}+\frac{1^6}{5\times 2^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=0-0.024822\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following the same calculations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0081767\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0032901\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
It is very difficult to simulate realistic volumes of liquid and in the scope of this experiment, we have simulated liquids with N (number of atoms) between 1,000 and 10,000. To demonstrate why simulating realistic volumes of liquid is difficult, let us first calculate the number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
(Assuming: Standard conditions; Density of water = 1.00 g/ml)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.00 \mathrm{ml} = 1.00 \mathrm{g}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;18.02 \mathrm{g/mol} = 0.0555 \text{ mols of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.0555 \times 6.022 \times 10^{23} = 3.34 \times 10^{22} \text{ molecules of water.}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the other hand, 10,000 water molecules is only &amp;lt;math&amp;gt;2.99 \times 10^{-19} \text{ ml of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus, in order to be able to complete the simulation in a practical amount of time, we place our atoms in a box that is repeated in all directions, similar to how unit cells repeat themselves in a lattice. When an atom crosses the boundary of the box, its replica enters the same box from the other side, thus keeping the total number of atoms in the box constant.&lt;br /&gt;
&lt;br /&gt;
For example, if an atom at position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a cubic box ranging from &amp;lt;math&amp;gt;(0, 0, 0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;, its final position would be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;, if the periodic boundary conditions have been applied.&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units ===&lt;br /&gt;
The LAMMPS calculations run in this experiment are all done in reduced units&lt;br /&gt;
&lt;br /&gt;
For example, the Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34 \mathrm{nm}&amp;lt;/math&amp;gt;; &amp;lt;math&amp;gt;\epsilon/k_B=120K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If we set the cutoff to be &amp;lt;math&amp;gt;r*=3.2,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=3.2\times0.34=1.088\mathrm{nm}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Well depth: &amp;lt;math&amp;gt;\epsilon=120K\times k_B \times 6.02 \times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon=0.998 \mathrm{kJ/mol}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and reduced temperature &amp;lt;math&amp;gt;T*=1.5&amp;lt;/math&amp;gt; would be &amp;lt;math&amp;gt;T=1.5 \times 120=180\mathrm{K}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
=== Creating Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
In order to simulate a liquid for this experiment, we first create a crystal lattice, then melt that lattice to create a liquid. This is preferable to generating a liquid since assigning a random position for each new atom could result in two or more atoms being generated in the same space, causing an error when running the simulation.&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is one lattice point per unit cell. Hence, if the number density is 0.8,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8 \text{ points/volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sqrt[3]{0.8}=0.9283\text{ points/length}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.9283^{-1}=1.0772 \text{ length/point}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is thus 1.0772 unit lengths of spacing between each point.&lt;br /&gt;
&lt;br /&gt;
Following the same logic, a face-centred cubic lattice (with 4 lattice points per unit cell) with a density of 1.2 would have a spacing of &amp;lt;math&amp;gt;0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\because \sqrt[3]{4.8^{-1}}=0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, the simple cubic lattice with a density of 0.8 would create 1,000 atoms in the given constraints of the box:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;region box block 0 10 0 10 0 10&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and a face centred cubic lattice with a density of 1.2 would create 4,000 atoms in the same box.&lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of the Atoms ===&lt;br /&gt;
In the input script, there are the following lines describing the properties of the atoms:&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;
In the first line, we are setting the mass of type 1 atoms (which includes all of the atoms in our simulation box, as we have created only one type of atoms) as &amp;lt;math&amp;gt;1.0&amp;lt;/math&amp;gt;, in reduced units. The second line defines the interaction between the atoms as a Lenard-Jones interaction, with a cutoff distance of &amp;lt;math&amp;gt;3.0 \text{ units.}&amp;lt;/math&amp;gt; Finally, the last line defines the coefficient in the Lenard-Jones interaction; the asterisk tells LAMMPS that the coefficients apply to all atoms in our system; the first coefficient is &amp;lt;math&amp;gt;\epsilon=1.0&amp;lt;/math&amp;gt; and the second coefficient is &amp;lt;math&amp;gt;\sigma=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After setting the properties of the atoms, we also defined the initial positions and the initial velocities for the atoms in the input script. Since we have both the &amp;lt;math&amp;gt;\mathbf{x}_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, we can use the Velocity-Verlet integration algorithm that employs the half-step method.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
In the following lines from the input script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we created and reset a variable called timestep to equal 0.001, then used that value to calculate how many runs (${n_steps}) to carry out. This is more beneficial than simply setting&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;
as it allows us to only change the value of the timestep variable to alter the number of runs, rather than having to calculate ${n_steps} ourselves every time we change the timestep, especially in cases such as this computational experiment where the timestep was changed multiple times.&lt;br /&gt;
&lt;br /&gt;
=== Checking Equilibration ===&lt;br /&gt;
&lt;br /&gt;
[[File:TotalE at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Temp at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Press at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
&lt;br /&gt;
These graphs have been plotted to ensure that the simulation reaches equilibrium, and we can see that indeed, they do, and very quickly. Analysis of the graphs show that equilibrium is reached before 1 unit time.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
The following graph shows the total energy of the system against time at varying timestep values:&lt;br /&gt;
&lt;br /&gt;
[[File:Equil Energy.png|thumb|800px|none]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from the graphs that for timestep = 0.001, 0.0025 and 0.0075, the energy reaches a stable equilibrium but for timestep = 0.01 and timestep = 0.015, the energy slowly decreases and rapidly increases, respectively, indicating that the results of the simulation are not very accurate for these values of timestep. Timestep = 0.015 is especially bad as it very obviously does not reach an equilibrium.&lt;br /&gt;
&lt;br /&gt;
Therefore, timestep = 0.0075 would be the ideal value as it provides the highest accuracy, while running the simulation for a suitably long time.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions (NpT) ==&lt;br /&gt;
&lt;br /&gt;
=== Temperature and Pressure Control ===&lt;br /&gt;
&lt;br /&gt;
Pressures chosen: 2.61, 2.63&lt;br /&gt;
&lt;br /&gt;
Temperatures chosen: 1.5, 1.6, 1.7, 1.8, 1.9&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 was chosen to provide the highest accuracy possible, without shortening the simulation time too much.&lt;br /&gt;
&lt;br /&gt;
In our simulation, the temperature was controlled by solving the two following equations for the instantaneous temperature &amp;lt;math&amp;gt;T,&amp;lt;/math&amp;gt; which fluctuates.&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 \qquad\qquad\qquad(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order for &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; to reach our target temperature &amp;lt;math&amp;gt;\mathfrak{T},&amp;lt;/math&amp;gt; we introduce a constant &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; to control the velocity such that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}\qquad\qquad(2)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can solve eq. &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt; to solve for &amp;lt;math&amp;gt;\gamma.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\sum_i m_i v_i^2 = 3N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substituting &amp;lt;math&amp;gt;\sum_i m_i v_i^2&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 3 N k_b T = 3N k_b \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\epsilon}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Examining the Input Script ===&lt;br /&gt;
&lt;br /&gt;
To calculate the average values for our simulation, we set certain parameters for LAMMPS in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time Nevery Nrepeat Nfreq&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Final averages are generated on timesteps that are multiples of Nevery, for Nrepeat number of times and an average is generated every Nfreq timesteps.&lt;br /&gt;
&lt;br /&gt;
In our script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The results are sampled at every 100 timesteps for 1000 times (100, 200, 300, etc.) Averages are generated every 100,000 timesteps, but our simulation runs for the same amount of time so only one average is generated from this code.&lt;br /&gt;
&lt;br /&gt;
The timestep chosen for this section of the experiment was 0.0025. Therefore, the simulation was run for &amp;lt;math&amp;gt;100000 \times 0.0025 = 250 \text{ unit time}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equations of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:Density Temp.png|700px]]&lt;br /&gt;
&lt;br /&gt;
The graph above shows the density of the simulated liquid against temperature, compared with the densities derived from the ideal gas law.&lt;br /&gt;
&lt;br /&gt;
It can be seen that within the ranges set for this simulation, the discrepancy between the simulated densities compared to the calculated densities are very high, to the point that the error bars for the y-axis is not even visible on the graph. Perhaps a more accurate simulation could have been run if a wider temperature and pressure ranges were selected.&lt;br /&gt;
&lt;br /&gt;
With the data range being one possible source of error between the simulation and the ideal gas law prediction, another possible factor is that the parameters set for this simulation are such that the repulsive force of the Lennard-Jones interaction is more significant than the attractive force. Since the ideal gas law assumes no electronic interaction between the particles, introducing a repulsive force would result in the density of the liquid being lower than the prediction.&lt;br /&gt;
&lt;br /&gt;
The most likely explanation, however, is that the ideal gas law, as its name suggests, is not very good at predicting the behavious of liquids. While both gas and liquid phases are fluids, there are major differences between them such as a much more prominent long-range order effect in liquids compared to gases.&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacity ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--To calculate the heat capacity of our simulated liquid, we investigated how much the energy of our system fluctuates with respect to temperature, according to the equation &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variance in energy can be derived from statistical thermodynamics: &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:HeatCap vs Density.png|thumb|800px|Graph of &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; against Temperature|none]]&lt;br /&gt;
&lt;br /&gt;
From thermodynamics:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;dU = TdS - PdV&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = T\frac{\partial S}{\partial T}-P\frac{\partial V}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and since &amp;lt;math&amp;gt;\frac{\partial S}{\partial T}\geq 0,&amp;lt;/math&amp;gt; heat capacity should increase with increasing temperature.&lt;br /&gt;
&lt;br /&gt;
The fact that &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; decreases with increasing temperature suggests that either the increase in temperature is causing the internal energy to increase at a faster rate than itself, or that there are issues with the simulation originating from possible sources such as small sampling size (number of atoms generated) or short run time.&lt;br /&gt;
&lt;br /&gt;
== Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
[[File:RDF SHL.png|thumb|700px]]&lt;br /&gt;
&lt;br /&gt;
It can be noticed that the three phases have clearly different Radial Distribution Functions (RDF) from each other and this can be attributed to the varying degrees of order each of the phases have: the atoms in the gas phase are completely free to move around, while atoms in the liquid phase have less freedom and in the solid phase, the atoms are set in a lattice, with only vibrational motion and no (or negligible) translational motion.&lt;br /&gt;
&lt;br /&gt;
In order to explain the graph, let us consider the RDF to be displaying the &amp;quot;effective density&amp;quot; of atoms in an area of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; at a distance &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; from a certain reference atom.&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf schematic.jpg|thumb|200px|Schematic of RDF|left]]&lt;br /&gt;
&lt;br /&gt;
There are three main parts to the RDF graphs: the region near the origin where the &amp;lt;math&amp;gt;\mathrm{RDF} = 0&amp;lt;/math&amp;gt;, the region after where there are big peaks and troughs, and the final region where the graphs have mostly reached equilibrium.&lt;br /&gt;
&lt;br /&gt;
First of all, the region near the origin is 0 for all three phases as that is still within the volume of the reference atom, and hence there are no other atoms in that radius.&lt;br /&gt;
&lt;br /&gt;
The peaks in the second region indicate that there is a higher &amp;quot;effective density&amp;quot; of atoms. The explanation for this is different for the lattice structure (solid) and the fluids (liquid and gas).&lt;br /&gt;
&lt;br /&gt;
For the liquid and gas phase, the peaks are due to the attractive force caused by the Lennard-Jones potential. We have calculated above [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:SUNG95#Lennard-Jones_Potential (1.2 LJ Potential)] that &amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}.&amp;lt;/math&amp;gt; Setting &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt; (as we have in our input file), we get &amp;lt;math&amp;gt;r_{eq} = 1.122&amp;lt;/math&amp;gt;, which is very close to where the largest peaks are for the two fluid phases.&lt;br /&gt;
&lt;br /&gt;
Then for the solid, where all the atoms are in a lattice structure, the effects due to the Lennard-Jones interaction becomes neglibigle. Instead, there will be certain values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where the effective density is higher than the overall density of the sample (the peaks), and some values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where it is lower than the density of the sample (the troughs). This is arisen from the fact that as the value of in a similar fashion to the schematic on the left.&lt;br /&gt;
&lt;br /&gt;
As the value of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the total volume covered by &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; also increases. But since all the atoms are set in place by the lattice, the number of atoms that &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; encompasses stays relatively constant. As a result, the peaks and the troughs tend 1 with increasing &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the case of the gas phase, the atoms are completely free to move around and the RDF graph can be entirely attributed to the effects of the L-J interaction. This justifies the lack of troughs for this phase. Furthermore, as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the attractive part of the L-J interaction &amp;lt;math&amp;gt;\frac{1}{r^6}&amp;lt;/math&amp;gt; gets exponentially smaller and quickly becomes negligible - RDF reaches equilibrium.&lt;br /&gt;
&lt;br /&gt;
Finally, the liquid phase can be considered to act as a mix between the solid phase and the gas phase: the L-J interactions are significant enough to reach equilibrium at a rate similar to the gas phase, but there exists an ordering of the atoms such that there are values of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; where the effective density is lower than the overall density.&lt;br /&gt;
&lt;br /&gt;
From the RDF of the solid phase, each of the peaks point to a certain lattice point. Simple geometrical calculations can be done to indicate that the first peak, which is the lattice point (1) closest to the reference atom (O), is at a separation of &amp;lt;math&amp;gt;\mathrm{r}=1.056.&amp;lt;/math&amp;gt; Second closest point (2) is at a distance of &amp;lt;math&amp;gt;\mathrm{r}=1.4938&amp;lt;/math&amp;gt; and the third (3) at &amp;lt;math&amp;gt;\mathrm{r}=1.8295.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:FCC-SHL.png|thumb|Face-centered cubic lattice|none]]&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
=== Mean Squared Displacement ===&lt;br /&gt;
&lt;br /&gt;
=== Velocity Autocorrelation Function ===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can also be calculated from the Velocity Autocorrelation Function, or VACF.&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;
From the 1D Harmonic Oscillator:&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;
Differentiating this gives the velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = -A\omega \sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting this into the integrated form of the VAFC:&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) \cdot A \omega \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(A \omega \sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, from the trigonometric identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin \left(\alpha + \beta \right)= \sin\alpha\cos\beta + \sin\beta\cos\alpha,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(\omega t + \phi + \omega\tau\right) = \sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \left(\sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\cos\left(\omega \tau\right) + \int_{-\infty}^{\infty} \sin \left(\omega \tau\right) \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt; is a constant so &amp;lt;math&amp;gt;\cos\left(\omega\tau\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sin\left(\omega\tau\right)&amp;lt;/math&amp;gt; can be taken out of the integral.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\cos\left(\omega \tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) + \sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; can cancel out:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\sin(x)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;\cos(x)&amp;lt;/math&amp;gt; is an even function, &amp;lt;math&amp;gt;\sin(x)\cos(x)&amp;lt;/math&amp;gt; is an odd function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; is an odd function (While the value of &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; can change whether or not the functions are even or odd, it shifts both functions by the same amount and the resulting &amp;lt;math&amp;gt;\cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; will still be odd)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}=\cos\left(\omega \tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\cos\left(\omega \tau\right)&amp;lt;/math&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Press_at_0.001_-_SHL.png&amp;diff=560560</id>
		<title>File:Press at 0.001 - SHL.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Press_at_0.001_-_SHL.png&amp;diff=560560"/>
		<updated>2016-10-21T07:16:15Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: Sl10014 uploaded a new version of File:Press at 0.001 - SHL.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Temp_at_0.001_-_SHL.png&amp;diff=560559</id>
		<title>File:Temp at 0.001 - SHL.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Temp_at_0.001_-_SHL.png&amp;diff=560559"/>
		<updated>2016-10-21T07:15:57Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: Sl10014 uploaded a new version of File:Temp at 0.001 - SHL.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560557</id>
		<title>Rep:Mod:SUNG95</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560557"/>
		<updated>2016-10-21T07:12:02Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Theory ==&lt;br /&gt;
=== The Velocity-Verlet Algorithm ===&lt;br /&gt;
[[File:Verlet-Velocity.png|thumb|700px|x(t) derived from the velocity-Verlet algorithm compared with the position of the classical harmonic oscillator.|left]]&lt;br /&gt;
[[File:Verlet-Energy.png|thumb|700px|Total energy of the system with respect to time|right]]&lt;br /&gt;
[[File:Verlet-Error.png|thumb|700px|The error derived by comparing the solution of the velocity-Verlet algorithm with the position of the classical harmonic oscillator|none]]&lt;br /&gt;
&lt;br /&gt;
The three graphs above display the position of an atom, the total energy of the system and the error between the two methods of calculating the atom position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Error wrt Time.png|thumb|600px|Maximum Error against Time|none]]&lt;br /&gt;
&lt;br /&gt;
From this graph of Maximum error vs Time, we can see that error increases with time at a stable linear rate.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Running the same calculations with varying timesteps show the importance of choosing the right value of the timestep:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Energy at t=0.05.png|Energy at timestep=0.05&lt;br /&gt;
Image:Energy at t=0.5.png|Energy at timestep=0.5&lt;br /&gt;
Image:Error at t=0.5.png|Error at timestep=0.5&lt;br /&gt;
Image:Error at t=0.05.png|Error at timestep=0.05&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examining the four additional graphs above, we can notice that a shorter timestep is able to provide a smaller value of error and that the energy fluctuates less than a bigger value of timestep. However, a shorter timestep results in a shorter simulation type, which can result in a less realistic simulation. It is therefore important to find the right balance between the two.&lt;br /&gt;
&lt;br /&gt;
Through trial and error, it has been found that timestep = 0.2850 or lower results in an energy fluctuation that is smaller than 1% over the course of the simulation. A small fluctuation in energy indicates higher resemblance to reality as technically the total energy should not fluctuate at all due to the Law of Conservation of Energy.&lt;br /&gt;
&lt;br /&gt;
=== Lennard-Jones Potential ===&lt;br /&gt;
The equation to calculate the Lennard-Jones potential is as follows:&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;
By equating this to 0, we find that the &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the separation at which the potential is 0, is &amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We can then find the force at this separation by differentiating the Lennard-Jones potential with respect to r, and substituting in &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}=\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24 \frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation (&amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;) is the separation of the particles at equilibrium, and represents the separation at which the potential energy is at a minimum. It can thus be found by setting &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}&amp;lt;/math&amp;gt;, (or &amp;lt;math&amp;gt;\mathbf{F}&amp;lt;/math&amp;gt;) to 0.&lt;br /&gt;
&lt;br /&gt;
Hence,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right) 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; gives us the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To put this equation into perspective, let us calculate the L-J potential for some realistic cutoff values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int 4\epsilon \left(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=4 \epsilon \left(\frac{\sigma^{12}}{11r^{11}}-\frac{\sigma^6}{5r^5}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\lim_{r\rightarrow \infty} 4 \left(\frac{1^{12}}{11r^{11}}-\frac{1^6}{5r^5}\right) - 4\left(\frac{1^{12}}{11\times 2^{11}}+\frac{1^6}{5\times 2^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=0-0.024822\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following the same calculations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0081767\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0032901\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
It is very difficult to simulate realistic volumes of liquid and in the scope of this experiment, we have simulated liquids with N (number of atoms) between 1,000 and 10,000. To demonstrate why simulating realistic volumes of liquid is difficult, let us first calculate the number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
(Assuming: Standard conditions; Density of water = 1.00 g/ml)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.00 \mathrm{ml} = 1.00 \mathrm{g}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;18.02 \mathrm{g/mol} = 0.0555 \text{ mols of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.0555 \times 6.022 \times 10^{23} = 3.34 \times 10^{22} \text{ molecules of water.}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the other hand, 10,000 water molecules is only &amp;lt;math&amp;gt;2.99 \times 10^{-19} \text{ ml of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus, in order to be able to complete the simulation in a practical amount of time, we place our atoms in a box that is repeated in all directions, similar to how unit cells repeat themselves in a lattice. When an atom crosses the boundary of the box, its replica enters the same box from the other side, thus keeping the total number of atoms in the box constant.&lt;br /&gt;
&lt;br /&gt;
For example, if an atom at position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a cubic box ranging from &amp;lt;math&amp;gt;(0, 0, 0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;, its final position would be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;, if the periodic boundary conditions have been applied.&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units ===&lt;br /&gt;
The LAMMPS calculations run in this experiment are all done in reduced units&lt;br /&gt;
&lt;br /&gt;
For example, the Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34 \mathrm{nm}&amp;lt;/math&amp;gt;; &amp;lt;math&amp;gt;\epsilon/k_B=120K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If we set the cutoff to be &amp;lt;math&amp;gt;r*=3.2,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=3.2\times0.34=1.088\mathrm{nm}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Well depth: &amp;lt;math&amp;gt;\epsilon=120K\times k_B \times 6.02 \times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon=0.998 \mathrm{kJ/mol}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and reduced temperature &amp;lt;math&amp;gt;T*=1.5&amp;lt;/math&amp;gt; would be &amp;lt;math&amp;gt;T=1.5 \times 120=180\mathrm{K}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
=== Creating Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
In order to simulate a liquid for this experiment, we first create a crystal lattice, then melt that lattice to create a liquid. This is preferable to generating a liquid since assigning a random position for each new atom could result in two or more atoms being generated in the same space, causing an error when running the simulation.&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is one lattice point per unit cell. Hence, if the number density is 0.8,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8 \text{ points/volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sqrt[3]{0.8}=0.9283\text{ points/length}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.9283^{-1}=1.0772 \text{ length/point}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is thus 1.0772 unit lengths of spacing between each point.&lt;br /&gt;
&lt;br /&gt;
Following the same logic, a face-centred cubic lattice (with 4 lattice points per unit cell) with a density of 1.2 would have a spacing of &amp;lt;math&amp;gt;0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\because \sqrt[3]{4.8^{-1}}=0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, the simple cubic lattice with a density of 0.8 would create 1,000 atoms in the given constraints of the box:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;region box block 0 10 0 10 0 10&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and a face centred cubic lattice with a density of 1.2 would create 4,000 atoms in the same box.&lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of the Atoms ===&lt;br /&gt;
In the input script, there are the following lines describing the properties of the atoms:&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;
In the first line, we are setting the mass of type 1 atoms (which includes all of the atoms in our simulation box, as we have created only one type of atoms) as &amp;lt;math&amp;gt;1.0&amp;lt;/math&amp;gt;, in reduced units. The second line defines the interaction between the atoms as a Lenard-Jones interaction, with a cutoff distance of &amp;lt;math&amp;gt;3.0 \text{ units.}&amp;lt;/math&amp;gt; Finally, the last line defines the coefficient in the Lenard-Jones interaction; the asterisk tells LAMMPS that the coefficients apply to all atoms in our system; the first coefficient is &amp;lt;math&amp;gt;\epsilon=1.0&amp;lt;/math&amp;gt; and the second coefficient is &amp;lt;math&amp;gt;\sigma=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After setting the properties of the atoms, we also defined the initial positions and the initial velocities for the atoms in the input script. Since we have both the &amp;lt;math&amp;gt;\mathbf{x}_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, we can use the Velocity-Verlet integration algorithm that employs the half-step method.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
In the following lines from the input script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we created and reset a variable called timestep to equal 0.001, then used that value to calculate how many runs (${n_steps}) to carry out. This is more beneficial than simply setting&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;
as it allows us to only change the value of the timestep variable to alter the number of runs, rather than having to calculate ${n_steps} ourselves every time we change the timestep, especially in cases such as this computational experiment where the timestep was changed multiple times.&lt;br /&gt;
&lt;br /&gt;
=== Checking Equilibration ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--TotalE at 0.0075 - SHL.png--&amp;gt;&lt;br /&gt;
[[File:TotalE at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Temp at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Press at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
&lt;br /&gt;
These graphs have been plotted to ensure that the simulation reaches equilibrium, and we can see that indeed, they do, and very quickly. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
The following graph shows the total energy of the system against time at varying timestep values:&lt;br /&gt;
&lt;br /&gt;
[[File:Equil Energy.png|thumb|800px|none]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from the graphs that for timestep = 0.001, 0.0025 and 0.0075, the energy reaches a stable equilibrium but for timestep = 0.01 and timestep = 0.015, the energy slowly decreases and rapidly increases, respectively, indicating that the results of the simulation are not very accurate for these values of timestep. Timestep = 0.015 is especially bad as it very obviously does not reach an equilibrium.&lt;br /&gt;
&lt;br /&gt;
Therefore, timestep = 0.0075 would be the ideal value as it provides the highest accuracy, while running the simulation for a suitably long time.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions (NpT) ==&lt;br /&gt;
&lt;br /&gt;
=== Temperature and Pressure Control ===&lt;br /&gt;
&lt;br /&gt;
Pressures chosen: 2.61, 2.63&lt;br /&gt;
&lt;br /&gt;
Temperatures chosen: 1.5, 1.6, 1.7, 1.8, 1.9&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 was chosen to provide the highest accuracy possible, without shortening the simulation time too much.&lt;br /&gt;
&lt;br /&gt;
In our simulation, the temperature was controlled by solving the two following equations for the instantaneous temperature &amp;lt;math&amp;gt;T,&amp;lt;/math&amp;gt; which fluctuates.&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 \qquad\qquad\qquad(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order for &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; to reach our target temperature &amp;lt;math&amp;gt;\mathfrak{T},&amp;lt;/math&amp;gt; we introduce a constant &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; to control the velocity such that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}\qquad\qquad(2)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can solve eq. &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt; to solve for &amp;lt;math&amp;gt;\gamma.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\sum_i m_i v_i^2 = 3N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substituting &amp;lt;math&amp;gt;\sum_i m_i v_i^2&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 3 N k_b T = 3N k_b \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\epsilon}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Examining the Input Script ===&lt;br /&gt;
&lt;br /&gt;
To calculate the average values for our simulation, we set certain parameters for LAMMPS in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time Nevery Nrepeat Nfreq&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Final averages are generated on timesteps that are multiples of Nevery, for Nrepeat number of times and an average is generated every Nfreq timesteps.&lt;br /&gt;
&lt;br /&gt;
In our script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The results are sampled at every 100 timesteps for 1000 times (100, 200, 300, etc.) Averages are generated every 100,000 timesteps, but our simulation runs for the same amount of time so only one average is generated from this code.&lt;br /&gt;
&lt;br /&gt;
The timestep chosen for this section of the experiment was 0.0025. Therefore, the simulation was run for &amp;lt;math&amp;gt;100000 \times 0.0025 = 250 \text{ unit time}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equations of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:Density Temp.png|700px]]&lt;br /&gt;
&lt;br /&gt;
The graph above shows the density of the simulated liquid against temperature, compared with the densities derived from the ideal gas law.&lt;br /&gt;
&lt;br /&gt;
It can be seen that within the ranges set for this simulation, the discrepancy between the simulated densities compared to the calculated densities are very high, to the point that the error bars for the y-axis is not even visible on the graph. Perhaps a more accurate simulation could have been run if a wider temperature and pressure ranges were selected.&lt;br /&gt;
&lt;br /&gt;
With the data range being one possible source of error between the simulation and the ideal gas law prediction, another possible factor is that the parameters set for this simulation are such that the repulsive force of the Lennard-Jones interaction is more significant than the attractive force. Since the ideal gas law assumes no electronic interaction between the particles, introducing a repulsive force would result in the density of the liquid being lower than the prediction.&lt;br /&gt;
&lt;br /&gt;
The most likely explanation, however, is that the ideal gas law, as its name suggests, is not very good at predicting the behavious of liquids. While both gas and liquid phases are fluids, there are major differences between them such as a much more prominent long-range order effect in liquids compared to gases.&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacity ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--To calculate the heat capacity of our simulated liquid, we investigated how much the energy of our system fluctuates with respect to temperature, according to the equation &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variance in energy can be derived from statistical thermodynamics: &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:HeatCap vs Density.png|thumb|800px|Graph of &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; against Temperature|none]]&lt;br /&gt;
&lt;br /&gt;
From thermodynamics:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;dU = TdS - PdV&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = T\frac{\partial S}{\partial T}-P\frac{\partial V}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and since &amp;lt;math&amp;gt;\frac{\partial S}{\partial T}\geq 0,&amp;lt;/math&amp;gt; heat capacity should increase with increasing temperature.&lt;br /&gt;
&lt;br /&gt;
The fact that &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; decreases with increasing temperature suggests that either the increase in temperature is causing the internal energy to increase at a faster rate than itself, or that there are issues with the simulation originating from possible sources such as small sampling size (number of atoms generated) or short run time.&lt;br /&gt;
&lt;br /&gt;
== Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
[[File:RDF SHL.png|thumb|700px]]&lt;br /&gt;
&lt;br /&gt;
It can be noticed that the three phases have clearly different Radial Distribution Functions (RDF) from each other and this can be attributed to the varying degrees of order each of the phases have: the atoms in the gas phase are completely free to move around, while atoms in the liquid phase have less freedom and in the solid phase, the atoms are set in a lattice, with only vibrational motion and no (or negligible) translational motion.&lt;br /&gt;
&lt;br /&gt;
In order to explain the graph, let us consider the RDF to be displaying the &amp;quot;effective density&amp;quot; of atoms in an area of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; at a distance &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; from a certain reference atom.&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf schematic.jpg|thumb|200px|Schematic of RDF|left]]&lt;br /&gt;
&lt;br /&gt;
There are three main parts to the RDF graphs: the region near the origin where the &amp;lt;math&amp;gt;\mathrm{RDF} = 0&amp;lt;/math&amp;gt;, the region after where there are big peaks and troughs, and the final region where the graphs have mostly reached equilibrium.&lt;br /&gt;
&lt;br /&gt;
First of all, the region near the origin is 0 for all three phases as that is still within the volume of the reference atom, and hence there are no other atoms in that radius.&lt;br /&gt;
&lt;br /&gt;
The peaks in the second region indicate that there is a higher &amp;quot;effective density&amp;quot; of atoms. The explanation for this is different for the lattice structure (solid) and the fluids (liquid and gas).&lt;br /&gt;
&lt;br /&gt;
For the liquid and gas phase, the peaks are due to the attractive force caused by the Lennard-Jones potential. We have calculated above [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:SUNG95#Lennard-Jones_Potential (1.2 LJ Potential)] that &amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}.&amp;lt;/math&amp;gt; Setting &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt; (as we have in our input file), we get &amp;lt;math&amp;gt;r_{eq} = 1.122&amp;lt;/math&amp;gt;, which is very close to where the largest peaks are for the two fluid phases.&lt;br /&gt;
&lt;br /&gt;
Then for the solid, where all the atoms are in a lattice structure, the effects due to the Lennard-Jones interaction becomes neglibigle. Instead, there will be certain values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where the effective density is higher than the overall density of the sample (the peaks), and some values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where it is lower than the density of the sample (the troughs). This is arisen from the fact that as the value of in a similar fashion to the schematic on the left.&lt;br /&gt;
&lt;br /&gt;
As the value of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the total volume covered by &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; also increases. But since all the atoms are set in place by the lattice, the number of atoms that &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; encompasses stays relatively constant. As a result, the peaks and the troughs tend 1 with increasing &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the case of the gas phase, the atoms are completely free to move around and the RDF graph can be entirely attributed to the effects of the L-J interaction. This justifies the lack of troughs for this phase. Furthermore, as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the attractive part of the L-J interaction &amp;lt;math&amp;gt;\frac{1}{r^6}&amp;lt;/math&amp;gt; gets exponentially smaller and quickly becomes negligible - RDF reaches equilibrium.&lt;br /&gt;
&lt;br /&gt;
Finally, the liquid phase can be considered to act as a mix between the solid phase and the gas phase: the L-J interactions are significant enough to reach equilibrium at a rate similar to the gas phase, but there exists an ordering of the atoms such that there are values of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; where the effective density is lower than the overall density.&lt;br /&gt;
&lt;br /&gt;
From the RDF of the solid phase, each of the peaks point to a certain lattice point. Simple geometrical calculations can be done to indicate that the first peak, which is the lattice point (1) closest to the reference atom (O), is at a separation of &amp;lt;math&amp;gt;\mathrm{r}=1.056.&amp;lt;/math&amp;gt; Second closest point (2) is at a distance of &amp;lt;math&amp;gt;\mathrm{r}=1.4938&amp;lt;/math&amp;gt; and the third (3) at &amp;lt;math&amp;gt;\mathrm{r}=1.8295.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:FCC-SHL.png|thumb|Face-centered cubic lattice|none]]&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
=== Mean Squared Displacement ===&lt;br /&gt;
&lt;br /&gt;
=== Velocity Autocorrelation Function ===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can also be calculated from the Velocity Autocorrelation Function, or VACF.&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;
From the 1D Harmonic Oscillator:&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;
Differentiating this gives the velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = -A\omega \sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting this into the integrated form of the VAFC:&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) \cdot A \omega \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(A \omega \sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, from the trigonometric identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin \left(\alpha + \beta \right)= \sin\alpha\cos\beta + \sin\beta\cos\alpha,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(\omega t + \phi + \omega\tau\right) = \sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \left(\sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\cos\left(\omega \tau\right) + \int_{-\infty}^{\infty} \sin \left(\omega \tau\right) \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt; is a constant so &amp;lt;math&amp;gt;\cos\left(\omega\tau\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sin\left(\omega\tau\right)&amp;lt;/math&amp;gt; can be taken out of the integral.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\cos\left(\omega \tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) + \sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; can cancel out:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\sin(x)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;\cos(x)&amp;lt;/math&amp;gt; is an even function, &amp;lt;math&amp;gt;\sin(x)\cos(x)&amp;lt;/math&amp;gt; is an odd function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; is an odd function (While the value of &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; can change whether or not the functions are even or odd, it shifts both functions by the same amount and the resulting &amp;lt;math&amp;gt;\cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; will still be odd)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}=\cos\left(\omega \tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\cos\left(\omega \tau\right)&amp;lt;/math&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560551</id>
		<title>Rep:Mod:SUNG95</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560551"/>
		<updated>2016-10-21T06:41:25Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: /* Examining the Input Script */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Theory ==&lt;br /&gt;
=== The Velocity-Verlet Algorithm ===&lt;br /&gt;
[[File:Verlet-Velocity.png|thumb|700px|x(t) derived from the velocity-Verlet algorithm compared with the position of the classical harmonic oscillator.|left]]&lt;br /&gt;
[[File:Verlet-Energy.png|thumb|700px|Total energy of the system with respect to time|right]]&lt;br /&gt;
[[File:Verlet-Error.png|thumb|700px|The error derived by comparing the solution of the velocity-Verlet algorithm with the position of the classical harmonic oscillator|none]]&lt;br /&gt;
&lt;br /&gt;
The three graphs above display the position of an atom, the total energy of the system and the error between the two methods of calculating the atom position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Error wrt Time.png|thumb|600px|Maximum Error against Time|none]]&lt;br /&gt;
&lt;br /&gt;
From this graph of Maximum error vs Time, we can see that error increases with time at a stable linear rate.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Running the same calculations with varying timesteps show the importance of choosing the right value of the timestep:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Energy at t=0.05.png|Energy at timestep=0.05&lt;br /&gt;
Image:Energy at t=0.5.png|Energy at timestep=0.5&lt;br /&gt;
Image:Error at t=0.5.png|Error at timestep=0.5&lt;br /&gt;
Image:Error at t=0.05.png|Error at timestep=0.05&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examining the four additional graphs above, we can notice that a shorter timestep is able to provide a smaller value of error and that the energy fluctuates less than a bigger value of timestep. However, a shorter timestep results in a shorter simulation type, which can result in a less realistic simulation. It is therefore important to find the right balance between the two.&lt;br /&gt;
&lt;br /&gt;
Through trial and error, it has been found that timestep = 0.2850 or lower results in an energy fluctuation that is smaller than 1% over the course of the simulation. A small fluctuation in energy indicates higher resemblance to reality as technically the total energy should not fluctuate at all due to the Law of Conservation of Energy.&lt;br /&gt;
&lt;br /&gt;
=== Lennard-Jones Potential ===&lt;br /&gt;
The equation to calculate the Lennard-Jones potential is as follows:&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;
By equating this to 0, we find that the &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the separation at which the potential is 0, is &amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We can then find the force at this separation by differentiating the Lennard-Jones potential with respect to r, and substituting in &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}=\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24 \frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation (&amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;) is the separation of the particles at equilibrium, and represents the separation at which the potential energy is at a minimum. It can thus be found by setting &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}&amp;lt;/math&amp;gt;, (or &amp;lt;math&amp;gt;\mathbf{F}&amp;lt;/math&amp;gt;) to 0.&lt;br /&gt;
&lt;br /&gt;
Hence,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right) 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; gives us the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To put this equation into perspective, let us calculate the L-J potential for some realistic cutoff values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int 4\epsilon \left(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=4 \epsilon \left(\frac{\sigma^{12}}{11r^{11}}-\frac{\sigma^6}{5r^5}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\lim_{r\rightarrow \infty} 4 \left(\frac{1^{12}}{11r^{11}}-\frac{1^6}{5r^5}\right) - 4\left(\frac{1^{12}}{11\times 2^{11}}+\frac{1^6}{5\times 2^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=0-0.024822\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following the same calculations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0081767\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0032901\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
It is very difficult to simulate realistic volumes of liquid and in the scope of this experiment, we have simulated liquids with N (number of atoms) between 1,000 and 10,000. To demonstrate why simulating realistic volumes of liquid is difficult, let us first calculate the number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--TASK: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.--&amp;gt;&lt;br /&gt;
(Assuming: Standard conditions; Density of water = 1.00 g/ml)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.00 \mathrm{ml} = 1.00 \mathrm{g}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;18.02 \mathrm{g/mol} = 0.0555 \text{ mols of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.0555 \times 6.022 \times 10^{23} = 3.34 \times 10^{22} \text{ molecules of water.}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the other hand, 10,000 water molecules is only &amp;lt;math&amp;gt;2.99 \times 10^{-19} \text{ ml of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
10000 water molecules == 1.661 x 10^-20 mols of water. (Conversion using Avogadro Constant)&lt;br /&gt;
1.661 x 10^-20 x 18.02 = 2.99 x 10^-19 g&lt;br /&gt;
approx. 2.99 x 10^-19 ml of water.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus, in order to be able to complete the simulation in a practical amount of time, we place our atoms in a box that is repeated in all directions, similar to how unit cells repeat themselves in a lattice. When an atom crosses the boundary of the box, its replica enters the same box from the other side, thus keeping the total number of atoms in the box constant.&lt;br /&gt;
&lt;br /&gt;
For example, if an atom at position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a cubic box ranging from &amp;lt;math&amp;gt;(0, 0, 0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;, its final position would be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;, if the periodic boundary conditions have been applied.&lt;br /&gt;
&amp;lt;!--We can safely avoid the issue we might encounter arising from the infinite number of particles by setting a cutoff limit ---- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units ===&lt;br /&gt;
The LAMMPS calculations run in this experiment are all done in reduced units&lt;br /&gt;
&lt;br /&gt;
For example, the Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34 \mathrm{nm}&amp;lt;/math&amp;gt;; &amp;lt;math&amp;gt;\epsilon/k_B=120K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If we set the cutoff to be &amp;lt;math&amp;gt;r*=3.2,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=3.2\times0.34=1.088\mathrm{nm}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Well depth: &amp;lt;math&amp;gt;\epsilon=120K\times k_B \times 6.02 \times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon=0.998 \mathrm{kJ/mol}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and reduced temperature &amp;lt;math&amp;gt;T*=1.5&amp;lt;/math&amp;gt; would be &amp;lt;math&amp;gt;T=1.5 \times 120=180\mathrm{K}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
=== Creating Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
In order to simulate a liquid for this experiment, we first create a crystal lattice, then melt that lattice to create a liquid. This is preferable to generating a liquid since assigning a random position for each new atom could result in two or more atoms being generated in the same space, causing an error when running the simulation.&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is one lattice point per unit cell. Hence, if the number density is 0.8,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8 \text{ points/volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sqrt[3]{0.8}=0.9283\text{ points/length}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.9283^{-1}=1.0772 \text{ length/point}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is thus 1.0772 unit lengths of spacing between each point.&lt;br /&gt;
&lt;br /&gt;
Following the same logic, a face-centred cubic lattice (with 4 lattice points per unit cell) with a density of 1.2 would have a spacing of &amp;lt;math&amp;gt;0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\because \sqrt[3]{4.8^{-1}}=0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, the simple cubic lattice with a density of 0.8 would create 1,000 atoms in the given constraints of the box:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;region box block 0 10 0 10 0 10&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and a face centred cubic lattice with a density of 1.2 would create 4,000 atoms in the same box.&lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of the Atoms ===&lt;br /&gt;
In the input script, there are the following lines describing the properties of the atoms:&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;
In the first line, we are setting the mass of type 1 atoms (which includes all of the atoms in our simulation box, as we have created only one type of atoms) as &amp;lt;math&amp;gt;1.0&amp;lt;/math&amp;gt;, in reduced units. The second line defines the interaction between the atoms as a Lenard-Jones interaction, with a cutoff distance of &amp;lt;math&amp;gt;3.0 \text{ units.}&amp;lt;/math&amp;gt; Finally, the last line defines the coefficient in the Lenard-Jones interaction; the asterisk tells LAMMPS that the coefficients apply to all atoms in our system; the first coefficient is &amp;lt;math&amp;gt;\epsilon=1.0&amp;lt;/math&amp;gt; and the second coefficient is &amp;lt;math&amp;gt;\sigma=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After setting the properties of the atoms, we also defined the initial positions and the initial velocities for the atoms in the input script. Since we have both the &amp;lt;math&amp;gt;\mathbf{x}_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, we can use the Velocity-Verlet integration algorithm that employs the half-step method.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
In the following lines from the input script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we created and reset a variable called timestep to equal 0.001, then used that value to calculate how many runs (${n_steps}) to carry out. This is more beneficial than simply setting&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;
as it allows us to only change the value of the timestep variable to alter the number of runs, rather than having to calculate ${n_steps} ourselves every time we change the timestep, especially in cases such as this computational experiment where the timestep was changed multiple times.&lt;br /&gt;
&lt;br /&gt;
=== Checking Equilibration ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--TotalE at 0.0075 - SHL.png--&amp;gt;&lt;br /&gt;
[[File:TotalE at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Temp at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Press at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
&lt;br /&gt;
These graphs have been plotted to ensure that the simulation reaches equilibrium, and we can see that indeed, they do, and very quickly. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
The following graph shows the total energy of the system against time at varying timestep values:&lt;br /&gt;
&lt;br /&gt;
[[File:Equil Energy.png|thumb|800px|none]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from the graphs that for timestep = 0.001, 0.0025 and 0.0075, the energy reaches a stable equilibrium but for timestep = 0.01 and timestep = 0.015, the energy slowly decreases and rapidly increases, respectively, indicating that the results of the simulation are not very accurate for these values of timestep. Timestep = 0.015 is especially bad as it very obviously does not reach an equilibrium.&lt;br /&gt;
&lt;br /&gt;
Therefore, timestep = 0.0075 would be the ideal value as it provides the highest accuracy, while running the simulation for a suitably long time.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions (NpT) ==&lt;br /&gt;
&lt;br /&gt;
=== Temperature and Pressure Control ===&lt;br /&gt;
&lt;br /&gt;
Pressures chosen: 2.61, 2.63&lt;br /&gt;
&lt;br /&gt;
Temperatures chosen: 1.5, 1.6, 1.7, 1.8, 1.9&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 was chosen to provide the highest accuracy possible, without shortening the simulation time too much.&lt;br /&gt;
&lt;br /&gt;
In our simulation, the temperature was controlled by solving the two following equations for the instantaneous temperature &amp;lt;math&amp;gt;T,&amp;lt;/math&amp;gt; which fluctuates.&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 \qquad\qquad\qquad(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order for &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; to reach our target temperature &amp;lt;math&amp;gt;\mathfrak{T},&amp;lt;/math&amp;gt; we introduce a constant &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; to control the velocity such that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}\qquad\qquad(2)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can solve eq. &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt; to solve for &amp;lt;math&amp;gt;\gamma.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\sum_i m_i v_i^2 = 3N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substituting &amp;lt;math&amp;gt;\sum_i m_i v_i^2&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 3 N k_b T = 3N k_b \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\epsilon}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Examining the Input Script ===&lt;br /&gt;
&lt;br /&gt;
To calculate the average values for our simulation, we set certain parameters for LAMMPS in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time Nevery Nrepeat Nfreq&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Final averages are generated on timesteps that are multiples of Nevery, for Nrepeat number of times and an average is generated every Nfreq timesteps.&lt;br /&gt;
&lt;br /&gt;
In our script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The results are sampled at every 100 timesteps for 1000 times (100, 200, 300, etc.) Averages are generated every 100,000 timesteps, but our simulation runs for the same amount of time so only one average is generated from this code.&lt;br /&gt;
&lt;br /&gt;
The timestep chosen for this section of the experiment was 0.0025. Therefore, the simulation was run for &amp;lt;math&amp;gt;100000 \times 0.0025 = 250 \text{ unit time}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equations of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:Density Temp.png|700px]]&lt;br /&gt;
&lt;br /&gt;
The graph above shows the density of the simulated liquid against temperature, compared with the densities derived from the ideal gas law.&lt;br /&gt;
&lt;br /&gt;
It can be seen that within the ranges set for this simulation, the discrepancy between the simulated densities compared to the calculated densities are very high, to the point that the error bars for the y-axis is not even visible on the graph. Perhaps a more accurate simulation could have been run if a wider temperature and pressure ranges were selected.&lt;br /&gt;
&lt;br /&gt;
With the data range being one possible source of error between the simulation and the ideal gas law prediction, another possible factor is that the parameters set for this simulation are such that the repulsive force of the Lennard-Jones interaction is more significant than the attractive force. Since the ideal gas law assumes no electronic interaction between the particles, introducing a repulsive force would result in the density of the liquid being lower than the prediction.&lt;br /&gt;
&lt;br /&gt;
The most likely explanation, however, is that the ideal gas law, as its name suggests, is not very good at predicting the behavious of liquids. While both gas and liquid phases are fluids, there are major differences between them such as a much more prominent long-range order effect in liquids compared to gases.&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacity ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--To calculate the heat capacity of our simulated liquid, we investigated how much the energy of our system fluctuates with respect to temperature, according to the equation &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variance in energy can be derived from statistical thermodynamics: &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:HeatCap vs Density.png|thumb|800px|Graph of &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; against Temperature|none]]&lt;br /&gt;
&lt;br /&gt;
From thermodynamics:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;dU = TdS - PdV&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = T\frac{\partial S}{\partial T}-P\frac{\partial V}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and since &amp;lt;math&amp;gt;\frac{\partial S}{\partial T}\geq 0,&amp;lt;/math&amp;gt; heat capacity should increase with increasing temperature.&lt;br /&gt;
&lt;br /&gt;
The fact that &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; decreases with increasing temperature suggests that either the increase in temperature is causing the internal energy to increase at a faster rate than itself, or that there are issues with the simulation originating from possible sources such as small sampling size (number of atoms generated) or short run time.&lt;br /&gt;
&lt;br /&gt;
== Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
[[File:RDF SHL.png|thumb|700px]]&lt;br /&gt;
&lt;br /&gt;
It can be noticed that the three phases have clearly different Radial Distribution Functions (RDF) from each other and this can be attributed to the varying degrees of order each of the phases have: the atoms in the gas phase are completely free to move around, while atoms in the liquid phase have less freedom and in the solid phase, the atoms are set in a lattice, with only vibrational motion and no (or negligible) translational motion.&lt;br /&gt;
&lt;br /&gt;
In order to explain the graph, let us consider the RDF to be displaying the &amp;quot;effective density&amp;quot; of atoms in an area of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; at a distance &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; from a certain reference atom.&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf schematic.jpg|thumb|200px|Schematic of RDF|left]]&lt;br /&gt;
&lt;br /&gt;
There are three main parts to the RDF graphs: the region near the origin where the &amp;lt;math&amp;gt;\mathrm{RDF} = 0&amp;lt;/math&amp;gt;, the region after where there are big peaks and troughs, and the final region where the graphs have mostly reached equilibrium.&lt;br /&gt;
&lt;br /&gt;
First of all, the region near the origin is 0 for all three phases as that is still within the volume of the reference atom, and hence there are no other atoms in that radius.&lt;br /&gt;
&lt;br /&gt;
The peaks in the second region indicate that there is a higher &amp;quot;effective density&amp;quot; of atoms. The explanation for this is different for the lattice structure (solid) and the fluids (liquid and gas).&lt;br /&gt;
&lt;br /&gt;
For the liquid and gas phase, the peaks are due to the attractive force caused by the Lennard-Jones potential. We have calculated above [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:SUNG95#Lennard-Jones_Potential (1.2 LJ Potential)] that &amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}.&amp;lt;/math&amp;gt; Setting &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt; (as we have in our input file), we get &amp;lt;math&amp;gt;r_{eq} = 1.122&amp;lt;/math&amp;gt;, which is very close to where the largest peaks are for the two fluid phases.&lt;br /&gt;
&lt;br /&gt;
Then for the solid, where all the atoms are in a lattice structure, the effects due to the Lennard-Jones interaction becomes neglibigle. Instead, there will be certain values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where the effective density is higher than the overall density of the sample (the peaks), and some values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where it is lower than the density of the sample (the troughs). This is arisen from the fact that as the value of in a similar fashion to the schematic on the left.&lt;br /&gt;
&lt;br /&gt;
As the value of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the total volume covered by &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; also increases. But since all the atoms are set in place by the lattice, the number of atoms that &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; encompasses stays relatively constant. As a result, the peaks and the troughs tend 1 with increasing &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the case of the gas phase, the atoms are completely free to move around and the RDF graph can be entirely attributed to the effects of the L-J interaction. This justifies the lack of troughs for this phase. Furthermore, as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the attractive part of the L-J interaction &amp;lt;math&amp;gt;\frac{1}{r^6}&amp;lt;/math&amp;gt; gets exponentially smaller and quickly becomes negligible - RDF reaches equilibrium.&lt;br /&gt;
&lt;br /&gt;
Finally, the liquid phase can be considered to act as a mix between the solid phase and the gas phase: the L-J interactions are significant enough to reach equilibrium at a rate similar to the gas phase, but there exists an ordering of the atoms such that there are values of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; where the effective density is lower than the overall density.&lt;br /&gt;
&lt;br /&gt;
From the RDF of the solid phase, each of the peaks point to a certain lattice point. Simple geometrical calculations can be done to indicate that the first peak, which is the lattice point (1) closest to the reference atom (O), is at a separation of &amp;lt;math&amp;gt;\mathrm{r}=1.056.&amp;lt;/math&amp;gt; Second closest point (2) is at a distance of &amp;lt;math&amp;gt;\mathrm{r}=1.4938&amp;lt;/math&amp;gt; and the third (3) at &amp;lt;math&amp;gt;\mathrm{r}=1.8295.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:FCC-SHL.png|thumb|Face-centered cubic lattice|none]]&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
=== Mean Squared Displacement ===&lt;br /&gt;
&lt;br /&gt;
=== Velocity Autocorrelation Function ===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can also be calculated from the Velocity Autocorrelation Function, or VACF.&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;
From the 1D Harmonic Oscillator:&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;
Differentiating this gives the velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = -A\omega \sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting this into the integrated form of the VAFC:&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) \cdot A \omega \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(A \omega \sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, from the trigonometric identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin \left(\alpha + \beta \right)= \sin\alpha\cos\beta + \sin\beta\cos\alpha,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(\omega t + \phi + \omega\tau\right) = \sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \left(\sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\cos\left(\omega \tau\right) + \int_{-\infty}^{\infty} \sin \left(\omega \tau\right) \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt; is a constant so &amp;lt;math&amp;gt;\cos\left(\omega\tau\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sin\left(\omega\tau\right)&amp;lt;/math&amp;gt; can be taken out of the integral.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\cos\left(\omega \tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) + \sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; can cancel out:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\sin(x)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;\cos(x)&amp;lt;/math&amp;gt; is an even function, &amp;lt;math&amp;gt;\sin(x)\cos(x)&amp;lt;/math&amp;gt; is an odd function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; is an odd function (While the value of &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; can change whether or not the functions are even or odd, it shifts both functions by the same amount and the resulting &amp;lt;math&amp;gt;\cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; will still be odd)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}=\cos\left(\omega \tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\cos\left(\omega \tau\right)&amp;lt;/math&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560548</id>
		<title>Rep:Mod:SUNG95</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560548"/>
		<updated>2016-10-21T06:20:30Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: /* Velocity Autocorrelation Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Theory ==&lt;br /&gt;
=== The Velocity-Verlet Algorithm ===&lt;br /&gt;
[[File:Verlet-Velocity.png|thumb|700px|x(t) derived from the velocity-Verlet algorithm compared with the position of the classical harmonic oscillator.|left]]&lt;br /&gt;
[[File:Verlet-Energy.png|thumb|700px|Total energy of the system with respect to time|right]]&lt;br /&gt;
[[File:Verlet-Error.png|thumb|700px|The error derived by comparing the solution of the velocity-Verlet algorithm with the position of the classical harmonic oscillator|none]]&lt;br /&gt;
&lt;br /&gt;
The three graphs above display the position of an atom, the total energy of the system and the error between the two methods of calculating the atom position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Error wrt Time.png|thumb|600px|Maximum Error against Time|none]]&lt;br /&gt;
&lt;br /&gt;
From this graph of Maximum error vs Time, we can see that error increases with time at a stable linear rate.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Running the same calculations with varying timesteps show the importance of choosing the right value of the timestep:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Energy at t=0.05.png|Energy at timestep=0.05&lt;br /&gt;
Image:Energy at t=0.5.png|Energy at timestep=0.5&lt;br /&gt;
Image:Error at t=0.5.png|Error at timestep=0.5&lt;br /&gt;
Image:Error at t=0.05.png|Error at timestep=0.05&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examining the four additional graphs above, we can notice that a shorter timestep is able to provide a smaller value of error and that the energy fluctuates less than a bigger value of timestep. However, a shorter timestep results in a shorter simulation type, which can result in a less realistic simulation. It is therefore important to find the right balance between the two.&lt;br /&gt;
&lt;br /&gt;
Through trial and error, it has been found that timestep = 0.2850 or lower results in an energy fluctuation that is smaller than 1% over the course of the simulation. A small fluctuation in energy indicates higher resemblance to reality as technically the total energy should not fluctuate at all due to the Law of Conservation of Energy.&lt;br /&gt;
&lt;br /&gt;
=== Lennard-Jones Potential ===&lt;br /&gt;
The equation to calculate the Lennard-Jones potential is as follows:&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;
By equating this to 0, we find that the &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the separation at which the potential is 0, is &amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We can then find the force at this separation by differentiating the Lennard-Jones potential with respect to r, and substituting in &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}=\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24 \frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation (&amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;) is the separation of the particles at equilibrium, and represents the separation at which the potential energy is at a minimum. It can thus be found by setting &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}&amp;lt;/math&amp;gt;, (or &amp;lt;math&amp;gt;\mathbf{F}&amp;lt;/math&amp;gt;) to 0.&lt;br /&gt;
&lt;br /&gt;
Hence,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right) 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; gives us the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To put this equation into perspective, let us calculate the L-J potential for some realistic cutoff values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int 4\epsilon \left(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=4 \epsilon \left(\frac{\sigma^{12}}{11r^{11}}-\frac{\sigma^6}{5r^5}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\lim_{r\rightarrow \infty} 4 \left(\frac{1^{12}}{11r^{11}}-\frac{1^6}{5r^5}\right) - 4\left(\frac{1^{12}}{11\times 2^{11}}+\frac{1^6}{5\times 2^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=0-0.024822\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following the same calculations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0081767\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0032901\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
It is very difficult to simulate realistic volumes of liquid and in the scope of this experiment, we have simulated liquids with N (number of atoms) between 1,000 and 10,000. To demonstrate why simulating realistic volumes of liquid is difficult, let us first calculate the number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--TASK: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.--&amp;gt;&lt;br /&gt;
(Assuming: Standard conditions; Density of water = 1.00 g/ml)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.00 \mathrm{ml} = 1.00 \mathrm{g}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;18.02 \mathrm{g/mol} = 0.0555 \text{ mols of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.0555 \times 6.022 \times 10^{23} = 3.34 \times 10^{22} \text{ molecules of water.}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the other hand, 10,000 water molecules is only &amp;lt;math&amp;gt;2.99 \times 10^{-19} \text{ ml of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
10000 water molecules == 1.661 x 10^-20 mols of water. (Conversion using Avogadro Constant)&lt;br /&gt;
1.661 x 10^-20 x 18.02 = 2.99 x 10^-19 g&lt;br /&gt;
approx. 2.99 x 10^-19 ml of water.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus, in order to be able to complete the simulation in a practical amount of time, we place our atoms in a box that is repeated in all directions, similar to how unit cells repeat themselves in a lattice. When an atom crosses the boundary of the box, its replica enters the same box from the other side, thus keeping the total number of atoms in the box constant.&lt;br /&gt;
&lt;br /&gt;
For example, if an atom at position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a cubic box ranging from &amp;lt;math&amp;gt;(0, 0, 0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;, its final position would be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;, if the periodic boundary conditions have been applied.&lt;br /&gt;
&amp;lt;!--We can safely avoid the issue we might encounter arising from the infinite number of particles by setting a cutoff limit ---- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units ===&lt;br /&gt;
The LAMMPS calculations run in this experiment are all done in reduced units&lt;br /&gt;
&lt;br /&gt;
For example, the Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34 \mathrm{nm}&amp;lt;/math&amp;gt;; &amp;lt;math&amp;gt;\epsilon/k_B=120K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If we set the cutoff to be &amp;lt;math&amp;gt;r*=3.2,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=3.2\times0.34=1.088\mathrm{nm}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Well depth: &amp;lt;math&amp;gt;\epsilon=120K\times k_B \times 6.02 \times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon=0.998 \mathrm{kJ/mol}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and reduced temperature &amp;lt;math&amp;gt;T*=1.5&amp;lt;/math&amp;gt; would be &amp;lt;math&amp;gt;T=1.5 \times 120=180\mathrm{K}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
=== Creating Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
In order to simulate a liquid for this experiment, we first create a crystal lattice, then melt that lattice to create a liquid. This is preferable to generating a liquid since assigning a random position for each new atom could result in two or more atoms being generated in the same space, causing an error when running the simulation.&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is one lattice point per unit cell. Hence, if the number density is 0.8,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8 \text{ points/volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sqrt[3]{0.8}=0.9283\text{ points/length}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.9283^{-1}=1.0772 \text{ length/point}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is thus 1.0772 unit lengths of spacing between each point.&lt;br /&gt;
&lt;br /&gt;
Following the same logic, a face-centred cubic lattice (with 4 lattice points per unit cell) with a density of 1.2 would have a spacing of &amp;lt;math&amp;gt;0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\because \sqrt[3]{4.8^{-1}}=0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, the simple cubic lattice with a density of 0.8 would create 1,000 atoms in the given constraints of the box:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;region box block 0 10 0 10 0 10&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and a face centred cubic lattice with a density of 1.2 would create 4,000 atoms in the same box.&lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of the Atoms ===&lt;br /&gt;
In the input script, there are the following lines describing the properties of the atoms:&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;
In the first line, we are setting the mass of type 1 atoms (which includes all of the atoms in our simulation box, as we have created only one type of atoms) as &amp;lt;math&amp;gt;1.0&amp;lt;/math&amp;gt;, in reduced units. The second line defines the interaction between the atoms as a Lenard-Jones interaction, with a cutoff distance of &amp;lt;math&amp;gt;3.0 \text{ units.}&amp;lt;/math&amp;gt; Finally, the last line defines the coefficient in the Lenard-Jones interaction; the asterisk tells LAMMPS that the coefficients apply to all atoms in our system; the first coefficient is &amp;lt;math&amp;gt;\epsilon=1.0&amp;lt;/math&amp;gt; and the second coefficient is &amp;lt;math&amp;gt;\sigma=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After setting the properties of the atoms, we also defined the initial positions and the initial velocities for the atoms in the input script. Since we have both the &amp;lt;math&amp;gt;\mathbf{x}_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, we can use the Velocity-Verlet integration algorithm that employs the half-step method.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
In the following lines from the input script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we created and reset a variable called timestep to equal 0.001, then used that value to calculate how many runs (${n_steps}) to carry out. This is more beneficial than simply setting&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;
as it allows us to only change the value of the timestep variable to alter the number of runs, rather than having to calculate ${n_steps} ourselves every time we change the timestep, especially in cases such as this computational experiment where the timestep was changed multiple times.&lt;br /&gt;
&lt;br /&gt;
=== Checking Equilibration ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--TotalE at 0.0075 - SHL.png--&amp;gt;&lt;br /&gt;
[[File:TotalE at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Temp at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Press at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
&lt;br /&gt;
These graphs have been plotted to ensure that the simulation reaches equilibrium, and we can see that indeed, they do, and very quickly. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
The following graph shows the total energy of the system against time at varying timestep values:&lt;br /&gt;
&lt;br /&gt;
[[File:Equil Energy.png|thumb|800px|none]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from the graphs that for timestep = 0.001, 0.0025 and 0.0075, the energy reaches a stable equilibrium but for timestep = 0.01 and timestep = 0.015, the energy slowly decreases and rapidly increases, respectively, indicating that the results of the simulation are not very accurate for these values of timestep. Timestep = 0.015 is especially bad as it very obviously does not reach an equilibrium.&lt;br /&gt;
&lt;br /&gt;
Therefore, timestep = 0.0075 would be the ideal value as it provides the highest accuracy, while running the simulation for a suitably long time.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions (NpT) ==&lt;br /&gt;
&lt;br /&gt;
=== Temperature and Pressure Control ===&lt;br /&gt;
&lt;br /&gt;
Pressures chosen: 2.61, 2.63&lt;br /&gt;
&lt;br /&gt;
Temperatures chosen: 1.5, 1.6, 1.7, 1.8, 1.9&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 was chosen to provide the highest accuracy possible, without shortening the simulation time too much.&lt;br /&gt;
&lt;br /&gt;
In our simulation, the temperature was controlled by solving the two following equations for the instantaneous temperature &amp;lt;math&amp;gt;T,&amp;lt;/math&amp;gt; which fluctuates.&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 \qquad\qquad\qquad(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order for &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; to reach our target temperature &amp;lt;math&amp;gt;\mathfrak{T},&amp;lt;/math&amp;gt; we introduce a constant &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; to control the velocity such that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}\qquad\qquad(2)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can solve eq. &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt; to solve for &amp;lt;math&amp;gt;\gamma.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\sum_i m_i v_i^2 = 3N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substituting &amp;lt;math&amp;gt;\sum_i m_i v_i^2&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 3 N k_b T = 3N k_b \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\epsilon}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Examining the Input Script ===&lt;br /&gt;
&lt;br /&gt;
To calculate the average values for our simulation, we set certain parameters for LAMMPS in the script.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time Nevery Nrepeat Nfreq&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Final averages are generated on timesteps that are multiples of Nevery, for Nrepeat number of times and an average is generated every Nfreq timesteps.&lt;br /&gt;
&lt;br /&gt;
In our script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The results are sampled at every 100 timesteps for 1000 times (100, 200, 300, etc.) Averages are generated every 100,000 timesteps, but our simulation runs for the same amount of time so only one average is generated from this code.&lt;br /&gt;
&lt;br /&gt;
The timestep chosen for this section of the experiment was 0.0025. Therefore, the simulation was run for &amp;lt;math&amp;gt;100000 \times 0.0025 = 250 \text{ unit time}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equations of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:Density Temp.png|700px]]&lt;br /&gt;
&lt;br /&gt;
The graph above shows the density of the simulated liquid against temperature, compared with the densities derived from the ideal gas law.&lt;br /&gt;
&lt;br /&gt;
It can be seen that within the ranges set for this simulation, the discrepancy between the simulated densities compared to the calculated densities are very high, to the point that the error bars for the y-axis is not even visible on the graph. Perhaps a more accurate simulation could have been run if a wider temperature and pressure ranges were selected.&lt;br /&gt;
&lt;br /&gt;
With the data range being one possible source of error between the simulation and the ideal gas law prediction, another possible factor is that the parameters set for this simulation are such that the repulsive force of the Lennard-Jones interaction is more significant than the attractive force. Since the ideal gas law assumes no electronic interaction between the particles, introducing a repulsive force would result in the density of the liquid being lower than the prediction.&lt;br /&gt;
&lt;br /&gt;
The most likely explanation, however, is that the ideal gas law, as its name suggests, is not very good at predicting the behavious of liquids. While both gas and liquid phases are fluids, there are major differences between them such as a much more prominent long-range order effect in liquids compared to gases.&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacity ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--To calculate the heat capacity of our simulated liquid, we investigated how much the energy of our system fluctuates with respect to temperature, according to the equation &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variance in energy can be derived from statistical thermodynamics: &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:HeatCap vs Density.png|thumb|800px|Graph of &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; against Temperature|none]]&lt;br /&gt;
&lt;br /&gt;
From thermodynamics:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;dU = TdS - PdV&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = T\frac{\partial S}{\partial T}-P\frac{\partial V}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and since &amp;lt;math&amp;gt;\frac{\partial S}{\partial T}\geq 0,&amp;lt;/math&amp;gt; heat capacity should increase with increasing temperature.&lt;br /&gt;
&lt;br /&gt;
The fact that &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; decreases with increasing temperature suggests that either the increase in temperature is causing the internal energy to increase at a faster rate than itself, or that there are issues with the simulation originating from possible sources such as small sampling size (number of atoms generated) or short run time.&lt;br /&gt;
&lt;br /&gt;
== Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
[[File:RDF SHL.png|thumb|700px]]&lt;br /&gt;
&lt;br /&gt;
It can be noticed that the three phases have clearly different Radial Distribution Functions (RDF) from each other and this can be attributed to the varying degrees of order each of the phases have: the atoms in the gas phase are completely free to move around, while atoms in the liquid phase have less freedom and in the solid phase, the atoms are set in a lattice, with only vibrational motion and no (or negligible) translational motion.&lt;br /&gt;
&lt;br /&gt;
In order to explain the graph, let us consider the RDF to be displaying the &amp;quot;effective density&amp;quot; of atoms in an area of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; at a distance &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; from a certain reference atom.&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf schematic.jpg|thumb|200px|Schematic of RDF|left]]&lt;br /&gt;
&lt;br /&gt;
There are three main parts to the RDF graphs: the region near the origin where the &amp;lt;math&amp;gt;\mathrm{RDF} = 0&amp;lt;/math&amp;gt;, the region after where there are big peaks and troughs, and the final region where the graphs have mostly reached equilibrium.&lt;br /&gt;
&lt;br /&gt;
First of all, the region near the origin is 0 for all three phases as that is still within the volume of the reference atom, and hence there are no other atoms in that radius.&lt;br /&gt;
&lt;br /&gt;
The peaks in the second region indicate that there is a higher &amp;quot;effective density&amp;quot; of atoms. The explanation for this is different for the lattice structure (solid) and the fluids (liquid and gas).&lt;br /&gt;
&lt;br /&gt;
For the liquid and gas phase, the peaks are due to the attractive force caused by the Lennard-Jones potential. We have calculated above [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:SUNG95#Lennard-Jones_Potential (1.2 LJ Potential)] that &amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}.&amp;lt;/math&amp;gt; Setting &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt; (as we have in our input file), we get &amp;lt;math&amp;gt;r_{eq} = 1.122&amp;lt;/math&amp;gt;, which is very close to where the largest peaks are for the two fluid phases.&lt;br /&gt;
&lt;br /&gt;
Then for the solid, where all the atoms are in a lattice structure, the effects due to the Lennard-Jones interaction becomes neglibigle. Instead, there will be certain values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where the effective density is higher than the overall density of the sample (the peaks), and some values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where it is lower than the density of the sample (the troughs). This is arisen from the fact that as the value of in a similar fashion to the schematic on the left.&lt;br /&gt;
&lt;br /&gt;
As the value of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the total volume covered by &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; also increases. But since all the atoms are set in place by the lattice, the number of atoms that &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; encompasses stays relatively constant. As a result, the peaks and the troughs tend 1 with increasing &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the case of the gas phase, the atoms are completely free to move around and the RDF graph can be entirely attributed to the effects of the L-J interaction. This justifies the lack of troughs for this phase. Furthermore, as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the attractive part of the L-J interaction &amp;lt;math&amp;gt;\frac{1}{r^6}&amp;lt;/math&amp;gt; gets exponentially smaller and quickly becomes negligible - RDF reaches equilibrium.&lt;br /&gt;
&lt;br /&gt;
Finally, the liquid phase can be considered to act as a mix between the solid phase and the gas phase: the L-J interactions are significant enough to reach equilibrium at a rate similar to the gas phase, but there exists an ordering of the atoms such that there are values of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; where the effective density is lower than the overall density.&lt;br /&gt;
&lt;br /&gt;
From the RDF of the solid phase, each of the peaks point to a certain lattice point. Simple geometrical calculations can be done to indicate that the first peak, which is the lattice point (1) closest to the reference atom (O), is at a separation of &amp;lt;math&amp;gt;\mathrm{r}=1.056.&amp;lt;/math&amp;gt; Second closest point (2) is at a distance of &amp;lt;math&amp;gt;\mathrm{r}=1.4938&amp;lt;/math&amp;gt; and the third (3) at &amp;lt;math&amp;gt;\mathrm{r}=1.8295.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:FCC-SHL.png|thumb|Face-centered cubic lattice|none]]&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
=== Mean Squared Displacement ===&lt;br /&gt;
&lt;br /&gt;
=== Velocity Autocorrelation Function ===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can also be calculated from the Velocity Autocorrelation Function, or VACF.&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;
From the 1D Harmonic Oscillator:&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;
Differentiating this gives the velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = -A\omega \sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting this into the integrated form of the VAFC:&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) \cdot A \omega \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(A \omega \sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, from the trigonometric identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin \left(\alpha + \beta \right)= \sin\alpha\cos\beta + \sin\beta\cos\alpha,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(\omega t + \phi + \omega\tau\right) = \sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \left(\sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\cos\left(\omega \tau\right) + \int_{-\infty}^{\infty} \sin \left(\omega \tau\right) \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt; is a constant so &amp;lt;math&amp;gt;\cos\left(\omega\tau\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sin\left(\omega\tau\right)&amp;lt;/math&amp;gt; can be taken out of the integral.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\cos\left(\omega \tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) + \sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; can cancel out:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\sin(x)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;\cos(x)&amp;lt;/math&amp;gt; is an even function, &amp;lt;math&amp;gt;\sin(x)\cos(x)&amp;lt;/math&amp;gt; is an odd function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; is an odd function (While the value of &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; can change whether or not the functions are even or odd, it shifts both functions by the same amount and the resulting &amp;lt;math&amp;gt;\cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; will still be odd)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}=\cos\left(\omega \tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\cos\left(\omega \tau\right)&amp;lt;/math&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560547</id>
		<title>Rep:Mod:SUNG95</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560547"/>
		<updated>2016-10-21T06:18:48Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: /* Velocity Autocorrelation Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Theory ==&lt;br /&gt;
=== The Velocity-Verlet Algorithm ===&lt;br /&gt;
[[File:Verlet-Velocity.png|thumb|700px|x(t) derived from the velocity-Verlet algorithm compared with the position of the classical harmonic oscillator.|left]]&lt;br /&gt;
[[File:Verlet-Energy.png|thumb|700px|Total energy of the system with respect to time|right]]&lt;br /&gt;
[[File:Verlet-Error.png|thumb|700px|The error derived by comparing the solution of the velocity-Verlet algorithm with the position of the classical harmonic oscillator|none]]&lt;br /&gt;
&lt;br /&gt;
The three graphs above display the position of an atom, the total energy of the system and the error between the two methods of calculating the atom position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Error wrt Time.png|thumb|600px|Maximum Error against Time|none]]&lt;br /&gt;
&lt;br /&gt;
From this graph of Maximum error vs Time, we can see that error increases with time at a stable linear rate.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Running the same calculations with varying timesteps show the importance of choosing the right value of the timestep:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Energy at t=0.05.png|Energy at timestep=0.05&lt;br /&gt;
Image:Energy at t=0.5.png|Energy at timestep=0.5&lt;br /&gt;
Image:Error at t=0.5.png|Error at timestep=0.5&lt;br /&gt;
Image:Error at t=0.05.png|Error at timestep=0.05&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examining the four additional graphs above, we can notice that a shorter timestep is able to provide a smaller value of error and that the energy fluctuates less than a bigger value of timestep. However, a shorter timestep results in a shorter simulation type, which can result in a less realistic simulation. It is therefore important to find the right balance between the two.&lt;br /&gt;
&lt;br /&gt;
Through trial and error, it has been found that timestep = 0.2850 or lower results in an energy fluctuation that is smaller than 1% over the course of the simulation. A small fluctuation in energy indicates higher resemblance to reality as technically the total energy should not fluctuate at all due to the Law of Conservation of Energy.&lt;br /&gt;
&lt;br /&gt;
=== Lennard-Jones Potential ===&lt;br /&gt;
The equation to calculate the Lennard-Jones potential is as follows:&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;
By equating this to 0, we find that the &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the separation at which the potential is 0, is &amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We can then find the force at this separation by differentiating the Lennard-Jones potential with respect to r, and substituting in &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}=\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24 \frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation (&amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;) is the separation of the particles at equilibrium, and represents the separation at which the potential energy is at a minimum. It can thus be found by setting &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}&amp;lt;/math&amp;gt;, (or &amp;lt;math&amp;gt;\mathbf{F}&amp;lt;/math&amp;gt;) to 0.&lt;br /&gt;
&lt;br /&gt;
Hence,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right) 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; gives us the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To put this equation into perspective, let us calculate the L-J potential for some realistic cutoff values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int 4\epsilon \left(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=4 \epsilon \left(\frac{\sigma^{12}}{11r^{11}}-\frac{\sigma^6}{5r^5}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\lim_{r\rightarrow \infty} 4 \left(\frac{1^{12}}{11r^{11}}-\frac{1^6}{5r^5}\right) - 4\left(\frac{1^{12}}{11\times 2^{11}}+\frac{1^6}{5\times 2^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=0-0.024822\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following the same calculations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0081767\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0032901\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
It is very difficult to simulate realistic volumes of liquid and in the scope of this experiment, we have simulated liquids with N (number of atoms) between 1,000 and 10,000. To demonstrate why simulating realistic volumes of liquid is difficult, let us first calculate the number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--TASK: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.--&amp;gt;&lt;br /&gt;
(Assuming: Standard conditions; Density of water = 1.00 g/ml)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.00 \mathrm{ml} = 1.00 \mathrm{g}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;18.02 \mathrm{g/mol} = 0.0555 \text{ mols of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.0555 \times 6.022 \times 10^{23} = 3.34 \times 10^{22} \text{ molecules of water.}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the other hand, 10,000 water molecules is only &amp;lt;math&amp;gt;2.99 \times 10^{-19} \text{ ml of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
10000 water molecules == 1.661 x 10^-20 mols of water. (Conversion using Avogadro Constant)&lt;br /&gt;
1.661 x 10^-20 x 18.02 = 2.99 x 10^-19 g&lt;br /&gt;
approx. 2.99 x 10^-19 ml of water.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus, in order to be able to complete the simulation in a practical amount of time, we place our atoms in a box that is repeated in all directions, similar to how unit cells repeat themselves in a lattice. When an atom crosses the boundary of the box, its replica enters the same box from the other side, thus keeping the total number of atoms in the box constant.&lt;br /&gt;
&lt;br /&gt;
For example, if an atom at position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a cubic box ranging from &amp;lt;math&amp;gt;(0, 0, 0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;, its final position would be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;, if the periodic boundary conditions have been applied.&lt;br /&gt;
&amp;lt;!--We can safely avoid the issue we might encounter arising from the infinite number of particles by setting a cutoff limit ---- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units ===&lt;br /&gt;
The LAMMPS calculations run in this experiment are all done in reduced units&lt;br /&gt;
&lt;br /&gt;
For example, the Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34 \mathrm{nm}&amp;lt;/math&amp;gt;; &amp;lt;math&amp;gt;\epsilon/k_B=120K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If we set the cutoff to be &amp;lt;math&amp;gt;r*=3.2,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=3.2\times0.34=1.088\mathrm{nm}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Well depth: &amp;lt;math&amp;gt;\epsilon=120K\times k_B \times 6.02 \times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon=0.998 \mathrm{kJ/mol}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and reduced temperature &amp;lt;math&amp;gt;T*=1.5&amp;lt;/math&amp;gt; would be &amp;lt;math&amp;gt;T=1.5 \times 120=180\mathrm{K}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
=== Creating Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
In order to simulate a liquid for this experiment, we first create a crystal lattice, then melt that lattice to create a liquid. This is preferable to generating a liquid since assigning a random position for each new atom could result in two or more atoms being generated in the same space, causing an error when running the simulation.&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is one lattice point per unit cell. Hence, if the number density is 0.8,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8 \text{ points/volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sqrt[3]{0.8}=0.9283\text{ points/length}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.9283^{-1}=1.0772 \text{ length/point}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is thus 1.0772 unit lengths of spacing between each point.&lt;br /&gt;
&lt;br /&gt;
Following the same logic, a face-centred cubic lattice (with 4 lattice points per unit cell) with a density of 1.2 would have a spacing of &amp;lt;math&amp;gt;0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\because \sqrt[3]{4.8^{-1}}=0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, the simple cubic lattice with a density of 0.8 would create 1,000 atoms in the given constraints of the box:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;region box block 0 10 0 10 0 10&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and a face centred cubic lattice with a density of 1.2 would create 4,000 atoms in the same box.&lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of the Atoms ===&lt;br /&gt;
In the input script, there are the following lines describing the properties of the atoms:&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;
In the first line, we are setting the mass of type 1 atoms (which includes all of the atoms in our simulation box, as we have created only one type of atoms) as &amp;lt;math&amp;gt;1.0&amp;lt;/math&amp;gt;, in reduced units. The second line defines the interaction between the atoms as a Lenard-Jones interaction, with a cutoff distance of &amp;lt;math&amp;gt;3.0 \text{ units.}&amp;lt;/math&amp;gt; Finally, the last line defines the coefficient in the Lenard-Jones interaction; the asterisk tells LAMMPS that the coefficients apply to all atoms in our system; the first coefficient is &amp;lt;math&amp;gt;\epsilon=1.0&amp;lt;/math&amp;gt; and the second coefficient is &amp;lt;math&amp;gt;\sigma=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After setting the properties of the atoms, we also defined the initial positions and the initial velocities for the atoms in the input script. Since we have both the &amp;lt;math&amp;gt;\mathbf{x}_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, we can use the Velocity-Verlet integration algorithm that employs the half-step method.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
In the following lines from the input script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we created and reset a variable called timestep to equal 0.001, then used that value to calculate how many runs (${n_steps}) to carry out. This is more beneficial than simply setting&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;
as it allows us to only change the value of the timestep variable to alter the number of runs, rather than having to calculate ${n_steps} ourselves every time we change the timestep, especially in cases such as this computational experiment where the timestep was changed multiple times.&lt;br /&gt;
&lt;br /&gt;
=== Checking Equilibration ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--TotalE at 0.0075 - SHL.png--&amp;gt;&lt;br /&gt;
[[File:TotalE at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Temp at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Press at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
&lt;br /&gt;
These graphs have been plotted to ensure that the simulation reaches equilibrium, and we can see that indeed, they do, and very quickly. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
The following graph shows the total energy of the system against time at varying timestep values:&lt;br /&gt;
&lt;br /&gt;
[[File:Equil Energy.png|thumb|800px|none]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from the graphs that for timestep = 0.001, 0.0025 and 0.0075, the energy reaches a stable equilibrium but for timestep = 0.01 and timestep = 0.015, the energy slowly decreases and rapidly increases, respectively, indicating that the results of the simulation are not very accurate for these values of timestep. Timestep = 0.015 is especially bad as it very obviously does not reach an equilibrium.&lt;br /&gt;
&lt;br /&gt;
Therefore, timestep = 0.0075 would be the ideal value as it provides the highest accuracy, while running the simulation for a suitably long time.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions (NpT) ==&lt;br /&gt;
&lt;br /&gt;
=== Temperature and Pressure Control ===&lt;br /&gt;
&lt;br /&gt;
Pressures chosen: 2.61, 2.63&lt;br /&gt;
&lt;br /&gt;
Temperatures chosen: 1.5, 1.6, 1.7, 1.8, 1.9&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 was chosen to provide the highest accuracy possible, without shortening the simulation time too much.&lt;br /&gt;
&lt;br /&gt;
In our simulation, the temperature was controlled by solving the two following equations for the instantaneous temperature &amp;lt;math&amp;gt;T,&amp;lt;/math&amp;gt; which fluctuates.&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 \qquad\qquad\qquad(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order for &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; to reach our target temperature &amp;lt;math&amp;gt;\mathfrak{T},&amp;lt;/math&amp;gt; we introduce a constant &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; to control the velocity such that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}\qquad\qquad(2)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can solve eq. &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt; to solve for &amp;lt;math&amp;gt;\gamma.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\sum_i m_i v_i^2 = 3N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substituting &amp;lt;math&amp;gt;\sum_i m_i v_i^2&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 3 N k_b T = 3N k_b \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\epsilon}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Examining the Input Script ===&lt;br /&gt;
&lt;br /&gt;
To calculate the average values for our simulation, we set certain parameters for LAMMPS in the script.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time Nevery Nrepeat Nfreq&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Final averages are generated on timesteps that are multiples of Nevery, for Nrepeat number of times and an average is generated every Nfreq timesteps.&lt;br /&gt;
&lt;br /&gt;
In our script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The results are sampled at every 100 timesteps for 1000 times (100, 200, 300, etc.) Averages are generated every 100,000 timesteps, but our simulation runs for the same amount of time so only one average is generated from this code.&lt;br /&gt;
&lt;br /&gt;
The timestep chosen for this section of the experiment was 0.0025. Therefore, the simulation was run for &amp;lt;math&amp;gt;100000 \times 0.0025 = 250 \text{ unit time}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equations of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:Density Temp.png|700px]]&lt;br /&gt;
&lt;br /&gt;
The graph above shows the density of the simulated liquid against temperature, compared with the densities derived from the ideal gas law.&lt;br /&gt;
&lt;br /&gt;
It can be seen that within the ranges set for this simulation, the discrepancy between the simulated densities compared to the calculated densities are very high, to the point that the error bars for the y-axis is not even visible on the graph. Perhaps a more accurate simulation could have been run if a wider temperature and pressure ranges were selected.&lt;br /&gt;
&lt;br /&gt;
With the data range being one possible source of error between the simulation and the ideal gas law prediction, another possible factor is that the parameters set for this simulation are such that the repulsive force of the Lennard-Jones interaction is more significant than the attractive force. Since the ideal gas law assumes no electronic interaction between the particles, introducing a repulsive force would result in the density of the liquid being lower than the prediction.&lt;br /&gt;
&lt;br /&gt;
The most likely explanation, however, is that the ideal gas law, as its name suggests, is not very good at predicting the behavious of liquids. While both gas and liquid phases are fluids, there are major differences between them such as a much more prominent long-range order effect in liquids compared to gases.&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacity ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--To calculate the heat capacity of our simulated liquid, we investigated how much the energy of our system fluctuates with respect to temperature, according to the equation &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variance in energy can be derived from statistical thermodynamics: &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:HeatCap vs Density.png|thumb|800px|Graph of &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; against Temperature|none]]&lt;br /&gt;
&lt;br /&gt;
From thermodynamics:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;dU = TdS - PdV&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = T\frac{\partial S}{\partial T}-P\frac{\partial V}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and since &amp;lt;math&amp;gt;\frac{\partial S}{\partial T}\geq 0,&amp;lt;/math&amp;gt; heat capacity should increase with increasing temperature.&lt;br /&gt;
&lt;br /&gt;
The fact that &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; decreases with increasing temperature suggests that either the increase in temperature is causing the internal energy to increase at a faster rate than itself, or that there are issues with the simulation originating from possible sources such as small sampling size (number of atoms generated) or short run time.&lt;br /&gt;
&lt;br /&gt;
== Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
[[File:RDF SHL.png|thumb|700px]]&lt;br /&gt;
&lt;br /&gt;
It can be noticed that the three phases have clearly different Radial Distribution Functions (RDF) from each other and this can be attributed to the varying degrees of order each of the phases have: the atoms in the gas phase are completely free to move around, while atoms in the liquid phase have less freedom and in the solid phase, the atoms are set in a lattice, with only vibrational motion and no (or negligible) translational motion.&lt;br /&gt;
&lt;br /&gt;
In order to explain the graph, let us consider the RDF to be displaying the &amp;quot;effective density&amp;quot; of atoms in an area of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; at a distance &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; from a certain reference atom.&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf schematic.jpg|thumb|200px|Schematic of RDF|left]]&lt;br /&gt;
&lt;br /&gt;
There are three main parts to the RDF graphs: the region near the origin where the &amp;lt;math&amp;gt;\mathrm{RDF} = 0&amp;lt;/math&amp;gt;, the region after where there are big peaks and troughs, and the final region where the graphs have mostly reached equilibrium.&lt;br /&gt;
&lt;br /&gt;
First of all, the region near the origin is 0 for all three phases as that is still within the volume of the reference atom, and hence there are no other atoms in that radius.&lt;br /&gt;
&lt;br /&gt;
The peaks in the second region indicate that there is a higher &amp;quot;effective density&amp;quot; of atoms. The explanation for this is different for the lattice structure (solid) and the fluids (liquid and gas).&lt;br /&gt;
&lt;br /&gt;
For the liquid and gas phase, the peaks are due to the attractive force caused by the Lennard-Jones potential. We have calculated above [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:SUNG95#Lennard-Jones_Potential (1.2 LJ Potential)] that &amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}.&amp;lt;/math&amp;gt; Setting &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt; (as we have in our input file), we get &amp;lt;math&amp;gt;r_{eq} = 1.122&amp;lt;/math&amp;gt;, which is very close to where the largest peaks are for the two fluid phases.&lt;br /&gt;
&lt;br /&gt;
Then for the solid, where all the atoms are in a lattice structure, the effects due to the Lennard-Jones interaction becomes neglibigle. Instead, there will be certain values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where the effective density is higher than the overall density of the sample (the peaks), and some values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where it is lower than the density of the sample (the troughs). This is arisen from the fact that as the value of in a similar fashion to the schematic on the left.&lt;br /&gt;
&lt;br /&gt;
As the value of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the total volume covered by &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; also increases. But since all the atoms are set in place by the lattice, the number of atoms that &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; encompasses stays relatively constant. As a result, the peaks and the troughs tend 1 with increasing &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the case of the gas phase, the atoms are completely free to move around and the RDF graph can be entirely attributed to the effects of the L-J interaction. This justifies the lack of troughs for this phase. Furthermore, as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the attractive part of the L-J interaction &amp;lt;math&amp;gt;\frac{1}{r^6}&amp;lt;/math&amp;gt; gets exponentially smaller and quickly becomes negligible - RDF reaches equilibrium.&lt;br /&gt;
&lt;br /&gt;
Finally, the liquid phase can be considered to act as a mix between the solid phase and the gas phase: the L-J interactions are significant enough to reach equilibrium at a rate similar to the gas phase, but there exists an ordering of the atoms such that there are values of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; where the effective density is lower than the overall density.&lt;br /&gt;
&lt;br /&gt;
From the RDF of the solid phase, each of the peaks point to a certain lattice point. Simple geometrical calculations can be done to indicate that the first peak, which is the lattice point (1) closest to the reference atom (O), is at a separation of &amp;lt;math&amp;gt;\mathrm{r}=1.056.&amp;lt;/math&amp;gt; Second closest point (2) is at a distance of &amp;lt;math&amp;gt;\mathrm{r}=1.4938&amp;lt;/math&amp;gt; and the third (3) at &amp;lt;math&amp;gt;\mathrm{r}=1.8295.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:FCC-SHL.png|thumb|Face-centered cubic lattice|none]]&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
=== Mean Squared Displacement ===&lt;br /&gt;
&lt;br /&gt;
=== Velocity Autocorrelation Function ===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can also be calculated from the Velocity Autocorrelation Function, or VACF.&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;
From the 1D Harmonic Oscillator:&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;
Differentiating this gives the velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = -A\omega \sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting this into the integrated form of the VAFC:&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) \cdot A \omega \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(A \omega \sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, from the trigonometric identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin \left(\alpha + \beta \right)= \sin\alpha\cos\beta + \sin\beta\cos\alpha,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(\omega t + \phi + \omega\tau\right) = \sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \left(\sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\cos\left(\omega \tau\right) + \int_{-\infty}^{\infty} \sin \left(\omega \tau\right) \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt; is a constant so &amp;lt;math&amp;gt;\cos\left(\omega\tau\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sin\left(\omega\tau\right)&amp;lt;/math&amp;gt; can be taken out of the integral.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\cos\left(\omega \tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) + \sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; can cancel out:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\sin(x)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;\cos(x)&amp;lt;/math&amp;gt; is an even function, &amp;lt;math&amp;gt;\sin(x)\cos(x)&amp;lt;/math&amp;gt; is an odd function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; is an odd function (While the value of &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; can change whether or not the functions are even or odd, it shifts both functions by the same amount and the resulting &amp;lt;math&amp;gt;\cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; will still be odd)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\qquad=\cos\left(\omega \tau\right)&amp;lt;/math&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560528</id>
		<title>Rep:Mod:SUNG95</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560528"/>
		<updated>2016-10-21T05:02:42Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: /* Calculating Heat Capacity */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Theory ==&lt;br /&gt;
=== The Velocity-Verlet Algorithm ===&lt;br /&gt;
[[File:Verlet-Velocity.png|thumb|700px|x(t) derived from the velocity-Verlet algorithm compared with the position of the classical harmonic oscillator.|left]]&lt;br /&gt;
[[File:Verlet-Energy.png|thumb|700px|Total energy of the system with respect to time|right]]&lt;br /&gt;
[[File:Verlet-Error.png|thumb|700px|The error derived by comparing the solution of the velocity-Verlet algorithm with the position of the classical harmonic oscillator|none]]&lt;br /&gt;
&lt;br /&gt;
The three graphs above display the position of an atom, the total energy of the system and the error between the two methods of calculating the atom position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Error wrt Time.png|thumb|600px|Maximum Error against Time|none]]&lt;br /&gt;
&lt;br /&gt;
From this graph of Maximum error vs Time, we can see that error increases with time at a stable linear rate.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Running the same calculations with varying timesteps show the importance of choosing the right value of the timestep:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Energy at t=0.05.png|Energy at timestep=0.05&lt;br /&gt;
Image:Energy at t=0.5.png|Energy at timestep=0.5&lt;br /&gt;
Image:Error at t=0.5.png|Error at timestep=0.5&lt;br /&gt;
Image:Error at t=0.05.png|Error at timestep=0.05&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examining the four additional graphs above, we can notice that a shorter timestep is able to provide a smaller value of error and that the energy fluctuates less than a bigger value of timestep. However, a shorter timestep results in a shorter simulation type, which can result in a less realistic simulation. It is therefore important to find the right balance between the two.&lt;br /&gt;
&lt;br /&gt;
Through trial and error, it has been found that timestep = 0.2850 or lower results in an energy fluctuation that is smaller than 1% over the course of the simulation. A small fluctuation in energy indicates higher resemblance to reality as technically the total energy should not fluctuate at all due to the Law of Conservation of Energy.&lt;br /&gt;
&lt;br /&gt;
=== Lennard-Jones Potential ===&lt;br /&gt;
The equation to calculate the Lennard-Jones potential is as follows:&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;
By equating this to 0, we find that the &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the separation at which the potential is 0, is &amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We can then find the force at this separation by differentiating the Lennard-Jones potential with respect to r, and substituting in &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}=\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24 \frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation (&amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;) is the separation of the particles at equilibrium, and represents the separation at which the potential energy is at a minimum. It can thus be found by setting &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}&amp;lt;/math&amp;gt;, (or &amp;lt;math&amp;gt;\mathbf{F}&amp;lt;/math&amp;gt;) to 0.&lt;br /&gt;
&lt;br /&gt;
Hence,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right) 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; gives us the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To put this equation into perspective, let us calculate the L-J potential for some realistic cutoff values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int 4\epsilon \left(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=4 \epsilon \left(\frac{\sigma^{12}}{11r^{11}}-\frac{\sigma^6}{5r^5}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\lim_{r\rightarrow \infty} 4 \left(\frac{1^{12}}{11r^{11}}-\frac{1^6}{5r^5}\right) - 4\left(\frac{1^{12}}{11\times 2^{11}}+\frac{1^6}{5\times 2^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=0-0.024822\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following the same calculations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0081767\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0032901\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
It is very difficult to simulate realistic volumes of liquid and in the scope of this experiment, we have simulated liquids with N (number of atoms) between 1,000 and 10,000. To demonstrate why simulating realistic volumes of liquid is difficult, let us first calculate the number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--TASK: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.--&amp;gt;&lt;br /&gt;
(Assuming: Standard conditions; Density of water = 1.00 g/ml)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.00 \mathrm{ml} = 1.00 \mathrm{g}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;18.02 \mathrm{g/mol} = 0.0555 \text{ mols of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.0555 \times 6.022 \times 10^{23} = 3.34 \times 10^{22} \text{ molecules of water.}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the other hand, 10,000 water molecules is only &amp;lt;math&amp;gt;2.99 \times 10^{-19} \text{ ml of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
10000 water molecules == 1.661 x 10^-20 mols of water. (Conversion using Avogadro Constant)&lt;br /&gt;
1.661 x 10^-20 x 18.02 = 2.99 x 10^-19 g&lt;br /&gt;
approx. 2.99 x 10^-19 ml of water.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus, in order to be able to complete the simulation in a practical amount of time, we place our atoms in a box that is repeated in all directions, similar to how unit cells repeat themselves in a lattice. When an atom crosses the boundary of the box, its replica enters the same box from the other side, thus keeping the total number of atoms in the box constant.&lt;br /&gt;
&lt;br /&gt;
For example, if an atom at position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a cubic box ranging from &amp;lt;math&amp;gt;(0, 0, 0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;, its final position would be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;, if the periodic boundary conditions have been applied.&lt;br /&gt;
&amp;lt;!--We can safely avoid the issue we might encounter arising from the infinite number of particles by setting a cutoff limit ---- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units ===&lt;br /&gt;
The LAMMPS calculations run in this experiment are all done in reduced units&lt;br /&gt;
&lt;br /&gt;
For example, the Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34 \mathrm{nm}&amp;lt;/math&amp;gt;; &amp;lt;math&amp;gt;\epsilon/k_B=120K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If we set the cutoff to be &amp;lt;math&amp;gt;r*=3.2,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=3.2\times0.34=1.088\mathrm{nm}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Well depth: &amp;lt;math&amp;gt;\epsilon=120K\times k_B \times 6.02 \times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon=0.998 \mathrm{kJ/mol}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and reduced temperature &amp;lt;math&amp;gt;T*=1.5&amp;lt;/math&amp;gt; would be &amp;lt;math&amp;gt;T=1.5 \times 120=180\mathrm{K}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
=== Creating Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
In order to simulate a liquid for this experiment, we first create a crystal lattice, then melt that lattice to create a liquid. This is preferable to generating a liquid since assigning a random position for each new atom could result in two or more atoms being generated in the same space, causing an error when running the simulation.&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is one lattice point per unit cell. Hence, if the number density is 0.8,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8 \text{ points/volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sqrt[3]{0.8}=0.9283\text{ points/length}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.9283^{-1}=1.0772 \text{ length/point}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is thus 1.0772 unit lengths of spacing between each point.&lt;br /&gt;
&lt;br /&gt;
Following the same logic, a face-centred cubic lattice (with 4 lattice points per unit cell) with a density of 1.2 would have a spacing of &amp;lt;math&amp;gt;0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\because \sqrt[3]{4.8^{-1}}=0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, the simple cubic lattice with a density of 0.8 would create 1,000 atoms in the given constraints of the box:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;region box block 0 10 0 10 0 10&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and a face centred cubic lattice with a density of 1.2 would create 4,000 atoms in the same box.&lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of the Atoms ===&lt;br /&gt;
In the input script, there are the following lines describing the properties of the atoms:&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;
In the first line, we are setting the mass of type 1 atoms (which includes all of the atoms in our simulation box, as we have created only one type of atoms) as &amp;lt;math&amp;gt;1.0&amp;lt;/math&amp;gt;, in reduced units. The second line defines the interaction between the atoms as a Lenard-Jones interaction, with a cutoff distance of &amp;lt;math&amp;gt;3.0 \text{ units.}&amp;lt;/math&amp;gt; Finally, the last line defines the coefficient in the Lenard-Jones interaction; the asterisk tells LAMMPS that the coefficients apply to all atoms in our system; the first coefficient is &amp;lt;math&amp;gt;\epsilon=1.0&amp;lt;/math&amp;gt; and the second coefficient is &amp;lt;math&amp;gt;\sigma=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After setting the properties of the atoms, we also defined the initial positions and the initial velocities for the atoms in the input script. Since we have both the &amp;lt;math&amp;gt;\mathbf{x}_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, we can use the Velocity-Verlet integration algorithm that employs the half-step method.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
In the following lines from the input script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we created and reset a variable called timestep to equal 0.001, then used that value to calculate how many runs (${n_steps}) to carry out. This is more beneficial than simply setting&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;
as it allows us to only change the value of the timestep variable to alter the number of runs, rather than having to calculate ${n_steps} ourselves every time we change the timestep, especially in cases such as this computational experiment where the timestep was changed multiple times.&lt;br /&gt;
&lt;br /&gt;
=== Checking Equilibration ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--TotalE at 0.0075 - SHL.png--&amp;gt;&lt;br /&gt;
[[File:TotalE at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Temp at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Press at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
&lt;br /&gt;
These graphs have been plotted to ensure that the simulation reaches equilibrium, and we can see that indeed, they do, and very quickly. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
The following graph shows the total energy of the system against time at varying timestep values:&lt;br /&gt;
&lt;br /&gt;
[[File:Equil Energy.png|thumb|800px|none]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from the graphs that for timestep = 0.001, 0.0025 and 0.0075, the energy reaches a stable equilibrium but for timestep = 0.01 and timestep = 0.015, the energy slowly decreases and rapidly increases, respectively, indicating that the results of the simulation are not very accurate for these values of timestep. Timestep = 0.015 is especially bad as it very obviously does not reach an equilibrium.&lt;br /&gt;
&lt;br /&gt;
Therefore, timestep = 0.0075 would be the ideal value as it provides the highest accuracy, while running the simulation for a suitably long time.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions (NpT) ==&lt;br /&gt;
&lt;br /&gt;
=== Temperature and Pressure Control ===&lt;br /&gt;
&lt;br /&gt;
Pressures chosen: 2.61, 2.63&lt;br /&gt;
&lt;br /&gt;
Temperatures chosen: 1.5, 1.6, 1.7, 1.8, 1.9&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 was chosen to provide the highest accuracy possible, without shortening the simulation time too much.&lt;br /&gt;
&lt;br /&gt;
In our simulation, the temperature was controlled by solving the two following equations for the instantaneous temperature &amp;lt;math&amp;gt;T,&amp;lt;/math&amp;gt; which fluctuates.&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 \qquad\qquad\qquad(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order for &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; to reach our target temperature &amp;lt;math&amp;gt;\mathfrak{T},&amp;lt;/math&amp;gt; we introduce a constant &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; to control the velocity such that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}\qquad\qquad(2)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can solve eq. &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt; to solve for &amp;lt;math&amp;gt;\gamma.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\sum_i m_i v_i^2 = 3N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substituting &amp;lt;math&amp;gt;\sum_i m_i v_i^2&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 3 N k_b T = 3N k_b \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\epsilon}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Examining the Input Script ===&lt;br /&gt;
&lt;br /&gt;
To calculate the average values for our simulation, we set certain parameters for LAMMPS in the script.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time Nevery Nrepeat Nfreq&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Final averages are generated on timesteps that are multiples of Nevery, for Nrepeat number of times and an average is generated every Nfreq timesteps.&lt;br /&gt;
&lt;br /&gt;
In our script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The results are sampled at every 100 timesteps for 1000 times (100, 200, 300, etc.) Averages are generated every 100,000 timesteps, but our simulation runs for the same amount of time so only one average is generated from this code.&lt;br /&gt;
&lt;br /&gt;
The timestep chosen for this section of the experiment was 0.0025. Therefore, the simulation was run for &amp;lt;math&amp;gt;100000 \times 0.0025 = 250 \text{ unit time}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equations of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:Density Temp.png|700px]]&lt;br /&gt;
&lt;br /&gt;
The graph above shows the density of the simulated liquid against temperature, compared with the densities derived from the ideal gas law.&lt;br /&gt;
&lt;br /&gt;
It can be seen that within the ranges set for this simulation, the discrepancy between the simulated densities compared to the calculated densities are very high, to the point that the error bars for the y-axis is not even visible on the graph. Perhaps a more accurate simulation could have been run if a wider temperature and pressure ranges were selected.&lt;br /&gt;
&lt;br /&gt;
With the data range being one possible source of error between the simulation and the ideal gas law prediction, another possible factor is that the parameters set for this simulation are such that the repulsive force of the Lennard-Jones interaction is more significant than the attractive force. Since the ideal gas law assumes no electronic interaction between the particles, introducing a repulsive force would result in the density of the liquid being lower than the prediction.&lt;br /&gt;
&lt;br /&gt;
The most likely explanation, however, is that the ideal gas law, as its name suggests, is not very good at predicting the behavious of liquids. While both gas and liquid phases are fluids, there are major differences between them such as a much more prominent long-range order effect in liquids compared to gases.&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacity ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--To calculate the heat capacity of our simulated liquid, we investigated how much the energy of our system fluctuates with respect to temperature, according to the equation &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variance in energy can be derived from statistical thermodynamics: &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:HeatCap vs Density.png|thumb|800px|Graph of &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; against Temperature|none]]&lt;br /&gt;
&lt;br /&gt;
From thermodynamics:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;dU = TdS - PdV&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = T\frac{\partial S}{\partial T}-P\frac{\partial V}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and since &amp;lt;math&amp;gt;\frac{\partial S}{\partial T}\geq 0,&amp;lt;/math&amp;gt; heat capacity should increase with increasing temperature.&lt;br /&gt;
&lt;br /&gt;
The fact that &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; decreases with increasing temperature suggests that either the increase in temperature is causing the internal energy to increase at a faster rate than itself, or that there are issues with the simulation originating from possible sources such as small sampling size (number of atoms generated) or short run time.&lt;br /&gt;
&lt;br /&gt;
== Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
[[File:RDF SHL.png|thumb|700px]]&lt;br /&gt;
&lt;br /&gt;
It can be noticed that the three phases have clearly different Radial Distribution Functions (RDF) from each other and this can be attributed to the varying degrees of order each of the phases have: the atoms in the gas phase are completely free to move around, while atoms in the liquid phase have less freedom and in the solid phase, the atoms are set in a lattice, with only vibrational motion and no (or negligible) translational motion.&lt;br /&gt;
&lt;br /&gt;
In order to explain the graph, let us consider the RDF to be displaying the &amp;quot;effective density&amp;quot; of atoms in an area of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; at a distance &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; from a certain reference atom.&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf schematic.jpg|thumb|200px|Schematic of RDF|left]]&lt;br /&gt;
&lt;br /&gt;
There are three main parts to the RDF graphs: the region near the origin where the &amp;lt;math&amp;gt;\mathrm{RDF} = 0&amp;lt;/math&amp;gt;, the region after where there are big peaks and troughs, and the final region where the graphs have mostly reached equilibrium.&lt;br /&gt;
&lt;br /&gt;
First of all, the region near the origin is 0 for all three phases as that is still within the volume of the reference atom, and hence there are no other atoms in that radius.&lt;br /&gt;
&lt;br /&gt;
The peaks in the second region indicate that there is a higher &amp;quot;effective density&amp;quot; of atoms. The explanation for this is different for the lattice structure (solid) and the fluids (liquid and gas).&lt;br /&gt;
&lt;br /&gt;
For the liquid and gas phase, the peaks are due to the attractive force caused by the Lennard-Jones potential. We have calculated above [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:SUNG95#Lennard-Jones_Potential (1.2 LJ Potential)] that &amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}.&amp;lt;/math&amp;gt; Setting &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt; (as we have in our input file), we get &amp;lt;math&amp;gt;r_{eq} = 1.122&amp;lt;/math&amp;gt;, which is very close to where the largest peaks are for the two fluid phases.&lt;br /&gt;
&lt;br /&gt;
Then for the solid, where all the atoms are in a lattice structure, the effects due to the Lennard-Jones interaction becomes neglibigle. Instead, there will be certain values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where the effective density is higher than the overall density of the sample (the peaks), and some values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where it is lower than the density of the sample (the troughs). This is arisen from the fact that as the value of in a similar fashion to the schematic on the left.&lt;br /&gt;
&lt;br /&gt;
As the value of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the total volume covered by &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; also increases. But since all the atoms are set in place by the lattice, the number of atoms that &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; encompasses stays relatively constant. As a result, the peaks and the troughs tend 1 with increasing &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the case of the gas phase, the atoms are completely free to move around and the RDF graph can be entirely attributed to the effects of the L-J interaction. This justifies the lack of troughs for this phase. Furthermore, as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the attractive part of the L-J interaction &amp;lt;math&amp;gt;\frac{1}{r^6}&amp;lt;/math&amp;gt; gets exponentially smaller and quickly becomes negligible - RDF reaches equilibrium.&lt;br /&gt;
&lt;br /&gt;
Finally, the liquid phase can be considered to act as a mix between the solid phase and the gas phase: the L-J interactions are significant enough to reach equilibrium at a rate similar to the gas phase, but there exists an ordering of the atoms such that there are values of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; where the effective density is lower than the overall density.&lt;br /&gt;
&lt;br /&gt;
From the RDF of the solid phase, each of the peaks point to a certain lattice point. Simple geometrical calculations can be done to indicate that the first peak, which is the lattice point (1) closest to the reference atom (O), is at a separation of &amp;lt;math&amp;gt;\mathrm{r}=1.056.&amp;lt;/math&amp;gt; Second closest point (2) is at a distance of &amp;lt;math&amp;gt;\mathrm{r}=1.4938&amp;lt;/math&amp;gt; and the third (3) at &amp;lt;math&amp;gt;\mathrm{r}=1.8295.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:FCC-SHL.png|thumb|Face-centered cubic lattice|none]]&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
=== Mean Squared Displacement ===&lt;br /&gt;
&lt;br /&gt;
=== Velocity Autocorrelation Function ===&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560515</id>
		<title>Rep:Mod:SUNG95</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560515"/>
		<updated>2016-10-21T04:53:23Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: /* Results of NpT Simulation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Theory ==&lt;br /&gt;
=== The Velocity-Verlet Algorithm ===&lt;br /&gt;
[[File:Verlet-Velocity.png|thumb|700px|x(t) derived from the velocity-Verlet algorithm compared with the position of the classical harmonic oscillator.|left]]&lt;br /&gt;
[[File:Verlet-Energy.png|thumb|700px|Total energy of the system with respect to time|right]]&lt;br /&gt;
[[File:Verlet-Error.png|thumb|700px|The error derived by comparing the solution of the velocity-Verlet algorithm with the position of the classical harmonic oscillator|none]]&lt;br /&gt;
&lt;br /&gt;
The three graphs above display the position of an atom, the total energy of the system and the error between the two methods of calculating the atom position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Error wrt Time.png|thumb|600px|Maximum Error against Time|none]]&lt;br /&gt;
&lt;br /&gt;
From this graph of Maximum error vs Time, we can see that error increases with time at a stable linear rate.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Running the same calculations with varying timesteps show the importance of choosing the right value of the timestep:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Energy at t=0.05.png|Energy at timestep=0.05&lt;br /&gt;
Image:Energy at t=0.5.png|Energy at timestep=0.5&lt;br /&gt;
Image:Error at t=0.5.png|Error at timestep=0.5&lt;br /&gt;
Image:Error at t=0.05.png|Error at timestep=0.05&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examining the four additional graphs above, we can notice that a shorter timestep is able to provide a smaller value of error and that the energy fluctuates less than a bigger value of timestep. However, a shorter timestep results in a shorter simulation type, which can result in a less realistic simulation. It is therefore important to find the right balance between the two.&lt;br /&gt;
&lt;br /&gt;
Through trial and error, it has been found that timestep = 0.2850 or lower results in an energy fluctuation that is smaller than 1% over the course of the simulation. A small fluctuation in energy indicates higher resemblance to reality as technically the total energy should not fluctuate at all due to the Law of Conservation of Energy.&lt;br /&gt;
&lt;br /&gt;
=== Lennard-Jones Potential ===&lt;br /&gt;
The equation to calculate the Lennard-Jones potential is as follows:&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;
By equating this to 0, we find that the &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the separation at which the potential is 0, is &amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We can then find the force at this separation by differentiating the Lennard-Jones potential with respect to r, and substituting in &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}=\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24 \frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation (&amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;) is the separation of the particles at equilibrium, and represents the separation at which the potential energy is at a minimum. It can thus be found by setting &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}&amp;lt;/math&amp;gt;, (or &amp;lt;math&amp;gt;\mathbf{F}&amp;lt;/math&amp;gt;) to 0.&lt;br /&gt;
&lt;br /&gt;
Hence,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right) 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; gives us the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To put this equation into perspective, let us calculate the L-J potential for some realistic cutoff values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int 4\epsilon \left(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=4 \epsilon \left(\frac{\sigma^{12}}{11r^{11}}-\frac{\sigma^6}{5r^5}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\lim_{r\rightarrow \infty} 4 \left(\frac{1^{12}}{11r^{11}}-\frac{1^6}{5r^5}\right) - 4\left(\frac{1^{12}}{11\times 2^{11}}+\frac{1^6}{5\times 2^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=0-0.024822\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following the same calculations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0081767\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0032901\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
It is very difficult to simulate realistic volumes of liquid and in the scope of this experiment, we have simulated liquids with N (number of atoms) between 1,000 and 10,000. To demonstrate why simulating realistic volumes of liquid is difficult, let us first calculate the number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--TASK: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.--&amp;gt;&lt;br /&gt;
(Assuming: Standard conditions; Density of water = 1.00 g/ml)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.00 \mathrm{ml} = 1.00 \mathrm{g}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;18.02 \mathrm{g/mol} = 0.0555 \text{ mols of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.0555 \times 6.022 \times 10^{23} = 3.34 \times 10^{22} \text{ molecules of water.}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the other hand, 10,000 water molecules is only &amp;lt;math&amp;gt;2.99 \times 10^{-19} \text{ ml of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
10000 water molecules == 1.661 x 10^-20 mols of water. (Conversion using Avogadro Constant)&lt;br /&gt;
1.661 x 10^-20 x 18.02 = 2.99 x 10^-19 g&lt;br /&gt;
approx. 2.99 x 10^-19 ml of water.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus, in order to be able to complete the simulation in a practical amount of time, we place our atoms in a box that is repeated in all directions, similar to how unit cells repeat themselves in a lattice. When an atom crosses the boundary of the box, its replica enters the same box from the other side, thus keeping the total number of atoms in the box constant.&lt;br /&gt;
&lt;br /&gt;
For example, if an atom at position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a cubic box ranging from &amp;lt;math&amp;gt;(0, 0, 0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;, its final position would be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;, if the periodic boundary conditions have been applied.&lt;br /&gt;
&amp;lt;!--We can safely avoid the issue we might encounter arising from the infinite number of particles by setting a cutoff limit ---- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units ===&lt;br /&gt;
The LAMMPS calculations run in this experiment are all done in reduced units&lt;br /&gt;
&lt;br /&gt;
For example, the Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34 \mathrm{nm}&amp;lt;/math&amp;gt;; &amp;lt;math&amp;gt;\epsilon/k_B=120K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If we set the cutoff to be &amp;lt;math&amp;gt;r*=3.2,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=3.2\times0.34=1.088\mathrm{nm}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Well depth: &amp;lt;math&amp;gt;\epsilon=120K\times k_B \times 6.02 \times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon=0.998 \mathrm{kJ/mol}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and reduced temperature &amp;lt;math&amp;gt;T*=1.5&amp;lt;/math&amp;gt; would be &amp;lt;math&amp;gt;T=1.5 \times 120=180\mathrm{K}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
=== Creating Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
In order to simulate a liquid for this experiment, we first create a crystal lattice, then melt that lattice to create a liquid. This is preferable to generating a liquid since assigning a random position for each new atom could result in two or more atoms being generated in the same space, causing an error when running the simulation.&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is one lattice point per unit cell. Hence, if the number density is 0.8,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8 \text{ points/volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sqrt[3]{0.8}=0.9283\text{ points/length}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.9283^{-1}=1.0772 \text{ length/point}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is thus 1.0772 unit lengths of spacing between each point.&lt;br /&gt;
&lt;br /&gt;
Following the same logic, a face-centred cubic lattice (with 4 lattice points per unit cell) with a density of 1.2 would have a spacing of &amp;lt;math&amp;gt;0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\because \sqrt[3]{4.8^{-1}}=0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, the simple cubic lattice with a density of 0.8 would create 1,000 atoms in the given constraints of the box:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;region box block 0 10 0 10 0 10&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and a face centred cubic lattice with a density of 1.2 would create 4,000 atoms in the same box.&lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of the Atoms ===&lt;br /&gt;
In the input script, there are the following lines describing the properties of the atoms:&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;
In the first line, we are setting the mass of type 1 atoms (which includes all of the atoms in our simulation box, as we have created only one type of atoms) as &amp;lt;math&amp;gt;1.0&amp;lt;/math&amp;gt;, in reduced units. The second line defines the interaction between the atoms as a Lenard-Jones interaction, with a cutoff distance of &amp;lt;math&amp;gt;3.0 \text{ units.}&amp;lt;/math&amp;gt; Finally, the last line defines the coefficient in the Lenard-Jones interaction; the asterisk tells LAMMPS that the coefficients apply to all atoms in our system; the first coefficient is &amp;lt;math&amp;gt;\epsilon=1.0&amp;lt;/math&amp;gt; and the second coefficient is &amp;lt;math&amp;gt;\sigma=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After setting the properties of the atoms, we also defined the initial positions and the initial velocities for the atoms in the input script. Since we have both the &amp;lt;math&amp;gt;\mathbf{x}_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, we can use the Velocity-Verlet integration algorithm that employs the half-step method.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
In the following lines from the input script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we created and reset a variable called timestep to equal 0.001, then used that value to calculate how many runs (${n_steps}) to carry out. This is more beneficial than simply setting&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;
as it allows us to only change the value of the timestep variable to alter the number of runs, rather than having to calculate ${n_steps} ourselves every time we change the timestep, especially in cases such as this computational experiment where the timestep was changed multiple times.&lt;br /&gt;
&lt;br /&gt;
=== Checking Equilibration ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--TotalE at 0.0075 - SHL.png--&amp;gt;&lt;br /&gt;
[[File:TotalE at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Temp at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Press at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
&lt;br /&gt;
These graphs have been plotted to ensure that the simulation reaches equilibrium, and we can see that indeed, they do, and very quickly. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
The following graph shows the total energy of the system against time at varying timestep values:&lt;br /&gt;
&lt;br /&gt;
[[File:Equil Energy.png|thumb|800px|none]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from the graphs that for timestep = 0.001, 0.0025 and 0.0075, the energy reaches a stable equilibrium but for timestep = 0.01 and timestep = 0.015, the energy slowly decreases and rapidly increases, respectively, indicating that the results of the simulation are not very accurate for these values of timestep. Timestep = 0.015 is especially bad as it very obviously does not reach an equilibrium.&lt;br /&gt;
&lt;br /&gt;
Therefore, timestep = 0.0075 would be the ideal value as it provides the highest accuracy, while running the simulation for a suitably long time.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions (NpT) ==&lt;br /&gt;
&lt;br /&gt;
=== Temperature and Pressure Control ===&lt;br /&gt;
&lt;br /&gt;
Pressures chosen: 2.61, 2.63&lt;br /&gt;
&lt;br /&gt;
Temperatures chosen: 1.5, 1.6, 1.7, 1.8, 1.9&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 was chosen to provide the highest accuracy possible, without shortening the simulation time too much.&lt;br /&gt;
&lt;br /&gt;
In our simulation, the temperature was controlled by solving the two following equations for the instantaneous temperature &amp;lt;math&amp;gt;T,&amp;lt;/math&amp;gt; which fluctuates.&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 \qquad\qquad\qquad(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order for &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; to reach our target temperature &amp;lt;math&amp;gt;\mathfrak{T},&amp;lt;/math&amp;gt; we introduce a constant &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; to control the velocity such that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}\qquad\qquad(2)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can solve eq. &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt; to solve for &amp;lt;math&amp;gt;\gamma.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\sum_i m_i v_i^2 = 3N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substituting &amp;lt;math&amp;gt;\sum_i m_i v_i^2&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 3 N k_b T = 3N k_b \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\epsilon}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Examining the Input Script ===&lt;br /&gt;
&lt;br /&gt;
To calculate the average values for our simulation, we set certain parameters for LAMMPS in the script.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time Nevery Nrepeat Nfreq&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Final averages are generated on timesteps that are multiples of Nevery, for Nrepeat number of times and an average is generated every Nfreq timesteps.&lt;br /&gt;
&lt;br /&gt;
In our script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The results are sampled at every 100 timesteps for 1000 times (100, 200, 300, etc.) Averages are generated every 100,000 timesteps, but our simulation runs for the same amount of time so only one average is generated from this code.&lt;br /&gt;
&lt;br /&gt;
The timestep chosen for this section of the experiment was 0.0025. Therefore, the simulation was run for &amp;lt;math&amp;gt;100000 \times 0.0025 = 250 \text{ unit time}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equations of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:Density Temp.png|700px]]&lt;br /&gt;
&lt;br /&gt;
The graph above shows the density of the simulated liquid against temperature, compared with the densities derived from the ideal gas law.&lt;br /&gt;
&lt;br /&gt;
It can be seen that within the ranges set for this simulation, the discrepancy between the simulated densities compared to the calculated densities are very high, to the point that the error bars for the y-axis is not even visible on the graph. Perhaps a more accurate simulation could have been run if a wider temperature and pressure ranges were selected.&lt;br /&gt;
&lt;br /&gt;
With the data range being one possible source of error between the simulation and the ideal gas law prediction, another possible factor is that the parameters set for this simulation are such that the repulsive force of the Lennard-Jones interaction is more significant than the attractive force. Since the ideal gas law assumes no electronic interaction between the particles, introducing a repulsive force would result in the density of the liquid being lower than the prediction.&lt;br /&gt;
&lt;br /&gt;
The most likely explanation, however, is that the ideal gas law, as its name suggests, is not very good at predicting the behavious of liquids. While both gas and liquid phases are fluids, there are major differences between them such as a much more prominent long-range order effect in liquids compared to gases.&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacity ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--To calculate the heat capacity of our simulated liquid, we investigated how much the energy of our system fluctuates with respect to temperature, according to the equation &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variance in energy can be derived from statistical thermodynamics: &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:HeatCap vs Density.png|thumb|800px|Graph of &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; against Temperature|none]]&lt;br /&gt;
&lt;br /&gt;
From thermodynamics:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;dU = TdS - PdV&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = T\frac{\partial S}{\partial T}-P\frac{\partial V}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and since &amp;lt;math&amp;gt;\frac{\partial S}{\partial T}\geq 0,&amp;lt;/math&amp;gt; heat capacity should increase with increasing temperature.&lt;br /&gt;
&lt;br /&gt;
The fact that &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; decreases with increasing temperature suggests that either&lt;br /&gt;
&lt;br /&gt;
== Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
[[File:RDF SHL.png|thumb|700px]]&lt;br /&gt;
&lt;br /&gt;
It can be noticed that the three phases have clearly different Radial Distribution Functions (RDF) from each other and this can be attributed to the varying degrees of order each of the phases have: the atoms in the gas phase are completely free to move around, while atoms in the liquid phase have less freedom and in the solid phase, the atoms are set in a lattice, with only vibrational motion and no (or negligible) translational motion.&lt;br /&gt;
&lt;br /&gt;
In order to explain the graph, let us consider the RDF to be displaying the &amp;quot;effective density&amp;quot; of atoms in an area of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; at a distance &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; from a certain reference atom.&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf schematic.jpg|thumb|200px|Schematic of RDF|left]]&lt;br /&gt;
&lt;br /&gt;
There are three main parts to the RDF graphs: the region near the origin where the &amp;lt;math&amp;gt;\mathrm{RDF} = 0&amp;lt;/math&amp;gt;, the region after where there are big peaks and troughs, and the final region where the graphs have mostly reached equilibrium.&lt;br /&gt;
&lt;br /&gt;
First of all, the region near the origin is 0 for all three phases as that is still within the volume of the reference atom, and hence there are no other atoms in that radius.&lt;br /&gt;
&lt;br /&gt;
The peaks in the second region indicate that there is a higher &amp;quot;effective density&amp;quot; of atoms. The explanation for this is different for the lattice structure (solid) and the fluids (liquid and gas).&lt;br /&gt;
&lt;br /&gt;
For the liquid and gas phase, the peaks are due to the attractive force caused by the Lennard-Jones potential. We have calculated above [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:SUNG95#Lennard-Jones_Potential (1.2 LJ Potential)] that &amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}.&amp;lt;/math&amp;gt; Setting &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt; (as we have in our input file), we get &amp;lt;math&amp;gt;r_{eq} = 1.122&amp;lt;/math&amp;gt;, which is very close to where the largest peaks are for the two fluid phases.&lt;br /&gt;
&lt;br /&gt;
Then for the solid, where all the atoms are in a lattice structure, the effects due to the Lennard-Jones interaction becomes neglibigle. Instead, there will be certain values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where the effective density is higher than the overall density of the sample (the peaks), and some values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where it is lower than the density of the sample (the troughs). This is arisen from the fact that as the value of in a similar fashion to the schematic on the left.&lt;br /&gt;
&lt;br /&gt;
As the value of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the total volume covered by &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; also increases. But since all the atoms are set in place by the lattice, the number of atoms that &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; encompasses stays relatively constant. As a result, the peaks and the troughs tend 1 with increasing &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the case of the gas phase, the atoms are completely free to move around and the RDF graph can be entirely attributed to the effects of the L-J interaction. This justifies the lack of troughs for this phase. Furthermore, as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the attractive part of the L-J interaction &amp;lt;math&amp;gt;\frac{1}{r^6}&amp;lt;/math&amp;gt; gets exponentially smaller and quickly becomes negligible - RDF reaches equilibrium.&lt;br /&gt;
&lt;br /&gt;
Finally, the liquid phase can be considered to act as a mix between the solid phase and the gas phase: the L-J interactions are significant enough to reach equilibrium at a rate similar to the gas phase, but there exists an ordering of the atoms such that there are values of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; where the effective density is lower than the overall density.&lt;br /&gt;
&lt;br /&gt;
From the RDF of the solid phase, each of the peaks point to a certain lattice point. Simple geometrical calculations can be done to indicate that the first peak, which is the lattice point (1) closest to the reference atom (O), is at a separation of &amp;lt;math&amp;gt;\mathrm{r}=1.056.&amp;lt;/math&amp;gt; Second closest point (2) is at a distance of &amp;lt;math&amp;gt;\mathrm{r}=1.4938&amp;lt;/math&amp;gt; and the third (3) at &amp;lt;math&amp;gt;\mathrm{r}=1.8295.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:FCC-SHL.png|thumb|Face-centered cubic lattice|none]]&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
=== Mean Squared Displacement ===&lt;br /&gt;
&lt;br /&gt;
=== Velocity Autocorrelation Function ===&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Density_Temp.png&amp;diff=560507</id>
		<title>File:Density Temp.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Density_Temp.png&amp;diff=560507"/>
		<updated>2016-10-21T04:41:49Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: Sl10014 uploaded a new version of File:Density Temp.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Density_Temp.png&amp;diff=560505</id>
		<title>File:Density Temp.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Density_Temp.png&amp;diff=560505"/>
		<updated>2016-10-21T04:36:33Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560503</id>
		<title>Rep:Mod:SUNG95</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560503"/>
		<updated>2016-10-21T04:32:46Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: /* Running Simulations Under Specific Conditions (NpT) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Theory ==&lt;br /&gt;
=== The Velocity-Verlet Algorithm ===&lt;br /&gt;
[[File:Verlet-Velocity.png|thumb|700px|x(t) derived from the velocity-Verlet algorithm compared with the position of the classical harmonic oscillator.|left]]&lt;br /&gt;
[[File:Verlet-Energy.png|thumb|700px|Total energy of the system with respect to time|right]]&lt;br /&gt;
[[File:Verlet-Error.png|thumb|700px|The error derived by comparing the solution of the velocity-Verlet algorithm with the position of the classical harmonic oscillator|none]]&lt;br /&gt;
&lt;br /&gt;
The three graphs above display the position of an atom, the total energy of the system and the error between the two methods of calculating the atom position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Error wrt Time.png|thumb|600px|Maximum Error against Time|none]]&lt;br /&gt;
&lt;br /&gt;
From this graph of Maximum error vs Time, we can see that error increases with time at a stable linear rate.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Running the same calculations with varying timesteps show the importance of choosing the right value of the timestep:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Energy at t=0.05.png|Energy at timestep=0.05&lt;br /&gt;
Image:Energy at t=0.5.png|Energy at timestep=0.5&lt;br /&gt;
Image:Error at t=0.5.png|Error at timestep=0.5&lt;br /&gt;
Image:Error at t=0.05.png|Error at timestep=0.05&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examining the four additional graphs above, we can notice that a shorter timestep is able to provide a smaller value of error and that the energy fluctuates less than a bigger value of timestep. However, a shorter timestep results in a shorter simulation type, which can result in a less realistic simulation. It is therefore important to find the right balance between the two.&lt;br /&gt;
&lt;br /&gt;
Through trial and error, it has been found that timestep = 0.2850 or lower results in an energy fluctuation that is smaller than 1% over the course of the simulation. A small fluctuation in energy indicates higher resemblance to reality as technically the total energy should not fluctuate at all due to the Law of Conservation of Energy.&lt;br /&gt;
&lt;br /&gt;
=== Lennard-Jones Potential ===&lt;br /&gt;
The equation to calculate the Lennard-Jones potential is as follows:&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;
By equating this to 0, we find that the &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the separation at which the potential is 0, is &amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We can then find the force at this separation by differentiating the Lennard-Jones potential with respect to r, and substituting in &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}=\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24 \frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation (&amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;) is the separation of the particles at equilibrium, and represents the separation at which the potential energy is at a minimum. It can thus be found by setting &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}&amp;lt;/math&amp;gt;, (or &amp;lt;math&amp;gt;\mathbf{F}&amp;lt;/math&amp;gt;) to 0.&lt;br /&gt;
&lt;br /&gt;
Hence,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right) 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; gives us the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To put this equation into perspective, let us calculate the L-J potential for some realistic cutoff values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int 4\epsilon \left(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=4 \epsilon \left(\frac{\sigma^{12}}{11r^{11}}-\frac{\sigma^6}{5r^5}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\lim_{r\rightarrow \infty} 4 \left(\frac{1^{12}}{11r^{11}}-\frac{1^6}{5r^5}\right) - 4\left(\frac{1^{12}}{11\times 2^{11}}+\frac{1^6}{5\times 2^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=0-0.024822\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following the same calculations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0081767\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0032901\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
It is very difficult to simulate realistic volumes of liquid and in the scope of this experiment, we have simulated liquids with N (number of atoms) between 1,000 and 10,000. To demonstrate why simulating realistic volumes of liquid is difficult, let us first calculate the number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--TASK: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.--&amp;gt;&lt;br /&gt;
(Assuming: Standard conditions; Density of water = 1.00 g/ml)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.00 \mathrm{ml} = 1.00 \mathrm{g}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;18.02 \mathrm{g/mol} = 0.0555 \text{ mols of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.0555 \times 6.022 \times 10^{23} = 3.34 \times 10^{22} \text{ molecules of water.}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the other hand, 10,000 water molecules is only &amp;lt;math&amp;gt;2.99 \times 10^{-19} \text{ ml of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
10000 water molecules == 1.661 x 10^-20 mols of water. (Conversion using Avogadro Constant)&lt;br /&gt;
1.661 x 10^-20 x 18.02 = 2.99 x 10^-19 g&lt;br /&gt;
approx. 2.99 x 10^-19 ml of water.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus, in order to be able to complete the simulation in a practical amount of time, we place our atoms in a box that is repeated in all directions, similar to how unit cells repeat themselves in a lattice. When an atom crosses the boundary of the box, its replica enters the same box from the other side, thus keeping the total number of atoms in the box constant.&lt;br /&gt;
&lt;br /&gt;
For example, if an atom at position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a cubic box ranging from &amp;lt;math&amp;gt;(0, 0, 0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;, its final position would be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;, if the periodic boundary conditions have been applied.&lt;br /&gt;
&amp;lt;!--We can safely avoid the issue we might encounter arising from the infinite number of particles by setting a cutoff limit ---- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units ===&lt;br /&gt;
The LAMMPS calculations run in this experiment are all done in reduced units&lt;br /&gt;
&lt;br /&gt;
For example, the Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34 \mathrm{nm}&amp;lt;/math&amp;gt;; &amp;lt;math&amp;gt;\epsilon/k_B=120K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If we set the cutoff to be &amp;lt;math&amp;gt;r*=3.2,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=3.2\times0.34=1.088\mathrm{nm}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Well depth: &amp;lt;math&amp;gt;\epsilon=120K\times k_B \times 6.02 \times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon=0.998 \mathrm{kJ/mol}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and reduced temperature &amp;lt;math&amp;gt;T*=1.5&amp;lt;/math&amp;gt; would be &amp;lt;math&amp;gt;T=1.5 \times 120=180\mathrm{K}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
=== Creating Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
In order to simulate a liquid for this experiment, we first create a crystal lattice, then melt that lattice to create a liquid. This is preferable to generating a liquid since assigning a random position for each new atom could result in two or more atoms being generated in the same space, causing an error when running the simulation.&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is one lattice point per unit cell. Hence, if the number density is 0.8,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8 \text{ points/volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sqrt[3]{0.8}=0.9283\text{ points/length}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.9283^{-1}=1.0772 \text{ length/point}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is thus 1.0772 unit lengths of spacing between each point.&lt;br /&gt;
&lt;br /&gt;
Following the same logic, a face-centred cubic lattice (with 4 lattice points per unit cell) with a density of 1.2 would have a spacing of &amp;lt;math&amp;gt;0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\because \sqrt[3]{4.8^{-1}}=0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, the simple cubic lattice with a density of 0.8 would create 1,000 atoms in the given constraints of the box:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;region box block 0 10 0 10 0 10&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and a face centred cubic lattice with a density of 1.2 would create 4,000 atoms in the same box.&lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of the Atoms ===&lt;br /&gt;
In the input script, there are the following lines describing the properties of the atoms:&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;
In the first line, we are setting the mass of type 1 atoms (which includes all of the atoms in our simulation box, as we have created only one type of atoms) as &amp;lt;math&amp;gt;1.0&amp;lt;/math&amp;gt;, in reduced units. The second line defines the interaction between the atoms as a Lenard-Jones interaction, with a cutoff distance of &amp;lt;math&amp;gt;3.0 \text{ units.}&amp;lt;/math&amp;gt; Finally, the last line defines the coefficient in the Lenard-Jones interaction; the asterisk tells LAMMPS that the coefficients apply to all atoms in our system; the first coefficient is &amp;lt;math&amp;gt;\epsilon=1.0&amp;lt;/math&amp;gt; and the second coefficient is &amp;lt;math&amp;gt;\sigma=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After setting the properties of the atoms, we also defined the initial positions and the initial velocities for the atoms in the input script. Since we have both the &amp;lt;math&amp;gt;\mathbf{x}_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, we can use the Velocity-Verlet integration algorithm that employs the half-step method.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
In the following lines from the input script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we created and reset a variable called timestep to equal 0.001, then used that value to calculate how many runs (${n_steps}) to carry out. This is more beneficial than simply setting&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;
as it allows us to only change the value of the timestep variable to alter the number of runs, rather than having to calculate ${n_steps} ourselves every time we change the timestep, especially in cases such as this computational experiment where the timestep was changed multiple times.&lt;br /&gt;
&lt;br /&gt;
=== Checking Equilibration ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--TotalE at 0.0075 - SHL.png--&amp;gt;&lt;br /&gt;
[[File:TotalE at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Temp at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Press at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
&lt;br /&gt;
These graphs have been plotted to ensure that the simulation reaches equilibrium, and we can see that indeed, they do, and very quickly. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
The following graph shows the total energy of the system against time at varying timestep values:&lt;br /&gt;
&lt;br /&gt;
[[File:Equil Energy.png|thumb|800px|none]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from the graphs that for timestep = 0.001, 0.0025 and 0.0075, the energy reaches a stable equilibrium but for timestep = 0.01 and timestep = 0.015, the energy slowly decreases and rapidly increases, respectively, indicating that the results of the simulation are not very accurate for these values of timestep. Timestep = 0.015 is especially bad as it very obviously does not reach an equilibrium.&lt;br /&gt;
&lt;br /&gt;
Therefore, timestep = 0.0075 would be the ideal value as it provides the highest accuracy, while running the simulation for a suitably long time.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions (NpT) ==&lt;br /&gt;
&lt;br /&gt;
=== Temperature and Pressure Control ===&lt;br /&gt;
&lt;br /&gt;
Pressures chosen: 2.61, 2.63&lt;br /&gt;
&lt;br /&gt;
Temperatures chosen: 1.5, 1.6, 1.7, 1.8, 1.9&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 was chosen to provide the highest accuracy possible, without shortening the simulation time too much.&lt;br /&gt;
&lt;br /&gt;
In our simulation, the temperature was controlled by solving the two following equations for the instantaneous temperature &amp;lt;math&amp;gt;T,&amp;lt;/math&amp;gt; which fluctuates.&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 \qquad\qquad\qquad(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order for &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; to reach our target temperature &amp;lt;math&amp;gt;\mathfrak{T},&amp;lt;/math&amp;gt; we introduce a constant &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; to control the velocity such that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}\qquad\qquad(2)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can solve eq. &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt; to solve for &amp;lt;math&amp;gt;\gamma.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\sum_i m_i v_i^2 = 3N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substituting &amp;lt;math&amp;gt;\sum_i m_i v_i^2&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 3 N k_b T = 3N k_b \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\epsilon}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Examining the Input Script ===&lt;br /&gt;
&lt;br /&gt;
To calculate the average values for our simulation, we set certain parameters for LAMMPS in the script.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time Nevery Nrepeat Nfreq&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Final averages are generated on timesteps that are multiples of Nevery, for Nrepeat number of times and an average is generated every Nfreq timesteps.&lt;br /&gt;
&lt;br /&gt;
In our script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The results are sampled at every 100 timesteps for 1000 times (100, 200, 300, etc.) Averages are generated every 100,000 timesteps, but our simulation runs for the same amount of time so only one average is generated from this code.&lt;br /&gt;
&lt;br /&gt;
The timestep chosen for this section of the experiment was 0.0025. Therefore, the simulation was run for &amp;lt;math&amp;gt;100000 \times 0.0025 = 250 \text{ unit time}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Results of NpT Simulation ===&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacity ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--To calculate the heat capacity of our simulated liquid, we investigated how much the energy of our system fluctuates with respect to temperature, according to the equation &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variance in energy can be derived from statistical thermodynamics: &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:HeatCap vs Density.png|thumb|800px|Graph of &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; against Temperature|none]]&lt;br /&gt;
&lt;br /&gt;
From thermodynamics:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;dU = TdS - PdV&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = T\frac{\partial S}{\partial T}-P\frac{\partial V}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and since &amp;lt;math&amp;gt;\frac{\partial S}{\partial T}\geq 0,&amp;lt;/math&amp;gt; heat capacity should increase with increasing temperature.&lt;br /&gt;
&lt;br /&gt;
The fact that &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; decreases with increasing temperature suggests that either&lt;br /&gt;
&lt;br /&gt;
== Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
[[File:RDF SHL.png|thumb|700px]]&lt;br /&gt;
&lt;br /&gt;
It can be noticed that the three phases have clearly different Radial Distribution Functions (RDF) from each other and this can be attributed to the varying degrees of order each of the phases have: the atoms in the gas phase are completely free to move around, while atoms in the liquid phase have less freedom and in the solid phase, the atoms are set in a lattice, with only vibrational motion and no (or negligible) translational motion.&lt;br /&gt;
&lt;br /&gt;
In order to explain the graph, let us consider the RDF to be displaying the &amp;quot;effective density&amp;quot; of atoms in an area of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; at a distance &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; from a certain reference atom.&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf schematic.jpg|thumb|200px|Schematic of RDF|left]]&lt;br /&gt;
&lt;br /&gt;
There are three main parts to the RDF graphs: the region near the origin where the &amp;lt;math&amp;gt;\mathrm{RDF} = 0&amp;lt;/math&amp;gt;, the region after where there are big peaks and troughs, and the final region where the graphs have mostly reached equilibrium.&lt;br /&gt;
&lt;br /&gt;
First of all, the region near the origin is 0 for all three phases as that is still within the volume of the reference atom, and hence there are no other atoms in that radius.&lt;br /&gt;
&lt;br /&gt;
The peaks in the second region indicate that there is a higher &amp;quot;effective density&amp;quot; of atoms. The explanation for this is different for the lattice structure (solid) and the fluids (liquid and gas).&lt;br /&gt;
&lt;br /&gt;
For the liquid and gas phase, the peaks are due to the attractive force caused by the Lennard-Jones potential. We have calculated above [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:SUNG95#Lennard-Jones_Potential (1.2 LJ Potential)] that &amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}.&amp;lt;/math&amp;gt; Setting &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt; (as we have in our input file), we get &amp;lt;math&amp;gt;r_{eq} = 1.122&amp;lt;/math&amp;gt;, which is very close to where the largest peaks are for the two fluid phases.&lt;br /&gt;
&lt;br /&gt;
Then for the solid, where all the atoms are in a lattice structure, the effects due to the Lennard-Jones interaction becomes neglibigle. Instead, there will be certain values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where the effective density is higher than the overall density of the sample (the peaks), and some values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where it is lower than the density of the sample (the troughs). This is arisen from the fact that as the value of in a similar fashion to the schematic on the left.&lt;br /&gt;
&lt;br /&gt;
As the value of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the total volume covered by &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; also increases. But since all the atoms are set in place by the lattice, the number of atoms that &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; encompasses stays relatively constant. As a result, the peaks and the troughs tend 1 with increasing &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the case of the gas phase, the atoms are completely free to move around and the RDF graph can be entirely attributed to the effects of the L-J interaction. This justifies the lack of troughs for this phase. Furthermore, as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the attractive part of the L-J interaction &amp;lt;math&amp;gt;\frac{1}{r^6}&amp;lt;/math&amp;gt; gets exponentially smaller and quickly becomes negligible - RDF reaches equilibrium.&lt;br /&gt;
&lt;br /&gt;
Finally, the liquid phase can be considered to act as a mix between the solid phase and the gas phase: the L-J interactions are significant enough to reach equilibrium at a rate similar to the gas phase, but there exists an ordering of the atoms such that there are values of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; where the effective density is lower than the overall density.&lt;br /&gt;
&lt;br /&gt;
From the RDF of the solid phase, each of the peaks point to a certain lattice point. Simple geometrical calculations can be done to indicate that the first peak, which is the lattice point (1) closest to the reference atom (O), is at a separation of &amp;lt;math&amp;gt;\mathrm{r}=1.056.&amp;lt;/math&amp;gt; Second closest point (2) is at a distance of &amp;lt;math&amp;gt;\mathrm{r}=1.4938&amp;lt;/math&amp;gt; and the third (3) at &amp;lt;math&amp;gt;\mathrm{r}=1.8295.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:FCC-SHL.png|thumb|Face-centered cubic lattice|none]]&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
=== Mean Squared Displacement ===&lt;br /&gt;
&lt;br /&gt;
=== Velocity Autocorrelation Function ===&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560502</id>
		<title>Rep:Mod:SUNG95</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560502"/>
		<updated>2016-10-21T04:31:44Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: /* Calculating Heat Capacity */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Theory ==&lt;br /&gt;
=== The Velocity-Verlet Algorithm ===&lt;br /&gt;
[[File:Verlet-Velocity.png|thumb|700px|x(t) derived from the velocity-Verlet algorithm compared with the position of the classical harmonic oscillator.|left]]&lt;br /&gt;
[[File:Verlet-Energy.png|thumb|700px|Total energy of the system with respect to time|right]]&lt;br /&gt;
[[File:Verlet-Error.png|thumb|700px|The error derived by comparing the solution of the velocity-Verlet algorithm with the position of the classical harmonic oscillator|none]]&lt;br /&gt;
&lt;br /&gt;
The three graphs above display the position of an atom, the total energy of the system and the error between the two methods of calculating the atom position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Error wrt Time.png|thumb|600px|Maximum Error against Time|none]]&lt;br /&gt;
&lt;br /&gt;
From this graph of Maximum error vs Time, we can see that error increases with time at a stable linear rate.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Running the same calculations with varying timesteps show the importance of choosing the right value of the timestep:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Energy at t=0.05.png|Energy at timestep=0.05&lt;br /&gt;
Image:Energy at t=0.5.png|Energy at timestep=0.5&lt;br /&gt;
Image:Error at t=0.5.png|Error at timestep=0.5&lt;br /&gt;
Image:Error at t=0.05.png|Error at timestep=0.05&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examining the four additional graphs above, we can notice that a shorter timestep is able to provide a smaller value of error and that the energy fluctuates less than a bigger value of timestep. However, a shorter timestep results in a shorter simulation type, which can result in a less realistic simulation. It is therefore important to find the right balance between the two.&lt;br /&gt;
&lt;br /&gt;
Through trial and error, it has been found that timestep = 0.2850 or lower results in an energy fluctuation that is smaller than 1% over the course of the simulation. A small fluctuation in energy indicates higher resemblance to reality as technically the total energy should not fluctuate at all due to the Law of Conservation of Energy.&lt;br /&gt;
&lt;br /&gt;
=== Lennard-Jones Potential ===&lt;br /&gt;
The equation to calculate the Lennard-Jones potential is as follows:&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;
By equating this to 0, we find that the &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the separation at which the potential is 0, is &amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We can then find the force at this separation by differentiating the Lennard-Jones potential with respect to r, and substituting in &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}=\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24 \frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation (&amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;) is the separation of the particles at equilibrium, and represents the separation at which the potential energy is at a minimum. It can thus be found by setting &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}&amp;lt;/math&amp;gt;, (or &amp;lt;math&amp;gt;\mathbf{F}&amp;lt;/math&amp;gt;) to 0.&lt;br /&gt;
&lt;br /&gt;
Hence,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right) 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; gives us the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To put this equation into perspective, let us calculate the L-J potential for some realistic cutoff values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int 4\epsilon \left(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=4 \epsilon \left(\frac{\sigma^{12}}{11r^{11}}-\frac{\sigma^6}{5r^5}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\lim_{r\rightarrow \infty} 4 \left(\frac{1^{12}}{11r^{11}}-\frac{1^6}{5r^5}\right) - 4\left(\frac{1^{12}}{11\times 2^{11}}+\frac{1^6}{5\times 2^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=0-0.024822\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following the same calculations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0081767\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0032901\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
It is very difficult to simulate realistic volumes of liquid and in the scope of this experiment, we have simulated liquids with N (number of atoms) between 1,000 and 10,000. To demonstrate why simulating realistic volumes of liquid is difficult, let us first calculate the number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--TASK: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.--&amp;gt;&lt;br /&gt;
(Assuming: Standard conditions; Density of water = 1.00 g/ml)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.00 \mathrm{ml} = 1.00 \mathrm{g}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;18.02 \mathrm{g/mol} = 0.0555 \text{ mols of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.0555 \times 6.022 \times 10^{23} = 3.34 \times 10^{22} \text{ molecules of water.}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the other hand, 10,000 water molecules is only &amp;lt;math&amp;gt;2.99 \times 10^{-19} \text{ ml of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
10000 water molecules == 1.661 x 10^-20 mols of water. (Conversion using Avogadro Constant)&lt;br /&gt;
1.661 x 10^-20 x 18.02 = 2.99 x 10^-19 g&lt;br /&gt;
approx. 2.99 x 10^-19 ml of water.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus, in order to be able to complete the simulation in a practical amount of time, we place our atoms in a box that is repeated in all directions, similar to how unit cells repeat themselves in a lattice. When an atom crosses the boundary of the box, its replica enters the same box from the other side, thus keeping the total number of atoms in the box constant.&lt;br /&gt;
&lt;br /&gt;
For example, if an atom at position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a cubic box ranging from &amp;lt;math&amp;gt;(0, 0, 0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;, its final position would be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;, if the periodic boundary conditions have been applied.&lt;br /&gt;
&amp;lt;!--We can safely avoid the issue we might encounter arising from the infinite number of particles by setting a cutoff limit ---- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units ===&lt;br /&gt;
The LAMMPS calculations run in this experiment are all done in reduced units&lt;br /&gt;
&lt;br /&gt;
For example, the Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34 \mathrm{nm}&amp;lt;/math&amp;gt;; &amp;lt;math&amp;gt;\epsilon/k_B=120K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If we set the cutoff to be &amp;lt;math&amp;gt;r*=3.2,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=3.2\times0.34=1.088\mathrm{nm}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Well depth: &amp;lt;math&amp;gt;\epsilon=120K\times k_B \times 6.02 \times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon=0.998 \mathrm{kJ/mol}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and reduced temperature &amp;lt;math&amp;gt;T*=1.5&amp;lt;/math&amp;gt; would be &amp;lt;math&amp;gt;T=1.5 \times 120=180\mathrm{K}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
=== Creating Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
In order to simulate a liquid for this experiment, we first create a crystal lattice, then melt that lattice to create a liquid. This is preferable to generating a liquid since assigning a random position for each new atom could result in two or more atoms being generated in the same space, causing an error when running the simulation.&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is one lattice point per unit cell. Hence, if the number density is 0.8,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8 \text{ points/volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sqrt[3]{0.8}=0.9283\text{ points/length}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.9283^{-1}=1.0772 \text{ length/point}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is thus 1.0772 unit lengths of spacing between each point.&lt;br /&gt;
&lt;br /&gt;
Following the same logic, a face-centred cubic lattice (with 4 lattice points per unit cell) with a density of 1.2 would have a spacing of &amp;lt;math&amp;gt;0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\because \sqrt[3]{4.8^{-1}}=0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, the simple cubic lattice with a density of 0.8 would create 1,000 atoms in the given constraints of the box:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;region box block 0 10 0 10 0 10&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and a face centred cubic lattice with a density of 1.2 would create 4,000 atoms in the same box.&lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of the Atoms ===&lt;br /&gt;
In the input script, there are the following lines describing the properties of the atoms:&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;
In the first line, we are setting the mass of type 1 atoms (which includes all of the atoms in our simulation box, as we have created only one type of atoms) as &amp;lt;math&amp;gt;1.0&amp;lt;/math&amp;gt;, in reduced units. The second line defines the interaction between the atoms as a Lenard-Jones interaction, with a cutoff distance of &amp;lt;math&amp;gt;3.0 \text{ units.}&amp;lt;/math&amp;gt; Finally, the last line defines the coefficient in the Lenard-Jones interaction; the asterisk tells LAMMPS that the coefficients apply to all atoms in our system; the first coefficient is &amp;lt;math&amp;gt;\epsilon=1.0&amp;lt;/math&amp;gt; and the second coefficient is &amp;lt;math&amp;gt;\sigma=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After setting the properties of the atoms, we also defined the initial positions and the initial velocities for the atoms in the input script. Since we have both the &amp;lt;math&amp;gt;\mathbf{x}_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, we can use the Velocity-Verlet integration algorithm that employs the half-step method.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
In the following lines from the input script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we created and reset a variable called timestep to equal 0.001, then used that value to calculate how many runs (${n_steps}) to carry out. This is more beneficial than simply setting&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;
as it allows us to only change the value of the timestep variable to alter the number of runs, rather than having to calculate ${n_steps} ourselves every time we change the timestep, especially in cases such as this computational experiment where the timestep was changed multiple times.&lt;br /&gt;
&lt;br /&gt;
=== Checking Equilibration ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--TotalE at 0.0075 - SHL.png--&amp;gt;&lt;br /&gt;
[[File:TotalE at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Temp at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Press at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
&lt;br /&gt;
These graphs have been plotted to ensure that the simulation reaches equilibrium, and we can see that indeed, they do, and very quickly. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
The following graph shows the total energy of the system against time at varying timestep values:&lt;br /&gt;
&lt;br /&gt;
[[File:Equil Energy.png|thumb|800px|none]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from the graphs that for timestep = 0.001, 0.0025 and 0.0075, the energy reaches a stable equilibrium but for timestep = 0.01 and timestep = 0.015, the energy slowly decreases and rapidly increases, respectively, indicating that the results of the simulation are not very accurate for these values of timestep. Timestep = 0.015 is especially bad as it very obviously does not reach an equilibrium.&lt;br /&gt;
&lt;br /&gt;
Therefore, timestep = 0.0075 would be the ideal value as it provides the highest accuracy, while running the simulation for a suitably long time.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions (NpT) ==&lt;br /&gt;
&lt;br /&gt;
=== Temperature and Pressure Control ===&lt;br /&gt;
&lt;br /&gt;
Pressures chosen: 2.61, 2.63&lt;br /&gt;
&lt;br /&gt;
Temperatures chosen: 1.5, 1.6, 1.7, 1.8, 1.9&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 was chosen to provide the highest accuracy possible, without shortening the simulation time too much.&lt;br /&gt;
&lt;br /&gt;
In our simulation, the temperature was controlled by solving the two following equations for the instantaneous temperature &amp;lt;math&amp;gt;T,&amp;lt;/math&amp;gt; which fluctuates.&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 \qquad\qquad\qquad(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order for &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; to reach our target temperature &amp;lt;math&amp;gt;\mathfrak{T},&amp;lt;/math&amp;gt; we introduce a constant &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; to control the velocity such that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}\qquad\qquad(2)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can solve eq. &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt; to solve for &amp;lt;math&amp;gt;\gamma.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\sum_i m_i v_i^2 = 3N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substituting &amp;lt;math&amp;gt;\sum_i m_i v_i^2&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 3 N k_b T = 3N k_b \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\epsilon}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Examining the Input Script ===&lt;br /&gt;
&lt;br /&gt;
To calculate the average values for our simulation, we set certain parameters for LAMMPS in the script.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time Nevery Nrepeat Nfreq&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Final averages are generated on timesteps that are multiples of Nevery, for Nrepeat number of times and an average is generated every Nfreq timesteps.&lt;br /&gt;
&lt;br /&gt;
In our script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The results are sampled at every 100 timesteps for 1000 times (100, 200, 300, etc.) Averages are generated every 100,000 timesteps, but our simulation runs for the same amount of time so only one average is generated from this code.&lt;br /&gt;
&lt;br /&gt;
The timestep chosen for this section of the experiment was 0.0025. Therefore, the simulation was run for &amp;lt;math&amp;gt;100000 \times 0.0025 = 250 \mathrm{unit time}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Results of NpT Simulation ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacity ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--To calculate the heat capacity of our simulated liquid, we investigated how much the energy of our system fluctuates with respect to temperature, according to the equation &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variance in energy can be derived from statistical thermodynamics: &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:HeatCap vs Density.png|thumb|800px|Graph of &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; against Temperature|none]]&lt;br /&gt;
&lt;br /&gt;
From thermodynamics:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;dU = TdS - PdV&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = T\frac{\partial S}{\partial T}-P\frac{\partial V}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and since &amp;lt;math&amp;gt;\frac{\partial S}{\partial T}\geq 0,&amp;lt;/math&amp;gt; heat capacity should increase with increasing temperature.&lt;br /&gt;
&lt;br /&gt;
The fact that &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; decreases with increasing temperature suggests that either&lt;br /&gt;
&lt;br /&gt;
== Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
[[File:RDF SHL.png|thumb|700px]]&lt;br /&gt;
&lt;br /&gt;
It can be noticed that the three phases have clearly different Radial Distribution Functions (RDF) from each other and this can be attributed to the varying degrees of order each of the phases have: the atoms in the gas phase are completely free to move around, while atoms in the liquid phase have less freedom and in the solid phase, the atoms are set in a lattice, with only vibrational motion and no (or negligible) translational motion.&lt;br /&gt;
&lt;br /&gt;
In order to explain the graph, let us consider the RDF to be displaying the &amp;quot;effective density&amp;quot; of atoms in an area of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; at a distance &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; from a certain reference atom.&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf schematic.jpg|thumb|200px|Schematic of RDF|left]]&lt;br /&gt;
&lt;br /&gt;
There are three main parts to the RDF graphs: the region near the origin where the &amp;lt;math&amp;gt;\mathrm{RDF} = 0&amp;lt;/math&amp;gt;, the region after where there are big peaks and troughs, and the final region where the graphs have mostly reached equilibrium.&lt;br /&gt;
&lt;br /&gt;
First of all, the region near the origin is 0 for all three phases as that is still within the volume of the reference atom, and hence there are no other atoms in that radius.&lt;br /&gt;
&lt;br /&gt;
The peaks in the second region indicate that there is a higher &amp;quot;effective density&amp;quot; of atoms. The explanation for this is different for the lattice structure (solid) and the fluids (liquid and gas).&lt;br /&gt;
&lt;br /&gt;
For the liquid and gas phase, the peaks are due to the attractive force caused by the Lennard-Jones potential. We have calculated above [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:SUNG95#Lennard-Jones_Potential (1.2 LJ Potential)] that &amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}.&amp;lt;/math&amp;gt; Setting &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt; (as we have in our input file), we get &amp;lt;math&amp;gt;r_{eq} = 1.122&amp;lt;/math&amp;gt;, which is very close to where the largest peaks are for the two fluid phases.&lt;br /&gt;
&lt;br /&gt;
Then for the solid, where all the atoms are in a lattice structure, the effects due to the Lennard-Jones interaction becomes neglibigle. Instead, there will be certain values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where the effective density is higher than the overall density of the sample (the peaks), and some values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where it is lower than the density of the sample (the troughs). This is arisen from the fact that as the value of in a similar fashion to the schematic on the left.&lt;br /&gt;
&lt;br /&gt;
As the value of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the total volume covered by &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; also increases. But since all the atoms are set in place by the lattice, the number of atoms that &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; encompasses stays relatively constant. As a result, the peaks and the troughs tend 1 with increasing &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the case of the gas phase, the atoms are completely free to move around and the RDF graph can be entirely attributed to the effects of the L-J interaction. This justifies the lack of troughs for this phase. Furthermore, as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the attractive part of the L-J interaction &amp;lt;math&amp;gt;\frac{1}{r^6}&amp;lt;/math&amp;gt; gets exponentially smaller and quickly becomes negligible - RDF reaches equilibrium.&lt;br /&gt;
&lt;br /&gt;
Finally, the liquid phase can be considered to act as a mix between the solid phase and the gas phase: the L-J interactions are significant enough to reach equilibrium at a rate similar to the gas phase, but there exists an ordering of the atoms such that there are values of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; where the effective density is lower than the overall density.&lt;br /&gt;
&lt;br /&gt;
From the RDF of the solid phase, each of the peaks point to a certain lattice point. Simple geometrical calculations can be done to indicate that the first peak, which is the lattice point (1) closest to the reference atom (O), is at a separation of &amp;lt;math&amp;gt;\mathrm{r}=1.056.&amp;lt;/math&amp;gt; Second closest point (2) is at a distance of &amp;lt;math&amp;gt;\mathrm{r}=1.4938&amp;lt;/math&amp;gt; and the third (3) at &amp;lt;math&amp;gt;\mathrm{r}=1.8295.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:FCC-SHL.png|thumb|Face-centered cubic lattice|none]]&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
=== Mean Squared Displacement ===&lt;br /&gt;
&lt;br /&gt;
=== Velocity Autocorrelation Function ===&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560500</id>
		<title>Rep:Mod:SUNG95</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560500"/>
		<updated>2016-10-21T04:25:57Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: /* Examining the Input Script (Come back) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Theory ==&lt;br /&gt;
=== The Velocity-Verlet Algorithm ===&lt;br /&gt;
[[File:Verlet-Velocity.png|thumb|700px|x(t) derived from the velocity-Verlet algorithm compared with the position of the classical harmonic oscillator.|left]]&lt;br /&gt;
[[File:Verlet-Energy.png|thumb|700px|Total energy of the system with respect to time|right]]&lt;br /&gt;
[[File:Verlet-Error.png|thumb|700px|The error derived by comparing the solution of the velocity-Verlet algorithm with the position of the classical harmonic oscillator|none]]&lt;br /&gt;
&lt;br /&gt;
The three graphs above display the position of an atom, the total energy of the system and the error between the two methods of calculating the atom position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Error wrt Time.png|thumb|600px|Maximum Error against Time|none]]&lt;br /&gt;
&lt;br /&gt;
From this graph of Maximum error vs Time, we can see that error increases with time at a stable linear rate.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Running the same calculations with varying timesteps show the importance of choosing the right value of the timestep:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Energy at t=0.05.png|Energy at timestep=0.05&lt;br /&gt;
Image:Energy at t=0.5.png|Energy at timestep=0.5&lt;br /&gt;
Image:Error at t=0.5.png|Error at timestep=0.5&lt;br /&gt;
Image:Error at t=0.05.png|Error at timestep=0.05&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examining the four additional graphs above, we can notice that a shorter timestep is able to provide a smaller value of error and that the energy fluctuates less than a bigger value of timestep. However, a shorter timestep results in a shorter simulation type, which can result in a less realistic simulation. It is therefore important to find the right balance between the two.&lt;br /&gt;
&lt;br /&gt;
Through trial and error, it has been found that timestep = 0.2850 or lower results in an energy fluctuation that is smaller than 1% over the course of the simulation. A small fluctuation in energy indicates higher resemblance to reality as technically the total energy should not fluctuate at all due to the Law of Conservation of Energy.&lt;br /&gt;
&lt;br /&gt;
=== Lennard-Jones Potential ===&lt;br /&gt;
The equation to calculate the Lennard-Jones potential is as follows:&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;
By equating this to 0, we find that the &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the separation at which the potential is 0, is &amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We can then find the force at this separation by differentiating the Lennard-Jones potential with respect to r, and substituting in &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}=\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24 \frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation (&amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;) is the separation of the particles at equilibrium, and represents the separation at which the potential energy is at a minimum. It can thus be found by setting &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}&amp;lt;/math&amp;gt;, (or &amp;lt;math&amp;gt;\mathbf{F}&amp;lt;/math&amp;gt;) to 0.&lt;br /&gt;
&lt;br /&gt;
Hence,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right) 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; gives us the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To put this equation into perspective, let us calculate the L-J potential for some realistic cutoff values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int 4\epsilon \left(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=4 \epsilon \left(\frac{\sigma^{12}}{11r^{11}}-\frac{\sigma^6}{5r^5}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\lim_{r\rightarrow \infty} 4 \left(\frac{1^{12}}{11r^{11}}-\frac{1^6}{5r^5}\right) - 4\left(\frac{1^{12}}{11\times 2^{11}}+\frac{1^6}{5\times 2^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=0-0.024822\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following the same calculations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0081767\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0032901\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
It is very difficult to simulate realistic volumes of liquid and in the scope of this experiment, we have simulated liquids with N (number of atoms) between 1,000 and 10,000. To demonstrate why simulating realistic volumes of liquid is difficult, let us first calculate the number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--TASK: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.--&amp;gt;&lt;br /&gt;
(Assuming: Standard conditions; Density of water = 1.00 g/ml)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.00 \mathrm{ml} = 1.00 \mathrm{g}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;18.02 \mathrm{g/mol} = 0.0555 \text{ mols of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.0555 \times 6.022 \times 10^{23} = 3.34 \times 10^{22} \text{ molecules of water.}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the other hand, 10,000 water molecules is only &amp;lt;math&amp;gt;2.99 \times 10^{-19} \text{ ml of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
10000 water molecules == 1.661 x 10^-20 mols of water. (Conversion using Avogadro Constant)&lt;br /&gt;
1.661 x 10^-20 x 18.02 = 2.99 x 10^-19 g&lt;br /&gt;
approx. 2.99 x 10^-19 ml of water.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus, in order to be able to complete the simulation in a practical amount of time, we place our atoms in a box that is repeated in all directions, similar to how unit cells repeat themselves in a lattice. When an atom crosses the boundary of the box, its replica enters the same box from the other side, thus keeping the total number of atoms in the box constant.&lt;br /&gt;
&lt;br /&gt;
For example, if an atom at position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a cubic box ranging from &amp;lt;math&amp;gt;(0, 0, 0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;, its final position would be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;, if the periodic boundary conditions have been applied.&lt;br /&gt;
&amp;lt;!--We can safely avoid the issue we might encounter arising from the infinite number of particles by setting a cutoff limit ---- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units ===&lt;br /&gt;
The LAMMPS calculations run in this experiment are all done in reduced units&lt;br /&gt;
&lt;br /&gt;
For example, the Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34 \mathrm{nm}&amp;lt;/math&amp;gt;; &amp;lt;math&amp;gt;\epsilon/k_B=120K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If we set the cutoff to be &amp;lt;math&amp;gt;r*=3.2,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=3.2\times0.34=1.088\mathrm{nm}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Well depth: &amp;lt;math&amp;gt;\epsilon=120K\times k_B \times 6.02 \times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon=0.998 \mathrm{kJ/mol}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and reduced temperature &amp;lt;math&amp;gt;T*=1.5&amp;lt;/math&amp;gt; would be &amp;lt;math&amp;gt;T=1.5 \times 120=180\mathrm{K}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
=== Creating Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
In order to simulate a liquid for this experiment, we first create a crystal lattice, then melt that lattice to create a liquid. This is preferable to generating a liquid since assigning a random position for each new atom could result in two or more atoms being generated in the same space, causing an error when running the simulation.&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is one lattice point per unit cell. Hence, if the number density is 0.8,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8 \text{ points/volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sqrt[3]{0.8}=0.9283\text{ points/length}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.9283^{-1}=1.0772 \text{ length/point}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is thus 1.0772 unit lengths of spacing between each point.&lt;br /&gt;
&lt;br /&gt;
Following the same logic, a face-centred cubic lattice (with 4 lattice points per unit cell) with a density of 1.2 would have a spacing of &amp;lt;math&amp;gt;0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\because \sqrt[3]{4.8^{-1}}=0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, the simple cubic lattice with a density of 0.8 would create 1,000 atoms in the given constraints of the box:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;region box block 0 10 0 10 0 10&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and a face centred cubic lattice with a density of 1.2 would create 4,000 atoms in the same box.&lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of the Atoms ===&lt;br /&gt;
In the input script, there are the following lines describing the properties of the atoms:&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;
In the first line, we are setting the mass of type 1 atoms (which includes all of the atoms in our simulation box, as we have created only one type of atoms) as &amp;lt;math&amp;gt;1.0&amp;lt;/math&amp;gt;, in reduced units. The second line defines the interaction between the atoms as a Lenard-Jones interaction, with a cutoff distance of &amp;lt;math&amp;gt;3.0 \text{ units.}&amp;lt;/math&amp;gt; Finally, the last line defines the coefficient in the Lenard-Jones interaction; the asterisk tells LAMMPS that the coefficients apply to all atoms in our system; the first coefficient is &amp;lt;math&amp;gt;\epsilon=1.0&amp;lt;/math&amp;gt; and the second coefficient is &amp;lt;math&amp;gt;\sigma=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After setting the properties of the atoms, we also defined the initial positions and the initial velocities for the atoms in the input script. Since we have both the &amp;lt;math&amp;gt;\mathbf{x}_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, we can use the Velocity-Verlet integration algorithm that employs the half-step method.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
In the following lines from the input script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we created and reset a variable called timestep to equal 0.001, then used that value to calculate how many runs (${n_steps}) to carry out. This is more beneficial than simply setting&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;
as it allows us to only change the value of the timestep variable to alter the number of runs, rather than having to calculate ${n_steps} ourselves every time we change the timestep, especially in cases such as this computational experiment where the timestep was changed multiple times.&lt;br /&gt;
&lt;br /&gt;
=== Checking Equilibration ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--TotalE at 0.0075 - SHL.png--&amp;gt;&lt;br /&gt;
[[File:TotalE at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Temp at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Press at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
&lt;br /&gt;
These graphs have been plotted to ensure that the simulation reaches equilibrium, and we can see that indeed, they do, and very quickly. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
The following graph shows the total energy of the system against time at varying timestep values:&lt;br /&gt;
&lt;br /&gt;
[[File:Equil Energy.png|thumb|800px|none]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from the graphs that for timestep = 0.001, 0.0025 and 0.0075, the energy reaches a stable equilibrium but for timestep = 0.01 and timestep = 0.015, the energy slowly decreases and rapidly increases, respectively, indicating that the results of the simulation are not very accurate for these values of timestep. Timestep = 0.015 is especially bad as it very obviously does not reach an equilibrium.&lt;br /&gt;
&lt;br /&gt;
Therefore, timestep = 0.0075 would be the ideal value as it provides the highest accuracy, while running the simulation for a suitably long time.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions (NpT) ==&lt;br /&gt;
&lt;br /&gt;
=== Temperature and Pressure Control ===&lt;br /&gt;
&lt;br /&gt;
Pressures chosen: 2.61, 2.63&lt;br /&gt;
&lt;br /&gt;
Temperatures chosen: 1.5, 1.6, 1.7, 1.8, 1.9&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 was chosen to provide the highest accuracy possible, without shortening the simulation time too much.&lt;br /&gt;
&lt;br /&gt;
In our simulation, the temperature was controlled by solving the two following equations for the instantaneous temperature &amp;lt;math&amp;gt;T,&amp;lt;/math&amp;gt; which fluctuates.&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 \qquad\qquad\qquad(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order for &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; to reach our target temperature &amp;lt;math&amp;gt;\mathfrak{T},&amp;lt;/math&amp;gt; we introduce a constant &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; to control the velocity such that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}\qquad\qquad(2)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can solve eq. &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt; to solve for &amp;lt;math&amp;gt;\gamma.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\sum_i m_i v_i^2 = 3N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substituting &amp;lt;math&amp;gt;\sum_i m_i v_i^2&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 3 N k_b T = 3N k_b \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\epsilon}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Examining the Input Script ===&lt;br /&gt;
&lt;br /&gt;
To calculate the average values for our simulation, we set certain parameters for LAMMPS in the script.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time Nevery Nrepeat Nfreq&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Final averages are generated on timesteps that are multiples of Nevery, for Nrepeat number of times and an average is generated every Nfreq timesteps.&lt;br /&gt;
&lt;br /&gt;
In our script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The results are sampled at every 100 timesteps for 1000 times (100, 200, 300, etc.) Averages are generated every 100,000 timesteps, but our simulation runs for the same amount of time so only one average is generated from this code.&lt;br /&gt;
&lt;br /&gt;
The timestep chosen for this section of the experiment was 0.0025. Therefore, the simulation was run for &amp;lt;math&amp;gt;100000 \times 0.0025 = 250 \mathrm{unit time}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Results of NpT Simulation ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacity ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--To calculate the heat capacity of our simulated liquid, we investigated how much the energy of our system fluctuates with respect to temperature, according to the equation &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variance in energy can be derived from statistical thermodynamics: &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:HeatCap vs Density.png|thumb|800px|Graph of &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; against Temperature|none]]&lt;br /&gt;
&lt;br /&gt;
From thermodynamics:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;dU = TdS - PdV&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = T\frac{\partial S}{\partial T}-P\frac{\partial V}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and since &amp;lt;math&amp;gt;\frac{\partial S}{\partial T}\geq 0,&amp;lt;/math&amp;gt; heat capacity should increase with increasing temperature.&lt;br /&gt;
&lt;br /&gt;
The fact that &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; decreases with increasing temperature &#039;&#039;&#039;------------&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
[[File:RDF SHL.png|thumb|700px]]&lt;br /&gt;
&lt;br /&gt;
It can be noticed that the three phases have clearly different Radial Distribution Functions (RDF) from each other and this can be attributed to the varying degrees of order each of the phases have: the atoms in the gas phase are completely free to move around, while atoms in the liquid phase have less freedom and in the solid phase, the atoms are set in a lattice, with only vibrational motion and no (or negligible) translational motion.&lt;br /&gt;
&lt;br /&gt;
In order to explain the graph, let us consider the RDF to be displaying the &amp;quot;effective density&amp;quot; of atoms in an area of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; at a distance &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; from a certain reference atom.&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf schematic.jpg|thumb|200px|Schematic of RDF|left]]&lt;br /&gt;
&lt;br /&gt;
There are three main parts to the RDF graphs: the region near the origin where the &amp;lt;math&amp;gt;\mathrm{RDF} = 0&amp;lt;/math&amp;gt;, the region after where there are big peaks and troughs, and the final region where the graphs have mostly reached equilibrium.&lt;br /&gt;
&lt;br /&gt;
First of all, the region near the origin is 0 for all three phases as that is still within the volume of the reference atom, and hence there are no other atoms in that radius.&lt;br /&gt;
&lt;br /&gt;
The peaks in the second region indicate that there is a higher &amp;quot;effective density&amp;quot; of atoms. The explanation for this is different for the lattice structure (solid) and the fluids (liquid and gas).&lt;br /&gt;
&lt;br /&gt;
For the liquid and gas phase, the peaks are due to the attractive force caused by the Lennard-Jones potential. We have calculated above [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:SUNG95#Lennard-Jones_Potential (1.2 LJ Potential)] that &amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}.&amp;lt;/math&amp;gt; Setting &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt; (as we have in our input file), we get &amp;lt;math&amp;gt;r_{eq} = 1.122&amp;lt;/math&amp;gt;, which is very close to where the largest peaks are for the two fluid phases.&lt;br /&gt;
&lt;br /&gt;
Then for the solid, where all the atoms are in a lattice structure, the effects due to the Lennard-Jones interaction becomes neglibigle. Instead, there will be certain values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where the effective density is higher than the overall density of the sample (the peaks), and some values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where it is lower than the density of the sample (the troughs). This is arisen from the fact that as the value of in a similar fashion to the schematic on the left.&lt;br /&gt;
&lt;br /&gt;
As the value of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the total volume covered by &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; also increases. But since all the atoms are set in place by the lattice, the number of atoms that &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; encompasses stays relatively constant. As a result, the peaks and the troughs tend 1 with increasing &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the case of the gas phase, the atoms are completely free to move around and the RDF graph can be entirely attributed to the effects of the L-J interaction. This justifies the lack of troughs for this phase. Furthermore, as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the attractive part of the L-J interaction &amp;lt;math&amp;gt;\frac{1}{r^6}&amp;lt;/math&amp;gt; gets exponentially smaller and quickly becomes negligible - RDF reaches equilibrium.&lt;br /&gt;
&lt;br /&gt;
Finally, the liquid phase can be considered to act as a mix between the solid phase and the gas phase: the L-J interactions are significant enough to reach equilibrium at a rate similar to the gas phase, but there exists an ordering of the atoms such that there are values of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; where the effective density is lower than the overall density.&lt;br /&gt;
&lt;br /&gt;
From the RDF of the solid phase, each of the peaks point to a certain lattice point. Simple geometrical calculations can be done to indicate that the first peak, which is the lattice point (1) closest to the reference atom (O), is at a separation of &amp;lt;math&amp;gt;\mathrm{r}=1.056.&amp;lt;/math&amp;gt; Second closest point (2) is at a distance of &amp;lt;math&amp;gt;\mathrm{r}=1.4938&amp;lt;/math&amp;gt; and the third (3) at &amp;lt;math&amp;gt;\mathrm{r}=1.8295.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:FCC-SHL.png|thumb|Face-centered cubic lattice|none]]&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
=== Mean Squared Displacement ===&lt;br /&gt;
&lt;br /&gt;
=== Velocity Autocorrelation Function ===&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560499</id>
		<title>Rep:Mod:SUNG95</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560499"/>
		<updated>2016-10-21T04:21:24Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: /* Checking Equilibration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Theory ==&lt;br /&gt;
=== The Velocity-Verlet Algorithm ===&lt;br /&gt;
[[File:Verlet-Velocity.png|thumb|700px|x(t) derived from the velocity-Verlet algorithm compared with the position of the classical harmonic oscillator.|left]]&lt;br /&gt;
[[File:Verlet-Energy.png|thumb|700px|Total energy of the system with respect to time|right]]&lt;br /&gt;
[[File:Verlet-Error.png|thumb|700px|The error derived by comparing the solution of the velocity-Verlet algorithm with the position of the classical harmonic oscillator|none]]&lt;br /&gt;
&lt;br /&gt;
The three graphs above display the position of an atom, the total energy of the system and the error between the two methods of calculating the atom position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Error wrt Time.png|thumb|600px|Maximum Error against Time|none]]&lt;br /&gt;
&lt;br /&gt;
From this graph of Maximum error vs Time, we can see that error increases with time at a stable linear rate.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Running the same calculations with varying timesteps show the importance of choosing the right value of the timestep:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Energy at t=0.05.png|Energy at timestep=0.05&lt;br /&gt;
Image:Energy at t=0.5.png|Energy at timestep=0.5&lt;br /&gt;
Image:Error at t=0.5.png|Error at timestep=0.5&lt;br /&gt;
Image:Error at t=0.05.png|Error at timestep=0.05&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examining the four additional graphs above, we can notice that a shorter timestep is able to provide a smaller value of error and that the energy fluctuates less than a bigger value of timestep. However, a shorter timestep results in a shorter simulation type, which can result in a less realistic simulation. It is therefore important to find the right balance between the two.&lt;br /&gt;
&lt;br /&gt;
Through trial and error, it has been found that timestep = 0.2850 or lower results in an energy fluctuation that is smaller than 1% over the course of the simulation. A small fluctuation in energy indicates higher resemblance to reality as technically the total energy should not fluctuate at all due to the Law of Conservation of Energy.&lt;br /&gt;
&lt;br /&gt;
=== Lennard-Jones Potential ===&lt;br /&gt;
The equation to calculate the Lennard-Jones potential is as follows:&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;
By equating this to 0, we find that the &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the separation at which the potential is 0, is &amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We can then find the force at this separation by differentiating the Lennard-Jones potential with respect to r, and substituting in &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}=\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24 \frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation (&amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;) is the separation of the particles at equilibrium, and represents the separation at which the potential energy is at a minimum. It can thus be found by setting &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}&amp;lt;/math&amp;gt;, (or &amp;lt;math&amp;gt;\mathbf{F}&amp;lt;/math&amp;gt;) to 0.&lt;br /&gt;
&lt;br /&gt;
Hence,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right) 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; gives us the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To put this equation into perspective, let us calculate the L-J potential for some realistic cutoff values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int 4\epsilon \left(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=4 \epsilon \left(\frac{\sigma^{12}}{11r^{11}}-\frac{\sigma^6}{5r^5}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\lim_{r\rightarrow \infty} 4 \left(\frac{1^{12}}{11r^{11}}-\frac{1^6}{5r^5}\right) - 4\left(\frac{1^{12}}{11\times 2^{11}}+\frac{1^6}{5\times 2^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=0-0.024822\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following the same calculations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0081767\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0032901\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
It is very difficult to simulate realistic volumes of liquid and in the scope of this experiment, we have simulated liquids with N (number of atoms) between 1,000 and 10,000. To demonstrate why simulating realistic volumes of liquid is difficult, let us first calculate the number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--TASK: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.--&amp;gt;&lt;br /&gt;
(Assuming: Standard conditions; Density of water = 1.00 g/ml)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.00 \mathrm{ml} = 1.00 \mathrm{g}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;18.02 \mathrm{g/mol} = 0.0555 \text{ mols of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.0555 \times 6.022 \times 10^{23} = 3.34 \times 10^{22} \text{ molecules of water.}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the other hand, 10,000 water molecules is only &amp;lt;math&amp;gt;2.99 \times 10^{-19} \text{ ml of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
10000 water molecules == 1.661 x 10^-20 mols of water. (Conversion using Avogadro Constant)&lt;br /&gt;
1.661 x 10^-20 x 18.02 = 2.99 x 10^-19 g&lt;br /&gt;
approx. 2.99 x 10^-19 ml of water.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus, in order to be able to complete the simulation in a practical amount of time, we place our atoms in a box that is repeated in all directions, similar to how unit cells repeat themselves in a lattice. When an atom crosses the boundary of the box, its replica enters the same box from the other side, thus keeping the total number of atoms in the box constant.&lt;br /&gt;
&lt;br /&gt;
For example, if an atom at position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a cubic box ranging from &amp;lt;math&amp;gt;(0, 0, 0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;, its final position would be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;, if the periodic boundary conditions have been applied.&lt;br /&gt;
&amp;lt;!--We can safely avoid the issue we might encounter arising from the infinite number of particles by setting a cutoff limit ---- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units ===&lt;br /&gt;
The LAMMPS calculations run in this experiment are all done in reduced units&lt;br /&gt;
&lt;br /&gt;
For example, the Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34 \mathrm{nm}&amp;lt;/math&amp;gt;; &amp;lt;math&amp;gt;\epsilon/k_B=120K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If we set the cutoff to be &amp;lt;math&amp;gt;r*=3.2,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=3.2\times0.34=1.088\mathrm{nm}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Well depth: &amp;lt;math&amp;gt;\epsilon=120K\times k_B \times 6.02 \times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon=0.998 \mathrm{kJ/mol}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and reduced temperature &amp;lt;math&amp;gt;T*=1.5&amp;lt;/math&amp;gt; would be &amp;lt;math&amp;gt;T=1.5 \times 120=180\mathrm{K}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
=== Creating Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
In order to simulate a liquid for this experiment, we first create a crystal lattice, then melt that lattice to create a liquid. This is preferable to generating a liquid since assigning a random position for each new atom could result in two or more atoms being generated in the same space, causing an error when running the simulation.&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is one lattice point per unit cell. Hence, if the number density is 0.8,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8 \text{ points/volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sqrt[3]{0.8}=0.9283\text{ points/length}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.9283^{-1}=1.0772 \text{ length/point}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is thus 1.0772 unit lengths of spacing between each point.&lt;br /&gt;
&lt;br /&gt;
Following the same logic, a face-centred cubic lattice (with 4 lattice points per unit cell) with a density of 1.2 would have a spacing of &amp;lt;math&amp;gt;0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\because \sqrt[3]{4.8^{-1}}=0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, the simple cubic lattice with a density of 0.8 would create 1,000 atoms in the given constraints of the box:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;region box block 0 10 0 10 0 10&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and a face centred cubic lattice with a density of 1.2 would create 4,000 atoms in the same box.&lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of the Atoms ===&lt;br /&gt;
In the input script, there are the following lines describing the properties of the atoms:&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;
In the first line, we are setting the mass of type 1 atoms (which includes all of the atoms in our simulation box, as we have created only one type of atoms) as &amp;lt;math&amp;gt;1.0&amp;lt;/math&amp;gt;, in reduced units. The second line defines the interaction between the atoms as a Lenard-Jones interaction, with a cutoff distance of &amp;lt;math&amp;gt;3.0 \text{ units.}&amp;lt;/math&amp;gt; Finally, the last line defines the coefficient in the Lenard-Jones interaction; the asterisk tells LAMMPS that the coefficients apply to all atoms in our system; the first coefficient is &amp;lt;math&amp;gt;\epsilon=1.0&amp;lt;/math&amp;gt; and the second coefficient is &amp;lt;math&amp;gt;\sigma=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After setting the properties of the atoms, we also defined the initial positions and the initial velocities for the atoms in the input script. Since we have both the &amp;lt;math&amp;gt;\mathbf{x}_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, we can use the Velocity-Verlet integration algorithm that employs the half-step method.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
In the following lines from the input script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we created and reset a variable called timestep to equal 0.001, then used that value to calculate how many runs (${n_steps}) to carry out. This is more beneficial than simply setting&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;
as it allows us to only change the value of the timestep variable to alter the number of runs, rather than having to calculate ${n_steps} ourselves every time we change the timestep, especially in cases such as this computational experiment where the timestep was changed multiple times.&lt;br /&gt;
&lt;br /&gt;
=== Checking Equilibration ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--TotalE at 0.0075 - SHL.png--&amp;gt;&lt;br /&gt;
[[File:TotalE at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Temp at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Press at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
&lt;br /&gt;
These graphs have been plotted to ensure that the simulation reaches equilibrium, and we can see that indeed, they do, and very quickly. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
The following graph shows the total energy of the system against time at varying timestep values:&lt;br /&gt;
&lt;br /&gt;
[[File:Equil Energy.png|thumb|800px|none]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from the graphs that for timestep = 0.001, 0.0025 and 0.0075, the energy reaches a stable equilibrium but for timestep = 0.01 and timestep = 0.015, the energy slowly decreases and rapidly increases, respectively, indicating that the results of the simulation are not very accurate for these values of timestep. Timestep = 0.015 is especially bad as it very obviously does not reach an equilibrium.&lt;br /&gt;
&lt;br /&gt;
Therefore, timestep = 0.0075 would be the ideal value as it provides the highest accuracy, while running the simulation for a suitably long time.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions (NpT) ==&lt;br /&gt;
&lt;br /&gt;
=== Temperature and Pressure Control ===&lt;br /&gt;
&lt;br /&gt;
Pressures chosen: 2.61, 2.63&lt;br /&gt;
&lt;br /&gt;
Temperatures chosen: 1.5, 1.6, 1.7, 1.8, 1.9&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 was chosen to provide the highest accuracy possible, without shortening the simulation time too much.&lt;br /&gt;
&lt;br /&gt;
In our simulation, the temperature was controlled by solving the two following equations for the instantaneous temperature &amp;lt;math&amp;gt;T,&amp;lt;/math&amp;gt; which fluctuates.&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 \qquad\qquad\qquad(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order for &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; to reach our target temperature &amp;lt;math&amp;gt;\mathfrak{T},&amp;lt;/math&amp;gt; we introduce a constant &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; to control the velocity such that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}\qquad\qquad(2)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can solve eq. &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt; to solve for &amp;lt;math&amp;gt;\gamma.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\sum_i m_i v_i^2 = 3N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substituting &amp;lt;math&amp;gt;\sum_i m_i v_i^2&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 3 N k_b T = 3N k_b \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\epsilon}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Examining the Input Script (Come back)===&lt;br /&gt;
&lt;br /&gt;
To calculate the average values for our simulation, we set certain parameters for LAMMPS in the script.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time Nevery Nrepeat Nfreq&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Final averages are generated on timesteps that are multiples of Nevery, for Nrepeat number of times until it reaches a total number of Nfreq timesteps.&lt;br /&gt;
&lt;br /&gt;
In our script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The results are sampled at every 100 timesteps for 1000 times (100, 200, 300, etc. until 100,000).&lt;br /&gt;
&lt;br /&gt;
=== Results of NpT Simulation ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacity ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--To calculate the heat capacity of our simulated liquid, we investigated how much the energy of our system fluctuates with respect to temperature, according to the equation &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variance in energy can be derived from statistical thermodynamics: &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:HeatCap vs Density.png|thumb|800px|Graph of &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; against Temperature|none]]&lt;br /&gt;
&lt;br /&gt;
From thermodynamics:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;dU = TdS - PdV&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = T\frac{\partial S}{\partial T}-P\frac{\partial V}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and since &amp;lt;math&amp;gt;\frac{\partial S}{\partial T}\geq 0,&amp;lt;/math&amp;gt; heat capacity should increase with increasing temperature.&lt;br /&gt;
&lt;br /&gt;
The fact that &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; decreases with increasing temperature &#039;&#039;&#039;------------&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
[[File:RDF SHL.png|thumb|700px]]&lt;br /&gt;
&lt;br /&gt;
It can be noticed that the three phases have clearly different Radial Distribution Functions (RDF) from each other and this can be attributed to the varying degrees of order each of the phases have: the atoms in the gas phase are completely free to move around, while atoms in the liquid phase have less freedom and in the solid phase, the atoms are set in a lattice, with only vibrational motion and no (or negligible) translational motion.&lt;br /&gt;
&lt;br /&gt;
In order to explain the graph, let us consider the RDF to be displaying the &amp;quot;effective density&amp;quot; of atoms in an area of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; at a distance &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; from a certain reference atom.&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf schematic.jpg|thumb|200px|Schematic of RDF|left]]&lt;br /&gt;
&lt;br /&gt;
There are three main parts to the RDF graphs: the region near the origin where the &amp;lt;math&amp;gt;\mathrm{RDF} = 0&amp;lt;/math&amp;gt;, the region after where there are big peaks and troughs, and the final region where the graphs have mostly reached equilibrium.&lt;br /&gt;
&lt;br /&gt;
First of all, the region near the origin is 0 for all three phases as that is still within the volume of the reference atom, and hence there are no other atoms in that radius.&lt;br /&gt;
&lt;br /&gt;
The peaks in the second region indicate that there is a higher &amp;quot;effective density&amp;quot; of atoms. The explanation for this is different for the lattice structure (solid) and the fluids (liquid and gas).&lt;br /&gt;
&lt;br /&gt;
For the liquid and gas phase, the peaks are due to the attractive force caused by the Lennard-Jones potential. We have calculated above [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:SUNG95#Lennard-Jones_Potential (1.2 LJ Potential)] that &amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}.&amp;lt;/math&amp;gt; Setting &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt; (as we have in our input file), we get &amp;lt;math&amp;gt;r_{eq} = 1.122&amp;lt;/math&amp;gt;, which is very close to where the largest peaks are for the two fluid phases.&lt;br /&gt;
&lt;br /&gt;
Then for the solid, where all the atoms are in a lattice structure, the effects due to the Lennard-Jones interaction becomes neglibigle. Instead, there will be certain values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where the effective density is higher than the overall density of the sample (the peaks), and some values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where it is lower than the density of the sample (the troughs). This is arisen from the fact that as the value of in a similar fashion to the schematic on the left.&lt;br /&gt;
&lt;br /&gt;
As the value of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the total volume covered by &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; also increases. But since all the atoms are set in place by the lattice, the number of atoms that &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; encompasses stays relatively constant. As a result, the peaks and the troughs tend 1 with increasing &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the case of the gas phase, the atoms are completely free to move around and the RDF graph can be entirely attributed to the effects of the L-J interaction. This justifies the lack of troughs for this phase. Furthermore, as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the attractive part of the L-J interaction &amp;lt;math&amp;gt;\frac{1}{r^6}&amp;lt;/math&amp;gt; gets exponentially smaller and quickly becomes negligible - RDF reaches equilibrium.&lt;br /&gt;
&lt;br /&gt;
Finally, the liquid phase can be considered to act as a mix between the solid phase and the gas phase: the L-J interactions are significant enough to reach equilibrium at a rate similar to the gas phase, but there exists an ordering of the atoms such that there are values of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; where the effective density is lower than the overall density.&lt;br /&gt;
&lt;br /&gt;
From the RDF of the solid phase, each of the peaks point to a certain lattice point. Simple geometrical calculations can be done to indicate that the first peak, which is the lattice point (1) closest to the reference atom (O), is at a separation of &amp;lt;math&amp;gt;\mathrm{r}=1.056.&amp;lt;/math&amp;gt; Second closest point (2) is at a distance of &amp;lt;math&amp;gt;\mathrm{r}=1.4938&amp;lt;/math&amp;gt; and the third (3) at &amp;lt;math&amp;gt;\mathrm{r}=1.8295.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:FCC-SHL.png|thumb|Face-centered cubic lattice|none]]&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
=== Mean Squared Displacement ===&lt;br /&gt;
&lt;br /&gt;
=== Velocity Autocorrelation Function ===&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Equil_Energy.png&amp;diff=560498</id>
		<title>File:Equil Energy.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Equil_Energy.png&amp;diff=560498"/>
		<updated>2016-10-21T04:14:48Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560490</id>
		<title>Rep:Mod:SUNG95</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560490"/>
		<updated>2016-10-21T04:02:08Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: /* Creating Simulation Box */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Theory ==&lt;br /&gt;
=== The Velocity-Verlet Algorithm ===&lt;br /&gt;
[[File:Verlet-Velocity.png|thumb|700px|x(t) derived from the velocity-Verlet algorithm compared with the position of the classical harmonic oscillator.|left]]&lt;br /&gt;
[[File:Verlet-Energy.png|thumb|700px|Total energy of the system with respect to time|right]]&lt;br /&gt;
[[File:Verlet-Error.png|thumb|700px|The error derived by comparing the solution of the velocity-Verlet algorithm with the position of the classical harmonic oscillator|none]]&lt;br /&gt;
&lt;br /&gt;
The three graphs above display the position of an atom, the total energy of the system and the error between the two methods of calculating the atom position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Error wrt Time.png|thumb|600px|Maximum Error against Time|none]]&lt;br /&gt;
&lt;br /&gt;
From this graph of Maximum error vs Time, we can see that error increases with time at a stable linear rate.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Running the same calculations with varying timesteps show the importance of choosing the right value of the timestep:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Energy at t=0.05.png|Energy at timestep=0.05&lt;br /&gt;
Image:Energy at t=0.5.png|Energy at timestep=0.5&lt;br /&gt;
Image:Error at t=0.5.png|Error at timestep=0.5&lt;br /&gt;
Image:Error at t=0.05.png|Error at timestep=0.05&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examining the four additional graphs above, we can notice that a shorter timestep is able to provide a smaller value of error and that the energy fluctuates less than a bigger value of timestep. However, a shorter timestep results in a shorter simulation type, which can result in a less realistic simulation. It is therefore important to find the right balance between the two.&lt;br /&gt;
&lt;br /&gt;
Through trial and error, it has been found that timestep = 0.2850 or lower results in an energy fluctuation that is smaller than 1% over the course of the simulation. A small fluctuation in energy indicates higher resemblance to reality as technically the total energy should not fluctuate at all due to the Law of Conservation of Energy.&lt;br /&gt;
&lt;br /&gt;
=== Lennard-Jones Potential ===&lt;br /&gt;
The equation to calculate the Lennard-Jones potential is as follows:&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;
By equating this to 0, we find that the &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the separation at which the potential is 0, is &amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We can then find the force at this separation by differentiating the Lennard-Jones potential with respect to r, and substituting in &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}=\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24 \frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation (&amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;) is the separation of the particles at equilibrium, and represents the separation at which the potential energy is at a minimum. It can thus be found by setting &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}&amp;lt;/math&amp;gt;, (or &amp;lt;math&amp;gt;\mathbf{F}&amp;lt;/math&amp;gt;) to 0.&lt;br /&gt;
&lt;br /&gt;
Hence,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right) 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; gives us the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To put this equation into perspective, let us calculate the L-J potential for some realistic cutoff values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int 4\epsilon \left(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=4 \epsilon \left(\frac{\sigma^{12}}{11r^{11}}-\frac{\sigma^6}{5r^5}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\lim_{r\rightarrow \infty} 4 \left(\frac{1^{12}}{11r^{11}}-\frac{1^6}{5r^5}\right) - 4\left(\frac{1^{12}}{11\times 2^{11}}+\frac{1^6}{5\times 2^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=0-0.024822\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following the same calculations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0081767\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0032901\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
It is very difficult to simulate realistic volumes of liquid and in the scope of this experiment, we have simulated liquids with N (number of atoms) between 1,000 and 10,000. To demonstrate why simulating realistic volumes of liquid is difficult, let us first calculate the number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--TASK: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.--&amp;gt;&lt;br /&gt;
(Assuming: Standard conditions; Density of water = 1.00 g/ml)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.00 \mathrm{ml} = 1.00 \mathrm{g}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;18.02 \mathrm{g/mol} = 0.0555 \text{ mols of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.0555 \times 6.022 \times 10^{23} = 3.34 \times 10^{22} \text{ molecules of water.}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the other hand, 10,000 water molecules is only &amp;lt;math&amp;gt;2.99 \times 10^{-19} \text{ ml of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
10000 water molecules == 1.661 x 10^-20 mols of water. (Conversion using Avogadro Constant)&lt;br /&gt;
1.661 x 10^-20 x 18.02 = 2.99 x 10^-19 g&lt;br /&gt;
approx. 2.99 x 10^-19 ml of water.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus, in order to be able to complete the simulation in a practical amount of time, we place our atoms in a box that is repeated in all directions, similar to how unit cells repeat themselves in a lattice. When an atom crosses the boundary of the box, its replica enters the same box from the other side, thus keeping the total number of atoms in the box constant.&lt;br /&gt;
&lt;br /&gt;
For example, if an atom at position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a cubic box ranging from &amp;lt;math&amp;gt;(0, 0, 0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;, its final position would be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;, if the periodic boundary conditions have been applied.&lt;br /&gt;
&amp;lt;!--We can safely avoid the issue we might encounter arising from the infinite number of particles by setting a cutoff limit ---- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units ===&lt;br /&gt;
The LAMMPS calculations run in this experiment are all done in reduced units&lt;br /&gt;
&lt;br /&gt;
For example, the Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34 \mathrm{nm}&amp;lt;/math&amp;gt;; &amp;lt;math&amp;gt;\epsilon/k_B=120K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If we set the cutoff to be &amp;lt;math&amp;gt;r*=3.2,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=3.2\times0.34=1.088\mathrm{nm}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Well depth: &amp;lt;math&amp;gt;\epsilon=120K\times k_B \times 6.02 \times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon=0.998 \mathrm{kJ/mol}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and reduced temperature &amp;lt;math&amp;gt;T*=1.5&amp;lt;/math&amp;gt; would be &amp;lt;math&amp;gt;T=1.5 \times 120=180\mathrm{K}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
=== Creating Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
In order to simulate a liquid for this experiment, we first create a crystal lattice, then melt that lattice to create a liquid. This is preferable to generating a liquid since assigning a random position for each new atom could result in two or more atoms being generated in the same space, causing an error when running the simulation.&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is one lattice point per unit cell. Hence, if the number density is 0.8,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8 \text{ points/volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sqrt[3]{0.8}=0.9283\text{ points/length}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.9283^{-1}=1.0772 \text{ length/point}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is thus 1.0772 unit lengths of spacing between each point.&lt;br /&gt;
&lt;br /&gt;
Following the same logic, a face-centred cubic lattice (with 4 lattice points per unit cell) with a density of 1.2 would have a spacing of &amp;lt;math&amp;gt;0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\because \sqrt[3]{4.8^{-1}}=0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, the simple cubic lattice with a density of 0.8 would create 1,000 atoms in the given constraints of the box:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;region box block 0 10 0 10 0 10&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and a face centred cubic lattice with a density of 1.2 would create 4,000 atoms in the same box.&lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of the Atoms ===&lt;br /&gt;
In the input script, there are the following lines describing the properties of the atoms:&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;
In the first line, we are setting the mass of type 1 atoms (which includes all of the atoms in our simulation box, as we have created only one type of atoms) as &amp;lt;math&amp;gt;1.0&amp;lt;/math&amp;gt;, in reduced units. The second line defines the interaction between the atoms as a Lenard-Jones interaction, with a cutoff distance of &amp;lt;math&amp;gt;3.0 \text{ units.}&amp;lt;/math&amp;gt; Finally, the last line defines the coefficient in the Lenard-Jones interaction; the asterisk tells LAMMPS that the coefficients apply to all atoms in our system; the first coefficient is &amp;lt;math&amp;gt;\epsilon=1.0&amp;lt;/math&amp;gt; and the second coefficient is &amp;lt;math&amp;gt;\sigma=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After setting the properties of the atoms, we also defined the initial positions and the initial velocities for the atoms in the input script. Since we have both the &amp;lt;math&amp;gt;\mathbf{x}_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, we can use the Velocity-Verlet integration algorithm that employs the half-step method.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
In the following lines from the input script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we created and reset a variable called timestep to equal 0.001, then used that value to calculate how many runs (${n_steps}) to carry out. This is more beneficial than simply setting&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;
as it allows us to only change the value of the timestep variable to alter the number of runs, rather than having to calculate ${n_steps} ourselves every time we change the timestep, especially in cases such as this computational experiment where the timestep was changed multiple times.&lt;br /&gt;
&lt;br /&gt;
=== Checking Equilibration ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--TotalE at 0.0075 - SHL.png--&amp;gt;&lt;br /&gt;
[[File:TotalE at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Temp at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Press at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
The following set of graphs show the total energy of the system against time at varying timestep values.&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:TotalE at 0.001 - SHL.png|Total Energy at timestep = 0.001&lt;br /&gt;
Image:TotalE at 0.0025 - SHL.png|Total Energy at timestep = 0.0025&lt;br /&gt;
Image:TotalE at 0.0075 - SHL.png|Total Energy at timestep = 0.0075&lt;br /&gt;
Image:TotalE at 0.01 - SHL.png|Total Energy at timestep = 0.01&lt;br /&gt;
Image:TotalE at 0.015 - SHL.png|Total Energy at timestep = 0.015&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can be seen from the graphs that for timestep = 0.001, 0.0025 and 0.0075, the energy reaches a stable equilibrium but for timestep = 0.01 and timestep = 0.015, the energy slowly decreases and rapidly increases, respectively, indicating that the results of the simulation are not very accurate for these values of timestep.&lt;br /&gt;
&lt;br /&gt;
Therefore, timestep = 0.0075 would be the ideal value as it provides the highest accuracy, while running the simulation for a suitably long time.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions (NpT) ==&lt;br /&gt;
&lt;br /&gt;
=== Temperature and Pressure Control ===&lt;br /&gt;
&lt;br /&gt;
Pressures chosen: 2.61, 2.63&lt;br /&gt;
&lt;br /&gt;
Temperatures chosen: 1.5, 1.6, 1.7, 1.8, 1.9&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 was chosen to provide the highest accuracy possible, without shortening the simulation time too much.&lt;br /&gt;
&lt;br /&gt;
In our simulation, the temperature was controlled by solving the two following equations for the instantaneous temperature &amp;lt;math&amp;gt;T,&amp;lt;/math&amp;gt; which fluctuates.&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 \qquad\qquad\qquad(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order for &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; to reach our target temperature &amp;lt;math&amp;gt;\mathfrak{T},&amp;lt;/math&amp;gt; we introduce a constant &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; to control the velocity such that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}\qquad\qquad(2)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can solve eq. &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt; to solve for &amp;lt;math&amp;gt;\gamma.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\sum_i m_i v_i^2 = 3N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substituting &amp;lt;math&amp;gt;\sum_i m_i v_i^2&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 3 N k_b T = 3N k_b \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\epsilon}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Examining the Input Script (Come back)===&lt;br /&gt;
&lt;br /&gt;
To calculate the average values for our simulation, we set certain parameters for LAMMPS in the script.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time Nevery Nrepeat Nfreq&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Final averages are generated on timesteps that are multiples of Nevery, for Nrepeat number of times until it reaches a total number of Nfreq timesteps.&lt;br /&gt;
&lt;br /&gt;
In our script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The results are sampled at every 100 timesteps for 1000 times (100, 200, 300, etc. until 100,000).&lt;br /&gt;
&lt;br /&gt;
=== Results of NpT Simulation ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacity ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--To calculate the heat capacity of our simulated liquid, we investigated how much the energy of our system fluctuates with respect to temperature, according to the equation &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variance in energy can be derived from statistical thermodynamics: &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:HeatCap vs Density.png|thumb|800px|Graph of &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; against Temperature|none]]&lt;br /&gt;
&lt;br /&gt;
From thermodynamics:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;dU = TdS - PdV&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = T\frac{\partial S}{\partial T}-P\frac{\partial V}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and since &amp;lt;math&amp;gt;\frac{\partial S}{\partial T}\geq 0,&amp;lt;/math&amp;gt; heat capacity should increase with increasing temperature.&lt;br /&gt;
&lt;br /&gt;
The fact that &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; decreases with increasing temperature &#039;&#039;&#039;------------&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
[[File:RDF SHL.png|thumb|700px]]&lt;br /&gt;
&lt;br /&gt;
It can be noticed that the three phases have clearly different Radial Distribution Functions (RDF) from each other and this can be attributed to the varying degrees of order each of the phases have: the atoms in the gas phase are completely free to move around, while atoms in the liquid phase have less freedom and in the solid phase, the atoms are set in a lattice, with only vibrational motion and no (or negligible) translational motion.&lt;br /&gt;
&lt;br /&gt;
In order to explain the graph, let us consider the RDF to be displaying the &amp;quot;effective density&amp;quot; of atoms in an area of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; at a distance &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; from a certain reference atom.&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf schematic.jpg|thumb|200px|Schematic of RDF|left]]&lt;br /&gt;
&lt;br /&gt;
There are three main parts to the RDF graphs: the region near the origin where the &amp;lt;math&amp;gt;\mathrm{RDF} = 0&amp;lt;/math&amp;gt;, the region after where there are big peaks and troughs, and the final region where the graphs have mostly reached equilibrium.&lt;br /&gt;
&lt;br /&gt;
First of all, the region near the origin is 0 for all three phases as that is still within the volume of the reference atom, and hence there are no other atoms in that radius.&lt;br /&gt;
&lt;br /&gt;
The peaks in the second region indicate that there is a higher &amp;quot;effective density&amp;quot; of atoms. The explanation for this is different for the lattice structure (solid) and the fluids (liquid and gas).&lt;br /&gt;
&lt;br /&gt;
For the liquid and gas phase, the peaks are due to the attractive force caused by the Lennard-Jones potential. We have calculated above [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:SUNG95#Lennard-Jones_Potential (1.2 LJ Potential)] that &amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}.&amp;lt;/math&amp;gt; Setting &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt; (as we have in our input file), we get &amp;lt;math&amp;gt;r_{eq} = 1.122&amp;lt;/math&amp;gt;, which is very close to where the largest peaks are for the two fluid phases.&lt;br /&gt;
&lt;br /&gt;
Then for the solid, where all the atoms are in a lattice structure, the effects due to the Lennard-Jones interaction becomes neglibigle. Instead, there will be certain values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where the effective density is higher than the overall density of the sample (the peaks), and some values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where it is lower than the density of the sample (the troughs). This is arisen from the fact that as the value of in a similar fashion to the schematic on the left.&lt;br /&gt;
&lt;br /&gt;
As the value of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the total volume covered by &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; also increases. But since all the atoms are set in place by the lattice, the number of atoms that &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; encompasses stays relatively constant. As a result, the peaks and the troughs tend 1 with increasing &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the case of the gas phase, the atoms are completely free to move around and the RDF graph can be entirely attributed to the effects of the L-J interaction. This justifies the lack of troughs for this phase. Furthermore, as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the attractive part of the L-J interaction &amp;lt;math&amp;gt;\frac{1}{r^6}&amp;lt;/math&amp;gt; gets exponentially smaller and quickly becomes negligible - RDF reaches equilibrium.&lt;br /&gt;
&lt;br /&gt;
Finally, the liquid phase can be considered to act as a mix between the solid phase and the gas phase: the L-J interactions are significant enough to reach equilibrium at a rate similar to the gas phase, but there exists an ordering of the atoms such that there are values of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; where the effective density is lower than the overall density.&lt;br /&gt;
&lt;br /&gt;
From the RDF of the solid phase, each of the peaks point to a certain lattice point. Simple geometrical calculations can be done to indicate that the first peak, which is the lattice point (1) closest to the reference atom (O), is at a separation of &amp;lt;math&amp;gt;\mathrm{r}=1.056.&amp;lt;/math&amp;gt; Second closest point (2) is at a distance of &amp;lt;math&amp;gt;\mathrm{r}=1.4938&amp;lt;/math&amp;gt; and the third (3) at &amp;lt;math&amp;gt;\mathrm{r}=1.8295.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:FCC-SHL.png|thumb|Face-centered cubic lattice|none]]&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
=== Mean Squared Displacement ===&lt;br /&gt;
&lt;br /&gt;
=== Velocity Autocorrelation Function ===&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560488</id>
		<title>Rep:Mod:SUNG95</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560488"/>
		<updated>2016-10-21T04:01:29Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: /* Creating Simulation Box */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Theory ==&lt;br /&gt;
=== The Velocity-Verlet Algorithm ===&lt;br /&gt;
[[File:Verlet-Velocity.png|thumb|700px|x(t) derived from the velocity-Verlet algorithm compared with the position of the classical harmonic oscillator.|left]]&lt;br /&gt;
[[File:Verlet-Energy.png|thumb|700px|Total energy of the system with respect to time|right]]&lt;br /&gt;
[[File:Verlet-Error.png|thumb|700px|The error derived by comparing the solution of the velocity-Verlet algorithm with the position of the classical harmonic oscillator|none]]&lt;br /&gt;
&lt;br /&gt;
The three graphs above display the position of an atom, the total energy of the system and the error between the two methods of calculating the atom position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Error wrt Time.png|thumb|600px|Maximum Error against Time|none]]&lt;br /&gt;
&lt;br /&gt;
From this graph of Maximum error vs Time, we can see that error increases with time at a stable linear rate.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Running the same calculations with varying timesteps show the importance of choosing the right value of the timestep:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Energy at t=0.05.png|Energy at timestep=0.05&lt;br /&gt;
Image:Energy at t=0.5.png|Energy at timestep=0.5&lt;br /&gt;
Image:Error at t=0.5.png|Error at timestep=0.5&lt;br /&gt;
Image:Error at t=0.05.png|Error at timestep=0.05&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examining the four additional graphs above, we can notice that a shorter timestep is able to provide a smaller value of error and that the energy fluctuates less than a bigger value of timestep. However, a shorter timestep results in a shorter simulation type, which can result in a less realistic simulation. It is therefore important to find the right balance between the two.&lt;br /&gt;
&lt;br /&gt;
Through trial and error, it has been found that timestep = 0.2850 or lower results in an energy fluctuation that is smaller than 1% over the course of the simulation. A small fluctuation in energy indicates higher resemblance to reality as technically the total energy should not fluctuate at all due to the Law of Conservation of Energy.&lt;br /&gt;
&lt;br /&gt;
=== Lennard-Jones Potential ===&lt;br /&gt;
The equation to calculate the Lennard-Jones potential is as follows:&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;
By equating this to 0, we find that the &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the separation at which the potential is 0, is &amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We can then find the force at this separation by differentiating the Lennard-Jones potential with respect to r, and substituting in &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}=\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24 \frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation (&amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;) is the separation of the particles at equilibrium, and represents the separation at which the potential energy is at a minimum. It can thus be found by setting &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}&amp;lt;/math&amp;gt;, (or &amp;lt;math&amp;gt;\mathbf{F}&amp;lt;/math&amp;gt;) to 0.&lt;br /&gt;
&lt;br /&gt;
Hence,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right) 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; gives us the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To put this equation into perspective, let us calculate the L-J potential for some realistic cutoff values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int 4\epsilon \left(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=4 \epsilon \left(\frac{\sigma^{12}}{11r^{11}}-\frac{\sigma^6}{5r^5}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\lim_{r\rightarrow \infty} 4 \left(\frac{1^{12}}{11r^{11}}-\frac{1^6}{5r^5}\right) - 4\left(\frac{1^{12}}{11\times 2^{11}}+\frac{1^6}{5\times 2^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=0-0.024822\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following the same calculations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0081767\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0032901\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
It is very difficult to simulate realistic volumes of liquid and in the scope of this experiment, we have simulated liquids with N (number of atoms) between 1,000 and 10,000. To demonstrate why simulating realistic volumes of liquid is difficult, let us first calculate the number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--TASK: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.--&amp;gt;&lt;br /&gt;
(Assuming: Standard conditions; Density of water = 1.00 g/ml)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.00 \mathrm{ml} = 1.00 \mathrm{g}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;18.02 \mathrm{g/mol} = 0.0555 \text{ mols of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.0555 \times 6.022 \times 10^{23} = 3.34 \times 10^{22} \text{ molecules of water.}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the other hand, 10,000 water molecules is only &amp;lt;math&amp;gt;2.99 \times 10^{-19} \text{ ml of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
10000 water molecules == 1.661 x 10^-20 mols of water. (Conversion using Avogadro Constant)&lt;br /&gt;
1.661 x 10^-20 x 18.02 = 2.99 x 10^-19 g&lt;br /&gt;
approx. 2.99 x 10^-19 ml of water.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus, in order to be able to complete the simulation in a practical amount of time, we place our atoms in a box that is repeated in all directions, similar to how unit cells repeat themselves in a lattice. When an atom crosses the boundary of the box, its replica enters the same box from the other side, thus keeping the total number of atoms in the box constant.&lt;br /&gt;
&lt;br /&gt;
For example, if an atom at position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a cubic box ranging from &amp;lt;math&amp;gt;(0, 0, 0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;, its final position would be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;, if the periodic boundary conditions have been applied.&lt;br /&gt;
&amp;lt;!--We can safely avoid the issue we might encounter arising from the infinite number of particles by setting a cutoff limit ---- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units ===&lt;br /&gt;
The LAMMPS calculations run in this experiment are all done in reduced units&lt;br /&gt;
&lt;br /&gt;
For example, the Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34 \mathrm{nm}&amp;lt;/math&amp;gt;; &amp;lt;math&amp;gt;\epsilon/k_B=120K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If we set the cutoff to be &amp;lt;math&amp;gt;r*=3.2,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=3.2\times0.34=1.088\mathrm{nm}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Well depth: &amp;lt;math&amp;gt;\epsilon=120K\times k_B \times 6.02 \times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon=0.998 \mathrm{kJ/mol}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and reduced temperature &amp;lt;math&amp;gt;T*=1.5&amp;lt;/math&amp;gt; would be &amp;lt;math&amp;gt;T=1.5 \times 120=180\mathrm{K}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
=== Creating Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
In order to simulate a liquid for this experiment, we first create a crystal lattice, then melt that lattice to create a liquid. This is preferable to generating a liquid since assigning a random position for each new atom could result in two or more atoms being generated in the same space, causing an error when running the simulation.&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is one lattice point per unit cell. Hence, if the number density is 0.8,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8 \text{ points/volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sqrt[3]{0.8}=0.9283\text{ points/length}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.9283^{-1}=1.0772 \text{ length/point}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is thus 1.0772 unit lengths of spacing between each point.&lt;br /&gt;
&lt;br /&gt;
Following the same logic, a face-centred cubic lattice (with 4 lattice points per unit cell) with a density of 1.2 would have a spacing of &amp;lt;math&amp;gt;0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\sqrt[3]{4.8^{-1}}=0.5928)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, the simple cubic lattice with a density of 0.8 would create 1,000 atoms in the given constraints of the box:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;region box block 0 10 0 10 0 10&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and a face centred cubic lattice with a density of 1.2 would create 4,000 atoms in the same box.&lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of the Atoms ===&lt;br /&gt;
In the input script, there are the following lines describing the properties of the atoms:&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;
In the first line, we are setting the mass of type 1 atoms (which includes all of the atoms in our simulation box, as we have created only one type of atoms) as &amp;lt;math&amp;gt;1.0&amp;lt;/math&amp;gt;, in reduced units. The second line defines the interaction between the atoms as a Lenard-Jones interaction, with a cutoff distance of &amp;lt;math&amp;gt;3.0 \text{ units.}&amp;lt;/math&amp;gt; Finally, the last line defines the coefficient in the Lenard-Jones interaction; the asterisk tells LAMMPS that the coefficients apply to all atoms in our system; the first coefficient is &amp;lt;math&amp;gt;\epsilon=1.0&amp;lt;/math&amp;gt; and the second coefficient is &amp;lt;math&amp;gt;\sigma=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After setting the properties of the atoms, we also defined the initial positions and the initial velocities for the atoms in the input script. Since we have both the &amp;lt;math&amp;gt;\mathbf{x}_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, we can use the Velocity-Verlet integration algorithm that employs the half-step method.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
In the following lines from the input script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we created and reset a variable called timestep to equal 0.001, then used that value to calculate how many runs (${n_steps}) to carry out. This is more beneficial than simply setting&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;
as it allows us to only change the value of the timestep variable to alter the number of runs, rather than having to calculate ${n_steps} ourselves every time we change the timestep, especially in cases such as this computational experiment where the timestep was changed multiple times.&lt;br /&gt;
&lt;br /&gt;
=== Checking Equilibration ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--TotalE at 0.0075 - SHL.png--&amp;gt;&lt;br /&gt;
[[File:TotalE at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Temp at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Press at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
The following set of graphs show the total energy of the system against time at varying timestep values.&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:TotalE at 0.001 - SHL.png|Total Energy at timestep = 0.001&lt;br /&gt;
Image:TotalE at 0.0025 - SHL.png|Total Energy at timestep = 0.0025&lt;br /&gt;
Image:TotalE at 0.0075 - SHL.png|Total Energy at timestep = 0.0075&lt;br /&gt;
Image:TotalE at 0.01 - SHL.png|Total Energy at timestep = 0.01&lt;br /&gt;
Image:TotalE at 0.015 - SHL.png|Total Energy at timestep = 0.015&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can be seen from the graphs that for timestep = 0.001, 0.0025 and 0.0075, the energy reaches a stable equilibrium but for timestep = 0.01 and timestep = 0.015, the energy slowly decreases and rapidly increases, respectively, indicating that the results of the simulation are not very accurate for these values of timestep.&lt;br /&gt;
&lt;br /&gt;
Therefore, timestep = 0.0075 would be the ideal value as it provides the highest accuracy, while running the simulation for a suitably long time.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions (NpT) ==&lt;br /&gt;
&lt;br /&gt;
=== Temperature and Pressure Control ===&lt;br /&gt;
&lt;br /&gt;
Pressures chosen: 2.61, 2.63&lt;br /&gt;
&lt;br /&gt;
Temperatures chosen: 1.5, 1.6, 1.7, 1.8, 1.9&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 was chosen to provide the highest accuracy possible, without shortening the simulation time too much.&lt;br /&gt;
&lt;br /&gt;
In our simulation, the temperature was controlled by solving the two following equations for the instantaneous temperature &amp;lt;math&amp;gt;T,&amp;lt;/math&amp;gt; which fluctuates.&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 \qquad\qquad\qquad(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order for &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; to reach our target temperature &amp;lt;math&amp;gt;\mathfrak{T},&amp;lt;/math&amp;gt; we introduce a constant &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; to control the velocity such that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}\qquad\qquad(2)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can solve eq. &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt; to solve for &amp;lt;math&amp;gt;\gamma.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\sum_i m_i v_i^2 = 3N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substituting &amp;lt;math&amp;gt;\sum_i m_i v_i^2&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 3 N k_b T = 3N k_b \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\epsilon}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Examining the Input Script (Come back)===&lt;br /&gt;
&lt;br /&gt;
To calculate the average values for our simulation, we set certain parameters for LAMMPS in the script.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time Nevery Nrepeat Nfreq&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Final averages are generated on timesteps that are multiples of Nevery, for Nrepeat number of times until it reaches a total number of Nfreq timesteps.&lt;br /&gt;
&lt;br /&gt;
In our script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The results are sampled at every 100 timesteps for 1000 times (100, 200, 300, etc. until 100,000).&lt;br /&gt;
&lt;br /&gt;
=== Results of NpT Simulation ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacity ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--To calculate the heat capacity of our simulated liquid, we investigated how much the energy of our system fluctuates with respect to temperature, according to the equation &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variance in energy can be derived from statistical thermodynamics: &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:HeatCap vs Density.png|thumb|800px|Graph of &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; against Temperature|none]]&lt;br /&gt;
&lt;br /&gt;
From thermodynamics:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;dU = TdS - PdV&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = T\frac{\partial S}{\partial T}-P\frac{\partial V}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and since &amp;lt;math&amp;gt;\frac{\partial S}{\partial T}\geq 0,&amp;lt;/math&amp;gt; heat capacity should increase with increasing temperature.&lt;br /&gt;
&lt;br /&gt;
The fact that &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; decreases with increasing temperature &#039;&#039;&#039;------------&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
[[File:RDF SHL.png|thumb|700px]]&lt;br /&gt;
&lt;br /&gt;
It can be noticed that the three phases have clearly different Radial Distribution Functions (RDF) from each other and this can be attributed to the varying degrees of order each of the phases have: the atoms in the gas phase are completely free to move around, while atoms in the liquid phase have less freedom and in the solid phase, the atoms are set in a lattice, with only vibrational motion and no (or negligible) translational motion.&lt;br /&gt;
&lt;br /&gt;
In order to explain the graph, let us consider the RDF to be displaying the &amp;quot;effective density&amp;quot; of atoms in an area of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; at a distance &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; from a certain reference atom.&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf schematic.jpg|thumb|200px|Schematic of RDF|left]]&lt;br /&gt;
&lt;br /&gt;
There are three main parts to the RDF graphs: the region near the origin where the &amp;lt;math&amp;gt;\mathrm{RDF} = 0&amp;lt;/math&amp;gt;, the region after where there are big peaks and troughs, and the final region where the graphs have mostly reached equilibrium.&lt;br /&gt;
&lt;br /&gt;
First of all, the region near the origin is 0 for all three phases as that is still within the volume of the reference atom, and hence there are no other atoms in that radius.&lt;br /&gt;
&lt;br /&gt;
The peaks in the second region indicate that there is a higher &amp;quot;effective density&amp;quot; of atoms. The explanation for this is different for the lattice structure (solid) and the fluids (liquid and gas).&lt;br /&gt;
&lt;br /&gt;
For the liquid and gas phase, the peaks are due to the attractive force caused by the Lennard-Jones potential. We have calculated above [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:SUNG95#Lennard-Jones_Potential (1.2 LJ Potential)] that &amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}.&amp;lt;/math&amp;gt; Setting &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt; (as we have in our input file), we get &amp;lt;math&amp;gt;r_{eq} = 1.122&amp;lt;/math&amp;gt;, which is very close to where the largest peaks are for the two fluid phases.&lt;br /&gt;
&lt;br /&gt;
Then for the solid, where all the atoms are in a lattice structure, the effects due to the Lennard-Jones interaction becomes neglibigle. Instead, there will be certain values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where the effective density is higher than the overall density of the sample (the peaks), and some values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where it is lower than the density of the sample (the troughs). This is arisen from the fact that as the value of in a similar fashion to the schematic on the left.&lt;br /&gt;
&lt;br /&gt;
As the value of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the total volume covered by &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; also increases. But since all the atoms are set in place by the lattice, the number of atoms that &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; encompasses stays relatively constant. As a result, the peaks and the troughs tend 1 with increasing &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the case of the gas phase, the atoms are completely free to move around and the RDF graph can be entirely attributed to the effects of the L-J interaction. This justifies the lack of troughs for this phase. Furthermore, as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the attractive part of the L-J interaction &amp;lt;math&amp;gt;\frac{1}{r^6}&amp;lt;/math&amp;gt; gets exponentially smaller and quickly becomes negligible - RDF reaches equilibrium.&lt;br /&gt;
&lt;br /&gt;
Finally, the liquid phase can be considered to act as a mix between the solid phase and the gas phase: the L-J interactions are significant enough to reach equilibrium at a rate similar to the gas phase, but there exists an ordering of the atoms such that there are values of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; where the effective density is lower than the overall density.&lt;br /&gt;
&lt;br /&gt;
From the RDF of the solid phase, each of the peaks point to a certain lattice point. Simple geometrical calculations can be done to indicate that the first peak, which is the lattice point (1) closest to the reference atom (O), is at a separation of &amp;lt;math&amp;gt;\mathrm{r}=1.056.&amp;lt;/math&amp;gt; Second closest point (2) is at a distance of &amp;lt;math&amp;gt;\mathrm{r}=1.4938&amp;lt;/math&amp;gt; and the third (3) at &amp;lt;math&amp;gt;\mathrm{r}=1.8295.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:FCC-SHL.png|thumb|Face-centered cubic lattice|none]]&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
=== Mean Squared Displacement ===&lt;br /&gt;
&lt;br /&gt;
=== Velocity Autocorrelation Function ===&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560487</id>
		<title>Rep:Mod:SUNG95</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560487"/>
		<updated>2016-10-21T04:01:07Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: /* Creating Simulation Box */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Theory ==&lt;br /&gt;
=== The Velocity-Verlet Algorithm ===&lt;br /&gt;
[[File:Verlet-Velocity.png|thumb|700px|x(t) derived from the velocity-Verlet algorithm compared with the position of the classical harmonic oscillator.|left]]&lt;br /&gt;
[[File:Verlet-Energy.png|thumb|700px|Total energy of the system with respect to time|right]]&lt;br /&gt;
[[File:Verlet-Error.png|thumb|700px|The error derived by comparing the solution of the velocity-Verlet algorithm with the position of the classical harmonic oscillator|none]]&lt;br /&gt;
&lt;br /&gt;
The three graphs above display the position of an atom, the total energy of the system and the error between the two methods of calculating the atom position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Error wrt Time.png|thumb|600px|Maximum Error against Time|none]]&lt;br /&gt;
&lt;br /&gt;
From this graph of Maximum error vs Time, we can see that error increases with time at a stable linear rate.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Running the same calculations with varying timesteps show the importance of choosing the right value of the timestep:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Energy at t=0.05.png|Energy at timestep=0.05&lt;br /&gt;
Image:Energy at t=0.5.png|Energy at timestep=0.5&lt;br /&gt;
Image:Error at t=0.5.png|Error at timestep=0.5&lt;br /&gt;
Image:Error at t=0.05.png|Error at timestep=0.05&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examining the four additional graphs above, we can notice that a shorter timestep is able to provide a smaller value of error and that the energy fluctuates less than a bigger value of timestep. However, a shorter timestep results in a shorter simulation type, which can result in a less realistic simulation. It is therefore important to find the right balance between the two.&lt;br /&gt;
&lt;br /&gt;
Through trial and error, it has been found that timestep = 0.2850 or lower results in an energy fluctuation that is smaller than 1% over the course of the simulation. A small fluctuation in energy indicates higher resemblance to reality as technically the total energy should not fluctuate at all due to the Law of Conservation of Energy.&lt;br /&gt;
&lt;br /&gt;
=== Lennard-Jones Potential ===&lt;br /&gt;
The equation to calculate the Lennard-Jones potential is as follows:&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;
By equating this to 0, we find that the &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the separation at which the potential is 0, is &amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We can then find the force at this separation by differentiating the Lennard-Jones potential with respect to r, and substituting in &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}=\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24 \frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation (&amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;) is the separation of the particles at equilibrium, and represents the separation at which the potential energy is at a minimum. It can thus be found by setting &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}&amp;lt;/math&amp;gt;, (or &amp;lt;math&amp;gt;\mathbf{F}&amp;lt;/math&amp;gt;) to 0.&lt;br /&gt;
&lt;br /&gt;
Hence,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right) 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; gives us the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To put this equation into perspective, let us calculate the L-J potential for some realistic cutoff values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int 4\epsilon \left(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=4 \epsilon \left(\frac{\sigma^{12}}{11r^{11}}-\frac{\sigma^6}{5r^5}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\lim_{r\rightarrow \infty} 4 \left(\frac{1^{12}}{11r^{11}}-\frac{1^6}{5r^5}\right) - 4\left(\frac{1^{12}}{11\times 2^{11}}+\frac{1^6}{5\times 2^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=0-0.024822\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following the same calculations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0081767\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0032901\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
It is very difficult to simulate realistic volumes of liquid and in the scope of this experiment, we have simulated liquids with N (number of atoms) between 1,000 and 10,000. To demonstrate why simulating realistic volumes of liquid is difficult, let us first calculate the number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--TASK: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.--&amp;gt;&lt;br /&gt;
(Assuming: Standard conditions; Density of water = 1.00 g/ml)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.00 \mathrm{ml} = 1.00 \mathrm{g}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;18.02 \mathrm{g/mol} = 0.0555 \text{ mols of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.0555 \times 6.022 \times 10^{23} = 3.34 \times 10^{22} \text{ molecules of water.}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the other hand, 10,000 water molecules is only &amp;lt;math&amp;gt;2.99 \times 10^{-19} \text{ ml of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
10000 water molecules == 1.661 x 10^-20 mols of water. (Conversion using Avogadro Constant)&lt;br /&gt;
1.661 x 10^-20 x 18.02 = 2.99 x 10^-19 g&lt;br /&gt;
approx. 2.99 x 10^-19 ml of water.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus, in order to be able to complete the simulation in a practical amount of time, we place our atoms in a box that is repeated in all directions, similar to how unit cells repeat themselves in a lattice. When an atom crosses the boundary of the box, its replica enters the same box from the other side, thus keeping the total number of atoms in the box constant.&lt;br /&gt;
&lt;br /&gt;
For example, if an atom at position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a cubic box ranging from &amp;lt;math&amp;gt;(0, 0, 0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;, its final position would be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;, if the periodic boundary conditions have been applied.&lt;br /&gt;
&amp;lt;!--We can safely avoid the issue we might encounter arising from the infinite number of particles by setting a cutoff limit ---- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units ===&lt;br /&gt;
The LAMMPS calculations run in this experiment are all done in reduced units&lt;br /&gt;
&lt;br /&gt;
For example, the Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34 \mathrm{nm}&amp;lt;/math&amp;gt;; &amp;lt;math&amp;gt;\epsilon/k_B=120K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If we set the cutoff to be &amp;lt;math&amp;gt;r*=3.2,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=3.2\times0.34=1.088\mathrm{nm}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Well depth: &amp;lt;math&amp;gt;\epsilon=120K\times k_B \times 6.02 \times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon=0.998 \mathrm{kJ/mol}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and reduced temperature &amp;lt;math&amp;gt;T*=1.5&amp;lt;/math&amp;gt; would be &amp;lt;math&amp;gt;T=1.5 \times 120=180\mathrm{K}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
=== Creating Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
In order to simulate a liquid for this experiment, we first create a crystal lattice, then melt that lattice to create a liquid. This is preferable to generating a liquid since assigning a random position for each new atom could result in two or more atoms being generated in the same space, causing an error when running the simulation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?--&amp;gt;&lt;br /&gt;
For a simple cubic lattice, there is one lattice point per unit cell. Hence, if the number density is 0.8,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8 \text{ points/volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sqrt[3]{0.8}=0.9283\text{ points/length}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.9283^{-1}=1.0772 \text{ length/point}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is thus 1.0772 unit lengths of spacing between each point.&lt;br /&gt;
&lt;br /&gt;
Following the same logic, a face-centred cubic lattice (with 4 lattice points per unit cell) with a density of 1.2 would have a spacing of &amp;lt;math&amp;gt;0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\sqrt[3]{4.8^{-1}}=0.5928)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, the simple cubic lattice with a density of 0.8 would create 1,000 atoms in the given constraints of the box:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;region box block 0 10 0 10 0 10&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and a face centred cubic lattice with a density of 1.2 would create 4,000 atoms in the same box.&lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of the Atoms ===&lt;br /&gt;
In the input script, there are the following lines describing the properties of the atoms:&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;
In the first line, we are setting the mass of type 1 atoms (which includes all of the atoms in our simulation box, as we have created only one type of atoms) as &amp;lt;math&amp;gt;1.0&amp;lt;/math&amp;gt;, in reduced units. The second line defines the interaction between the atoms as a Lenard-Jones interaction, with a cutoff distance of &amp;lt;math&amp;gt;3.0 \text{ units.}&amp;lt;/math&amp;gt; Finally, the last line defines the coefficient in the Lenard-Jones interaction; the asterisk tells LAMMPS that the coefficients apply to all atoms in our system; the first coefficient is &amp;lt;math&amp;gt;\epsilon=1.0&amp;lt;/math&amp;gt; and the second coefficient is &amp;lt;math&amp;gt;\sigma=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After setting the properties of the atoms, we also defined the initial positions and the initial velocities for the atoms in the input script. Since we have both the &amp;lt;math&amp;gt;\mathbf{x}_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, we can use the Velocity-Verlet integration algorithm that employs the half-step method.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
In the following lines from the input script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we created and reset a variable called timestep to equal 0.001, then used that value to calculate how many runs (${n_steps}) to carry out. This is more beneficial than simply setting&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;
as it allows us to only change the value of the timestep variable to alter the number of runs, rather than having to calculate ${n_steps} ourselves every time we change the timestep, especially in cases such as this computational experiment where the timestep was changed multiple times.&lt;br /&gt;
&lt;br /&gt;
=== Checking Equilibration ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--TotalE at 0.0075 - SHL.png--&amp;gt;&lt;br /&gt;
[[File:TotalE at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Temp at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Press at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
The following set of graphs show the total energy of the system against time at varying timestep values.&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:TotalE at 0.001 - SHL.png|Total Energy at timestep = 0.001&lt;br /&gt;
Image:TotalE at 0.0025 - SHL.png|Total Energy at timestep = 0.0025&lt;br /&gt;
Image:TotalE at 0.0075 - SHL.png|Total Energy at timestep = 0.0075&lt;br /&gt;
Image:TotalE at 0.01 - SHL.png|Total Energy at timestep = 0.01&lt;br /&gt;
Image:TotalE at 0.015 - SHL.png|Total Energy at timestep = 0.015&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can be seen from the graphs that for timestep = 0.001, 0.0025 and 0.0075, the energy reaches a stable equilibrium but for timestep = 0.01 and timestep = 0.015, the energy slowly decreases and rapidly increases, respectively, indicating that the results of the simulation are not very accurate for these values of timestep.&lt;br /&gt;
&lt;br /&gt;
Therefore, timestep = 0.0075 would be the ideal value as it provides the highest accuracy, while running the simulation for a suitably long time.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions (NpT) ==&lt;br /&gt;
&lt;br /&gt;
=== Temperature and Pressure Control ===&lt;br /&gt;
&lt;br /&gt;
Pressures chosen: 2.61, 2.63&lt;br /&gt;
&lt;br /&gt;
Temperatures chosen: 1.5, 1.6, 1.7, 1.8, 1.9&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 was chosen to provide the highest accuracy possible, without shortening the simulation time too much.&lt;br /&gt;
&lt;br /&gt;
In our simulation, the temperature was controlled by solving the two following equations for the instantaneous temperature &amp;lt;math&amp;gt;T,&amp;lt;/math&amp;gt; which fluctuates.&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 \qquad\qquad\qquad(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order for &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; to reach our target temperature &amp;lt;math&amp;gt;\mathfrak{T},&amp;lt;/math&amp;gt; we introduce a constant &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; to control the velocity such that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}\qquad\qquad(2)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can solve eq. &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt; to solve for &amp;lt;math&amp;gt;\gamma.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\sum_i m_i v_i^2 = 3N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substituting &amp;lt;math&amp;gt;\sum_i m_i v_i^2&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 3 N k_b T = 3N k_b \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\epsilon}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Examining the Input Script (Come back)===&lt;br /&gt;
&lt;br /&gt;
To calculate the average values for our simulation, we set certain parameters for LAMMPS in the script.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time Nevery Nrepeat Nfreq&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Final averages are generated on timesteps that are multiples of Nevery, for Nrepeat number of times until it reaches a total number of Nfreq timesteps.&lt;br /&gt;
&lt;br /&gt;
In our script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The results are sampled at every 100 timesteps for 1000 times (100, 200, 300, etc. until 100,000).&lt;br /&gt;
&lt;br /&gt;
=== Results of NpT Simulation ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacity ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--To calculate the heat capacity of our simulated liquid, we investigated how much the energy of our system fluctuates with respect to temperature, according to the equation &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variance in energy can be derived from statistical thermodynamics: &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:HeatCap vs Density.png|thumb|800px|Graph of &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; against Temperature|none]]&lt;br /&gt;
&lt;br /&gt;
From thermodynamics:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;dU = TdS - PdV&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = T\frac{\partial S}{\partial T}-P\frac{\partial V}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and since &amp;lt;math&amp;gt;\frac{\partial S}{\partial T}\geq 0,&amp;lt;/math&amp;gt; heat capacity should increase with increasing temperature.&lt;br /&gt;
&lt;br /&gt;
The fact that &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; decreases with increasing temperature &#039;&#039;&#039;------------&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
[[File:RDF SHL.png|thumb|700px]]&lt;br /&gt;
&lt;br /&gt;
It can be noticed that the three phases have clearly different Radial Distribution Functions (RDF) from each other and this can be attributed to the varying degrees of order each of the phases have: the atoms in the gas phase are completely free to move around, while atoms in the liquid phase have less freedom and in the solid phase, the atoms are set in a lattice, with only vibrational motion and no (or negligible) translational motion.&lt;br /&gt;
&lt;br /&gt;
In order to explain the graph, let us consider the RDF to be displaying the &amp;quot;effective density&amp;quot; of atoms in an area of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; at a distance &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; from a certain reference atom.&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf schematic.jpg|thumb|200px|Schematic of RDF|left]]&lt;br /&gt;
&lt;br /&gt;
There are three main parts to the RDF graphs: the region near the origin where the &amp;lt;math&amp;gt;\mathrm{RDF} = 0&amp;lt;/math&amp;gt;, the region after where there are big peaks and troughs, and the final region where the graphs have mostly reached equilibrium.&lt;br /&gt;
&lt;br /&gt;
First of all, the region near the origin is 0 for all three phases as that is still within the volume of the reference atom, and hence there are no other atoms in that radius.&lt;br /&gt;
&lt;br /&gt;
The peaks in the second region indicate that there is a higher &amp;quot;effective density&amp;quot; of atoms. The explanation for this is different for the lattice structure (solid) and the fluids (liquid and gas).&lt;br /&gt;
&lt;br /&gt;
For the liquid and gas phase, the peaks are due to the attractive force caused by the Lennard-Jones potential. We have calculated above [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:SUNG95#Lennard-Jones_Potential (1.2 LJ Potential)] that &amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}.&amp;lt;/math&amp;gt; Setting &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt; (as we have in our input file), we get &amp;lt;math&amp;gt;r_{eq} = 1.122&amp;lt;/math&amp;gt;, which is very close to where the largest peaks are for the two fluid phases.&lt;br /&gt;
&lt;br /&gt;
Then for the solid, where all the atoms are in a lattice structure, the effects due to the Lennard-Jones interaction becomes neglibigle. Instead, there will be certain values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where the effective density is higher than the overall density of the sample (the peaks), and some values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where it is lower than the density of the sample (the troughs). This is arisen from the fact that as the value of in a similar fashion to the schematic on the left.&lt;br /&gt;
&lt;br /&gt;
As the value of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the total volume covered by &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; also increases. But since all the atoms are set in place by the lattice, the number of atoms that &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; encompasses stays relatively constant. As a result, the peaks and the troughs tend 1 with increasing &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the case of the gas phase, the atoms are completely free to move around and the RDF graph can be entirely attributed to the effects of the L-J interaction. This justifies the lack of troughs for this phase. Furthermore, as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the attractive part of the L-J interaction &amp;lt;math&amp;gt;\frac{1}{r^6}&amp;lt;/math&amp;gt; gets exponentially smaller and quickly becomes negligible - RDF reaches equilibrium.&lt;br /&gt;
&lt;br /&gt;
Finally, the liquid phase can be considered to act as a mix between the solid phase and the gas phase: the L-J interactions are significant enough to reach equilibrium at a rate similar to the gas phase, but there exists an ordering of the atoms such that there are values of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; where the effective density is lower than the overall density.&lt;br /&gt;
&lt;br /&gt;
From the RDF of the solid phase, each of the peaks point to a certain lattice point. Simple geometrical calculations can be done to indicate that the first peak, which is the lattice point (1) closest to the reference atom (O), is at a separation of &amp;lt;math&amp;gt;\mathrm{r}=1.056.&amp;lt;/math&amp;gt; Second closest point (2) is at a distance of &amp;lt;math&amp;gt;\mathrm{r}=1.4938&amp;lt;/math&amp;gt; and the third (3) at &amp;lt;math&amp;gt;\mathrm{r}=1.8295.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:FCC-SHL.png|thumb|Face-centered cubic lattice|none]]&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
=== Mean Squared Displacement ===&lt;br /&gt;
&lt;br /&gt;
=== Velocity Autocorrelation Function ===&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560486</id>
		<title>Rep:Mod:SUNG95</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560486"/>
		<updated>2016-10-21T03:57:09Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: /* Reduced Units */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Theory ==&lt;br /&gt;
=== The Velocity-Verlet Algorithm ===&lt;br /&gt;
[[File:Verlet-Velocity.png|thumb|700px|x(t) derived from the velocity-Verlet algorithm compared with the position of the classical harmonic oscillator.|left]]&lt;br /&gt;
[[File:Verlet-Energy.png|thumb|700px|Total energy of the system with respect to time|right]]&lt;br /&gt;
[[File:Verlet-Error.png|thumb|700px|The error derived by comparing the solution of the velocity-Verlet algorithm with the position of the classical harmonic oscillator|none]]&lt;br /&gt;
&lt;br /&gt;
The three graphs above display the position of an atom, the total energy of the system and the error between the two methods of calculating the atom position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Error wrt Time.png|thumb|600px|Maximum Error against Time|none]]&lt;br /&gt;
&lt;br /&gt;
From this graph of Maximum error vs Time, we can see that error increases with time at a stable linear rate.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Running the same calculations with varying timesteps show the importance of choosing the right value of the timestep:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Energy at t=0.05.png|Energy at timestep=0.05&lt;br /&gt;
Image:Energy at t=0.5.png|Energy at timestep=0.5&lt;br /&gt;
Image:Error at t=0.5.png|Error at timestep=0.5&lt;br /&gt;
Image:Error at t=0.05.png|Error at timestep=0.05&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examining the four additional graphs above, we can notice that a shorter timestep is able to provide a smaller value of error and that the energy fluctuates less than a bigger value of timestep. However, a shorter timestep results in a shorter simulation type, which can result in a less realistic simulation. It is therefore important to find the right balance between the two.&lt;br /&gt;
&lt;br /&gt;
Through trial and error, it has been found that timestep = 0.2850 or lower results in an energy fluctuation that is smaller than 1% over the course of the simulation. A small fluctuation in energy indicates higher resemblance to reality as technically the total energy should not fluctuate at all due to the Law of Conservation of Energy.&lt;br /&gt;
&lt;br /&gt;
=== Lennard-Jones Potential ===&lt;br /&gt;
The equation to calculate the Lennard-Jones potential is as follows:&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;
By equating this to 0, we find that the &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the separation at which the potential is 0, is &amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We can then find the force at this separation by differentiating the Lennard-Jones potential with respect to r, and substituting in &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}=\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24 \frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation (&amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;) is the separation of the particles at equilibrium, and represents the separation at which the potential energy is at a minimum. It can thus be found by setting &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}&amp;lt;/math&amp;gt;, (or &amp;lt;math&amp;gt;\mathbf{F}&amp;lt;/math&amp;gt;) to 0.&lt;br /&gt;
&lt;br /&gt;
Hence,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right) 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; gives us the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To put this equation into perspective, let us calculate the L-J potential for some realistic cutoff values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int 4\epsilon \left(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=4 \epsilon \left(\frac{\sigma^{12}}{11r^{11}}-\frac{\sigma^6}{5r^5}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\lim_{r\rightarrow \infty} 4 \left(\frac{1^{12}}{11r^{11}}-\frac{1^6}{5r^5}\right) - 4\left(\frac{1^{12}}{11\times 2^{11}}+\frac{1^6}{5\times 2^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=0-0.024822\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following the same calculations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0081767\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0032901\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
It is very difficult to simulate realistic volumes of liquid and in the scope of this experiment, we have simulated liquids with N (number of atoms) between 1,000 and 10,000. To demonstrate why simulating realistic volumes of liquid is difficult, let us first calculate the number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--TASK: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.--&amp;gt;&lt;br /&gt;
(Assuming: Standard conditions; Density of water = 1.00 g/ml)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.00 \mathrm{ml} = 1.00 \mathrm{g}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;18.02 \mathrm{g/mol} = 0.0555 \text{ mols of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.0555 \times 6.022 \times 10^{23} = 3.34 \times 10^{22} \text{ molecules of water.}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the other hand, 10,000 water molecules is only &amp;lt;math&amp;gt;2.99 \times 10^{-19} \text{ ml of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
10000 water molecules == 1.661 x 10^-20 mols of water. (Conversion using Avogadro Constant)&lt;br /&gt;
1.661 x 10^-20 x 18.02 = 2.99 x 10^-19 g&lt;br /&gt;
approx. 2.99 x 10^-19 ml of water.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus, in order to be able to complete the simulation in a practical amount of time, we place our atoms in a box that is repeated in all directions, similar to how unit cells repeat themselves in a lattice. When an atom crosses the boundary of the box, its replica enters the same box from the other side, thus keeping the total number of atoms in the box constant.&lt;br /&gt;
&lt;br /&gt;
For example, if an atom at position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a cubic box ranging from &amp;lt;math&amp;gt;(0, 0, 0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;, its final position would be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;, if the periodic boundary conditions have been applied.&lt;br /&gt;
&amp;lt;!--We can safely avoid the issue we might encounter arising from the infinite number of particles by setting a cutoff limit ---- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units ===&lt;br /&gt;
The LAMMPS calculations run in this experiment are all done in reduced units&lt;br /&gt;
&lt;br /&gt;
For example, the Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34 \mathrm{nm}&amp;lt;/math&amp;gt;; &amp;lt;math&amp;gt;\epsilon/k_B=120K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If we set the cutoff to be &amp;lt;math&amp;gt;r*=3.2,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=3.2\times0.34=1.088\mathrm{nm}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Well depth: &amp;lt;math&amp;gt;\epsilon=120K\times k_B \times 6.02 \times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon=0.998 \mathrm{kJ/mol}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and reduced temperature &amp;lt;math&amp;gt;T*=1.5&amp;lt;/math&amp;gt; would be &amp;lt;math&amp;gt;T=1.5 \times 120=180\mathrm{K}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
=== Creating Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;TASK: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?--&amp;gt;&lt;br /&gt;
For a simple cubic lattice, there is one lattice point per unit cell. Hence, if the number density is 0.8,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8 \text{ points/volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sqrt[3]{0.8}=0.9283\text{ points/length}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.9283^{-1}=1.0772 \text{ length/point}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is thus 1.0772 unit lengths of spacing between each point.&lt;br /&gt;
&lt;br /&gt;
Following the same logic, a face-centred cubic lattice (with 4 lattice points per unit cell) with a density of 1.2 would have a spacing of &amp;lt;math&amp;gt;0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\sqrt[3]{4.8^{-1}}=0.5928)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, the simple cubic lattice with a density of 0.8 would create 1,000 atoms in the given constraints of the box:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;region box block 0 10 0 10 0 10&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and a face centred cubic lattice with a density of 1.2 would create 4,000 atoms in the same box.&lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of the Atoms ===&lt;br /&gt;
In the input script, there are the following lines describing the properties of the atoms:&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;
In the first line, we are setting the mass of type 1 atoms (which includes all of the atoms in our simulation box, as we have created only one type of atoms) as &amp;lt;math&amp;gt;1.0&amp;lt;/math&amp;gt;, in reduced units. The second line defines the interaction between the atoms as a Lenard-Jones interaction, with a cutoff distance of &amp;lt;math&amp;gt;3.0 \text{ units.}&amp;lt;/math&amp;gt; Finally, the last line defines the coefficient in the Lenard-Jones interaction; the asterisk tells LAMMPS that the coefficients apply to all atoms in our system; the first coefficient is &amp;lt;math&amp;gt;\epsilon=1.0&amp;lt;/math&amp;gt; and the second coefficient is &amp;lt;math&amp;gt;\sigma=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After setting the properties of the atoms, we also defined the initial positions and the initial velocities for the atoms in the input script. Since we have both the &amp;lt;math&amp;gt;\mathbf{x}_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, we can use the Velocity-Verlet integration algorithm that employs the half-step method.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
In the following lines from the input script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we created and reset a variable called timestep to equal 0.001, then used that value to calculate how many runs (${n_steps}) to carry out. This is more beneficial than simply setting&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;
as it allows us to only change the value of the timestep variable to alter the number of runs, rather than having to calculate ${n_steps} ourselves every time we change the timestep, especially in cases such as this computational experiment where the timestep was changed multiple times.&lt;br /&gt;
&lt;br /&gt;
=== Checking Equilibration ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--TotalE at 0.0075 - SHL.png--&amp;gt;&lt;br /&gt;
[[File:TotalE at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Temp at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Press at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
The following set of graphs show the total energy of the system against time at varying timestep values.&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:TotalE at 0.001 - SHL.png|Total Energy at timestep = 0.001&lt;br /&gt;
Image:TotalE at 0.0025 - SHL.png|Total Energy at timestep = 0.0025&lt;br /&gt;
Image:TotalE at 0.0075 - SHL.png|Total Energy at timestep = 0.0075&lt;br /&gt;
Image:TotalE at 0.01 - SHL.png|Total Energy at timestep = 0.01&lt;br /&gt;
Image:TotalE at 0.015 - SHL.png|Total Energy at timestep = 0.015&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can be seen from the graphs that for timestep = 0.001, 0.0025 and 0.0075, the energy reaches a stable equilibrium but for timestep = 0.01 and timestep = 0.015, the energy slowly decreases and rapidly increases, respectively, indicating that the results of the simulation are not very accurate for these values of timestep.&lt;br /&gt;
&lt;br /&gt;
Therefore, timestep = 0.0075 would be the ideal value as it provides the highest accuracy, while running the simulation for a suitably long time.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions (NpT) ==&lt;br /&gt;
&lt;br /&gt;
=== Temperature and Pressure Control ===&lt;br /&gt;
&lt;br /&gt;
Pressures chosen: 2.61, 2.63&lt;br /&gt;
&lt;br /&gt;
Temperatures chosen: 1.5, 1.6, 1.7, 1.8, 1.9&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 was chosen to provide the highest accuracy possible, without shortening the simulation time too much.&lt;br /&gt;
&lt;br /&gt;
In our simulation, the temperature was controlled by solving the two following equations for the instantaneous temperature &amp;lt;math&amp;gt;T,&amp;lt;/math&amp;gt; which fluctuates.&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 \qquad\qquad\qquad(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order for &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; to reach our target temperature &amp;lt;math&amp;gt;\mathfrak{T},&amp;lt;/math&amp;gt; we introduce a constant &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; to control the velocity such that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}\qquad\qquad(2)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can solve eq. &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt; to solve for &amp;lt;math&amp;gt;\gamma.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\sum_i m_i v_i^2 = 3N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substituting &amp;lt;math&amp;gt;\sum_i m_i v_i^2&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 3 N k_b T = 3N k_b \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\epsilon}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Examining the Input Script (Come back)===&lt;br /&gt;
&lt;br /&gt;
To calculate the average values for our simulation, we set certain parameters for LAMMPS in the script.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time Nevery Nrepeat Nfreq&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Final averages are generated on timesteps that are multiples of Nevery, for Nrepeat number of times until it reaches a total number of Nfreq timesteps.&lt;br /&gt;
&lt;br /&gt;
In our script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The results are sampled at every 100 timesteps for 1000 times (100, 200, 300, etc. until 100,000).&lt;br /&gt;
&lt;br /&gt;
=== Results of NpT Simulation ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacity ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--To calculate the heat capacity of our simulated liquid, we investigated how much the energy of our system fluctuates with respect to temperature, according to the equation &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variance in energy can be derived from statistical thermodynamics: &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:HeatCap vs Density.png|thumb|800px|Graph of &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; against Temperature|none]]&lt;br /&gt;
&lt;br /&gt;
From thermodynamics:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;dU = TdS - PdV&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = T\frac{\partial S}{\partial T}-P\frac{\partial V}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and since &amp;lt;math&amp;gt;\frac{\partial S}{\partial T}\geq 0,&amp;lt;/math&amp;gt; heat capacity should increase with increasing temperature.&lt;br /&gt;
&lt;br /&gt;
The fact that &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; decreases with increasing temperature &#039;&#039;&#039;------------&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
[[File:RDF SHL.png|thumb|700px]]&lt;br /&gt;
&lt;br /&gt;
It can be noticed that the three phases have clearly different Radial Distribution Functions (RDF) from each other and this can be attributed to the varying degrees of order each of the phases have: the atoms in the gas phase are completely free to move around, while atoms in the liquid phase have less freedom and in the solid phase, the atoms are set in a lattice, with only vibrational motion and no (or negligible) translational motion.&lt;br /&gt;
&lt;br /&gt;
In order to explain the graph, let us consider the RDF to be displaying the &amp;quot;effective density&amp;quot; of atoms in an area of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; at a distance &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; from a certain reference atom.&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf schematic.jpg|thumb|200px|Schematic of RDF|left]]&lt;br /&gt;
&lt;br /&gt;
There are three main parts to the RDF graphs: the region near the origin where the &amp;lt;math&amp;gt;\mathrm{RDF} = 0&amp;lt;/math&amp;gt;, the region after where there are big peaks and troughs, and the final region where the graphs have mostly reached equilibrium.&lt;br /&gt;
&lt;br /&gt;
First of all, the region near the origin is 0 for all three phases as that is still within the volume of the reference atom, and hence there are no other atoms in that radius.&lt;br /&gt;
&lt;br /&gt;
The peaks in the second region indicate that there is a higher &amp;quot;effective density&amp;quot; of atoms. The explanation for this is different for the lattice structure (solid) and the fluids (liquid and gas).&lt;br /&gt;
&lt;br /&gt;
For the liquid and gas phase, the peaks are due to the attractive force caused by the Lennard-Jones potential. We have calculated above [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:SUNG95#Lennard-Jones_Potential (1.2 LJ Potential)] that &amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}.&amp;lt;/math&amp;gt; Setting &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt; (as we have in our input file), we get &amp;lt;math&amp;gt;r_{eq} = 1.122&amp;lt;/math&amp;gt;, which is very close to where the largest peaks are for the two fluid phases.&lt;br /&gt;
&lt;br /&gt;
Then for the solid, where all the atoms are in a lattice structure, the effects due to the Lennard-Jones interaction becomes neglibigle. Instead, there will be certain values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where the effective density is higher than the overall density of the sample (the peaks), and some values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where it is lower than the density of the sample (the troughs). This is arisen from the fact that as the value of in a similar fashion to the schematic on the left.&lt;br /&gt;
&lt;br /&gt;
As the value of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the total volume covered by &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; also increases. But since all the atoms are set in place by the lattice, the number of atoms that &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; encompasses stays relatively constant. As a result, the peaks and the troughs tend 1 with increasing &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the case of the gas phase, the atoms are completely free to move around and the RDF graph can be entirely attributed to the effects of the L-J interaction. This justifies the lack of troughs for this phase. Furthermore, as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the attractive part of the L-J interaction &amp;lt;math&amp;gt;\frac{1}{r^6}&amp;lt;/math&amp;gt; gets exponentially smaller and quickly becomes negligible - RDF reaches equilibrium.&lt;br /&gt;
&lt;br /&gt;
Finally, the liquid phase can be considered to act as a mix between the solid phase and the gas phase: the L-J interactions are significant enough to reach equilibrium at a rate similar to the gas phase, but there exists an ordering of the atoms such that there are values of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; where the effective density is lower than the overall density.&lt;br /&gt;
&lt;br /&gt;
From the RDF of the solid phase, each of the peaks point to a certain lattice point. Simple geometrical calculations can be done to indicate that the first peak, which is the lattice point (1) closest to the reference atom (O), is at a separation of &amp;lt;math&amp;gt;\mathrm{r}=1.056.&amp;lt;/math&amp;gt; Second closest point (2) is at a distance of &amp;lt;math&amp;gt;\mathrm{r}=1.4938&amp;lt;/math&amp;gt; and the third (3) at &amp;lt;math&amp;gt;\mathrm{r}=1.8295.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:FCC-SHL.png|thumb|Face-centered cubic lattice|none]]&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
=== Mean Squared Displacement ===&lt;br /&gt;
&lt;br /&gt;
=== Velocity Autocorrelation Function ===&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560485</id>
		<title>Rep:Mod:SUNG95</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560485"/>
		<updated>2016-10-21T03:40:09Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: /* Come back to this */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Theory ==&lt;br /&gt;
=== The Velocity-Verlet Algorithm ===&lt;br /&gt;
[[File:Verlet-Velocity.png|thumb|700px|x(t) derived from the velocity-Verlet algorithm compared with the position of the classical harmonic oscillator.|left]]&lt;br /&gt;
[[File:Verlet-Energy.png|thumb|700px|Total energy of the system with respect to time|right]]&lt;br /&gt;
[[File:Verlet-Error.png|thumb|700px|The error derived by comparing the solution of the velocity-Verlet algorithm with the position of the classical harmonic oscillator|none]]&lt;br /&gt;
&lt;br /&gt;
The three graphs above display the position of an atom, the total energy of the system and the error between the two methods of calculating the atom position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Error wrt Time.png|thumb|600px|Maximum Error against Time|none]]&lt;br /&gt;
&lt;br /&gt;
From this graph of Maximum error vs Time, we can see that error increases with time at a stable linear rate.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Running the same calculations with varying timesteps show the importance of choosing the right value of the timestep:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Energy at t=0.05.png|Energy at timestep=0.05&lt;br /&gt;
Image:Energy at t=0.5.png|Energy at timestep=0.5&lt;br /&gt;
Image:Error at t=0.5.png|Error at timestep=0.5&lt;br /&gt;
Image:Error at t=0.05.png|Error at timestep=0.05&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examining the four additional graphs above, we can notice that a shorter timestep is able to provide a smaller value of error and that the energy fluctuates less than a bigger value of timestep. However, a shorter timestep results in a shorter simulation type, which can result in a less realistic simulation. It is therefore important to find the right balance between the two.&lt;br /&gt;
&lt;br /&gt;
Through trial and error, it has been found that timestep = 0.2850 or lower results in an energy fluctuation that is smaller than 1% over the course of the simulation. A small fluctuation in energy indicates higher resemblance to reality as technically the total energy should not fluctuate at all due to the Law of Conservation of Energy.&lt;br /&gt;
&lt;br /&gt;
=== Lennard-Jones Potential ===&lt;br /&gt;
The equation to calculate the Lennard-Jones potential is as follows:&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;
By equating this to 0, we find that the &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the separation at which the potential is 0, is &amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We can then find the force at this separation by differentiating the Lennard-Jones potential with respect to r, and substituting in &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}=\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24 \frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation (&amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;) is the separation of the particles at equilibrium, and represents the separation at which the potential energy is at a minimum. It can thus be found by setting &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}&amp;lt;/math&amp;gt;, (or &amp;lt;math&amp;gt;\mathbf{F}&amp;lt;/math&amp;gt;) to 0.&lt;br /&gt;
&lt;br /&gt;
Hence,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right) 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; gives us the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To put this equation into perspective, let us calculate the L-J potential for some realistic cutoff values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int 4\epsilon \left(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=4 \epsilon \left(\frac{\sigma^{12}}{11r^{11}}-\frac{\sigma^6}{5r^5}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\lim_{r\rightarrow \infty} 4 \left(\frac{1^{12}}{11r^{11}}-\frac{1^6}{5r^5}\right) - 4\left(\frac{1^{12}}{11\times 2^{11}}+\frac{1^6}{5\times 2^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=0-0.024822\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following the same calculations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0081767\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0032901\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
It is very difficult to simulate realistic volumes of liquid and in the scope of this experiment, we have simulated liquids with N (number of atoms) between 1,000 and 10,000. To demonstrate why simulating realistic volumes of liquid is difficult, let us first calculate the number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--TASK: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.--&amp;gt;&lt;br /&gt;
(Assuming: Standard conditions; Density of water = 1.00 g/ml)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.00 \mathrm{ml} = 1.00 \mathrm{g}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;18.02 \mathrm{g/mol} = 0.0555 \text{ mols of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.0555 \times 6.022 \times 10^{23} = 3.34 \times 10^{22} \text{ molecules of water.}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the other hand, 10,000 water molecules is only &amp;lt;math&amp;gt;2.99 \times 10^{-19} \text{ ml of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
10000 water molecules == 1.661 x 10^-20 mols of water. (Conversion using Avogadro Constant)&lt;br /&gt;
1.661 x 10^-20 x 18.02 = 2.99 x 10^-19 g&lt;br /&gt;
approx. 2.99 x 10^-19 ml of water.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus, in order to be able to complete the simulation in a practical amount of time, we place our atoms in a box that is repeated in all directions, similar to how unit cells repeat themselves in a lattice. When an atom crosses the boundary of the box, its replica enters the same box from the other side, thus keeping the total number of atoms in the box constant.&lt;br /&gt;
&lt;br /&gt;
For example, if an atom at position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a cubic box ranging from &amp;lt;math&amp;gt;(0, 0, 0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;, its final position would be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;, if the periodic boundary conditions have been applied.&lt;br /&gt;
&amp;lt;!--We can safely avoid the issue we might encounter arising from the infinite number of particles by setting a cutoff limit ---- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units ===&lt;br /&gt;
The LAMMPS calculations run in this experiment are all done in reduced units &#039;&#039;&#039;&#039;&#039;(because...)&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For example, the Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34 \mathrm{nm}&amp;lt;/math&amp;gt;; &amp;lt;math&amp;gt;\epsilon/k_B=120K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If we set the cutoff to be &amp;lt;math&amp;gt;r*=3.2,&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;r=3.2\times0.34=1.088\mathrm{nm}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Well depth &amp;lt;math&amp;gt;\epsilon=&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
and reduced temperature &amp;lt;math&amp;gt;T*=1.5&amp;lt;/math&amp;gt; would be &amp;lt;math&amp;gt;T=1.5 \times 120=180\mathrm{K}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
=== Creating Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;TASK: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?--&amp;gt;&lt;br /&gt;
For a simple cubic lattice, there is one lattice point per unit cell. Hence, if the number density is 0.8,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8 \text{ points/volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sqrt[3]{0.8}=0.9283\text{ points/length}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.9283^{-1}=1.0772 \text{ length/point}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is thus 1.0772 unit lengths of spacing between each point.&lt;br /&gt;
&lt;br /&gt;
Following the same logic, a face-centred cubic lattice (with 4 lattice points per unit cell) with a density of 1.2 would have a spacing of &amp;lt;math&amp;gt;0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\sqrt[3]{4.8^{-1}}=0.5928)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, the simple cubic lattice with a density of 0.8 would create 1,000 atoms in the given constraints of the box:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;region box block 0 10 0 10 0 10&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and a face centred cubic lattice with a density of 1.2 would create 4,000 atoms in the same box.&lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of the Atoms ===&lt;br /&gt;
In the input script, there are the following lines describing the properties of the atoms:&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;
In the first line, we are setting the mass of type 1 atoms (which includes all of the atoms in our simulation box, as we have created only one type of atoms) as &amp;lt;math&amp;gt;1.0&amp;lt;/math&amp;gt;, in reduced units. The second line defines the interaction between the atoms as a Lenard-Jones interaction, with a cutoff distance of &amp;lt;math&amp;gt;3.0 \text{ units.}&amp;lt;/math&amp;gt; Finally, the last line defines the coefficient in the Lenard-Jones interaction; the asterisk tells LAMMPS that the coefficients apply to all atoms in our system; the first coefficient is &amp;lt;math&amp;gt;\epsilon=1.0&amp;lt;/math&amp;gt; and the second coefficient is &amp;lt;math&amp;gt;\sigma=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After setting the properties of the atoms, we also defined the initial positions and the initial velocities for the atoms in the input script. Since we have both the &amp;lt;math&amp;gt;\mathbf{x}_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, we can use the Velocity-Verlet integration algorithm that employs the half-step method.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
In the following lines from the input script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we created and reset a variable called timestep to equal 0.001, then used that value to calculate how many runs (${n_steps}) to carry out. This is more beneficial than simply setting&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;
as it allows us to only change the value of the timestep variable to alter the number of runs, rather than having to calculate ${n_steps} ourselves every time we change the timestep, especially in cases such as this computational experiment where the timestep was changed multiple times.&lt;br /&gt;
&lt;br /&gt;
=== Checking Equilibration ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--TotalE at 0.0075 - SHL.png--&amp;gt;&lt;br /&gt;
[[File:TotalE at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Temp at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Press at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
The following set of graphs show the total energy of the system against time at varying timestep values.&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:TotalE at 0.001 - SHL.png|Total Energy at timestep = 0.001&lt;br /&gt;
Image:TotalE at 0.0025 - SHL.png|Total Energy at timestep = 0.0025&lt;br /&gt;
Image:TotalE at 0.0075 - SHL.png|Total Energy at timestep = 0.0075&lt;br /&gt;
Image:TotalE at 0.01 - SHL.png|Total Energy at timestep = 0.01&lt;br /&gt;
Image:TotalE at 0.015 - SHL.png|Total Energy at timestep = 0.015&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can be seen from the graphs that for timestep = 0.001, 0.0025 and 0.0075, the energy reaches a stable equilibrium but for timestep = 0.01 and timestep = 0.015, the energy slowly decreases and rapidly increases, respectively, indicating that the results of the simulation are not very accurate for these values of timestep.&lt;br /&gt;
&lt;br /&gt;
Therefore, timestep = 0.0075 would be the ideal value as it provides the highest accuracy, while running the simulation for a suitably long time.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions (NpT) ==&lt;br /&gt;
&lt;br /&gt;
=== Temperature and Pressure Control ===&lt;br /&gt;
&lt;br /&gt;
Pressures chosen: 2.61, 2.63&lt;br /&gt;
&lt;br /&gt;
Temperatures chosen: 1.5, 1.6, 1.7, 1.8, 1.9&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 was chosen to provide the highest accuracy possible, without shortening the simulation time too much.&lt;br /&gt;
&lt;br /&gt;
In our simulation, the temperature was controlled by solving the two following equations for the instantaneous temperature &amp;lt;math&amp;gt;T,&amp;lt;/math&amp;gt; which fluctuates.&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 \qquad\qquad\qquad(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order for &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; to reach our target temperature &amp;lt;math&amp;gt;\mathfrak{T},&amp;lt;/math&amp;gt; we introduce a constant &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; to control the velocity such that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}\qquad\qquad(2)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can solve eq. &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt; to solve for &amp;lt;math&amp;gt;\gamma.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\sum_i m_i v_i^2 = 3N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substituting &amp;lt;math&amp;gt;\sum_i m_i v_i^2&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 3 N k_b T = 3N k_b \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\epsilon}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Examining the Input Script (Come back)===&lt;br /&gt;
&lt;br /&gt;
To calculate the average values for our simulation, we set certain parameters for LAMMPS in the script.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time Nevery Nrepeat Nfreq&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Final averages are generated on timesteps that are multiples of Nevery, for Nrepeat number of times until it reaches a total number of Nfreq timesteps.&lt;br /&gt;
&lt;br /&gt;
In our script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The results are sampled at every 100 timesteps for 1000 times (100, 200, 300, etc. until 100,000).&lt;br /&gt;
&lt;br /&gt;
=== Results of NpT Simulation ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacity ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--To calculate the heat capacity of our simulated liquid, we investigated how much the energy of our system fluctuates with respect to temperature, according to the equation &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variance in energy can be derived from statistical thermodynamics: &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:HeatCap vs Density.png|thumb|800px|Graph of &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; against Temperature|none]]&lt;br /&gt;
&lt;br /&gt;
From thermodynamics:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;dU = TdS - PdV&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = T\frac{\partial S}{\partial T}-P\frac{\partial V}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and since &amp;lt;math&amp;gt;\frac{\partial S}{\partial T}\geq 0,&amp;lt;/math&amp;gt; heat capacity should increase with increasing temperature.&lt;br /&gt;
&lt;br /&gt;
The fact that &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; decreases with increasing temperature &#039;&#039;&#039;------------&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
[[File:RDF SHL.png|thumb|700px]]&lt;br /&gt;
&lt;br /&gt;
It can be noticed that the three phases have clearly different Radial Distribution Functions (RDF) from each other and this can be attributed to the varying degrees of order each of the phases have: the atoms in the gas phase are completely free to move around, while atoms in the liquid phase have less freedom and in the solid phase, the atoms are set in a lattice, with only vibrational motion and no (or negligible) translational motion.&lt;br /&gt;
&lt;br /&gt;
In order to explain the graph, let us consider the RDF to be displaying the &amp;quot;effective density&amp;quot; of atoms in an area of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; at a distance &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; from a certain reference atom.&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf schematic.jpg|thumb|200px|Schematic of RDF|left]]&lt;br /&gt;
&lt;br /&gt;
There are three main parts to the RDF graphs: the region near the origin where the &amp;lt;math&amp;gt;\mathrm{RDF} = 0&amp;lt;/math&amp;gt;, the region after where there are big peaks and troughs, and the final region where the graphs have mostly reached equilibrium.&lt;br /&gt;
&lt;br /&gt;
First of all, the region near the origin is 0 for all three phases as that is still within the volume of the reference atom, and hence there are no other atoms in that radius.&lt;br /&gt;
&lt;br /&gt;
The peaks in the second region indicate that there is a higher &amp;quot;effective density&amp;quot; of atoms. The explanation for this is different for the lattice structure (solid) and the fluids (liquid and gas).&lt;br /&gt;
&lt;br /&gt;
For the liquid and gas phase, the peaks are due to the attractive force caused by the Lennard-Jones potential. We have calculated above [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:SUNG95#Lennard-Jones_Potential (1.2 LJ Potential)] that &amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}.&amp;lt;/math&amp;gt; Setting &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt; (as we have in our input file), we get &amp;lt;math&amp;gt;r_{eq} = 1.122&amp;lt;/math&amp;gt;, which is very close to where the largest peaks are for the two fluid phases.&lt;br /&gt;
&lt;br /&gt;
Then for the solid, where all the atoms are in a lattice structure, the effects due to the Lennard-Jones interaction becomes neglibigle. Instead, there will be certain values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where the effective density is higher than the overall density of the sample (the peaks), and some values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where it is lower than the density of the sample (the troughs). This is arisen from the fact that as the value of in a similar fashion to the schematic on the left.&lt;br /&gt;
&lt;br /&gt;
As the value of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the total volume covered by &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; also increases. But since all the atoms are set in place by the lattice, the number of atoms that &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; encompasses stays relatively constant. As a result, the peaks and the troughs tend 1 with increasing &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the case of the gas phase, the atoms are completely free to move around and the RDF graph can be entirely attributed to the effects of the L-J interaction. This justifies the lack of troughs for this phase. Furthermore, as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the attractive part of the L-J interaction &amp;lt;math&amp;gt;\frac{1}{r^6}&amp;lt;/math&amp;gt; gets exponentially smaller and quickly becomes negligible - RDF reaches equilibrium.&lt;br /&gt;
&lt;br /&gt;
Finally, the liquid phase can be considered to act as a mix between the solid phase and the gas phase: the L-J interactions are significant enough to reach equilibrium at a rate similar to the gas phase, but there exists an ordering of the atoms such that there are values of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; where the effective density is lower than the overall density.&lt;br /&gt;
&lt;br /&gt;
From the RDF of the solid phase, each of the peaks point to a certain lattice point. Simple geometrical calculations can be done to indicate that the first peak, which is the lattice point (1) closest to the reference atom (O), is at a separation of &amp;lt;math&amp;gt;\mathrm{r}=1.056.&amp;lt;/math&amp;gt; Second closest point (2) is at a distance of &amp;lt;math&amp;gt;\mathrm{r}=1.4938&amp;lt;/math&amp;gt; and the third (3) at &amp;lt;math&amp;gt;\mathrm{r}=1.8295.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:FCC-SHL.png|thumb|Face-centered cubic lattice|none]]&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
=== Mean Squared Displacement ===&lt;br /&gt;
&lt;br /&gt;
=== Velocity Autocorrelation Function ===&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560484</id>
		<title>Rep:Mod:SUNG95</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560484"/>
		<updated>2016-10-21T03:39:32Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: /* Lennard-Jones Potential */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Theory ==&lt;br /&gt;
=== The Velocity-Verlet Algorithm ===&lt;br /&gt;
[[File:Verlet-Velocity.png|thumb|700px|x(t) derived from the velocity-Verlet algorithm compared with the position of the classical harmonic oscillator.|left]]&lt;br /&gt;
[[File:Verlet-Energy.png|thumb|700px|Total energy of the system with respect to time|right]]&lt;br /&gt;
[[File:Verlet-Error.png|thumb|700px|The error derived by comparing the solution of the velocity-Verlet algorithm with the position of the classical harmonic oscillator|none]]&lt;br /&gt;
&lt;br /&gt;
The three graphs above display the position of an atom, the total energy of the system and the error between the two methods of calculating the atom position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Error wrt Time.png|thumb|600px|Maximum Error against Time|none]]&lt;br /&gt;
&lt;br /&gt;
From this graph of Maximum error vs Time, we can see that error increases with time at a stable linear rate.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Running the same calculations with varying timesteps show the importance of choosing the right value of the timestep:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Energy at t=0.05.png|Energy at timestep=0.05&lt;br /&gt;
Image:Energy at t=0.5.png|Energy at timestep=0.5&lt;br /&gt;
Image:Error at t=0.5.png|Error at timestep=0.5&lt;br /&gt;
Image:Error at t=0.05.png|Error at timestep=0.05&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examining the four additional graphs above, we can notice that a shorter timestep is able to provide a smaller value of error and that the energy fluctuates less than a bigger value of timestep. However, a shorter timestep results in a shorter simulation type, which can result in a less realistic simulation. It is therefore important to find the right balance between the two.&lt;br /&gt;
&lt;br /&gt;
Through trial and error, it has been found that timestep = 0.2850 or lower results in an energy fluctuation that is smaller than 1% over the course of the simulation. A small fluctuation in energy indicates higher resemblance to reality as technically the total energy should not fluctuate at all due to the Law of Conservation of Energy.&lt;br /&gt;
&lt;br /&gt;
=== Lennard-Jones Potential ===&lt;br /&gt;
The equation to calculate the Lennard-Jones potential is as follows:&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;
By equating this to 0, we find that the &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the separation at which the potential is 0, is &amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We can then find the force at this separation by differentiating the Lennard-Jones potential with respect to r, and substituting in &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}=\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24 \frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation (&amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;) is the separation of the particles at equilibrium, and represents the separation at which the potential energy is at a minimum. It can thus be found by setting &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}&amp;lt;/math&amp;gt;, (or &amp;lt;math&amp;gt;\mathbf{F}&amp;lt;/math&amp;gt;) to 0.&lt;br /&gt;
&lt;br /&gt;
Hence,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right) 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; gives us the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To put this equation into perspective, let us calculate the L-J potential for some realistic cutoff values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int 4\epsilon \left(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=4 \epsilon \left(\frac{\sigma^{12}}{11r^{11}}-\frac{\sigma^6}{5r^5}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\lim_{r\rightarrow \infty} 4 \left(\frac{1^{12}}{11r^{11}}-\frac{1^6}{5r^5}\right) - 4\left(\frac{1^{12}}{11\times 2^{11}}+\frac{1^6}{5\times 2^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=0-0.024822\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following the same calculations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0081767\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0032901\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;&#039;&#039;Come back to this&#039;&#039;&#039;&#039;&#039;===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4\epsilon\sigma^{12}r^{-12} - 4\epsilon\sigma^{6}r^{-6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{d\phi}{dr}=-48\epsilon\sigma^{12}r^{-13}+24\epsilon\sigma^{6}r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
It is very difficult to simulate realistic volumes of liquid and in the scope of this experiment, we have simulated liquids with N (number of atoms) between 1,000 and 10,000. To demonstrate why simulating realistic volumes of liquid is difficult, let us first calculate the number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--TASK: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.--&amp;gt;&lt;br /&gt;
(Assuming: Standard conditions; Density of water = 1.00 g/ml)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.00 \mathrm{ml} = 1.00 \mathrm{g}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;18.02 \mathrm{g/mol} = 0.0555 \text{ mols of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.0555 \times 6.022 \times 10^{23} = 3.34 \times 10^{22} \text{ molecules of water.}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the other hand, 10,000 water molecules is only &amp;lt;math&amp;gt;2.99 \times 10^{-19} \text{ ml of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
10000 water molecules == 1.661 x 10^-20 mols of water. (Conversion using Avogadro Constant)&lt;br /&gt;
1.661 x 10^-20 x 18.02 = 2.99 x 10^-19 g&lt;br /&gt;
approx. 2.99 x 10^-19 ml of water.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus, in order to be able to complete the simulation in a practical amount of time, we place our atoms in a box that is repeated in all directions, similar to how unit cells repeat themselves in a lattice. When an atom crosses the boundary of the box, its replica enters the same box from the other side, thus keeping the total number of atoms in the box constant.&lt;br /&gt;
&lt;br /&gt;
For example, if an atom at position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a cubic box ranging from &amp;lt;math&amp;gt;(0, 0, 0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;, its final position would be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;, if the periodic boundary conditions have been applied.&lt;br /&gt;
&amp;lt;!--We can safely avoid the issue we might encounter arising from the infinite number of particles by setting a cutoff limit ---- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units ===&lt;br /&gt;
The LAMMPS calculations run in this experiment are all done in reduced units &#039;&#039;&#039;&#039;&#039;(because...)&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For example, the Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34 \mathrm{nm}&amp;lt;/math&amp;gt;; &amp;lt;math&amp;gt;\epsilon/k_B=120K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If we set the cutoff to be &amp;lt;math&amp;gt;r*=3.2,&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;r=3.2\times0.34=1.088\mathrm{nm}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Well depth &amp;lt;math&amp;gt;\epsilon=&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
and reduced temperature &amp;lt;math&amp;gt;T*=1.5&amp;lt;/math&amp;gt; would be &amp;lt;math&amp;gt;T=1.5 \times 120=180\mathrm{K}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
=== Creating Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;TASK: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?--&amp;gt;&lt;br /&gt;
For a simple cubic lattice, there is one lattice point per unit cell. Hence, if the number density is 0.8,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8 \text{ points/volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sqrt[3]{0.8}=0.9283\text{ points/length}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.9283^{-1}=1.0772 \text{ length/point}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is thus 1.0772 unit lengths of spacing between each point.&lt;br /&gt;
&lt;br /&gt;
Following the same logic, a face-centred cubic lattice (with 4 lattice points per unit cell) with a density of 1.2 would have a spacing of &amp;lt;math&amp;gt;0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\sqrt[3]{4.8^{-1}}=0.5928)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, the simple cubic lattice with a density of 0.8 would create 1,000 atoms in the given constraints of the box:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;region box block 0 10 0 10 0 10&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and a face centred cubic lattice with a density of 1.2 would create 4,000 atoms in the same box.&lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of the Atoms ===&lt;br /&gt;
In the input script, there are the following lines describing the properties of the atoms:&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;
In the first line, we are setting the mass of type 1 atoms (which includes all of the atoms in our simulation box, as we have created only one type of atoms) as &amp;lt;math&amp;gt;1.0&amp;lt;/math&amp;gt;, in reduced units. The second line defines the interaction between the atoms as a Lenard-Jones interaction, with a cutoff distance of &amp;lt;math&amp;gt;3.0 \text{ units.}&amp;lt;/math&amp;gt; Finally, the last line defines the coefficient in the Lenard-Jones interaction; the asterisk tells LAMMPS that the coefficients apply to all atoms in our system; the first coefficient is &amp;lt;math&amp;gt;\epsilon=1.0&amp;lt;/math&amp;gt; and the second coefficient is &amp;lt;math&amp;gt;\sigma=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After setting the properties of the atoms, we also defined the initial positions and the initial velocities for the atoms in the input script. Since we have both the &amp;lt;math&amp;gt;\mathbf{x}_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, we can use the Velocity-Verlet integration algorithm that employs the half-step method.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
In the following lines from the input script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we created and reset a variable called timestep to equal 0.001, then used that value to calculate how many runs (${n_steps}) to carry out. This is more beneficial than simply setting&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;
as it allows us to only change the value of the timestep variable to alter the number of runs, rather than having to calculate ${n_steps} ourselves every time we change the timestep, especially in cases such as this computational experiment where the timestep was changed multiple times.&lt;br /&gt;
&lt;br /&gt;
=== Checking Equilibration ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--TotalE at 0.0075 - SHL.png--&amp;gt;&lt;br /&gt;
[[File:TotalE at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Temp at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Press at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
The following set of graphs show the total energy of the system against time at varying timestep values.&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:TotalE at 0.001 - SHL.png|Total Energy at timestep = 0.001&lt;br /&gt;
Image:TotalE at 0.0025 - SHL.png|Total Energy at timestep = 0.0025&lt;br /&gt;
Image:TotalE at 0.0075 - SHL.png|Total Energy at timestep = 0.0075&lt;br /&gt;
Image:TotalE at 0.01 - SHL.png|Total Energy at timestep = 0.01&lt;br /&gt;
Image:TotalE at 0.015 - SHL.png|Total Energy at timestep = 0.015&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can be seen from the graphs that for timestep = 0.001, 0.0025 and 0.0075, the energy reaches a stable equilibrium but for timestep = 0.01 and timestep = 0.015, the energy slowly decreases and rapidly increases, respectively, indicating that the results of the simulation are not very accurate for these values of timestep.&lt;br /&gt;
&lt;br /&gt;
Therefore, timestep = 0.0075 would be the ideal value as it provides the highest accuracy, while running the simulation for a suitably long time.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions (NpT) ==&lt;br /&gt;
&lt;br /&gt;
=== Temperature and Pressure Control ===&lt;br /&gt;
&lt;br /&gt;
Pressures chosen: 2.61, 2.63&lt;br /&gt;
&lt;br /&gt;
Temperatures chosen: 1.5, 1.6, 1.7, 1.8, 1.9&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 was chosen to provide the highest accuracy possible, without shortening the simulation time too much.&lt;br /&gt;
&lt;br /&gt;
In our simulation, the temperature was controlled by solving the two following equations for the instantaneous temperature &amp;lt;math&amp;gt;T,&amp;lt;/math&amp;gt; which fluctuates.&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 \qquad\qquad\qquad(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order for &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; to reach our target temperature &amp;lt;math&amp;gt;\mathfrak{T},&amp;lt;/math&amp;gt; we introduce a constant &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; to control the velocity such that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}\qquad\qquad(2)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can solve eq. &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt; to solve for &amp;lt;math&amp;gt;\gamma.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\sum_i m_i v_i^2 = 3N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substituting &amp;lt;math&amp;gt;\sum_i m_i v_i^2&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 3 N k_b T = 3N k_b \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\epsilon}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Examining the Input Script (Come back)===&lt;br /&gt;
&lt;br /&gt;
To calculate the average values for our simulation, we set certain parameters for LAMMPS in the script.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time Nevery Nrepeat Nfreq&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Final averages are generated on timesteps that are multiples of Nevery, for Nrepeat number of times until it reaches a total number of Nfreq timesteps.&lt;br /&gt;
&lt;br /&gt;
In our script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The results are sampled at every 100 timesteps for 1000 times (100, 200, 300, etc. until 100,000).&lt;br /&gt;
&lt;br /&gt;
=== Results of NpT Simulation ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacity ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--To calculate the heat capacity of our simulated liquid, we investigated how much the energy of our system fluctuates with respect to temperature, according to the equation &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variance in energy can be derived from statistical thermodynamics: &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:HeatCap vs Density.png|thumb|800px|Graph of &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; against Temperature|none]]&lt;br /&gt;
&lt;br /&gt;
From thermodynamics:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;dU = TdS - PdV&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = T\frac{\partial S}{\partial T}-P\frac{\partial V}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and since &amp;lt;math&amp;gt;\frac{\partial S}{\partial T}\geq 0,&amp;lt;/math&amp;gt; heat capacity should increase with increasing temperature.&lt;br /&gt;
&lt;br /&gt;
The fact that &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; decreases with increasing temperature &#039;&#039;&#039;------------&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
[[File:RDF SHL.png|thumb|700px]]&lt;br /&gt;
&lt;br /&gt;
It can be noticed that the three phases have clearly different Radial Distribution Functions (RDF) from each other and this can be attributed to the varying degrees of order each of the phases have: the atoms in the gas phase are completely free to move around, while atoms in the liquid phase have less freedom and in the solid phase, the atoms are set in a lattice, with only vibrational motion and no (or negligible) translational motion.&lt;br /&gt;
&lt;br /&gt;
In order to explain the graph, let us consider the RDF to be displaying the &amp;quot;effective density&amp;quot; of atoms in an area of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; at a distance &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; from a certain reference atom.&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf schematic.jpg|thumb|200px|Schematic of RDF|left]]&lt;br /&gt;
&lt;br /&gt;
There are three main parts to the RDF graphs: the region near the origin where the &amp;lt;math&amp;gt;\mathrm{RDF} = 0&amp;lt;/math&amp;gt;, the region after where there are big peaks and troughs, and the final region where the graphs have mostly reached equilibrium.&lt;br /&gt;
&lt;br /&gt;
First of all, the region near the origin is 0 for all three phases as that is still within the volume of the reference atom, and hence there are no other atoms in that radius.&lt;br /&gt;
&lt;br /&gt;
The peaks in the second region indicate that there is a higher &amp;quot;effective density&amp;quot; of atoms. The explanation for this is different for the lattice structure (solid) and the fluids (liquid and gas).&lt;br /&gt;
&lt;br /&gt;
For the liquid and gas phase, the peaks are due to the attractive force caused by the Lennard-Jones potential. We have calculated above [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:SUNG95#Lennard-Jones_Potential (1.2 LJ Potential)] that &amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}.&amp;lt;/math&amp;gt; Setting &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt; (as we have in our input file), we get &amp;lt;math&amp;gt;r_{eq} = 1.122&amp;lt;/math&amp;gt;, which is very close to where the largest peaks are for the two fluid phases.&lt;br /&gt;
&lt;br /&gt;
Then for the solid, where all the atoms are in a lattice structure, the effects due to the Lennard-Jones interaction becomes neglibigle. Instead, there will be certain values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where the effective density is higher than the overall density of the sample (the peaks), and some values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where it is lower than the density of the sample (the troughs). This is arisen from the fact that as the value of in a similar fashion to the schematic on the left.&lt;br /&gt;
&lt;br /&gt;
As the value of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the total volume covered by &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; also increases. But since all the atoms are set in place by the lattice, the number of atoms that &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; encompasses stays relatively constant. As a result, the peaks and the troughs tend 1 with increasing &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the case of the gas phase, the atoms are completely free to move around and the RDF graph can be entirely attributed to the effects of the L-J interaction. This justifies the lack of troughs for this phase. Furthermore, as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the attractive part of the L-J interaction &amp;lt;math&amp;gt;\frac{1}{r^6}&amp;lt;/math&amp;gt; gets exponentially smaller and quickly becomes negligible - RDF reaches equilibrium.&lt;br /&gt;
&lt;br /&gt;
Finally, the liquid phase can be considered to act as a mix between the solid phase and the gas phase: the L-J interactions are significant enough to reach equilibrium at a rate similar to the gas phase, but there exists an ordering of the atoms such that there are values of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; where the effective density is lower than the overall density.&lt;br /&gt;
&lt;br /&gt;
From the RDF of the solid phase, each of the peaks point to a certain lattice point. Simple geometrical calculations can be done to indicate that the first peak, which is the lattice point (1) closest to the reference atom (O), is at a separation of &amp;lt;math&amp;gt;\mathrm{r}=1.056.&amp;lt;/math&amp;gt; Second closest point (2) is at a distance of &amp;lt;math&amp;gt;\mathrm{r}=1.4938&amp;lt;/math&amp;gt; and the third (3) at &amp;lt;math&amp;gt;\mathrm{r}=1.8295.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:FCC-SHL.png|thumb|Face-centered cubic lattice|none]]&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
=== Mean Squared Displacement ===&lt;br /&gt;
&lt;br /&gt;
=== Velocity Autocorrelation Function ===&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560466</id>
		<title>Rep:Mod:SUNG95</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560466"/>
		<updated>2016-10-21T03:17:24Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: /* The Velocity-Verlet Algorithm */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Theory ==&lt;br /&gt;
=== The Velocity-Verlet Algorithm ===&lt;br /&gt;
[[File:Verlet-Velocity.png|thumb|700px|x(t) derived from the velocity-Verlet algorithm compared with the position of the classical harmonic oscillator.|left]]&lt;br /&gt;
[[File:Verlet-Energy.png|thumb|700px|Total energy of the system with respect to time|right]]&lt;br /&gt;
[[File:Verlet-Error.png|thumb|700px|The error derived by comparing the solution of the velocity-Verlet algorithm with the position of the classical harmonic oscillator|none]]&lt;br /&gt;
&lt;br /&gt;
The three graphs above display the position of an atom, the total energy of the system and the error between the two methods of calculating the atom position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Error wrt Time.png|thumb|600px|Maximum Error against Time|none]]&lt;br /&gt;
&lt;br /&gt;
From this graph of Maximum error vs Time, we can see that error increases with time at a stable linear rate.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Running the same calculations with varying timesteps show the importance of choosing the right value of the timestep:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Energy at t=0.05.png|Energy at timestep=0.05&lt;br /&gt;
Image:Energy at t=0.5.png|Energy at timestep=0.5&lt;br /&gt;
Image:Error at t=0.5.png|Error at timestep=0.5&lt;br /&gt;
Image:Error at t=0.05.png|Error at timestep=0.05&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examining the four additional graphs above, we can notice that a shorter timestep is able to provide a smaller value of error and that the energy fluctuates less than a bigger value of timestep. However, a shorter timestep results in a shorter simulation type, which can result in a less realistic simulation. It is therefore important to find the right balance between the two.&lt;br /&gt;
&lt;br /&gt;
Through trial and error, it has been found that timestep = 0.2850 or lower results in an energy fluctuation that is smaller than 1% over the course of the simulation. A small fluctuation in energy indicates higher resemblance to reality as technically the total energy should not fluctuate at all due to the Law of Conservation of Energy.&lt;br /&gt;
&lt;br /&gt;
=== Lennard-Jones Potential ===&lt;br /&gt;
The equation to calculate the Lennard-Jones potential is as follows:&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;
By equating this to 0, we find that the &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the separation at which the potential is 0, is &amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We can then find the force at this separation by differentiating the Lennard-Jones potential with respect to r, and substituting in &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}=\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24 \frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation (&amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;) is the separation of the particles at equilibrium, and represents the separation at which the potential energy is at a minimum. It can thus be found by setting &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}&amp;lt;/math&amp;gt;, (or &amp;lt;math&amp;gt;\mathbf{F}&amp;lt;/math&amp;gt;) to 0.&lt;br /&gt;
&lt;br /&gt;
Hence,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right) 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; gives us the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;&#039;&#039;Come back to this&#039;&#039;&#039;&#039;&#039;===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4\epsilon\sigma^{12}r^{-12} - 4\epsilon\sigma^{6}r^{-6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{d\phi}{dr}=-48\epsilon\sigma^{12}r^{-13}+24\epsilon\sigma^{6}r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
It is very difficult to simulate realistic volumes of liquid and in the scope of this experiment, we have simulated liquids with N (number of atoms) between 1,000 and 10,000. To demonstrate why simulating realistic volumes of liquid is difficult, let us first calculate the number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--TASK: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.--&amp;gt;&lt;br /&gt;
(Assuming: Standard conditions; Density of water = 1.00 g/ml)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.00 \mathrm{ml} = 1.00 \mathrm{g}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;18.02 \mathrm{g/mol} = 0.0555 \text{ mols of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.0555 \times 6.022 \times 10^{23} = 3.34 \times 10^{22} \text{ molecules of water.}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the other hand, 10,000 water molecules is only &amp;lt;math&amp;gt;2.99 \times 10^{-19} \text{ ml of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
10000 water molecules == 1.661 x 10^-20 mols of water. (Conversion using Avogadro Constant)&lt;br /&gt;
1.661 x 10^-20 x 18.02 = 2.99 x 10^-19 g&lt;br /&gt;
approx. 2.99 x 10^-19 ml of water.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus, in order to be able to complete the simulation in a practical amount of time, we place our atoms in a box that is repeated in all directions, similar to how unit cells repeat themselves in a lattice. When an atom crosses the boundary of the box, its replica enters the same box from the other side, thus keeping the total number of atoms in the box constant.&lt;br /&gt;
&lt;br /&gt;
For example, if an atom at position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a cubic box ranging from &amp;lt;math&amp;gt;(0, 0, 0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;, its final position would be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;, if the periodic boundary conditions have been applied.&lt;br /&gt;
&amp;lt;!--We can safely avoid the issue we might encounter arising from the infinite number of particles by setting a cutoff limit ---- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units ===&lt;br /&gt;
The LAMMPS calculations run in this experiment are all done in reduced units &#039;&#039;&#039;&#039;&#039;(because...)&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For example, the Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34 \mathrm{nm}&amp;lt;/math&amp;gt;; &amp;lt;math&amp;gt;\epsilon/k_B=120K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If we set the cutoff to be &amp;lt;math&amp;gt;r*=3.2,&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;r=3.2\times0.34=1.088\mathrm{nm}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Well depth &amp;lt;math&amp;gt;\epsilon=&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
and reduced temperature &amp;lt;math&amp;gt;T*=1.5&amp;lt;/math&amp;gt; would be &amp;lt;math&amp;gt;T=1.5 \times 120=180\mathrm{K}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
=== Creating Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;TASK: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?--&amp;gt;&lt;br /&gt;
For a simple cubic lattice, there is one lattice point per unit cell. Hence, if the number density is 0.8,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8 \text{ points/volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sqrt[3]{0.8}=0.9283\text{ points/length}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.9283^{-1}=1.0772 \text{ length/point}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is thus 1.0772 unit lengths of spacing between each point.&lt;br /&gt;
&lt;br /&gt;
Following the same logic, a face-centred cubic lattice (with 4 lattice points per unit cell) with a density of 1.2 would have a spacing of &amp;lt;math&amp;gt;0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\sqrt[3]{4.8^{-1}}=0.5928)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, the simple cubic lattice with a density of 0.8 would create 1,000 atoms in the given constraints of the box:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;region box block 0 10 0 10 0 10&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and a face centred cubic lattice with a density of 1.2 would create 4,000 atoms in the same box.&lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of the Atoms ===&lt;br /&gt;
In the input script, there are the following lines describing the properties of the atoms:&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;
In the first line, we are setting the mass of type 1 atoms (which includes all of the atoms in our simulation box, as we have created only one type of atoms) as &amp;lt;math&amp;gt;1.0&amp;lt;/math&amp;gt;, in reduced units. The second line defines the interaction between the atoms as a Lenard-Jones interaction, with a cutoff distance of &amp;lt;math&amp;gt;3.0 \text{ units.}&amp;lt;/math&amp;gt; Finally, the last line defines the coefficient in the Lenard-Jones interaction; the asterisk tells LAMMPS that the coefficients apply to all atoms in our system; the first coefficient is &amp;lt;math&amp;gt;\epsilon=1.0&amp;lt;/math&amp;gt; and the second coefficient is &amp;lt;math&amp;gt;\sigma=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After setting the properties of the atoms, we also defined the initial positions and the initial velocities for the atoms in the input script. Since we have both the &amp;lt;math&amp;gt;\mathbf{x}_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, we can use the Velocity-Verlet integration algorithm that employs the half-step method.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
In the following lines from the input script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we created and reset a variable called timestep to equal 0.001, then used that value to calculate how many runs (${n_steps}) to carry out. This is more beneficial than simply setting&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;
as it allows us to only change the value of the timestep variable to alter the number of runs, rather than having to calculate ${n_steps} ourselves every time we change the timestep, especially in cases such as this computational experiment where the timestep was changed multiple times.&lt;br /&gt;
&lt;br /&gt;
=== Checking Equilibration ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--TotalE at 0.0075 - SHL.png--&amp;gt;&lt;br /&gt;
[[File:TotalE at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Temp at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Press at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
The following set of graphs show the total energy of the system against time at varying timestep values.&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:TotalE at 0.001 - SHL.png|Total Energy at timestep = 0.001&lt;br /&gt;
Image:TotalE at 0.0025 - SHL.png|Total Energy at timestep = 0.0025&lt;br /&gt;
Image:TotalE at 0.0075 - SHL.png|Total Energy at timestep = 0.0075&lt;br /&gt;
Image:TotalE at 0.01 - SHL.png|Total Energy at timestep = 0.01&lt;br /&gt;
Image:TotalE at 0.015 - SHL.png|Total Energy at timestep = 0.015&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can be seen from the graphs that for timestep = 0.001, 0.0025 and 0.0075, the energy reaches a stable equilibrium but for timestep = 0.01 and timestep = 0.015, the energy slowly decreases and rapidly increases, respectively, indicating that the results of the simulation are not very accurate for these values of timestep.&lt;br /&gt;
&lt;br /&gt;
Therefore, timestep = 0.0075 would be the ideal value as it provides the highest accuracy, while running the simulation for a suitably long time.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions (NpT) ==&lt;br /&gt;
&lt;br /&gt;
=== Temperature and Pressure Control ===&lt;br /&gt;
&lt;br /&gt;
Pressures chosen: 2.61, 2.63&lt;br /&gt;
&lt;br /&gt;
Temperatures chosen: 1.5, 1.6, 1.7, 1.8, 1.9&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 was chosen to provide the highest accuracy possible, without shortening the simulation time too much.&lt;br /&gt;
&lt;br /&gt;
In our simulation, the temperature was controlled by solving the two following equations for the instantaneous temperature &amp;lt;math&amp;gt;T,&amp;lt;/math&amp;gt; which fluctuates.&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 \qquad\qquad\qquad(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order for &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; to reach our target temperature &amp;lt;math&amp;gt;\mathfrak{T},&amp;lt;/math&amp;gt; we introduce a constant &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; to control the velocity such that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}\qquad\qquad(2)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can solve eq. &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt; to solve for &amp;lt;math&amp;gt;\gamma.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\sum_i m_i v_i^2 = 3N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substituting &amp;lt;math&amp;gt;\sum_i m_i v_i^2&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 3 N k_b T = 3N k_b \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\epsilon}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Examining the Input Script (Come back)===&lt;br /&gt;
&lt;br /&gt;
To calculate the average values for our simulation, we set certain parameters for LAMMPS in the script.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time Nevery Nrepeat Nfreq&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Final averages are generated on timesteps that are multiples of Nevery, for Nrepeat number of times until it reaches a total number of Nfreq timesteps.&lt;br /&gt;
&lt;br /&gt;
In our script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The results are sampled at every 100 timesteps for 1000 times (100, 200, 300, etc. until 100,000).&lt;br /&gt;
&lt;br /&gt;
=== Results of NpT Simulation ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacity ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--To calculate the heat capacity of our simulated liquid, we investigated how much the energy of our system fluctuates with respect to temperature, according to the equation &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variance in energy can be derived from statistical thermodynamics: &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:HeatCap vs Density.png|thumb|800px|Graph of &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; against Temperature|none]]&lt;br /&gt;
&lt;br /&gt;
From thermodynamics:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;dU = TdS - PdV&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = T\frac{\partial S}{\partial T}-P\frac{\partial V}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and since &amp;lt;math&amp;gt;\frac{\partial S}{\partial T}\geq 0,&amp;lt;/math&amp;gt; heat capacity should increase with increasing temperature.&lt;br /&gt;
&lt;br /&gt;
The fact that &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; decreases with increasing temperature &#039;&#039;&#039;------------&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
[[File:RDF SHL.png|thumb|700px]]&lt;br /&gt;
&lt;br /&gt;
It can be noticed that the three phases have clearly different Radial Distribution Functions (RDF) from each other and this can be attributed to the varying degrees of order each of the phases have: the atoms in the gas phase are completely free to move around, while atoms in the liquid phase have less freedom and in the solid phase, the atoms are set in a lattice, with only vibrational motion and no (or negligible) translational motion.&lt;br /&gt;
&lt;br /&gt;
In order to explain the graph, let us consider the RDF to be displaying the &amp;quot;effective density&amp;quot; of atoms in an area of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; at a distance &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; from a certain reference atom.&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf schematic.jpg|thumb|200px|Schematic of RDF|left]]&lt;br /&gt;
&lt;br /&gt;
There are three main parts to the RDF graphs: the region near the origin where the &amp;lt;math&amp;gt;\mathrm{RDF} = 0&amp;lt;/math&amp;gt;, the region after where there are big peaks and troughs, and the final region where the graphs have mostly reached equilibrium.&lt;br /&gt;
&lt;br /&gt;
First of all, the region near the origin is 0 for all three phases as that is still within the volume of the reference atom, and hence there are no other atoms in that radius.&lt;br /&gt;
&lt;br /&gt;
The peaks in the second region indicate that there is a higher &amp;quot;effective density&amp;quot; of atoms. The explanation for this is different for the lattice structure (solid) and the fluids (liquid and gas).&lt;br /&gt;
&lt;br /&gt;
For the liquid and gas phase, the peaks are due to the attractive force caused by the Lennard-Jones potential. We have calculated above [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:SUNG95#Lennard-Jones_Potential (1.2 LJ Potential)] that &amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}.&amp;lt;/math&amp;gt; Setting &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt; (as we have in our input file), we get &amp;lt;math&amp;gt;r_{eq} = 1.122&amp;lt;/math&amp;gt;, which is very close to where the largest peaks are for the two fluid phases.&lt;br /&gt;
&lt;br /&gt;
Then for the solid, where all the atoms are in a lattice structure, the effects due to the Lennard-Jones interaction becomes neglibigle. Instead, there will be certain values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where the effective density is higher than the overall density of the sample (the peaks), and some values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where it is lower than the density of the sample (the troughs). This is arisen from the fact that as the value of in a similar fashion to the schematic on the left.&lt;br /&gt;
&lt;br /&gt;
As the value of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the total volume covered by &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; also increases. But since all the atoms are set in place by the lattice, the number of atoms that &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; encompasses stays relatively constant. As a result, the peaks and the troughs tend 1 with increasing &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the case of the gas phase, the atoms are completely free to move around and the RDF graph can be entirely attributed to the effects of the L-J interaction. This justifies the lack of troughs for this phase. Furthermore, as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the attractive part of the L-J interaction &amp;lt;math&amp;gt;\frac{1}{r^6}&amp;lt;/math&amp;gt; gets exponentially smaller and quickly becomes negligible - RDF reaches equilibrium.&lt;br /&gt;
&lt;br /&gt;
Finally, the liquid phase can be considered to act as a mix between the solid phase and the gas phase: the L-J interactions are significant enough to reach equilibrium at a rate similar to the gas phase, but there exists an ordering of the atoms such that there are values of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; where the effective density is lower than the overall density.&lt;br /&gt;
&lt;br /&gt;
From the RDF of the solid phase, each of the peaks point to a certain lattice point. Simple geometrical calculations can be done to indicate that the first peak, which is the lattice point (1) closest to the reference atom (O), is at a separation of &amp;lt;math&amp;gt;\mathrm{r}=1.056.&amp;lt;/math&amp;gt; Second closest point (2) is at a distance of &amp;lt;math&amp;gt;\mathrm{r}=1.4938&amp;lt;/math&amp;gt; and the third (3) at &amp;lt;math&amp;gt;\mathrm{r}=1.8295.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:FCC-SHL.png|thumb|Face-centered cubic lattice|none]]&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
=== Mean Squared Displacement ===&lt;br /&gt;
&lt;br /&gt;
=== Velocity Autocorrelation Function ===&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560460</id>
		<title>Rep:Mod:SUNG95</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:SUNG95&amp;diff=560460"/>
		<updated>2016-10-21T03:12:58Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: /* The Velocity-Verlet Algorithm */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Theory ==&lt;br /&gt;
=== The Velocity-Verlet Algorithm ===&lt;br /&gt;
[[File:Verlet-Velocity.png|thumb|700px|x(t) derived from the velocity-Verlet algorithm compared with the position of the classical harmonic oscillator.|left]]&lt;br /&gt;
[[File:Verlet-Energy.png|thumb|700px|Total energy of the system with respect to time|right]]&lt;br /&gt;
[[File:Verlet-Error.png|thumb|700px|The error derived by comparing the solution of the velocity-Verlet algorithm with the position of the classical harmonic oscillator|none]]&lt;br /&gt;
&lt;br /&gt;
The three graphs above display the position of an atom, the total energy of the system and the error between the two methods of calculating the atom position.&lt;br /&gt;
&lt;br /&gt;
[[File:Error wrt Time.png|thumb|600px|Maximum Error against Time|none]]&lt;br /&gt;
&lt;br /&gt;
From this graph of Maximum error vs Time, we can see that error increases with time at a stable linear rate.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Running the same calculations with varying timesteps show the importance of choosing the right value of the timestep:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Energy at t=0.05.png|Energy at timestep=0.05&lt;br /&gt;
Image:Energy at t=0.5.png|Energy at timestep=0.5&lt;br /&gt;
Image:Error at t=0.5.png|Error at timestep=0.5&lt;br /&gt;
Image:Error at t=0.05.png|Error at timestep=0.05&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examining the four additional graphs above, we can notice that a shorter timestep is able to provide a smaller value of error and that the energy fluctuates less than a bigger value of timestep. However, a shorter timestep results in a shorter simulation type, which can result in a less realistic simulation. It is therefore important to find the right balance between the two.&lt;br /&gt;
&lt;br /&gt;
Through trial and error, it has been found that timestep = 0.2850 or lower results in an energy fluctuation that is smaller than 1% over the course of the simulation. A small fluctuation in energy indicates higher resemblance to reality as technically the total energy should not fluctuate at all due to the Law of Conservation of Energy.&lt;br /&gt;
&lt;br /&gt;
=== Lennard-Jones Potential ===&lt;br /&gt;
The equation to calculate the Lennard-Jones potential is as follows:&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;
By equating this to 0, we find that the &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, the separation at which the potential is 0, is &amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We can then find the force at this separation by differentiating the Lennard-Jones potential with respect to r, and substituting in &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}=\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24 \frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation (&amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;) is the separation of the particles at equilibrium, and represents the separation at which the potential energy is at a minimum. It can thus be found by setting &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}&amp;lt;/math&amp;gt;, (or &amp;lt;math&amp;gt;\mathbf{F}&amp;lt;/math&amp;gt;) to 0.&lt;br /&gt;
&lt;br /&gt;
Hence,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right) 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; gives us the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;&#039;&#039;Come back to this&#039;&#039;&#039;&#039;&#039;===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4\epsilon\sigma^{12}r^{-12} - 4\epsilon\sigma^{6}r^{-6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{d\phi}{dr}=-48\epsilon\sigma^{12}r^{-13}+24\epsilon\sigma^{6}r^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
It is very difficult to simulate realistic volumes of liquid and in the scope of this experiment, we have simulated liquids with N (number of atoms) between 1,000 and 10,000. To demonstrate why simulating realistic volumes of liquid is difficult, let us first calculate the number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--TASK: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.--&amp;gt;&lt;br /&gt;
(Assuming: Standard conditions; Density of water = 1.00 g/ml)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.00 \mathrm{ml} = 1.00 \mathrm{g}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;18.02 \mathrm{g/mol} = 0.0555 \text{ mols of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.0555 \times 6.022 \times 10^{23} = 3.34 \times 10^{22} \text{ molecules of water.}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the other hand, 10,000 water molecules is only &amp;lt;math&amp;gt;2.99 \times 10^{-19} \text{ ml of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
10000 water molecules == 1.661 x 10^-20 mols of water. (Conversion using Avogadro Constant)&lt;br /&gt;
1.661 x 10^-20 x 18.02 = 2.99 x 10^-19 g&lt;br /&gt;
approx. 2.99 x 10^-19 ml of water.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus, in order to be able to complete the simulation in a practical amount of time, we place our atoms in a box that is repeated in all directions, similar to how unit cells repeat themselves in a lattice. When an atom crosses the boundary of the box, its replica enters the same box from the other side, thus keeping the total number of atoms in the box constant.&lt;br /&gt;
&lt;br /&gt;
For example, if an atom at position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a cubic box ranging from &amp;lt;math&amp;gt;(0, 0, 0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;, its final position would be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;, if the periodic boundary conditions have been applied.&lt;br /&gt;
&amp;lt;!--We can safely avoid the issue we might encounter arising from the infinite number of particles by setting a cutoff limit ---- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units ===&lt;br /&gt;
The LAMMPS calculations run in this experiment are all done in reduced units &#039;&#039;&#039;&#039;&#039;(because...)&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For example, the Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34 \mathrm{nm}&amp;lt;/math&amp;gt;; &amp;lt;math&amp;gt;\epsilon/k_B=120K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If we set the cutoff to be &amp;lt;math&amp;gt;r*=3.2,&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;r=3.2\times0.34=1.088\mathrm{nm}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Well depth &amp;lt;math&amp;gt;\epsilon=&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
and reduced temperature &amp;lt;math&amp;gt;T*=1.5&amp;lt;/math&amp;gt; would be &amp;lt;math&amp;gt;T=1.5 \times 120=180\mathrm{K}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
=== Creating Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;TASK: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?--&amp;gt;&lt;br /&gt;
For a simple cubic lattice, there is one lattice point per unit cell. Hence, if the number density is 0.8,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8 \text{ points/volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sqrt[3]{0.8}=0.9283\text{ points/length}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.9283^{-1}=1.0772 \text{ length/point}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is thus 1.0772 unit lengths of spacing between each point.&lt;br /&gt;
&lt;br /&gt;
Following the same logic, a face-centred cubic lattice (with 4 lattice points per unit cell) with a density of 1.2 would have a spacing of &amp;lt;math&amp;gt;0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\sqrt[3]{4.8^{-1}}=0.5928)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, the simple cubic lattice with a density of 0.8 would create 1,000 atoms in the given constraints of the box:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;region box block 0 10 0 10 0 10&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and a face centred cubic lattice with a density of 1.2 would create 4,000 atoms in the same box.&lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of the Atoms ===&lt;br /&gt;
In the input script, there are the following lines describing the properties of the atoms:&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;
In the first line, we are setting the mass of type 1 atoms (which includes all of the atoms in our simulation box, as we have created only one type of atoms) as &amp;lt;math&amp;gt;1.0&amp;lt;/math&amp;gt;, in reduced units. The second line defines the interaction between the atoms as a Lenard-Jones interaction, with a cutoff distance of &amp;lt;math&amp;gt;3.0 \text{ units.}&amp;lt;/math&amp;gt; Finally, the last line defines the coefficient in the Lenard-Jones interaction; the asterisk tells LAMMPS that the coefficients apply to all atoms in our system; the first coefficient is &amp;lt;math&amp;gt;\epsilon=1.0&amp;lt;/math&amp;gt; and the second coefficient is &amp;lt;math&amp;gt;\sigma=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After setting the properties of the atoms, we also defined the initial positions and the initial velocities for the atoms in the input script. Since we have both the &amp;lt;math&amp;gt;\mathbf{x}_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, we can use the Velocity-Verlet integration algorithm that employs the half-step method.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
In the following lines from the input script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we created and reset a variable called timestep to equal 0.001, then used that value to calculate how many runs (${n_steps}) to carry out. This is more beneficial than simply setting&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;
as it allows us to only change the value of the timestep variable to alter the number of runs, rather than having to calculate ${n_steps} ourselves every time we change the timestep, especially in cases such as this computational experiment where the timestep was changed multiple times.&lt;br /&gt;
&lt;br /&gt;
=== Checking Equilibration ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--TotalE at 0.0075 - SHL.png--&amp;gt;&lt;br /&gt;
[[File:TotalE at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Temp at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
[[File:Press at 0.001 - SHL.png|thumb|700px|none]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
The following set of graphs show the total energy of the system against time at varying timestep values.&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:TotalE at 0.001 - SHL.png|Total Energy at timestep = 0.001&lt;br /&gt;
Image:TotalE at 0.0025 - SHL.png|Total Energy at timestep = 0.0025&lt;br /&gt;
Image:TotalE at 0.0075 - SHL.png|Total Energy at timestep = 0.0075&lt;br /&gt;
Image:TotalE at 0.01 - SHL.png|Total Energy at timestep = 0.01&lt;br /&gt;
Image:TotalE at 0.015 - SHL.png|Total Energy at timestep = 0.015&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can be seen from the graphs that for timestep = 0.001, 0.0025 and 0.0075, the energy reaches a stable equilibrium but for timestep = 0.01 and timestep = 0.015, the energy slowly decreases and rapidly increases, respectively, indicating that the results of the simulation are not very accurate for these values of timestep.&lt;br /&gt;
&lt;br /&gt;
Therefore, timestep = 0.0075 would be the ideal value as it provides the highest accuracy, while running the simulation for a suitably long time.&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions (NpT) ==&lt;br /&gt;
&lt;br /&gt;
=== Temperature and Pressure Control ===&lt;br /&gt;
&lt;br /&gt;
Pressures chosen: 2.61, 2.63&lt;br /&gt;
&lt;br /&gt;
Temperatures chosen: 1.5, 1.6, 1.7, 1.8, 1.9&lt;br /&gt;
&lt;br /&gt;
Timestep of 0.0025 was chosen to provide the highest accuracy possible, without shortening the simulation time too much.&lt;br /&gt;
&lt;br /&gt;
In our simulation, the temperature was controlled by solving the two following equations for the instantaneous temperature &amp;lt;math&amp;gt;T,&amp;lt;/math&amp;gt; which fluctuates.&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 \qquad\qquad\qquad(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order for &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; to reach our target temperature &amp;lt;math&amp;gt;\mathfrak{T},&amp;lt;/math&amp;gt; we introduce a constant &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; to control the velocity such that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}\qquad\qquad(2)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can solve eq. &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt; to solve for &amp;lt;math&amp;gt;\gamma.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\sum_i m_i v_i^2 = 3N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substituting &amp;lt;math&amp;gt;\sum_i m_i v_i^2&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 3 N k_b T = 3N k_b \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\epsilon}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Examining the Input Script (Come back)===&lt;br /&gt;
&lt;br /&gt;
To calculate the average values for our simulation, we set certain parameters for LAMMPS in the script.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time Nevery Nrepeat Nfreq&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Final averages are generated on timesteps that are multiples of Nevery, for Nrepeat number of times until it reaches a total number of Nfreq timesteps.&lt;br /&gt;
&lt;br /&gt;
In our script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The results are sampled at every 100 timesteps for 1000 times (100, 200, 300, etc. until 100,000).&lt;br /&gt;
&lt;br /&gt;
=== Results of NpT Simulation ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacity ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--To calculate the heat capacity of our simulated liquid, we investigated how much the energy of our system fluctuates with respect to temperature, according to the equation &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variance in energy can be derived from statistical thermodynamics: &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:HeatCap vs Density.png|thumb|800px|Graph of &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; against Temperature|none]]&lt;br /&gt;
&lt;br /&gt;
From thermodynamics:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;dU = TdS - PdV&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = T\frac{\partial S}{\partial T}-P\frac{\partial V}{\partial T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and since &amp;lt;math&amp;gt;\frac{\partial S}{\partial T}\geq 0,&amp;lt;/math&amp;gt; heat capacity should increase with increasing temperature.&lt;br /&gt;
&lt;br /&gt;
The fact that &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; decreases with increasing temperature &#039;&#039;&#039;------------&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
[[File:RDF SHL.png|thumb|700px]]&lt;br /&gt;
&lt;br /&gt;
It can be noticed that the three phases have clearly different Radial Distribution Functions (RDF) from each other and this can be attributed to the varying degrees of order each of the phases have: the atoms in the gas phase are completely free to move around, while atoms in the liquid phase have less freedom and in the solid phase, the atoms are set in a lattice, with only vibrational motion and no (or negligible) translational motion.&lt;br /&gt;
&lt;br /&gt;
In order to explain the graph, let us consider the RDF to be displaying the &amp;quot;effective density&amp;quot; of atoms in an area of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; at a distance &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; from a certain reference atom.&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf schematic.jpg|thumb|200px|Schematic of RDF|left]]&lt;br /&gt;
&lt;br /&gt;
There are three main parts to the RDF graphs: the region near the origin where the &amp;lt;math&amp;gt;\mathrm{RDF} = 0&amp;lt;/math&amp;gt;, the region after where there are big peaks and troughs, and the final region where the graphs have mostly reached equilibrium.&lt;br /&gt;
&lt;br /&gt;
First of all, the region near the origin is 0 for all three phases as that is still within the volume of the reference atom, and hence there are no other atoms in that radius.&lt;br /&gt;
&lt;br /&gt;
The peaks in the second region indicate that there is a higher &amp;quot;effective density&amp;quot; of atoms. The explanation for this is different for the lattice structure (solid) and the fluids (liquid and gas).&lt;br /&gt;
&lt;br /&gt;
For the liquid and gas phase, the peaks are due to the attractive force caused by the Lennard-Jones potential. We have calculated above [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:SUNG95#Lennard-Jones_Potential (1.2 LJ Potential)] that &amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}.&amp;lt;/math&amp;gt; Setting &amp;lt;math&amp;gt;\sigma = 1&amp;lt;/math&amp;gt; (as we have in our input file), we get &amp;lt;math&amp;gt;r_{eq} = 1.122&amp;lt;/math&amp;gt;, which is very close to where the largest peaks are for the two fluid phases.&lt;br /&gt;
&lt;br /&gt;
Then for the solid, where all the atoms are in a lattice structure, the effects due to the Lennard-Jones interaction becomes neglibigle. Instead, there will be certain values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where the effective density is higher than the overall density of the sample (the peaks), and some values of &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; where it is lower than the density of the sample (the troughs). This is arisen from the fact that as the value of in a similar fashion to the schematic on the left.&lt;br /&gt;
&lt;br /&gt;
As the value of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the total volume covered by &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; also increases. But since all the atoms are set in place by the lattice, the number of atoms that &amp;lt;math&amp;gt;\mathrm{dr}&amp;lt;/math&amp;gt; encompasses stays relatively constant. As a result, the peaks and the troughs tend 1 with increasing &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the case of the gas phase, the atoms are completely free to move around and the RDF graph can be entirely attributed to the effects of the L-J interaction. This justifies the lack of troughs for this phase. Furthermore, as &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; increases, the attractive part of the L-J interaction &amp;lt;math&amp;gt;\frac{1}{r^6}&amp;lt;/math&amp;gt; gets exponentially smaller and quickly becomes negligible - RDF reaches equilibrium.&lt;br /&gt;
&lt;br /&gt;
Finally, the liquid phase can be considered to act as a mix between the solid phase and the gas phase: the L-J interactions are significant enough to reach equilibrium at a rate similar to the gas phase, but there exists an ordering of the atoms such that there are values of &amp;lt;math&amp;gt;\mathrm{r}&amp;lt;/math&amp;gt; where the effective density is lower than the overall density.&lt;br /&gt;
&lt;br /&gt;
From the RDF of the solid phase, each of the peaks point to a certain lattice point. Simple geometrical calculations can be done to indicate that the first peak, which is the lattice point (1) closest to the reference atom (O), is at a separation of &amp;lt;math&amp;gt;\mathrm{r}=1.056.&amp;lt;/math&amp;gt; Second closest point (2) is at a distance of &amp;lt;math&amp;gt;\mathrm{r}=1.4938&amp;lt;/math&amp;gt; and the third (3) at &amp;lt;math&amp;gt;\mathrm{r}=1.8295.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:FCC-SHL.png|thumb|Face-centered cubic lattice|none]]&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
=== Mean Squared Displacement ===&lt;br /&gt;
&lt;br /&gt;
=== Velocity Autocorrelation Function ===&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Error_wrt_Time.png&amp;diff=560458</id>
		<title>File:Error wrt Time.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Error_wrt_Time.png&amp;diff=560458"/>
		<updated>2016-10-21T03:09:40Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: Sl10014 uploaded a new version of File:Error wrt Time.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Error_wrt_Time.png&amp;diff=560455</id>
		<title>File:Error wrt Time.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Error_wrt_Time.png&amp;diff=560455"/>
		<updated>2016-10-21T03:08:49Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Verlet-Error.png&amp;diff=560451</id>
		<title>File:Verlet-Error.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Verlet-Error.png&amp;diff=560451"/>
		<updated>2016-10-21T02:59:25Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: Sl10014 uploaded a new version of File:Verlet-Error.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Error_at_t%3D0.5.png&amp;diff=560449</id>
		<title>File:Error at t=0.5.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Error_at_t%3D0.5.png&amp;diff=560449"/>
		<updated>2016-10-21T02:59:07Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: Sl10014 uploaded a new version of File:Error at t=0.5.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Error_at_t%3D0.05.png&amp;diff=560448</id>
		<title>File:Error at t=0.05.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Error_at_t%3D0.05.png&amp;diff=560448"/>
		<updated>2016-10-21T02:58:51Z</updated>

		<summary type="html">&lt;p&gt;Sl10014: Sl10014 uploaded a new version of File:Error at t=0.05.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sl10014</name></author>
	</entry>
</feed>