<?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=Gm1110</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=Gm1110"/>
	<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/wiki/Special:Contributions/Gm1110"/>
	<updated>2026-04-10T01:05:49Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665592</id>
		<title>Rep:Gm1110LiquidSim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665592"/>
		<updated>2018-02-16T14:47:07Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: /* Diffusion Coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Preliminary tests were conducted to determine a suitable timestep value for simulations into a Lennard-Jones fluid (0.0025 s). It was shown that the density of the systems decreased with an increase in temperature, and that running the simulations at higher pressures led to a greater deviation from ideality. A further investigation into heat capacity showed that ease of heating increases as temperature increases, and that heat capacity decreases for lower density systems. &lt;br /&gt;
&lt;br /&gt;
The radial distribution functions calculated confirmed that the simulations were producing structurally accurate systems for solid, liquid and vapour phases, allowing for calculation of the diffusion coefficients via the mean square displacement method and the velocity autocorrelation function.&lt;br /&gt;
&lt;br /&gt;
For the more accurate 1,000,000 atom simulation, the diffusion coefficients were calculated to be -6.83x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;, 0.0698 and 2.47 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; for the solid, liquid and vapour phases respectively using the mean square displacement method, and 4.55x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;, 0.0901 and 3.27 m&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; using the velocity autocorrelation function. &lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
The process of diffusion is important in all aspects of life, from the perfume industry&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://onlinelibrary.wiley.com/doi/10.1002/aic.14106/epdf&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt; to insulation&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;https://ac.els-cdn.com/S0142061513002032/1-s2.0-S0142061513002032-main.pdf?_tid=958b3390-1323-11e8-8822-00000aacb360&amp;amp;acdnat=1518790607_86d8f9f122450bef4ef7e3fc82f97936&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;. For example, fragrance companies may need to know how long their perfume will last before it completely diffuses away after application, or the way in which the different components of their fragrance interact. In the case of insulation, investigating how thermal energy diffuses through different materials is very important for improving their efficiencies. Computer simulations are often used nowadays to predict the time taken for certain processes to occur, and the mechanisms that drive them, and these results can used as a preliminary basis to conduct physical experiments.&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
The main aim of the experiment was to determine the diffusion coefficient for the solid, liquid and vapour phases of a Lennard-Jones fluid using both the mean squared displacement method and velocity autocorrelation function method.&lt;br /&gt;
&lt;br /&gt;
In order to achieve this, it was first necessary to determine an appropriate timestep with which to run simulations, and investigate the effect of temperature and pressure on the density of the system. Other aims included seeing how heat capacity varied as a function of temperature for different densities, and calculating the radial distribution function for the three phases from simulations using VMD.    &lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
All simulations of the Lennard-Jones fluid were run using the LAMMPS software, and all quantities used were in reduced units.&lt;br /&gt;
&lt;br /&gt;
=== Part 1: Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
A simulation box consisting of 10 x 10 x 10 unit cells of a simple cubic lattice with an atomic density of 0.8 was defined. The atomic mass was set to 1.0 and the Lennard-Jones pairwise interaction cutoff distance was set to 3.0. The pairwise forcefield coefficients ε (potential well depth) and σ (zero-potential distance) were both set to 1.0. Five simulations were run for differing timestep values (0.0010, 0.0025, 0.0075, 0.0100 and 0.0150).&lt;br /&gt;
&lt;br /&gt;
=== Part 2: Equations of State in the NpT Ensemble ===&lt;br /&gt;
The simulation box was increased to consist of 15 x 15 x 15 unit cells of the same simple cubic lattice defined in part 1. A total of ten simulations were run in the NpT ensemble, varying temperature (2.0, 4.0, 6.0, 8.0 and 10.0) at two different densities (1.8 and 2.8) using the timestep value of 0.0025 determined in Part 1.&lt;br /&gt;
&lt;br /&gt;
=== Part 3: Calculation of Heat Capacity ===&lt;br /&gt;
The simulation box from Part 2 was used, with the density altered to take the values 0.2 and 0.8. Five simulations were run for each, with varying values of temperature (2.0, 2.2, 2.4, 2.6 and 2.8). A copy of the script written for this simulation can be found by clicking the image below:&lt;br /&gt;
[[File:gm1110_LS_M_3_1.png|centre|thumb|Copy of Script]]&lt;br /&gt;
&lt;br /&gt;
=== Part 4: Radial Distribution Functions ===&lt;br /&gt;
The simulation boxes used previously were altered to take a timestep of 0.002 and a L-J cutoff distance of 3.2, after which the solid, liquid and vapour phases were defined as having (density, temperature) values of (1.2, 1.2), (0.8, 1.2) and (0.05, 1.1) respectively&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;https://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;. In particular, the solid phase was defined as having a face-centred cubic lattice, instead of the simple cubic lattice used for the liquid and vapour phases. VMD was used to analyse the trajectories for the three phases, with the distance between points in the generated RDF set to 0.05.&lt;br /&gt;
&lt;br /&gt;
=== Part 5: Diffusion Coefficient ===&lt;br /&gt;
The results from Part 4 were used to graph the mean squared displacement as a function of time, after which the gradient of the linear portion of the graph was extracted and used to calculate the diffusion coefficient from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_M_5_1.png|centre|150px]]&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were also calculated from the velocity autocorrelation function from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_M_5_2.png|centre|180px]]&lt;br /&gt;
&lt;br /&gt;
where [[File:gm1110_LS_M_5_3.png|150px]] is the velocity autocorrelation function.&lt;br /&gt;
&lt;br /&gt;
==Results and Discussion==&lt;br /&gt;
&lt;br /&gt;
=== Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
Simulations were run using the five different timesteps 0.0010, 0.0025, 0.0075, 0.0100 and 0.0150, and a plot of the results can be seen below (Figure 1).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_1_1.png|centre|thumb|Figure 1. A plot of total energy (reduced units) against time comparing simulations run using five different timestep values]]&lt;br /&gt;
&lt;br /&gt;
It was observed that the simulation run with a timestep of 0.0150 did not equilibrate. This was thought to have potentially been due to the timestep being too large, and therefore the simulation was missing too much detail to accurately simulate the fluid. The simulations run for timesteps of 0.0100 and 0.0075 did equilibrate (supporting the previous hypothesis that the 0.0150 timestep was too large), but converged at the wrong energy (approximately -3.181 and -3.183 respectively), indicating that the timesteps were still not quite small enough.&lt;br /&gt;
&lt;br /&gt;
The final two simulations run at timesteps of 0.0025 and 0.0010 both equilibrated to the same, correct energy (approximately -3.184), indicating that both would be suitable for use in further simulations. It is preferable, however, to maximise the timestep when running simulations as a smaller timestep requires more data points, and is therefore more “expensive” and takes longer to run for no real added value. Hence it was decided that a timestep of 0.0025 would be suitable for running further simulations.    &lt;br /&gt;
&lt;br /&gt;
=== Equations of State in the NpT Ensemble ===&lt;br /&gt;
Although specific values for temperature and pressure are specified for the simulations, in reality, the temperature and pressure of a system fluctuates over time and may therefore deviate away from the inputted values. Hence, the simulation calculates the pressure of the system at the end of every timestep, and adjusts the size of the simulation box such that the pressure once again corresponds to the specified value. Pressure controlled simulations are thus in the NpT ensemble and so volume (and therefore density) is not constant.&lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the resulting densities were plotted against temperature, along with values predicted by the ideal gas law and can be seen below (Figure 2).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_2_1.png|centre|thumb|Figure 2. Plot showing density as a function of temperature at pressures of 1.8 and 2.8 (all in reduced units), with error bars, and a plot of the densities predicted by the ideal gas law]]&lt;br /&gt;
&lt;br /&gt;
Clearly, the simulated densities are lower than those predicted by the ideal gas law, and the discrepancy increases with increasing pressure. This is due to the fact that the ideal gas law assumes perfectly elastic collisions between point particles, but in reality, intermolecular repulsive forces cause the simulated densities to be lower. In addition, an increase in pressure causes the molecules to be pushed closer together and increases both the number of collisions as well as the repulsive forces, leading to a greater deviation from ideality.    &lt;br /&gt;
&lt;br /&gt;
=== Calculation of Heat Capacity ===&lt;br /&gt;
Switching to the NVT ensemble, the heat capacity of the system can be determined by considering the magnitude of fluctuations in the system’s energy from its average equilibrium state from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_1.png|centre|250px]]            &lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the average heat capacities were plotted as a function of temperature (Figure 3).        &lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_2.png|centre|thumb|Figure 3. Plot of average heat capacity against temperature for densities of 0.8 and 0.2]]Heat capacity is a measure of the amount of energy required to increase the temperature of a substance. It is clear that the heat capacity is lower, and therefore easier to heat, for lower density systems as the particles are more spaced apart. This means that they are able to gain thermal energy more easily as they have more room for increased vibrations without an increase of repulsive forces or collisions compared to a higher density system. It was also noted that the heat capacity decreased with increasing temperature. This is due to the fact that at higher temperatures, the gap between energy levels decreases as the particles occupy higher energy states, thus making it easier for the particles to be promoted to higher energy levels.&lt;br /&gt;
&lt;br /&gt;
It is also clear that heat capacity decreases with increasing temperature (ie it is easier to heat a hotter object). This is due to the fact that as temperature increases, more rotational and vibrational energy levels become thermally accessible, leading to a faster increase in internal energy and thus a lower heat capacity.&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Functions ===&lt;br /&gt;
Radial distribution functions (g(r)) were calculated for the solid, liquid and vapour phases (see Figure 4) to check that the simulations were correctly reproducing the structural features of each phase. RDFs are essentially probability distribution functions for the likelihood of finding a particle at a given distance r away from a reference particle, and also gives information on the coordination sphere of the reference particle. The integral of the RDF (Figure 5) is also useful as it gives information on the number of atoms found at a distance r.&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_1.png|centre|thumb|Figure 4. Radial distribution function against displacement from a reference atom]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_2.png|centre|thumb|Figure 5. Integral of the radial distribution function against displacement]]&lt;br /&gt;
&lt;br /&gt;
For small r, all three phases have g(r) ~ 0, indicating an atomic density of zero as there exists a minimum distance at which atoms can approach each other. Also, g(r) tends to 1 for all three phases with increasing r, which represents the fact that the local density becomes equivalent to the mean density of the system as a whole&amp;lt;ref&amp;gt;Frenkel, Daan; Smit, Berend (2002). &#039;&#039;Understanding molecular simulation from algorithms to applications&#039;&#039; (2nd ed.). San Diego: Academic Press. ISBN 0122673514.&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The graph of the solid phase shows sharp oscillating peaks, indicating that the atoms are strongly confined to their positions in the crystalline lattice, and the high degree of ordering means that although the osciallations do tend to g(r) = 1 for large r, this occurs much more slowly than for the other two phases&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;https://en.wikibooks.org/wiki/Molecular_Simulation/Radial_Distribution_Functions&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;. The first peak corresponds to the atoms nearest neighbours (of which there are 12), and the second and third peak correspond to the second and third nearest neighbours respectively (of which there are 6 and 24). &lt;br /&gt;
&lt;br /&gt;
The graph for the liquid phase shows broad, gently oscillating peaks that rapidly decay to g(r) = 1. As with the solid phase, the oscillations indicate some structure in the system whereby the atoms are loosely bound to their original positions, but the broader peaks indicate that they have much more freedom to move away from their positions. &lt;br /&gt;
&lt;br /&gt;
The graph for the vapour phase shows a single peak at approximately r = 1, after which it quickly decays back to g(r) = 1. This shows that the structure has very little to no order, and the particles are free to move unbound to any specific position. &lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|MSD Graphs (1,000 atoms)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_7.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_8.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_9.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 6. Graph of solid phase MSD for 1,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 7. Graph of liquid phase MSD for 1,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 8. Graph of vapour phase MSD for 1,000 atoms(with trendline)&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The general trends displayed in Figures 6-8 are as expected: the simulation does eventually establish linear behaviour, with the gradients increasing exponentially going from the solid to vapour phases. It is well known that diffusion in the vapour phase occurs much more readily than in the liquid phase, and more readily in the liquid phase than solid phase, and given that the diffusion coefficient is linearly correlated to the gradient of the mean square displacement, it was expected that the gradients of the graphs would increase in this manner. It was noted that the linear region of the solid phase plot (Figure 6) was quite noisy, but it was thought that this may be due to the small simulation size of 1,000 atoms.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|MSD Graphs (1,000,000 atoms)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_10.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_11.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_12.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 9. Graph of solid phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 10. Graph of liquid phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 11. Graph of vapour phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results from the simulation with 1,000,000 atoms (Figures 9-11) support the observations made with the 1,000 atom simulation. The only noticeable improvement from the 1,000 atom simulation was the reduction in noise of the linear region of the solid phase (Figure 9), suggesting that the assumption made previously to consider the more noisy region in Figure 6 as linear was correct, and that increasing the sample size did indeed improve the smoothness and accuracy of the curve.&lt;br /&gt;
&lt;br /&gt;
The gradient for the linear region of the plots were determined and used to calculate the diffusion coefficients (see table below).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=4|Table 1. Diffusion Coefficients Calculated Using the Mean Square Displacement Method&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Solid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Liquid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Vapour Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-6.17x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0688 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;2.27 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-6.83x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0698 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;2.47 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The results obtained are reasonable figures. In comparison with the 1,000,000 atom simulation, the values calculated for the diffusion coefficient with 1,000 atoms yielded a 9.7%, 1.4% and 8.0% error for the solid, liquid and vapour phases respectively. This suggests that for systems involving atoms that are at either extreme with regards to their range of motion, a larger atomic sample size would be suitable for simulations, whereas for liquids, more time-efficient simulations can be accurately conducted using the smaller 1,000 atom sample size.&lt;br /&gt;
&lt;br /&gt;
The positive values obtained for the liquid and vapour phase show that the atoms diffuse away from their original positions over time, whereas the negative value obtained for the solid phase arises as a consequence of attractive nearest neighbour interactions within the lattice structure&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;https://journals.aps.org/prb/pdf/10.1103/PhysRevB.80.104203&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient was also calculated using the velocity autocorrelation function (henceforth VACF).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|VACF Graphs&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_13.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_14.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_15.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 12. Graph of solid, liquid phase and simple harmonic oscillator VACF for 1,000 atoms&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 13. Running integral of solid, liquid and vapour phase VACF for 1,000 atoms&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 14. Running integral of solid, liquid and vapour phase VACF for 1,000,000 atoms&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=4|Table 2. Diffusion Coefficients Calculated Using the Velocity Autocorrelation Function&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Solid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Liquid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Vapour Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-1.84x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0783 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;3.06 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;4.55x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0901 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;3.27 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Generally, the results show that the diffusion coefficients calculated using the VACF method and MSD method are both to the same order of magnitude, although the coefficients calculated via the VACF were 29-32% greater for the liquid and vapour phases.&lt;br /&gt;
&lt;br /&gt;
The largest source of error in estimating the diffusion coefficient using the VACF was the number of atoms used in the simulations. This can be seen more clearly in Figures 16 and 17 which compare the VACF calculated for the liquid and vapour phases. The 1,000 atom simulation is clearly more noisy than the 1,000,000 atom simulation, indicating that the 1,000,000 atom simulation increases the reliability and accuracy of the results.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|VACF Graph Comparisons&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_18.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_19.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_20.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 15. Running integral of solid phase VACF for 1,000 and 1,000,000 atom simulations&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 16. Running integral of liquid phase VACF for 1,000 and 1,000,000 atom simulations&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 17. Running integral of vapour phase VACF for 1,000 and 1,000,000 atom simulations&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
A suitable timestep with which to run the simulations was determined to be 0.0025 s. Simulations then showed that the density of the systems decreased with an increase in temperature, and that running the simulations at higher pressures led to a greater deviation from ideality. A further investigation into heat capacity showed that ease of heating increases as temperature increases, and that heat capacity decreases for lower density systems.&lt;br /&gt;
&lt;br /&gt;
The radial distribution functions calculated show that the simulations were producing structurally accurate systems for the solid, liquid and vapour phases, allowing for calculation of the diffusion coefficients via the mean square displacement method and the velocity autocorrelation function.&lt;br /&gt;
&lt;br /&gt;
For a 1,000 atom simulation, the diffusion coefficients were calculated to be -6.17x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;, 0.0688 and 2.27 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;for the solid, liquid and vapour phases respectively using the mean square displacement method, and -1.84x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;, 0.0783 and 3.06 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;using the velocity autocorrelation function. It was discovered that depending on the method used, and the specific phase being considered, that 1,000 atoms was not a sufficiently large enough sample to accurately model the systems, so 1,000,000 atom simulations were conducted.&lt;br /&gt;
&lt;br /&gt;
For a 1,000,000 atom simulation, the diffusion coefficients were calculated to be -6.83x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;, 0.0698 and 2.47 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; for the solid, liquid and vapour phases respectively using the mean square displacement method, and 4.55x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;, 0.0901 and 3.27 m&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; using the velocity autocorrelation function. &lt;br /&gt;
&lt;br /&gt;
==Tasks==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Introduction to Molecular Dynamics Simulations&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 1. For a default timestep value 0.1, estimate the positions of the maxima in the ERROR column as a function of time.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_1_1.png|centre|thumb|Figure 18. Plot showing the positions of the error maxima as a function of time, with a best fit line]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 2. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using a timestep of 0.1990 meant that the total energy did not change by more than 1% over the course of the simulation (Figure 19).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_2_1.png|centre|thumb|Figure 19. Plot showing the total energy during the simulation using a timestep of 0.1990]]&lt;br /&gt;
&lt;br /&gt;
The simulations are being run in isolated systems which requires total energy conservation, so large fluctuations in the energy would lead to inaccurate results. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 3. For a single Lennard-Jones interaction, find the separation, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;, and work out the well depth. Evaluate the integrals when σ = ε = 1.0.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i) The Lennard-Jones interaction is given by:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_1.png|200px]]&lt;br /&gt;
&lt;br /&gt;
Since r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; when ɸ = 0,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(ii) The force is given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_3.png|250px]]&lt;br /&gt;
&lt;br /&gt;
So at the separation r&amp;lt;sub&amp;gt;0 &amp;lt;/sub&amp;gt;= σ,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_4.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iii) The equilibrium separation r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs at the point at which all forces vanish, ie. when F = 0, so&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_5.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iv) And the well depth is therefore given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_6.png|270px]]&lt;br /&gt;
&lt;br /&gt;
(v)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_7.png|370px]]&lt;br /&gt;
&lt;br /&gt;
(vi)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_8.png|400px]]&lt;br /&gt;
&lt;br /&gt;
(vii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_9.png|370px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4. Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10,000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_1.png|550px]]&lt;br /&gt;
&lt;br /&gt;
For 10,000 water molecules,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_3.png|230px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 5. Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After the timestep, the atom would be at position (0.5 + 0.7, 0.5 + 0.6, 0.5 + 0.2) = (1.2, 1.1, 0.7). Applying the boundary conditions, this is equivalent to the position (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 6. The Lennard-Jones parameters for argon are sigma = 0.34nm, ε/k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt; = 120K. If the LJ cutoff is r&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 1.5 in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_1.png|140px]]&lt;br /&gt;
&lt;br /&gt;
(ii) It was previously determined in Task 1 that the well depth is - ε, so in real units,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_4.png|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(iii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_3.png|130px]]&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Equilibration&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 7. Why do you think giving atoms random starting coordinates causes problems in simulations?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If two atoms are generated too close to one another, then they would experience a large repulsive force, and would disrupt the behaviour of the surrounding atoms, causing the simulation to become inaccurate. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 8. Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_1.png|380px]]&lt;br /&gt;
&lt;br /&gt;
(ii) For a face-centred cubic lattice, note that the unit cell contains four atoms, as opposed to one atom with a simple cubic lattice. Then&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_4.png|460px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 9. Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is 1 atom contained within each unit cell. However for face-centred cubic lattices, each unit cell contains 4 atoms so four times as many atoms are created than with the simple lattice (ie. 4000 atoms).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 10. Given that we are specifying x&amp;lt;sub&amp;gt;i &amp;lt;/sub&amp;gt;(0) and v&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; (0), which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We will be using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 11. In the code section &amp;quot;Specify Timestep&amp;quot;, the second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write &amp;quot;timestep 0.001 // run 100000&amp;quot;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Defining the variable timestep allows us to reference the variable multiple times throughout the simulation if required, whilst preventing errors and making it easier to alter the code if we want to run the simulation for different timestep values. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 12. Make plots of energy, temperature, and pressure, against time for the 0.001 timestep experiment. Does the simulation reach equilibrium? How long does this take? Make a single plot of energy vs time for all of the timesteps. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice and why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_12_1.png|centre|thumb|Figure 20. Plot of energy against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_2.png|centre|thumb|Figure 21. Plot of temperature against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_3.png|centre|thumb|Figure 22. Plot of pressure against time for the 0.001 timestep experiment]]&lt;br /&gt;
&lt;br /&gt;
The 0.001 timestep experiment reaches equilibrium very quickly, within approximately 0.2s. &lt;br /&gt;
&lt;br /&gt;
A single plot of energy vs time for all of the timesteps can be found in &amp;quot;Results &amp;amp; Discussion: Investigation into Simulation Timestep in the NVE Ensemble&amp;quot; (Figure 1), along with a detailed analysis, but in brief: the largest acceptable timestep is 0.0025, and a particularly bad choice would be 0.015 as it does not reach equilibrium.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Running Simulations under Specific Conditions&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 13. We need to choose gamma so that the temperature is correct T=fancy T if we multiply every velocity by γ. Solve the following two equations to determine gamma:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_2.png|center|200px]]&lt;br /&gt;
&lt;br /&gt;
Starting from the 2&amp;lt;sup&amp;gt;nd&amp;lt;/sup&amp;gt; equation,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_1.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 14: Use the manual to find out the importance of the three numbers 100 1000 100000. 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 (&amp;quot;run 100000&amp;quot;), how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Firstly, averages are taken for blocks of 100 values at a time to form the first set of averaged values (where av&amp;lt;sub&amp;gt;100,n&amp;lt;/sub&amp;gt; is the average value for the n&amp;lt;sup&amp;gt;th&amp;lt;/sup&amp;gt; block of 100 values). These values are then themselves averaged in blocks of 1000 values to form a second set of averaged values (av&amp;lt;sub&amp;gt;100,1&amp;lt;/sub&amp;gt; + av&amp;lt;sub&amp;gt;100,2&amp;lt;/sub&amp;gt; + ... + av&amp;lt;sub&amp;gt;100,1000&amp;lt;/sub&amp;gt;)/1000 = av&amp;lt;sub&amp;gt;1000,1&amp;lt;/sub&amp;gt;. Finally, these values are averaged once more in blocks of 100000 values.&lt;br /&gt;
&lt;br /&gt;
The amount of time simulated can be found by multiplying the number of steps by the value of the timestep (eg. 100,000 steps of a 0.001 timestep simulates 100 seconds).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 15: Plot density as a function of temperature for both of the pressures that you simulated. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figure 2 in &amp;quot;Results and Discussion: Equations of State in the NpT Ensemble&amp;quot; for the plot and subsequent discussion.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Heat Capacity Calculation&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 16: Run simulations at densities of 0.2, 0.8 and temperatures of 2.0, 2.2, 2.4, 2.6, 2.8, plotting C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;/V as a function of temperature, where V is the volume of the simulation cell, for both of your densities. Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the plot of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;/V as a function of temperature, please see Figure 3 in &amp;quot;Results and Discussion: Calculation of Heat Capacity&amp;quot; and the subsequent discussion on why the trend was as expected. A copy of the input script can be found in &amp;quot;Method: Part 3: Calculation of Heat Capacity&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Structural Properties and the Radial Distribution Function&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 17: Plot the RDFs for the three systems on the same axes. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figure 4 in &amp;quot;Results and Discussion: Radial Distribution Functions&amp;quot; for the plot and analysis. &lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Dynamical Properties and the Diffusion Coefficient&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 18: Make a plot for each of your simulations, showing the mean squared displacement as a function of timestep. Are these as you would expect? Estimate D in each case. Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figures 6-11 and Table 1 in &amp;quot;Results and Discussion: Diffusion Coefficient&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 19: Evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator. On the same graph, with x range 0 to 500, plot C(τ) with Ω = 1/(2π) and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. Why is the harmonic oscillator VACF very different to the Lennard Jones solid and liquid?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_3.png|700px]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_2.png|700px]]&lt;br /&gt;
&lt;br /&gt;
See also &amp;quot;Results and Discussion: Diffusion Coefficient&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 20: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Results and Discussion: Diffusion Coefficient&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665591</id>
		<title>Rep:Gm1110LiquidSim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665591"/>
		<updated>2018-02-16T14:45:01Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: /* Tasks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Preliminary tests were conducted to determine a suitable timestep value for simulations into a Lennard-Jones fluid (0.0025 s). It was shown that the density of the systems decreased with an increase in temperature, and that running the simulations at higher pressures led to a greater deviation from ideality. A further investigation into heat capacity showed that ease of heating increases as temperature increases, and that heat capacity decreases for lower density systems. &lt;br /&gt;
&lt;br /&gt;
The radial distribution functions calculated confirmed that the simulations were producing structurally accurate systems for solid, liquid and vapour phases, allowing for calculation of the diffusion coefficients via the mean square displacement method and the velocity autocorrelation function.&lt;br /&gt;
&lt;br /&gt;
For the more accurate 1,000,000 atom simulation, the diffusion coefficients were calculated to be -6.83x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;, 0.0698 and 2.47 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; for the solid, liquid and vapour phases respectively using the mean square displacement method, and 4.55x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;, 0.0901 and 3.27 m&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; using the velocity autocorrelation function. &lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
The process of diffusion is important in all aspects of life, from the perfume industry&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://onlinelibrary.wiley.com/doi/10.1002/aic.14106/epdf&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt; to insulation&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;https://ac.els-cdn.com/S0142061513002032/1-s2.0-S0142061513002032-main.pdf?_tid=958b3390-1323-11e8-8822-00000aacb360&amp;amp;acdnat=1518790607_86d8f9f122450bef4ef7e3fc82f97936&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;. For example, fragrance companies may need to know how long their perfume will last before it completely diffuses away after application, or the way in which the different components of their fragrance interact. In the case of insulation, investigating how thermal energy diffuses through different materials is very important for improving their efficiencies. Computer simulations are often used nowadays to predict the time taken for certain processes to occur, and the mechanisms that drive them, and these results can used as a preliminary basis to conduct physical experiments.&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
The main aim of the experiment was to determine the diffusion coefficient for the solid, liquid and vapour phases of a Lennard-Jones fluid using both the mean squared displacement method and velocity autocorrelation function method.&lt;br /&gt;
&lt;br /&gt;
In order to achieve this, it was first necessary to determine an appropriate timestep with which to run simulations, and investigate the effect of temperature and pressure on the density of the system. Other aims included seeing how heat capacity varied as a function of temperature for different densities, and calculating the radial distribution function for the three phases from simulations using VMD.    &lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
All simulations of the Lennard-Jones fluid were run using the LAMMPS software, and all quantities used were in reduced units.&lt;br /&gt;
&lt;br /&gt;
=== Part 1: Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
A simulation box consisting of 10 x 10 x 10 unit cells of a simple cubic lattice with an atomic density of 0.8 was defined. The atomic mass was set to 1.0 and the Lennard-Jones pairwise interaction cutoff distance was set to 3.0. The pairwise forcefield coefficients ε (potential well depth) and σ (zero-potential distance) were both set to 1.0. Five simulations were run for differing timestep values (0.0010, 0.0025, 0.0075, 0.0100 and 0.0150).&lt;br /&gt;
&lt;br /&gt;
=== Part 2: Equations of State in the NpT Ensemble ===&lt;br /&gt;
The simulation box was increased to consist of 15 x 15 x 15 unit cells of the same simple cubic lattice defined in part 1. A total of ten simulations were run in the NpT ensemble, varying temperature (2.0, 4.0, 6.0, 8.0 and 10.0) at two different densities (1.8 and 2.8) using the timestep value of 0.0025 determined in Part 1.&lt;br /&gt;
&lt;br /&gt;
=== Part 3: Calculation of Heat Capacity ===&lt;br /&gt;
The simulation box from Part 2 was used, with the density altered to take the values 0.2 and 0.8. Five simulations were run for each, with varying values of temperature (2.0, 2.2, 2.4, 2.6 and 2.8). A copy of the script written for this simulation can be found by clicking the image below:&lt;br /&gt;
[[File:gm1110_LS_M_3_1.png|centre|thumb|Copy of Script]]&lt;br /&gt;
&lt;br /&gt;
=== Part 4: Radial Distribution Functions ===&lt;br /&gt;
The simulation boxes used previously were altered to take a timestep of 0.002 and a L-J cutoff distance of 3.2, after which the solid, liquid and vapour phases were defined as having (density, temperature) values of (1.2, 1.2), (0.8, 1.2) and (0.05, 1.1) respectively&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;https://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;. In particular, the solid phase was defined as having a face-centred cubic lattice, instead of the simple cubic lattice used for the liquid and vapour phases. VMD was used to analyse the trajectories for the three phases, with the distance between points in the generated RDF set to 0.05.&lt;br /&gt;
&lt;br /&gt;
=== Part 5: Diffusion Coefficient ===&lt;br /&gt;
The results from Part 4 were used to graph the mean squared displacement as a function of time, after which the gradient of the linear portion of the graph was extracted and used to calculate the diffusion coefficient from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_M_5_1.png|centre|150px]]&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were also calculated from the velocity autocorrelation function from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_M_5_2.png|centre|180px]]&lt;br /&gt;
&lt;br /&gt;
where [[File:gm1110_LS_M_5_3.png|150px]] is the velocity autocorrelation function.&lt;br /&gt;
&lt;br /&gt;
==Results and Discussion==&lt;br /&gt;
&lt;br /&gt;
=== Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
Simulations were run using the five different timesteps 0.0010, 0.0025, 0.0075, 0.0100 and 0.0150, and a plot of the results can be seen below (Figure 1).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_1_1.png|centre|thumb|Figure 1. A plot of total energy (reduced units) against time comparing simulations run using five different timestep values]]&lt;br /&gt;
&lt;br /&gt;
It was observed that the simulation run with a timestep of 0.0150 did not equilibrate. This was thought to have potentially been due to the timestep being too large, and therefore the simulation was missing too much detail to accurately simulate the fluid. The simulations run for timesteps of 0.0100 and 0.0075 did equilibrate (supporting the previous hypothesis that the 0.0150 timestep was too large), but converged at the wrong energy (approximately -3.181 and -3.183 respectively), indicating that the timesteps were still not quite small enough.&lt;br /&gt;
&lt;br /&gt;
The final two simulations run at timesteps of 0.0025 and 0.0010 both equilibrated to the same, correct energy (approximately -3.184), indicating that both would be suitable for use in further simulations. It is preferable, however, to maximise the timestep when running simulations as a smaller timestep requires more data points, and is therefore more “expensive” and takes longer to run for no real added value. Hence it was decided that a timestep of 0.0025 would be suitable for running further simulations.    &lt;br /&gt;
&lt;br /&gt;
=== Equations of State in the NpT Ensemble ===&lt;br /&gt;
Although specific values for temperature and pressure are specified for the simulations, in reality, the temperature and pressure of a system fluctuates over time and may therefore deviate away from the inputted values. Hence, the simulation calculates the pressure of the system at the end of every timestep, and adjusts the size of the simulation box such that the pressure once again corresponds to the specified value. Pressure controlled simulations are thus in the NpT ensemble and so volume (and therefore density) is not constant.&lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the resulting densities were plotted against temperature, along with values predicted by the ideal gas law and can be seen below (Figure 2).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_2_1.png|centre|thumb|Figure 2. Plot showing density as a function of temperature at pressures of 1.8 and 2.8 (all in reduced units), with error bars, and a plot of the densities predicted by the ideal gas law]]&lt;br /&gt;
&lt;br /&gt;
Clearly, the simulated densities are lower than those predicted by the ideal gas law, and the discrepancy increases with increasing pressure. This is due to the fact that the ideal gas law assumes perfectly elastic collisions between point particles, but in reality, intermolecular repulsive forces cause the simulated densities to be lower. In addition, an increase in pressure causes the molecules to be pushed closer together and increases both the number of collisions as well as the repulsive forces, leading to a greater deviation from ideality.    &lt;br /&gt;
&lt;br /&gt;
=== Calculation of Heat Capacity ===&lt;br /&gt;
Switching to the NVT ensemble, the heat capacity of the system can be determined by considering the magnitude of fluctuations in the system’s energy from its average equilibrium state from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_1.png|centre|250px]]            &lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the average heat capacities were plotted as a function of temperature (Figure 3).        &lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_2.png|centre|thumb|Figure 3. Plot of average heat capacity against temperature for densities of 0.8 and 0.2]]Heat capacity is a measure of the amount of energy required to increase the temperature of a substance. It is clear that the heat capacity is lower, and therefore easier to heat, for lower density systems as the particles are more spaced apart. This means that they are able to gain thermal energy more easily as they have more room for increased vibrations without an increase of repulsive forces or collisions compared to a higher density system. It was also noted that the heat capacity decreased with increasing temperature. This is due to the fact that at higher temperatures, the gap between energy levels decreases as the particles occupy higher energy states, thus making it easier for the particles to be promoted to higher energy levels.&lt;br /&gt;
&lt;br /&gt;
It is also clear that heat capacity decreases with increasing temperature (ie it is easier to heat a hotter object). This is due to the fact that as temperature increases, more rotational and vibrational energy levels become thermally accessible, leading to a faster increase in internal energy and thus a lower heat capacity.&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Functions ===&lt;br /&gt;
Radial distribution functions (g(r)) were calculated for the solid, liquid and vapour phases (see Figure 4) to check that the simulations were correctly reproducing the structural features of each phase. RDFs are essentially probability distribution functions for the likelihood of finding a particle at a given distance r away from a reference particle, and also gives information on the coordination sphere of the reference particle. The integral of the RDF (Figure 5) is also useful as it gives information on the number of atoms found at a distance r.&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_1.png|centre|thumb|Figure 4. Radial distribution function against displacement from a reference atom]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_2.png|centre|thumb|Figure 5. Integral of the radial distribution function against displacement]]&lt;br /&gt;
&lt;br /&gt;
For small r, all three phases have g(r) ~ 0, indicating an atomic density of zero as there exists a minimum distance at which atoms can approach each other. Also, g(r) tends to 1 for all three phases with increasing r, which represents the fact that the local density becomes equivalent to the mean density of the system as a whole&amp;lt;ref&amp;gt;Frenkel, Daan; Smit, Berend (2002). &#039;&#039;Understanding molecular simulation from algorithms to applications&#039;&#039; (2nd ed.). San Diego: Academic Press. ISBN 0122673514.&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The graph of the solid phase shows sharp oscillating peaks, indicating that the atoms are strongly confined to their positions in the crystalline lattice, and the high degree of ordering means that although the osciallations do tend to g(r) = 1 for large r, this occurs much more slowly than for the other two phases&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;https://en.wikibooks.org/wiki/Molecular_Simulation/Radial_Distribution_Functions&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;. The first peak corresponds to the atoms nearest neighbours (of which there are 12), and the second and third peak correspond to the second and third nearest neighbours respectively (of which there are 6 and 24). &lt;br /&gt;
&lt;br /&gt;
The graph for the liquid phase shows broad, gently oscillating peaks that rapidly decay to g(r) = 1. As with the solid phase, the oscillations indicate some structure in the system whereby the atoms are loosely bound to their original positions, but the broader peaks indicate that they have much more freedom to move away from their positions. &lt;br /&gt;
&lt;br /&gt;
The graph for the vapour phase shows a single peak at approximately r = 1, after which it quickly decays back to g(r) = 1. This shows that the structure has very little to no order, and the particles are free to move unbound to any specific position. &lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|MSD Graphs (1,000 atoms)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_7.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_8.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_9.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 6. Graph of solid phase MSD for 1,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 7. Graph of fluid phase MSD for 1,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 8. Graph of vapour phase MSD for 1,000 atoms(with trendline)&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The general trends displayed in Figures 6-8 are as expected: the simulation does eventually establish linear behaviour, with the gradients increasing exponentially going from the solid to vapour phases. It is well known that diffusion in the vapour phase occurs much more readily than in the liquid phase, and more readily in the liquid phase than solid phase, and given that the diffusion coefficient is linearly correlated to the gradient of the mean square displacement, it was expected that the gradients of the graphs would increase in this manner. It was noted that the linear region of the solid phase plot (Figure 6) was quite noisy, but it was thought that this may be due to the small simulation size of 1,000 atoms.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|MSD Graphs (1,000,000 atoms)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_10.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_11.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_12.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 9. Graph of solid phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 10. Graph of fluid phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 11. Graph of vapour phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results from the simulation with 1,000,000 atoms (Figures 9-11) support the observations made with the 1,000 atom simulation. The only noticeable improvement from the 1,000 atom simulation was the reduction in noise of the linear region of the solid phase (Figure 9), suggesting that the assumption made previously to consider the more noisy region in Figure 6 as linear was correct, and that increasing the sample size did indeed improve the smoothness and accuracy of the curve.&lt;br /&gt;
&lt;br /&gt;
The gradient for the linear region of the plots were determined and used to calculate the diffusion coefficients (see table below).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=4|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Solid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Liquid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Vapour Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-6.17x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0688 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;2.27 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-6.83x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0698 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;2.47 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The results obtained are reasonable figures. In comparison with the 1,000,000 atom simulation, the values calculated for the diffusion coefficient with 1,000 atoms yielded a 9.7%, 1.4% and 8.0% error for the solid, liquid and vapour phases respectively. This suggests that for systems involving atoms that are at either extreme with regards to their range of motion, a larger atomic sample size would be suitable for simulations, whereas for liquids, more time-efficient simulations can be accurately conducted using the smaller 1,000 atom sample size.&lt;br /&gt;
&lt;br /&gt;
The positive values obtained for the liquid and vapour phase show that the atoms diffuse away from their original positions over time, whereas the negative value obtained for the solid phase arises as a consequence of attractive nearest neighbour interactions within the lattice structure&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;https://journals.aps.org/prb/pdf/10.1103/PhysRevB.80.104203&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient was also calculated using the velocity autocorrelation function (henceforth VACF).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|VACF Graphs&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_13.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_14.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_15.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 12. Graph of solid, liquid phase and simple harmonic oscillator VACF for 1,000 atoms&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 13. Running integral of solid, fluid and vapour phase VACF for 1,000 atoms&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 14. Running integral of solid, fluid and vapour phase VACF for 1,000,000 atoms&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=4|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Solid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Liquid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Vapour Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-1.84x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0783 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;3.06 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;4.55x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0901 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;3.27 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Generally, the results show that the diffusion coefficients calculated using the VACF method and MSD method are both to the same order of magnitude, although the coefficients calculated via the VACF were 29-32% greater for the liquid and vapour phases.&lt;br /&gt;
&lt;br /&gt;
The largest source of error in estimating the diffusion coefficient using the VACF was the number of atoms used in the simulations. This can be seen more clearly in Figures 16 and 17 which compare the VACF calculated for the liquid and vapour phases. The 1,000 atom simulation is clearly more noisy than the 1,000,000 atom simulation, indicating that the 1,000,000 atom simulation increases the reliability and accuracy of the results.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|VACF Graph Comparisons&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_18.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_19.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_20.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 15. Running integral of solid phase VACF for 1,000 and 1,000,000 atom simulations&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 16. Running integral of fluid phase VACF for 1,000 and 1,000,000 atom simulations&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 17. Running integral of vapour phase VACF for 1,000 and 1,000,000 atom simulations&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
A suitable timestep with which to run the simulations was determined to be 0.0025 s. Simulations then showed that the density of the systems decreased with an increase in temperature, and that running the simulations at higher pressures led to a greater deviation from ideality. A further investigation into heat capacity showed that ease of heating increases as temperature increases, and that heat capacity decreases for lower density systems.&lt;br /&gt;
&lt;br /&gt;
The radial distribution functions calculated show that the simulations were producing structurally accurate systems for the solid, liquid and vapour phases, allowing for calculation of the diffusion coefficients via the mean square displacement method and the velocity autocorrelation function.&lt;br /&gt;
&lt;br /&gt;
For a 1,000 atom simulation, the diffusion coefficients were calculated to be -6.17x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;, 0.0688 and 2.27 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;for the solid, liquid and vapour phases respectively using the mean square displacement method, and -1.84x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;, 0.0783 and 3.06 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;using the velocity autocorrelation function. It was discovered that depending on the method used, and the specific phase being considered, that 1,000 atoms was not a sufficiently large enough sample to accurately model the systems, so 1,000,000 atom simulations were conducted.&lt;br /&gt;
&lt;br /&gt;
For a 1,000,000 atom simulation, the diffusion coefficients were calculated to be -6.83x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;, 0.0698 and 2.47 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; for the solid, liquid and vapour phases respectively using the mean square displacement method, and 4.55x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;, 0.0901 and 3.27 m&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; using the velocity autocorrelation function. &lt;br /&gt;
&lt;br /&gt;
==Tasks==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Introduction to Molecular Dynamics Simulations&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 1. For a default timestep value 0.1, estimate the positions of the maxima in the ERROR column as a function of time.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_1_1.png|centre|thumb|Figure 18. Plot showing the positions of the error maxima as a function of time, with a best fit line]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 2. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using a timestep of 0.1990 meant that the total energy did not change by more than 1% over the course of the simulation (Figure 19).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_2_1.png|centre|thumb|Figure 19. Plot showing the total energy during the simulation using a timestep of 0.1990]]&lt;br /&gt;
&lt;br /&gt;
The simulations are being run in isolated systems which requires total energy conservation, so large fluctuations in the energy would lead to inaccurate results. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 3. For a single Lennard-Jones interaction, find the separation, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;, and work out the well depth. Evaluate the integrals when σ = ε = 1.0.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i) The Lennard-Jones interaction is given by:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_1.png|200px]]&lt;br /&gt;
&lt;br /&gt;
Since r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; when ɸ = 0,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(ii) The force is given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_3.png|250px]]&lt;br /&gt;
&lt;br /&gt;
So at the separation r&amp;lt;sub&amp;gt;0 &amp;lt;/sub&amp;gt;= σ,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_4.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iii) The equilibrium separation r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs at the point at which all forces vanish, ie. when F = 0, so&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_5.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iv) And the well depth is therefore given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_6.png|270px]]&lt;br /&gt;
&lt;br /&gt;
(v)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_7.png|370px]]&lt;br /&gt;
&lt;br /&gt;
(vi)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_8.png|400px]]&lt;br /&gt;
&lt;br /&gt;
(vii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_9.png|370px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4. Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10,000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_1.png|550px]]&lt;br /&gt;
&lt;br /&gt;
For 10,000 water molecules,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_3.png|230px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 5. Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After the timestep, the atom would be at position (0.5 + 0.7, 0.5 + 0.6, 0.5 + 0.2) = (1.2, 1.1, 0.7). Applying the boundary conditions, this is equivalent to the position (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 6. The Lennard-Jones parameters for argon are sigma = 0.34nm, ε/k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt; = 120K. If the LJ cutoff is r&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 1.5 in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_1.png|140px]]&lt;br /&gt;
&lt;br /&gt;
(ii) It was previously determined in Task 1 that the well depth is - ε, so in real units,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_4.png|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(iii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_3.png|130px]]&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Equilibration&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 7. Why do you think giving atoms random starting coordinates causes problems in simulations?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If two atoms are generated too close to one another, then they would experience a large repulsive force, and would disrupt the behaviour of the surrounding atoms, causing the simulation to become inaccurate. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 8. Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_1.png|380px]]&lt;br /&gt;
&lt;br /&gt;
(ii) For a face-centred cubic lattice, note that the unit cell contains four atoms, as opposed to one atom with a simple cubic lattice. Then&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_4.png|460px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 9. Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is 1 atom contained within each unit cell. However for face-centred cubic lattices, each unit cell contains 4 atoms so four times as many atoms are created than with the simple lattice (ie. 4000 atoms).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 10. Given that we are specifying x&amp;lt;sub&amp;gt;i &amp;lt;/sub&amp;gt;(0) and v&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; (0), which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We will be using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 11. In the code section &amp;quot;Specify Timestep&amp;quot;, the second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write &amp;quot;timestep 0.001 // run 100000&amp;quot;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Defining the variable timestep allows us to reference the variable multiple times throughout the simulation if required, whilst preventing errors and making it easier to alter the code if we want to run the simulation for different timestep values. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 12. Make plots of energy, temperature, and pressure, against time for the 0.001 timestep experiment. Does the simulation reach equilibrium? How long does this take? Make a single plot of energy vs time for all of the timesteps. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice and why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_12_1.png|centre|thumb|Figure 20. Plot of energy against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_2.png|centre|thumb|Figure 21. Plot of temperature against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_3.png|centre|thumb|Figure 22. Plot of pressure against time for the 0.001 timestep experiment]]&lt;br /&gt;
&lt;br /&gt;
The 0.001 timestep experiment reaches equilibrium very quickly, within approximately 0.2s. &lt;br /&gt;
&lt;br /&gt;
A single plot of energy vs time for all of the timesteps can be found in &amp;quot;Results &amp;amp; Discussion: Investigation into Simulation Timestep in the NVE Ensemble&amp;quot; (Figure 1), along with a detailed analysis, but in brief: the largest acceptable timestep is 0.0025, and a particularly bad choice would be 0.015 as it does not reach equilibrium.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Running Simulations under Specific Conditions&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 13. We need to choose gamma so that the temperature is correct T=fancy T if we multiply every velocity by γ. Solve the following two equations to determine gamma:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_2.png|center|200px]]&lt;br /&gt;
&lt;br /&gt;
Starting from the 2&amp;lt;sup&amp;gt;nd&amp;lt;/sup&amp;gt; equation,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_1.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 14: Use the manual to find out the importance of the three numbers 100 1000 100000. 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 (&amp;quot;run 100000&amp;quot;), how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Firstly, averages are taken for blocks of 100 values at a time to form the first set of averaged values (where av&amp;lt;sub&amp;gt;100,n&amp;lt;/sub&amp;gt; is the average value for the n&amp;lt;sup&amp;gt;th&amp;lt;/sup&amp;gt; block of 100 values). These values are then themselves averaged in blocks of 1000 values to form a second set of averaged values (av&amp;lt;sub&amp;gt;100,1&amp;lt;/sub&amp;gt; + av&amp;lt;sub&amp;gt;100,2&amp;lt;/sub&amp;gt; + ... + av&amp;lt;sub&amp;gt;100,1000&amp;lt;/sub&amp;gt;)/1000 = av&amp;lt;sub&amp;gt;1000,1&amp;lt;/sub&amp;gt;. Finally, these values are averaged once more in blocks of 100000 values.&lt;br /&gt;
&lt;br /&gt;
The amount of time simulated can be found by multiplying the number of steps by the value of the timestep (eg. 100,000 steps of a 0.001 timestep simulates 100 seconds).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 15: Plot density as a function of temperature for both of the pressures that you simulated. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figure 2 in &amp;quot;Results and Discussion: Equations of State in the NpT Ensemble&amp;quot; for the plot and subsequent discussion.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Heat Capacity Calculation&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 16: Run simulations at densities of 0.2, 0.8 and temperatures of 2.0, 2.2, 2.4, 2.6, 2.8, plotting C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;/V as a function of temperature, where V is the volume of the simulation cell, for both of your densities. Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the plot of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;/V as a function of temperature, please see Figure 3 in &amp;quot;Results and Discussion: Calculation of Heat Capacity&amp;quot; and the subsequent discussion on why the trend was as expected. A copy of the input script can be found in &amp;quot;Method: Part 3: Calculation of Heat Capacity&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Structural Properties and the Radial Distribution Function&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 17: Plot the RDFs for the three systems on the same axes. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figure 4 in &amp;quot;Results and Discussion: Radial Distribution Functions&amp;quot; for the plot and analysis. &lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Dynamical Properties and the Diffusion Coefficient&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 18: Make a plot for each of your simulations, showing the mean squared displacement as a function of timestep. Are these as you would expect? Estimate D in each case. Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figures 6-11 and Table 1 in &amp;quot;Results and Discussion: Diffusion Coefficient&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 19: Evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator. On the same graph, with x range 0 to 500, plot C(τ) with Ω = 1/(2π) and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. Why is the harmonic oscillator VACF very different to the Lennard Jones solid and liquid?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_3.png|700px]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_2.png|700px]]&lt;br /&gt;
&lt;br /&gt;
See also &amp;quot;Results and Discussion: Diffusion Coefficient&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 20: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Results and Discussion: Diffusion Coefficient&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665590</id>
		<title>Rep:Gm1110LiquidSim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665590"/>
		<updated>2018-02-16T14:43:49Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Preliminary tests were conducted to determine a suitable timestep value for simulations into a Lennard-Jones fluid (0.0025 s). It was shown that the density of the systems decreased with an increase in temperature, and that running the simulations at higher pressures led to a greater deviation from ideality. A further investigation into heat capacity showed that ease of heating increases as temperature increases, and that heat capacity decreases for lower density systems. &lt;br /&gt;
&lt;br /&gt;
The radial distribution functions calculated confirmed that the simulations were producing structurally accurate systems for solid, liquid and vapour phases, allowing for calculation of the diffusion coefficients via the mean square displacement method and the velocity autocorrelation function.&lt;br /&gt;
&lt;br /&gt;
For the more accurate 1,000,000 atom simulation, the diffusion coefficients were calculated to be -6.83x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;, 0.0698 and 2.47 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; for the solid, liquid and vapour phases respectively using the mean square displacement method, and 4.55x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;, 0.0901 and 3.27 m&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; using the velocity autocorrelation function. &lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
The process of diffusion is important in all aspects of life, from the perfume industry&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://onlinelibrary.wiley.com/doi/10.1002/aic.14106/epdf&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt; to insulation&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;https://ac.els-cdn.com/S0142061513002032/1-s2.0-S0142061513002032-main.pdf?_tid=958b3390-1323-11e8-8822-00000aacb360&amp;amp;acdnat=1518790607_86d8f9f122450bef4ef7e3fc82f97936&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;. For example, fragrance companies may need to know how long their perfume will last before it completely diffuses away after application, or the way in which the different components of their fragrance interact. In the case of insulation, investigating how thermal energy diffuses through different materials is very important for improving their efficiencies. Computer simulations are often used nowadays to predict the time taken for certain processes to occur, and the mechanisms that drive them, and these results can used as a preliminary basis to conduct physical experiments.&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
The main aim of the experiment was to determine the diffusion coefficient for the solid, liquid and vapour phases of a Lennard-Jones fluid using both the mean squared displacement method and velocity autocorrelation function method.&lt;br /&gt;
&lt;br /&gt;
In order to achieve this, it was first necessary to determine an appropriate timestep with which to run simulations, and investigate the effect of temperature and pressure on the density of the system. Other aims included seeing how heat capacity varied as a function of temperature for different densities, and calculating the radial distribution function for the three phases from simulations using VMD.    &lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
All simulations of the Lennard-Jones fluid were run using the LAMMPS software, and all quantities used were in reduced units.&lt;br /&gt;
&lt;br /&gt;
=== Part 1: Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
A simulation box consisting of 10 x 10 x 10 unit cells of a simple cubic lattice with an atomic density of 0.8 was defined. The atomic mass was set to 1.0 and the Lennard-Jones pairwise interaction cutoff distance was set to 3.0. The pairwise forcefield coefficients ε (potential well depth) and σ (zero-potential distance) were both set to 1.0. Five simulations were run for differing timestep values (0.0010, 0.0025, 0.0075, 0.0100 and 0.0150).&lt;br /&gt;
&lt;br /&gt;
=== Part 2: Equations of State in the NpT Ensemble ===&lt;br /&gt;
The simulation box was increased to consist of 15 x 15 x 15 unit cells of the same simple cubic lattice defined in part 1. A total of ten simulations were run in the NpT ensemble, varying temperature (2.0, 4.0, 6.0, 8.0 and 10.0) at two different densities (1.8 and 2.8) using the timestep value of 0.0025 determined in Part 1.&lt;br /&gt;
&lt;br /&gt;
=== Part 3: Calculation of Heat Capacity ===&lt;br /&gt;
The simulation box from Part 2 was used, with the density altered to take the values 0.2 and 0.8. Five simulations were run for each, with varying values of temperature (2.0, 2.2, 2.4, 2.6 and 2.8). A copy of the script written for this simulation can be found by clicking the image below:&lt;br /&gt;
[[File:gm1110_LS_M_3_1.png|centre|thumb|Copy of Script]]&lt;br /&gt;
&lt;br /&gt;
=== Part 4: Radial Distribution Functions ===&lt;br /&gt;
The simulation boxes used previously were altered to take a timestep of 0.002 and a L-J cutoff distance of 3.2, after which the solid, liquid and vapour phases were defined as having (density, temperature) values of (1.2, 1.2), (0.8, 1.2) and (0.05, 1.1) respectively&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;https://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;. In particular, the solid phase was defined as having a face-centred cubic lattice, instead of the simple cubic lattice used for the liquid and vapour phases. VMD was used to analyse the trajectories for the three phases, with the distance between points in the generated RDF set to 0.05.&lt;br /&gt;
&lt;br /&gt;
=== Part 5: Diffusion Coefficient ===&lt;br /&gt;
The results from Part 4 were used to graph the mean squared displacement as a function of time, after which the gradient of the linear portion of the graph was extracted and used to calculate the diffusion coefficient from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_M_5_1.png|centre|150px]]&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were also calculated from the velocity autocorrelation function from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_M_5_2.png|centre|180px]]&lt;br /&gt;
&lt;br /&gt;
where [[File:gm1110_LS_M_5_3.png|150px]] is the velocity autocorrelation function.&lt;br /&gt;
&lt;br /&gt;
==Results and Discussion==&lt;br /&gt;
&lt;br /&gt;
=== Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
Simulations were run using the five different timesteps 0.0010, 0.0025, 0.0075, 0.0100 and 0.0150, and a plot of the results can be seen below (Figure 1).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_1_1.png|centre|thumb|Figure 1. A plot of total energy (reduced units) against time comparing simulations run using five different timestep values]]&lt;br /&gt;
&lt;br /&gt;
It was observed that the simulation run with a timestep of 0.0150 did not equilibrate. This was thought to have potentially been due to the timestep being too large, and therefore the simulation was missing too much detail to accurately simulate the fluid. The simulations run for timesteps of 0.0100 and 0.0075 did equilibrate (supporting the previous hypothesis that the 0.0150 timestep was too large), but converged at the wrong energy (approximately -3.181 and -3.183 respectively), indicating that the timesteps were still not quite small enough.&lt;br /&gt;
&lt;br /&gt;
The final two simulations run at timesteps of 0.0025 and 0.0010 both equilibrated to the same, correct energy (approximately -3.184), indicating that both would be suitable for use in further simulations. It is preferable, however, to maximise the timestep when running simulations as a smaller timestep requires more data points, and is therefore more “expensive” and takes longer to run for no real added value. Hence it was decided that a timestep of 0.0025 would be suitable for running further simulations.    &lt;br /&gt;
&lt;br /&gt;
=== Equations of State in the NpT Ensemble ===&lt;br /&gt;
Although specific values for temperature and pressure are specified for the simulations, in reality, the temperature and pressure of a system fluctuates over time and may therefore deviate away from the inputted values. Hence, the simulation calculates the pressure of the system at the end of every timestep, and adjusts the size of the simulation box such that the pressure once again corresponds to the specified value. Pressure controlled simulations are thus in the NpT ensemble and so volume (and therefore density) is not constant.&lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the resulting densities were plotted against temperature, along with values predicted by the ideal gas law and can be seen below (Figure 2).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_2_1.png|centre|thumb|Figure 2. Plot showing density as a function of temperature at pressures of 1.8 and 2.8 (all in reduced units), with error bars, and a plot of the densities predicted by the ideal gas law]]&lt;br /&gt;
&lt;br /&gt;
Clearly, the simulated densities are lower than those predicted by the ideal gas law, and the discrepancy increases with increasing pressure. This is due to the fact that the ideal gas law assumes perfectly elastic collisions between point particles, but in reality, intermolecular repulsive forces cause the simulated densities to be lower. In addition, an increase in pressure causes the molecules to be pushed closer together and increases both the number of collisions as well as the repulsive forces, leading to a greater deviation from ideality.    &lt;br /&gt;
&lt;br /&gt;
=== Calculation of Heat Capacity ===&lt;br /&gt;
Switching to the NVT ensemble, the heat capacity of the system can be determined by considering the magnitude of fluctuations in the system’s energy from its average equilibrium state from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_1.png|centre|250px]]            &lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the average heat capacities were plotted as a function of temperature (Figure 3).        &lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_2.png|centre|thumb|Figure 3. Plot of average heat capacity against temperature for densities of 0.8 and 0.2]]Heat capacity is a measure of the amount of energy required to increase the temperature of a substance. It is clear that the heat capacity is lower, and therefore easier to heat, for lower density systems as the particles are more spaced apart. This means that they are able to gain thermal energy more easily as they have more room for increased vibrations without an increase of repulsive forces or collisions compared to a higher density system. It was also noted that the heat capacity decreased with increasing temperature. This is due to the fact that at higher temperatures, the gap between energy levels decreases as the particles occupy higher energy states, thus making it easier for the particles to be promoted to higher energy levels.&lt;br /&gt;
&lt;br /&gt;
It is also clear that heat capacity decreases with increasing temperature (ie it is easier to heat a hotter object). This is due to the fact that as temperature increases, more rotational and vibrational energy levels become thermally accessible, leading to a faster increase in internal energy and thus a lower heat capacity.&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Functions ===&lt;br /&gt;
Radial distribution functions (g(r)) were calculated for the solid, liquid and vapour phases (see Figure 4) to check that the simulations were correctly reproducing the structural features of each phase. RDFs are essentially probability distribution functions for the likelihood of finding a particle at a given distance r away from a reference particle, and also gives information on the coordination sphere of the reference particle. The integral of the RDF (Figure 5) is also useful as it gives information on the number of atoms found at a distance r.&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_1.png|centre|thumb|Figure 4. Radial distribution function against displacement from a reference atom]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_2.png|centre|thumb|Figure 5. Integral of the radial distribution function against displacement]]&lt;br /&gt;
&lt;br /&gt;
For small r, all three phases have g(r) ~ 0, indicating an atomic density of zero as there exists a minimum distance at which atoms can approach each other. Also, g(r) tends to 1 for all three phases with increasing r, which represents the fact that the local density becomes equivalent to the mean density of the system as a whole&amp;lt;ref&amp;gt;Frenkel, Daan; Smit, Berend (2002). &#039;&#039;Understanding molecular simulation from algorithms to applications&#039;&#039; (2nd ed.). San Diego: Academic Press. ISBN 0122673514.&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The graph of the solid phase shows sharp oscillating peaks, indicating that the atoms are strongly confined to their positions in the crystalline lattice, and the high degree of ordering means that although the osciallations do tend to g(r) = 1 for large r, this occurs much more slowly than for the other two phases&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;https://en.wikibooks.org/wiki/Molecular_Simulation/Radial_Distribution_Functions&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;. The first peak corresponds to the atoms nearest neighbours (of which there are 12), and the second and third peak correspond to the second and third nearest neighbours respectively (of which there are 6 and 24). &lt;br /&gt;
&lt;br /&gt;
The graph for the liquid phase shows broad, gently oscillating peaks that rapidly decay to g(r) = 1. As with the solid phase, the oscillations indicate some structure in the system whereby the atoms are loosely bound to their original positions, but the broader peaks indicate that they have much more freedom to move away from their positions. &lt;br /&gt;
&lt;br /&gt;
The graph for the vapour phase shows a single peak at approximately r = 1, after which it quickly decays back to g(r) = 1. This shows that the structure has very little to no order, and the particles are free to move unbound to any specific position. &lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|MSD Graphs (1,000 atoms)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_7.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_8.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_9.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 6. Graph of solid phase MSD for 1,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 7. Graph of fluid phase MSD for 1,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 8. Graph of vapour phase MSD for 1,000 atoms(with trendline)&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The general trends displayed in Figures 6-8 are as expected: the simulation does eventually establish linear behaviour, with the gradients increasing exponentially going from the solid to vapour phases. It is well known that diffusion in the vapour phase occurs much more readily than in the liquid phase, and more readily in the liquid phase than solid phase, and given that the diffusion coefficient is linearly correlated to the gradient of the mean square displacement, it was expected that the gradients of the graphs would increase in this manner. It was noted that the linear region of the solid phase plot (Figure 6) was quite noisy, but it was thought that this may be due to the small simulation size of 1,000 atoms.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|MSD Graphs (1,000,000 atoms)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_10.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_11.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_12.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 9. Graph of solid phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 10. Graph of fluid phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 11. Graph of vapour phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results from the simulation with 1,000,000 atoms (Figures 9-11) support the observations made with the 1,000 atom simulation. The only noticeable improvement from the 1,000 atom simulation was the reduction in noise of the linear region of the solid phase (Figure 9), suggesting that the assumption made previously to consider the more noisy region in Figure 6 as linear was correct, and that increasing the sample size did indeed improve the smoothness and accuracy of the curve.&lt;br /&gt;
&lt;br /&gt;
The gradient for the linear region of the plots were determined and used to calculate the diffusion coefficients (see table below).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=4|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Solid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Liquid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Vapour Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-6.17x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0688 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;2.27 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-6.83x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0698 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;2.47 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The results obtained are reasonable figures. In comparison with the 1,000,000 atom simulation, the values calculated for the diffusion coefficient with 1,000 atoms yielded a 9.7%, 1.4% and 8.0% error for the solid, liquid and vapour phases respectively. This suggests that for systems involving atoms that are at either extreme with regards to their range of motion, a larger atomic sample size would be suitable for simulations, whereas for liquids, more time-efficient simulations can be accurately conducted using the smaller 1,000 atom sample size.&lt;br /&gt;
&lt;br /&gt;
The positive values obtained for the liquid and vapour phase show that the atoms diffuse away from their original positions over time, whereas the negative value obtained for the solid phase arises as a consequence of attractive nearest neighbour interactions within the lattice structure&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;https://journals.aps.org/prb/pdf/10.1103/PhysRevB.80.104203&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient was also calculated using the velocity autocorrelation function (henceforth VACF).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|VACF Graphs&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_13.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_14.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_15.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 12. Graph of solid, liquid phase and simple harmonic oscillator VACF for 1,000 atoms&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 13. Running integral of solid, fluid and vapour phase VACF for 1,000 atoms&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 14. Running integral of solid, fluid and vapour phase VACF for 1,000,000 atoms&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=4|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Solid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Liquid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Vapour Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-1.84x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0783 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;3.06 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;4.55x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0901 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;3.27 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Generally, the results show that the diffusion coefficients calculated using the VACF method and MSD method are both to the same order of magnitude, although the coefficients calculated via the VACF were 29-32% greater for the liquid and vapour phases.&lt;br /&gt;
&lt;br /&gt;
The largest source of error in estimating the diffusion coefficient using the VACF was the number of atoms used in the simulations. This can be seen more clearly in Figures 16 and 17 which compare the VACF calculated for the liquid and vapour phases. The 1,000 atom simulation is clearly more noisy than the 1,000,000 atom simulation, indicating that the 1,000,000 atom simulation increases the reliability and accuracy of the results.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|VACF Graph Comparisons&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_18.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_19.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_20.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 15. Running integral of solid phase VACF for 1,000 and 1,000,000 atom simulations&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 16. Running integral of fluid phase VACF for 1,000 and 1,000,000 atom simulations&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 17. Running integral of vapour phase VACF for 1,000 and 1,000,000 atom simulations&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
A suitable timestep with which to run the simulations was determined to be 0.0025 s. Simulations then showed that the density of the systems decreased with an increase in temperature, and that running the simulations at higher pressures led to a greater deviation from ideality. A further investigation into heat capacity showed that ease of heating increases as temperature increases, and that heat capacity decreases for lower density systems.&lt;br /&gt;
&lt;br /&gt;
The radial distribution functions calculated show that the simulations were producing structurally accurate systems for the solid, liquid and vapour phases, allowing for calculation of the diffusion coefficients via the mean square displacement method and the velocity autocorrelation function.&lt;br /&gt;
&lt;br /&gt;
For a 1,000 atom simulation, the diffusion coefficients were calculated to be -6.17x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;, 0.0688 and 2.27 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;for the solid, liquid and vapour phases respectively using the mean square displacement method, and -1.84x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;, 0.0783 and 3.06 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;using the velocity autocorrelation function. It was discovered that depending on the method used, and the specific phase being considered, that 1,000 atoms was not a sufficiently large enough sample to accurately model the systems, so 1,000,000 atom simulations were conducted.&lt;br /&gt;
&lt;br /&gt;
For a 1,000,000 atom simulation, the diffusion coefficients were calculated to be -6.83x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;, 0.0698 and 2.47 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; for the solid, liquid and vapour phases respectively using the mean square displacement method, and 4.55x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;, 0.0901 and 3.27 m&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; using the velocity autocorrelation function. &lt;br /&gt;
&lt;br /&gt;
==Tasks==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Introduction to Molecular Dynamics Simulations&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 1. For a default timestep value 0.1, estimate the positions of the maxima in the ERROR column as a function of time.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_1_1.png|centre|thumb|Figure 18. Plot showing the positions of the error maxima as a function of time, with a best fit line]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 2. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using a timestep of 0.1990 meant that the total energy did not change by more than 1% over the course of the simulation (Figure 19).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_2_1.png|centre|thumb|Figure 19. Plot showing the total energy during the simulation using a timestep of 0.1990]]&lt;br /&gt;
&lt;br /&gt;
The simulations are being run in isolated systems which requires total energy conservation, so large fluctuations in the energy would lead to inaccurate results. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 3. For a single Lennard-Jones interaction, find the separation, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;, and work out the well depth. Evaluate the integrals when σ = ε = 1.0.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i) The Lennard-Jones interaction is given by:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_1.png|200px]]&lt;br /&gt;
&lt;br /&gt;
Since r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; when ɸ = 0,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(ii) The force is given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_3.png|250px]]&lt;br /&gt;
&lt;br /&gt;
So at the separation r&amp;lt;sub&amp;gt;0 &amp;lt;/sub&amp;gt;= σ,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_4.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iii) The equilibrium separation r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs at the point at which all forces vanish, ie. when F = 0, so&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_5.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iv) And the well depth is therefore given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_6.png|270px]]&lt;br /&gt;
&lt;br /&gt;
(v)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_7.png|370px]]&lt;br /&gt;
&lt;br /&gt;
(vi)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_8.png|400px]]&lt;br /&gt;
&lt;br /&gt;
(vii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_9.png|370px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4. Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10,000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_1.png|550px]]&lt;br /&gt;
&lt;br /&gt;
For 10,000 water molecules,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_3.png|230px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 5. Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After the timestep, the atom would be at position (0.5 + 0.7, 0.5 + 0.6, 0.5 + 0.2) = (1.2, 1.1, 0.7). Applying the boundary conditions, this is equivalent to the position (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 6. The Lennard-Jones parameters for argon are sigma = 0.34nm, ε/k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt; = 120K. If the LJ cutoff is r&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 1.5 in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_1.png|140px]]&lt;br /&gt;
&lt;br /&gt;
(ii) It was previously determined in Task 1 that the well depth is - ε, so in real units,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_4.png|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(iii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_3.png|130px]]&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Equilibration&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 7. Why do you think giving atoms random starting coordinates causes problems in simulations?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If two atoms are generated too close to one another, then they would experience a large repulsive force, and would disrupt the behaviour of the surrounding atoms, causing the simulation to become inaccurate. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 8. Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_1.png|380px]]&lt;br /&gt;
&lt;br /&gt;
(ii) For a face-centred cubic lattice, note that the unit cell contains four atoms, as opposed to one atom with a simple cubic lattice. Then&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_4.png|460px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 9. Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is 1 atom contained within each unit cell. However for face-centred cubic lattices, each unit cell contains 4 atoms so four times as many atoms are created than with the simple lattice (ie. 4000 atoms).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 10. Given that we are specifying x&amp;lt;sub&amp;gt;i &amp;lt;/sub&amp;gt;(0) and v&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; (0), which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We will be using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 11. In the code section &amp;quot;Specify Timestep&amp;quot;, the second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write &amp;quot;timestep 0.001 // run 100000&amp;quot;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Defining the variable timestep allows us to reference the variable multiple times throughout the simulation if required, whilst preventing errors and making it easier to alter the code if we want to run the simulation for different timestep values. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 12. Make plots of energy, temperature, and pressure, against time for the 0.001 timestep experiment. Does the simulation reach equilibrium? How long does this take? Make a single plot of energy vs time for all of the timesteps. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice and why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_12_1.png|centre|thumb|Figure 20. Plot of energy against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_2.png|centre|thumb|Figure 21. Plot of temperature against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_3.png|centre|thumb|Figure 22. Plot of pressure against time for the 0.001 timestep experiment]]&lt;br /&gt;
&lt;br /&gt;
The 0.001 timestep experiment reaches equilibrium very quickly, within approximately 0.2s. &lt;br /&gt;
&lt;br /&gt;
A single plot of energy vs time for all of the timesteps can be found in &amp;quot;Results &amp;amp; Discussion: Investigation into Simulation Timestep in the NVE Ensemble&amp;quot; (Figure 1), along with a detailed analysis, but in brief: the largest acceptable timestep is 0.0025, and a particularly bad choice would be 0.015 as it does not reach equilibrium.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Running Simulations under Specific Conditions&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 13. We need to choose gamma so that the temperature is correct T=fancy T if we multiply every velocity by γ. Solve the following two equations to determine gamma:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_2.png|center|200px]]&lt;br /&gt;
&lt;br /&gt;
Starting from the 2&amp;lt;sup&amp;gt;nd&amp;lt;/sup&amp;gt; equation,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_1.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 14: Use the manual to find out the importance of the three numbers 100 1000 100000. 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 (&amp;quot;run 100000&amp;quot;), how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Firstly, averages are taken for blocks of 100 values at a time to form the first set of averaged values (where av&amp;lt;sub&amp;gt;100,n&amp;lt;/sub&amp;gt; is the average value for the n&amp;lt;sup&amp;gt;th&amp;lt;/sup&amp;gt; block of 100 values). These values are then themselves averaged in blocks of 1000 values to form a second set of averaged values (av&amp;lt;sub&amp;gt;100,1&amp;lt;/sub&amp;gt; + av&amp;lt;sub&amp;gt;100,2&amp;lt;/sub&amp;gt; + ... + av&amp;lt;sub&amp;gt;100,1000&amp;lt;/sub&amp;gt;)/1000 = av&amp;lt;sub&amp;gt;1000,1&amp;lt;/sub&amp;gt;. Finally, these values are averaged once more in blocks of 100000 values.&lt;br /&gt;
&lt;br /&gt;
The amount of time simulated can be found by multiplying the number of steps by the value of the timestep (eg. 100,000 steps of a 0.001 timestep simulates 100 seconds).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 15: Plot density as a function of temperature for both of the pressures that you simulated. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figure 2 in &amp;quot;Results and Discussion: Equations of State in the NpT Ensemble&amp;quot; for the plot and subsequent discussion.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Heat Capacity Calculation&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 16: Run simulations at densities of 0.2, 0.8 and temperatures of 2.0, 2.2, 2.4, 2.6, 2.8, plotting C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;/V as a function of temperature, where V is the volume of the simulation cell, for both of your densities. Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the plot of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;/V as a function of temperature, please see Figure 3 in &amp;quot;Results and Discussion: Calculation of Heat Capacity&amp;quot; and the subsequent discussion on why the trend was as expected. A copy of the input script can be found in &amp;quot;Method: Part 3: Calculation of Heat Capacity&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Structural Properties and the Radial Distribution Function&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 17: Plot the RDFs for the three systems on the same axes. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figure 4 in &amp;quot;Results and Discussion: Radial Distribution Functions&amp;quot; for the plot and analysis. &lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Dynamical Properties and the Diffusion Coefficient&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 18: Make a plot for each of your simulations, showing the mean squared displacement as a function of timestep. Are these as you would expect? Estimate D in each case. Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figures 6-11 and Table 1 in &amp;quot;Results and Discussion: Diffusion Coefficient&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 19: Evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator. On the same graph, with x range 0 to 500, plot C(τ) with Ω = 1/(2π) and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. Why is the harmonic oscillator VACF very different to the Lennard Jones solid and liquid?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_3.png|700px]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_2.png|700px]]&lt;br /&gt;
&lt;br /&gt;
See also &amp;quot;Results and Discussion: Diffusion Coefficient&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 20: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Results and Discussion: Diffusion Coefficient&amp;quot;.&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665587</id>
		<title>Rep:Gm1110LiquidSim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665587"/>
		<updated>2018-02-16T14:10:28Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Preliminary tests were conducted to determine a suitable timestep value for simulations into a Lennard-Jones fluid (0.0025 s). It was shown that the density of the systems decreased with an increase in temperature, and that running the simulations at higher pressures led to a greater deviation from ideality. A further investigation into heat capacity showed that ease of heating increases as temperature increases, and that heat capacity decreases for lower density systems. &lt;br /&gt;
&lt;br /&gt;
The radial distribution functions calculated confirmed that the simulations were producing structurally accurate systems for solid, liquid and vapour phases, allowing for calculation of the diffusion coefficients via the mean square displacement method and the velocity autocorrelation function.&lt;br /&gt;
&lt;br /&gt;
For the more accurate 1,000,000 atom simulation, the diffusion coefficients were calculated to be -6.83x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;, 0.0698 and 2.47 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; for the solid, liquid and vapour phases respectively using the mean square displacement method, and 4.55x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;, 0.0901 and 3.27 m&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; using the velocity autocorrelation function. &lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
The main aim of the experiment was to determine the diffusion coefficient for the solid, liquid and vapour phases of a Lennard-Jones fluid using both the mean squared displacement method and velocity autocorrelation function method.&lt;br /&gt;
&lt;br /&gt;
In order to achieve this, it was first necessary to determine an appropriate timestep with which to run simulations, and investigate the effect of temperature and pressure on the density of the system. Other aims included seeing how heat capacity varied as a function of temperature for different densities, and calculating the radial distribution function for the three phases from simulations using VMD.    &lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
All simulations of the Lennard-Jones fluid were run using the LAMMPS software, and all quantities used were in reduced units.&lt;br /&gt;
&lt;br /&gt;
=== Part 1: Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
A simulation box consisting of 10 x 10 x 10 unit cells of a simple cubic lattice with an atomic density of 0.8 was defined. The atomic mass was set to 1.0 and the Lennard-Jones pairwise interaction cutoff distance was set to 3.0. The pairwise forcefield coefficients ε (potential well depth) and σ (zero-potential distance) were both set to 1.0. Five simulations were run for differing timestep values (0.0010, 0.0025, 0.0075, 0.0100 and 0.0150).&lt;br /&gt;
&lt;br /&gt;
=== Part 2: Equations of State in the NpT Ensemble ===&lt;br /&gt;
The simulation box was increased to consist of 15 x 15 x 15 unit cells of the same simple cubic lattice defined in part 1. A total of ten simulations were run in the NpT ensemble, varying temperature (2.0, 4.0, 6.0, 8.0 and 10.0) at two different densities (1.8 and 2.8) using the timestep value of 0.0025 determined in Part 1.&lt;br /&gt;
&lt;br /&gt;
=== Part 3: Calculation of Heat Capacity ===&lt;br /&gt;
The simulation box from Part 2 was used, with the density altered to take the values 0.2 and 0.8. Five simulations were run for each, with varying values of temperature (2.0, 2.2, 2.4, 2.6 and 2.8). A copy of the script written for this simulation can be found by clicking the image below:&lt;br /&gt;
[[File:gm1110_LS_M_3_1.png|centre|thumb|Copy of Script]]&lt;br /&gt;
&lt;br /&gt;
=== Part 4: Radial Distribution Functions ===&lt;br /&gt;
The simulation boxes used previously were altered to take a timestep of 0.002 and a L-J cutoff distance of 3.2, after which the solid, liquid and vapour phases were defined as having (density, temperature) values of (1.2, 1.2), (0.8, 1.2) and (0.05, 1.1) respectively. In particular, the solid phase was defined as having a face-centred cubic lattice, instead of the simple cubic lattice used for the liquid and vapour phases. VMD was used to analyse the trajectories for the three phases, with the distance between points in the generated RDF set to 0.05.&lt;br /&gt;
&lt;br /&gt;
=== Part 5: Diffusion Coefficient ===&lt;br /&gt;
The results from Part 4 were used to graph the mean squared displacement as a function of time, after which the gradient of the linear portion of the graph was extracted and used to calculate the diffusion coefficient from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_M_5_1.png|centre|150px]]&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were also calculated from the velocity autocorrelation function from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_M_5_2.png|centre|180px]]&lt;br /&gt;
&lt;br /&gt;
where [[File:gm1110_LS_M_5_3.png|150px]] is the velocity autocorrelation function.&lt;br /&gt;
&lt;br /&gt;
==Results and Discussion==&lt;br /&gt;
&lt;br /&gt;
=== Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
Simulations were run using the five different timesteps 0.0010, 0.0025, 0.0075, 0.0100 and 0.0150, and a plot of the results can be seen below (Figure 1).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_1_1.png|centre|thumb|Figure 1. A plot of total energy (reduced units) against time comparing simulations run using five different timestep values]]&lt;br /&gt;
&lt;br /&gt;
It was observed that the simulation run with a timestep of 0.0150 did not equilibrate. This was thought to have potentially been due to the timestep being too large, and therefore the simulation was missing too much detail to accurately simulate the fluid. The simulations run for timesteps of 0.0100 and 0.0075 did equilibrate (supporting the previous hypothesis that the 0.0150 timestep was too large), but converged at the wrong energy (approximately -3.181 and -3.183 respectively), indicating that the timesteps were still not quite small enough.&lt;br /&gt;
&lt;br /&gt;
The final two simulations run at timesteps of 0.0025 and 0.0010 both equilibrated to the same, correct energy (approximately -3.184), indicating that both would be suitable for use in further simulations. It is preferable, however, to maximise the timestep when running simulations as a smaller timestep requires more data points, and is therefore more “expensive” and takes longer to run for no real added value. Hence it was decided that a timestep of 0.0025 would be suitable for running further simulations.    &lt;br /&gt;
&lt;br /&gt;
=== Equations of State in the NpT Ensemble ===&lt;br /&gt;
Although specific values for temperature and pressure are specified for the simulations, in reality, the temperature and pressure of a system fluctuates over time and may therefore deviate away from the inputted values. Hence, the simulation calculates the pressure of the system at the end of every timestep, and adjusts the size of the simulation box such that the pressure once again corresponds to the specified value. Pressure controlled simulations are thus in the NpT ensemble and so volume (and therefore density) is not constant.&lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the resulting densities were plotted against temperature, along with values predicted by the ideal gas law and can be seen below (Figure 2).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_2_1.png|centre|thumb|Figure 2. Plot showing density as a function of temperature at pressures of 1.8 and 2.8 (all in reduced units), with error bars, and a plot of the densities predicted by the ideal gas law]]&lt;br /&gt;
&lt;br /&gt;
Clearly, the simulated densities are lower than those predicted by the ideal gas law, and the discrepancy increases with increasing pressure. This is due to the fact that the ideal gas law assumes perfectly elastic collisions between point particles, but in reality, intermolecular repulsive forces cause the simulated densities to be lower. In addition, an increase in pressure causes the molecules to be pushed closer together and increases both the number of collisions as well as the repulsive forces, leading to a greater deviation from ideality.    &lt;br /&gt;
&lt;br /&gt;
=== Calculation of Heat Capacity ===&lt;br /&gt;
Switching to the NVT ensemble, the heat capacity of the system can be determined by considering the magnitude of fluctuations in the system’s energy from its average equilibrium state from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_1.png|centre|250px]]            &lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the average heat capacities were plotted as a function of temperature (Figure 3).        &lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_2.png|centre|thumb|Figure 3. Plot of average heat capacity against temperature for densities of 0.8 and 0.2]]Heat capacity is a measure of the amount of energy required to increase the temperature of a substance. It is clear that the heat capacity is lower, and therefore easier to heat, for lower density systems as the particles are more spaced apart. This means that they are able to gain thermal energy more easily as they have more room for increased vibrations without an increase of repulsive forces or collisions compared to a higher density system. It was also noted that the heat capacity decreased with increasing temperature. This is due to the fact that at higher temperatures, the gap between energy levels decreases as the particles occupy higher energy states, thus making it easier for the particles to be promoted to higher energy levels.&lt;br /&gt;
&lt;br /&gt;
It is also clear that heat capacity decreases with increasing temperature (ie it is easier to heat a hotter object). This is due to the fact that as temperature increases, more rotational and vibrational energy levels become thermally accessible, leading to a faster increase in internal energy and thus a lower heat capacity.&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Functions ===&lt;br /&gt;
Radial distribution functions (g(r)) were calculated for the solid, liquid and vapour phases (see Figure 4) to check that the simulations were correctly reproducing the structural features of each phase. RDFs are essentially probability distribution functions for the likelihood of finding a particle at a given distance r away from a reference particle, and also gives information on the coordination sphere of the reference particle. The integral of the RDF (Figure 5) is also useful as it gives information on the number of atoms found at a distance r.&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_1.png|centre|thumb|Figure 4. Radial distribution function against displacement from a reference atom]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_2.png|centre|thumb|Figure 5. Integral of the radial distribution function against displacement]]&lt;br /&gt;
&lt;br /&gt;
For small r, all three phases have g(r) ~ 0, indicating an atomic density of zero as there exists a minimum distance at which atoms can approach each other. Also, g(r) tends to 1 for all three phases with increasing r, which represents the fact that the local density becomes equivalent to the mean density of the system as a whole.&lt;br /&gt;
&lt;br /&gt;
The graph of the solid phase shows sharp oscillating peaks, indicating that the atoms are strongly confined to their positions in the crystalline lattice, and the high degree of ordering means that although the osciallations do tend to g(r) = 1 for large r, this occurs much more slowly than for the other two phases. The first peak corresponds to the atoms nearest neighbours (of which there are 12), and the second and third peak correspond to the second and third nearest neighbours respectively (of which there are 6 and 24). &lt;br /&gt;
&lt;br /&gt;
The graph for the liquid phase shows broad, gently oscillating peaks that rapidly decay to g(r) = 1. As with the solid phase, the oscillations indicate some structure in the system whereby the atoms are loosely bound to their original positions, but the broader peaks indicate that they have much more freedom to move away from their positions. &lt;br /&gt;
&lt;br /&gt;
The graph for the vapour phase shows a single peak at approximately r = 1, after which it quickly decays back to g(r) = 1. This shows that the structure has very little to no order, and the particles are free to move unbound to any specific position. &lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|MSD Graphs (1,000 atoms)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_7.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_8.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_9.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 6. Graph of solid phase MSD for 1,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 7. Graph of fluid phase MSD for 1,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 8. Graph of vapour phase MSD for 1,000 atoms(with trendline)&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The general trends displayed in Figures 6-8 are as expected: the simulation does eventually establish linear behaviour, with the gradients increasing exponentially going from the solid to vapour phases. It is well known that diffusion in the vapour phase occurs much more readily than in the fluid phase, and more readily in the fluid phase than solid phase, and given that the diffusion coefficient is linearly correlated to the gradient of the mean square displacement, it was expected that the gradients of the graphs would increase in this manner. It was noted that the linear region of the solid phase plot (Figure 6) was quite noisy, but it was thought that this may be due to the small simulation size of 1,000 atoms.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|MSD Graphs (1,000,000 atoms)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_10.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_11.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_12.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 9. Graph of solid phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 10. Graph of fluid phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 11. Graph of vapour phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results from the simulation with 1,000,000 atoms (Figures 9-11) support the observations made with the 1,000 atom simulation. The only noticeable improvement from the 1,000 atom simulation was the reduction in noise of the linear region of the solid phase (Figure 9), suggesting that the assumption made previously to consider the more noisy region in Figure 6 as linear was correct, and that increasing the sample size did indeed improve the smoothness and accuracy of the curve.&lt;br /&gt;
&lt;br /&gt;
The gradient for the linear region of the plots were determined and used to calculate the diffusion coefficients (see table below).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=4|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Solid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Liquid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Vapour Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-6.17x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0688 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;2.27 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-6.83x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0698 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;2.47 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The results obtained are reasonable figures. In comparison with the 1,000,000 atom simulation, the values calculated for the diffusion coefficient with 1,000 atoms yielded a 9.7%, 1.4% and 8.0% error for the solid, liquid and vapour phases respectively. This suggests that for systems involving atoms that are at either extreme with regards to their range of motion, a larger atomic sample size would be suitable for simulations, whereas for fluids, more time-efficient simulations can be accurately conducted using the smaller 1,000 atom sample size.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient was also calculated using the velocity autocorrelation function (henceforth VACF).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|VACF Graphs&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_13.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_14.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_15.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 12. Graph of solid, liquid phase and simple harmonic oscillator VACF for 1,000 atoms&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 13. Running integral of solid, fluid and vapour phase VACF for 1,000 atoms&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 14. Running integral of solid, fluid and vapour phase VACF for 1,000,000 atoms&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=4|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Solid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Liquid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Vapour Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-1.84x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0783 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;3.06 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;4.55x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0901 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;3.27 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Generally, the results show that the diffusion coefficients calculated using the VACF method and MSD method are both to the same order of magnitude, although the coefficients calculated via the VACF were 29-32% greater for the fluid and vapour phases.&lt;br /&gt;
&lt;br /&gt;
The largest source of error in estimating the diffusion coefficient using the VACF was the number of atoms used in the simulations. This can be seen more clearly in Figures 16 and 17 which compare the VACF calculated for the fluid and vapour phases. The 1,000 atom simulation is clearly more noisy than the 1,000,000 atom simulation, indicating that the 1,000,000 atom simulation increases the reliability and accuracy of the results.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|VACF Graph Comparisons&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_18.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_19.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_20.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 15. Running integral of solid phase VACF for 1,000 and 1,000,000 atom simulations&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 16. Running integral of fluid phase VACF for 1,000 and 1,000,000 atom simulations&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 17. Running integral of vapour phase VACF for 1,000 and 1,000,000 atom simulations&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
A suitable timestep with which to run the simulations was determined to be 0.0025 s. Simulations then showed that the density of the systems decreased with an increase in temperature, and that running the simulations at higher pressures led to a greater deviation from ideality. A further investigation into heat capacity showed that ease of heating increases as temperature increases, and that heat capacity decreases for lower density systems.&lt;br /&gt;
&lt;br /&gt;
The radial distribution functions calculated show that the simulations were producing structurally accurate systems for the solid, liquid and vapour phases, allowing for calculation of the diffusion coefficients via the mean square displacement method and the velocity autocorrelation function.&lt;br /&gt;
&lt;br /&gt;
For a 1,000 atom simulation, the diffusion coefficients were calculated to be -6.17x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;, 0.0688 and 2.27 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;for the solid, liquid and vapour phases respectively using the mean square displacement method, and -1.84x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;, 0.0783 and 3.06 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;using the velocity autocorrelation function. It was discovered that depending on the method used, and the specific phase being considered, that 1,000 atoms was not a sufficiently large enough sample to accurately model the systems, so 1,000,000 atom simulations were conducted.&lt;br /&gt;
&lt;br /&gt;
For a 1,000,000 atom simulation, the diffusion coefficients were calculated to be -6.83x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;, 0.0698 and 2.47 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; for the solid, liquid and vapour phases respectively using the mean square displacement method, and 4.55x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;, 0.0901 and 3.27 m&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; using the velocity autocorrelation function. &lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
==Tasks==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Introduction to Molecular Dynamics Simulations&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 1. For a default timestep value 0.1, estimate the positions of the maxima in the ERROR column as a function of time.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_1_1.png|centre|thumb|Figure 18. Plot showing the positions of the error maxima as a function of time, with a best fit line]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 2. (Experiment with different values of the timestep.) What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using a timestep of 0.1990 meant that the total energy did not change by more than 1% over the course of the simulation (Figure 19).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_2_1.png|centre|thumb|Figure 19. Plot showing the total energy during the simulation using a timestep of 0.1990]]&lt;br /&gt;
&lt;br /&gt;
The simulations are being run in isolated systems which requires total energy conservation, so large fluctuations in the energy would lead to inaccurate results. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 3. For a single Lennard-Jones interaction, find the separation, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;, and work out the well depth. Evaluate the integrals when σ = ε = 1.0.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i) The Lennard-Jones interaction is given by:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_1.png|200px]]&lt;br /&gt;
&lt;br /&gt;
Since r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; when ɸ = 0,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(ii) The force is given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_3.png|250px]]&lt;br /&gt;
&lt;br /&gt;
So at the separation r&amp;lt;sub&amp;gt;0 &amp;lt;/sub&amp;gt;= σ,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_4.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iii) The equilibrium separation r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs at the point at which all forces vanish, ie. when F = 0, so&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_5.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iv) And the well depth is therefore given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_6.png|270px]]&lt;br /&gt;
&lt;br /&gt;
(v)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_7.png|370px]]&lt;br /&gt;
&lt;br /&gt;
(vi)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_8.png|400px]]&lt;br /&gt;
&lt;br /&gt;
(vii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_9.png|370px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4. Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10,000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_1.png|550px]]&lt;br /&gt;
&lt;br /&gt;
For 10,000 water molecules,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_3.png|230px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 5. Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After the timestep, the atom would be at position (0.5 + 0.7, 0.5 + 0.6, 0.5 + 0.2) = (1.2, 1.1, 0.7). Applying the boundary conditions, this is equivalent to the position (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 6. The Lennard-Jones parameters for argon are sigma = 0.34nm, ε/k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt; = 120K. If the LJ cutoff is r&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 1.5 in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_1.png|140px]]&lt;br /&gt;
&lt;br /&gt;
(ii) It was previously determined in Task 1 that the well depth is - ε, so in real units,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_4.png|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(iii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_3.png|130px]]&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Equilibration&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 7. Why do you think giving atoms random starting coordinates causes problems in simulations?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If two atoms are generated too close to one another, then they would experience a large repulsive force, and would disrupt the behaviour of the surrounding atoms, causing the simulation to become inaccurate. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 8. Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_1.png|380px]]&lt;br /&gt;
&lt;br /&gt;
(ii) For a face-centred cubic lattice, note that the unit cell contains four atoms, as opposed to one atom with a simple cubic lattice. Then&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_4.png|460px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 9. Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is 1 atom contained within each unit cell. However for face-centred cubic lattices, each unit cell contains 4 atoms so four times as many atoms are created than with the simple lattice (ie. 4000 atoms).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 10. Given that we are specifying x&amp;lt;sub&amp;gt;i &amp;lt;/sub&amp;gt;(0) and v&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; (0), which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We will be using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 11. In the code section &amp;quot;Specify Timestep&amp;quot;, the second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write &amp;quot;timestep 0.001 // run 100000&amp;quot;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Defining the variable timestep allows us to reference the variable multiple times throughout the simulation if required, whilst preventing errors and making it easier to alter the code if we want to run the simulation for different timestep values. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 12. Make plots of energy, temperature, and pressure, against time for the 0.001 timestep experiment. Does the simulation reach equilibrium? How long does this take? Make a single plot of energy vs time for all of the timesteps. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice and why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_12_1.png|centre|thumb|Figure 20. Plot of energy against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_2.png|centre|thumb|Figure 21. Plot of temperature against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_3.png|centre|thumb|Figure 22. Plot of pressure against time for the 0.001 timestep experiment]]&lt;br /&gt;
&lt;br /&gt;
The 0.001 timestep experiment reaches equilibrium very quickly, within approximately 0.2s. &lt;br /&gt;
&lt;br /&gt;
A single plot of energy vs time for all of the timesteps can be found in &amp;quot;Results &amp;amp; Discussion: Investigation into Simulation Timestep in the NVE Ensemble Figure 1&amp;quot;, along with a detailed analysis, but in brief: the largest acceptable timestep is 0.0025, and a particularly bad choice would be 0.015 as it does not reach equilibrium.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Running Simulations under Specific Conditions&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 13. We need to choose gamma so that the temperature is correct T=fancy T if we multiply every velocity by γ. Solve the following two equations to determine gamma:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_2.png|center|200px]]&lt;br /&gt;
&lt;br /&gt;
Starting from the 2&amp;lt;sup&amp;gt;nd&amp;lt;/sup&amp;gt; equation,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_1.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 14: (Use the manual to find out the importance of the three numbers 100 1000 100000.) 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 (&amp;quot;run 100000&amp;quot;), how much time will you simulate? (DOUBLE CHECK THIS PART WITH OLLIE!)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Firstly, averages are taken for blocks of 100 values at a time to form the first set of averaged values (where av&amp;lt;sub&amp;gt;100,n&amp;lt;/sub&amp;gt; is the average value for the n&amp;lt;sup&amp;gt;th&amp;lt;/sup&amp;gt; block of 100 values). These values are then themselves averaged in blocks of 1000 values to form a second set of averaged values (av&amp;lt;sub&amp;gt;100,1&amp;lt;/sub&amp;gt; + av&amp;lt;sub&amp;gt;100,2&amp;lt;/sub&amp;gt; + ... + av&amp;lt;sub&amp;gt;100,1000&amp;lt;/sub&amp;gt;)/1000 = av&amp;lt;sub&amp;gt;1000,1&amp;lt;/sub&amp;gt;. Finally, these values are averaged once more in blocks of 100000 values.&lt;br /&gt;
&lt;br /&gt;
The amount of time simulated can be found by multiplying the number of steps by the value of the timestep (eg. 100,000 steps of a 0.001 timestep simulates 100 seconds).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 15: Plot density as a function of temperature for both of the pressures that you simulated. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figure 2 in &amp;quot;Results and Discussion: Equations of State in the NpT Ensemble&amp;quot; for the plot and subsequent discussion.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Heat Capacity Calculation&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 16: Run simulations at densities of 0.2, 0.8 and temperatures of 2.0, 2.2, 2.4, 2.6, 2.8, plotting C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;/V as a function of temperature, where V is the volume of the simulation cell, for both of your densities. Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the plot of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;/V as a function of temperature, please see Figure 3 in &amp;quot;Results and Discussion: Calculation of Heat Capacity&amp;quot; and the subsequent discussion on why the trend was as expected. A copy of the input script can be found in &amp;quot;Method: Part 3: Calculation of Heat Capacity&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Structural Properties and the Radial Distribution Function&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 17: Plot the RDFs for the three systems on the same axes. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figure 4 in &amp;quot;Results and Discussion: Radial Distribution Functions&amp;quot; for the plot and analysis. &lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Dynamical Properties and the Diffusion Coefficient&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 18: Make a plot for each of your simulations, showing the mean squared displacement as a function of timestep. Are these as you would expect? Estimate D in each case. Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figures 6-11 and Table 1 in &amp;quot;Results and Discussion: Diffusion Coefficient&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 19: Evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator. On the same graph, with x range 0 to 500, plot C(τ) with Ω = 1/(2π) and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. Why is the harmonic oscillator VACF very different to the Lennard Jones solid and liquid?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_3.png|700px]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_2.png|700px]]&lt;br /&gt;
&lt;br /&gt;
See also &amp;quot;Results and Discussion: Diffusion Coefficient&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 20: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Results and Discussion: Diffusion Coefficient&amp;quot;.&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665586</id>
		<title>Rep:Gm1110LiquidSim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665586"/>
		<updated>2018-02-16T14:03:59Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: /* Abstract */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Preliminary tests were conducted to determine a suitable timestep value for simulations into a Lennard-Jones fluid (0.0025 s). It was shown that the density of the systems decreased with an increase in temperature, and that running the simulations at higher pressures led to a greater deviation from ideality. A further investigation into heat capacity showed that ease of heating increases as temperature increases, and that heat capacity decreases for lower density systems. &lt;br /&gt;
&lt;br /&gt;
The radial distribution functions calculated confirmed that the simulations were producing structurally accurate systems for solid, liquid and vapour phases, allowing for calculation of the diffusion coefficients via the mean square displacement method and the velocity autocorrelation function.&lt;br /&gt;
&lt;br /&gt;
For the more accurate 1,000,000 atom simulation, the diffusion coefficients were calculated to be -6.83x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;, 0.0698 and 2.47 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; for the solid, liquid and vapour phases respectively using the mean square displacement method, and 4.55x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;, 0.0901 and 3.27 m&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; using the velocity autocorrelation function. &lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
The main aim of the experiment was to determine the diffusion coefficient for the solid, liquid and vapour phases of a Lennard-Jones fluid using both the mean squared displacement method and velocity autocorrelation function method.&lt;br /&gt;
&lt;br /&gt;
In order to achieve this, it was first necessary to determine an appropriate timestep with which to run simulations, and investigate the effect of temperature and pressure on the density of the system. Other aims included seeing how heat capacity varied as a function of temperature for different densities, and calculating the radial distribution function for the three phases from simulations using VMD.    &lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
All simulations of the Lennard-Jones fluid were run using the LAMMPS software, and all quantities used were in reduced units.&lt;br /&gt;
&lt;br /&gt;
=== Part 1: Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
A simulation box consisting of 10 x 10 x 10 unit cells of a simple cubic lattice with an atomic density of 0.8 was defined. The atomic mass was set to 1.0 and the Lennard-Jones pairwise interaction cutoff distance was set to 3.0. The pairwise forcefield coefficients ε (potential well depth) and σ (zero-potential distance) were both set to 1.0. Five simulations were run for differing timestep values (0.0010, 0.0025, 0.0075, 0.0100 and 0.0150).&lt;br /&gt;
&lt;br /&gt;
=== Part 2: Equations of State in the NpT Ensemble ===&lt;br /&gt;
The simulation box was increased to consist of 15 x 15 x 15 unit cells of the same simple cubic lattice defined in part 1. A total of ten simulations were run in the NpT ensemble, varying temperature (2.0, 4.0, 6.0, 8.0 and 10.0) at two different densities (1.8 and 2.8) using the timestep value of 0.0025 determined in Part 1.&lt;br /&gt;
&lt;br /&gt;
=== Part 3: Calculation of Heat Capacity ===&lt;br /&gt;
The simulation box from Part 2 was used, with the density altered to take the values 0.2 and 0.8. Five simulations were run for each, with varying values of temperature (2.0, 2.2, 2.4, 2.6 and 2.8). A copy of the script written for this simulation can be found by clicking the image below:&lt;br /&gt;
[[File:gm1110_LS_M_3_1.png|centre|thumb|Copy of Script]]&lt;br /&gt;
&lt;br /&gt;
=== Part 4: Radial Distribution Functions ===&lt;br /&gt;
The simulation boxes used previously were altered to take a timestep of 0.002 and a L-J cutoff distance of 3.2, after which the solid, liquid and vapour phases were defined as having (density, temperature) values of (1.2, 1.2), (0.8, 1.2) and (0.05, 1.1) respectively. In particular, the solid phase was defined as having a face-centred cubic lattice, instead of the simple cubic lattice used for the liquid and vapour phases. VMD was used to analyse the trajectories for the three phases, with the distance between points in the generated RDF set to 0.05.&lt;br /&gt;
&lt;br /&gt;
=== Part 5: Diffusion Coefficient ===&lt;br /&gt;
The results from Part 4 were used to graph the mean squared displacement as a function of time, after which the gradient of the linear portion of the graph was extracted and used to calculate the diffusion coefficient from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_M_5_1.png|centre|150px]]&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were also calculated from the velocity autocorrelation function from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_M_5_2.png|centre|180px]]&lt;br /&gt;
&lt;br /&gt;
where [[File:gm1110_LS_M_5_3.png|150px]] is the velocity autocorrelation function.&lt;br /&gt;
&lt;br /&gt;
==Results and Discussion==&lt;br /&gt;
&lt;br /&gt;
=== Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
Simulations were run using the five different timesteps 0.0010, 0.0025, 0.0075, 0.0100 and 0.0150, and a plot of the results can be seen below (Figure 1).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_1_1.png|centre|thumb|Figure 1. A plot of total energy (reduced units) against time comparing simulations run using five different timestep values]]&lt;br /&gt;
&lt;br /&gt;
It was observed that the simulation run with a timestep of 0.0150 did not equilibrate. This was thought to have potentially been due to the timestep being too large, and therefore the simulation was missing too much detail to accurately simulate the fluid. The simulations run for timesteps of 0.0100 and 0.0075 did equilibrate (supporting the previous hypothesis that the 0.0150 timestep was too large), but converged at the wrong energy (approximately -3.181 and -3.183 respectively), indicating that the timesteps were still not quite small enough.&lt;br /&gt;
&lt;br /&gt;
The final two simulations run at timesteps of 0.0025 and 0.0010 both equilibrated to the same, correct energy (approximately -3.184), indicating that both would be suitable for use in further simulations. It is preferable, however, to maximise the timestep when running simulations as a smaller timestep requires more data points, and is therefore more “expensive” and takes longer to run for no real added value. Hence it was decided that a timestep of 0.0025 would be suitable for running further simulations.    &lt;br /&gt;
&lt;br /&gt;
=== Equations of State in the NpT Ensemble ===&lt;br /&gt;
Although specific values for temperature and pressure are specified for the simulations, in reality, the temperature and pressure of a system fluctuates over time and may therefore deviate away from the inputted values. Hence, the simulation calculates the pressure of the system at the end of every timestep, and adjusts the size of the simulation box such that the pressure once again corresponds to the specified value. Pressure controlled simulations are thus in the NpT ensemble and so volume (and therefore density) is not constant.&lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the resulting densities were plotted against temperature, along with values predicted by the ideal gas law and can be seen below (Figure 2).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_2_1.png|centre|thumb|Figure 2. Plot showing density as a function of temperature at pressures of 1.8 and 2.8 (all in reduced units), with error bars, and a plot of the densities predicted by the ideal gas law]]&lt;br /&gt;
&lt;br /&gt;
Clearly, the simulated densities are lower than those predicted by the ideal gas law, and the discrepancy increases with increasing pressure. This is due to the fact that the ideal gas law assumes perfectly elastic collisions between point particles, but in reality, intermolecular repulsive forces cause the simulated densities to be lower. In addition, an increase in pressure causes the molecules to be pushed closer together and increases both the number of collisions as well as the repulsive forces, leading to a greater deviation from ideality.    &lt;br /&gt;
&lt;br /&gt;
=== Calculation of Heat Capacity ===&lt;br /&gt;
Switching to the NVT ensemble, the heat capacity of the system can be determined by considering the magnitude of fluctuations in the system’s energy from its average equilibrium state from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_1.png|centre|250px]]            &lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the average heat capacities were plotted as a function of temperature (Figure 3).        &lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_2.png|centre|thumb|Figure 3. Plot of average heat capacity against temperature for densities of 0.8 and 0.2]]Heat capacity is a measure of the amount of energy required to increase the temperature of a substance. It is clear that the heat capacity is lower, and therefore easier to heat, for lower density systems as the particles are more spaced apart. This means that they are able to gain thermal energy more easily as they have more room for increased vibrations without an increase of repulsive forces or collisions compared to a higher density system. It was also noted that the heat capacity decreased with increasing temperature. This is due to the fact that at higher temperatures, the gap between energy levels decreases as the particles occupy higher energy states, thus making it easier for the particles to be promoted to higher energy levels.&lt;br /&gt;
&lt;br /&gt;
It is also clear that heat capacity decreases with increasing temperature (ie it is easier to heat a hotter object). This is due to the fact that as temperature increases, more rotational and vibrational energy levels become thermally accessible, leading to a faster increase in internal energy and thus a lower heat capacity.&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Functions ===&lt;br /&gt;
Radial distribution functions (g(r)) were calculated for the solid, liquid and vapour phases (see Figure 4) to check that the simulations were correctly reproducing the structural features of each phase. RDFs are essentially probability distribution functions for the likelihood of finding a particle at a given distance r away from a reference particle, and also gives information on the coordination sphere of the reference particle. The integral of the RDF (Figure 5) is also useful as it gives information on the number of atoms found at a distance r.&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_1.png|centre|thumb|Figure 4. Radial distribution function against displacement from a reference atom]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_2.png|centre|thumb|Figure 5. Integral of the radial distribution function against displacement]]&lt;br /&gt;
&lt;br /&gt;
For small r, all three phases have g(r) ~ 0, indicating an atomic density of zero as there exists a minimum distance at which atoms can approach each other. Also, g(r) tends to 1 for all three phases with increasing r, which represents the fact that the local density becomes equivalent to the mean density of the system as a whole.&lt;br /&gt;
&lt;br /&gt;
The graph of the solid phase shows sharp oscillating peaks, indicating that the atoms are strongly confined to their positions in the crystalline lattice, and the high degree of ordering means that although the osciallations do tend to g(r) = 1 for large r, this occurs much more slowly than for the other two phases. The first peak corresponds to the atoms nearest neighbours (of which there are 12), and the second and third peak correspond to the second and third nearest neighbours respectively (of which there are 6 and 24). &lt;br /&gt;
&lt;br /&gt;
The graph for the liquid phase shows broad, gently oscillating peaks that rapidly decay to g(r) = 1. As with the solid phase, the oscillations indicate some structure in the system whereby the atoms are loosely bound to their original positions, but the broader peaks indicate that they have much more freedom to move away from their positions. &lt;br /&gt;
&lt;br /&gt;
The graph for the vapour phase shows a single peak at approximately r = 1, after which it quickly decays back to g(r) = 1. This shows that the structure has very little to no order, and the particles are free to move unbound to any specific position. &lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|MSD Graphs (1,000 atoms)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_7.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_8.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_9.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 6. Graph of solid phase MSD for 1,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 7. Graph of fluid phase MSD for 1,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 8. Graph of vapour phase MSD for 1,000 atoms(with trendline)&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The general trends displayed in Figures 6-8 are as expected: the simulation does eventually establish linear behaviour, with the gradients increasing exponentially going from the solid to vapour phases. It is well known that diffusion in the vapour phase occurs much more readily than in the fluid phase, and more readily in the fluid phase than solid phase, and given that the diffusion coefficient is linearly correlated to the gradient of the mean square displacement, it was expected that the gradients of the graphs would increase in this manner. It was noted that the linear region of the solid phase plot (Figure 6) was quite noisy, but it was thought that this may be due to the small simulation size of 1,000 atoms.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|MSD Graphs (1,000,000 atoms)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_10.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_11.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_12.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 9. Graph of solid phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 10. Graph of fluid phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 11. Graph of vapour phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results from the simulation with 1,000,000 atoms (Figures 9-11) support the observations made with the 1,000 atom simulation. The only noticeable improvement from the 1,000 atom simulation was the reduction in noise of the linear region of the solid phase (Figure 9), suggesting that the assumption made previously to consider the more noisy region in Figure 6 as linear was correct, and that increasing the sample size did indeed improve the smoothness and accuracy of the curve.&lt;br /&gt;
&lt;br /&gt;
The gradient for the linear region of the plots were determined and used to calculate the diffusion coefficients (see table below).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=4|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Solid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Liquid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Vapour Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-6.17x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0688 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;2.27 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-6.83x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0698 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;2.47 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The results obtained are reasonable figures. In comparison with the 1,000,000 atom simulation, the values calculated for the diffusion coefficient with 1,000 atoms yielded a 9.7%, 1.4% and 8.0% error for the solid, liquid and vapour phases respectively. This suggests that for systems involving atoms that are at either extreme with regards to their range of motion, a larger atomic sample size would be suitable for simulations, whereas for fluids, more time-efficient simulations can be accurately conducted using the smaller 1,000 atom sample size.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient was also calculated using the velocity autocorrelation function (henceforth VACF).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|VACF Graphs&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_13.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_14.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_15.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 12. Graph of solid, liquid phase and simple harmonic oscillator VACF for 1,000 atoms&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 13. Running integral of solid, fluid and vapour phase VACF for 1,000 atoms&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 14. Running integral of solid, fluid and vapour phase VACF for 1,000,000 atoms&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=4|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Solid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Liquid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Vapour Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-1.84x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0783 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;3.06 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;4.55x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0901 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;3.27 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Generally, the results show that the diffusion coefficients calculated using the VACF method and MSD method are both to the same order of magnitude, although the coefficients calculated via the VACF were 29-32% greater for the fluid and vapour phases.&lt;br /&gt;
&lt;br /&gt;
The largest source of error in estimating the diffusion coefficient using the VACF was the number of atoms used in the simulations. This can be seen more clearly in Figures 16 and 17 which compare the VACF calculated for the fluid and vapour phases. The 1,000 atom simulation is clearly more noisy than the 1,000,000 atom simulation, indicating that the 1,000,000 atom simulation increases the reliability and accuracy of the results.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|VACF Graph Comparisons&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_18.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_19.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_20.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 15. Running integral of solid phase VACF for 1,000 and 1,000,000 atom simulations&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 16. Running integral of fluid phase VACF for 1,000 and 1,000,000 atom simulations&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 17. Running integral of vapour phase VACF for 1,000 and 1,000,000 atom simulations&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
It was determined that a suitable timestep value for the simulations was 0.0025&lt;br /&gt;
&lt;br /&gt;
For a 1,000,000 atom simulation, the diffusion coefficients were calculated to be -6.83x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;, 0.0698 and 2.47 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; for the solid, fluid and vapour phases respectively using the mean square displacement method, and 4.55x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;, 0.0901 and 3.27 m&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; using the velocity autocorrelation function.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
==Tasks==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Introduction to Molecular Dynamics Simulations&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 1. For a default timestep value 0.1, estimate the positions of the maxima in the ERROR column as a function of time.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_1_1.png|centre|thumb|Figure 18. Plot showing the positions of the error maxima as a function of time, with a best fit line]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 2. (Experiment with different values of the timestep.) What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using a timestep of 0.1990 meant that the total energy did not change by more than 1% over the course of the simulation (Figure 19).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_2_1.png|centre|thumb|Figure 19. Plot showing the total energy during the simulation using a timestep of 0.1990]]&lt;br /&gt;
&lt;br /&gt;
The simulations are being run in isolated systems which requires total energy conservation, so large fluctuations in the energy would lead to inaccurate results. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 3. For a single Lennard-Jones interaction, find the separation, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;, and work out the well depth. Evaluate the integrals when σ = ε = 1.0.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i) The Lennard-Jones interaction is given by:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_1.png|200px]]&lt;br /&gt;
&lt;br /&gt;
Since r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; when ɸ = 0,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(ii) The force is given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_3.png|250px]]&lt;br /&gt;
&lt;br /&gt;
So at the separation r&amp;lt;sub&amp;gt;0 &amp;lt;/sub&amp;gt;= σ,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_4.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iii) The equilibrium separation r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs at the point at which all forces vanish, ie. when F = 0, so&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_5.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iv) And the well depth is therefore given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_6.png|270px]]&lt;br /&gt;
&lt;br /&gt;
(v)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_7.png|370px]]&lt;br /&gt;
&lt;br /&gt;
(vi)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_8.png|400px]]&lt;br /&gt;
&lt;br /&gt;
(vii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_9.png|370px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4. Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10,000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_1.png|550px]]&lt;br /&gt;
&lt;br /&gt;
For 10,000 water molecules,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_3.png|230px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 5. Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After the timestep, the atom would be at position (0.5 + 0.7, 0.5 + 0.6, 0.5 + 0.2) = (1.2, 1.1, 0.7). Applying the boundary conditions, this is equivalent to the position (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 6. The Lennard-Jones parameters for argon are sigma = 0.34nm, ε/k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt; = 120K. If the LJ cutoff is r&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 1.5 in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_1.png|140px]]&lt;br /&gt;
&lt;br /&gt;
(ii) It was previously determined in Task 1 that the well depth is - ε, so in real units,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_4.png|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(iii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_3.png|130px]]&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Equilibration&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 7. Why do you think giving atoms random starting coordinates causes problems in simulations?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If two atoms are generated too close to one another, then they would experience a large repulsive force, and would disrupt the behaviour of the surrounding atoms, causing the simulation to become inaccurate. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 8. Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_1.png|380px]]&lt;br /&gt;
&lt;br /&gt;
(ii) For a face-centred cubic lattice, note that the unit cell contains four atoms, as opposed to one atom with a simple cubic lattice. Then&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_4.png|460px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 9. Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is 1 atom contained within each unit cell. However for face-centred cubic lattices, each unit cell contains 4 atoms so four times as many atoms are created than with the simple lattice (ie. 4000 atoms).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 10. Given that we are specifying x&amp;lt;sub&amp;gt;i &amp;lt;/sub&amp;gt;(0) and v&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; (0), which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We will be using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 11. In the code section &amp;quot;Specify Timestep&amp;quot;, the second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write &amp;quot;timestep 0.001 // run 100000&amp;quot;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Defining the variable timestep allows us to reference the variable multiple times throughout the simulation if required, whilst preventing errors and making it easier to alter the code if we want to run the simulation for different timestep values. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 12. Make plots of energy, temperature, and pressure, against time for the 0.001 timestep experiment. Does the simulation reach equilibrium? How long does this take? Make a single plot of energy vs time for all of the timesteps. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice and why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_12_1.png|centre|thumb|Figure 20. Plot of energy against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_2.png|centre|thumb|Figure 21. Plot of temperature against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_3.png|centre|thumb|Figure 22. Plot of pressure against time for the 0.001 timestep experiment]]&lt;br /&gt;
&lt;br /&gt;
The 0.001 timestep experiment reaches equilibrium very quickly, within approximately 0.2s. &lt;br /&gt;
&lt;br /&gt;
A single plot of energy vs time for all of the timesteps can be found in &amp;quot;Results &amp;amp; Discussion: Investigation into Simulation Timestep in the NVE Ensemble Figure 1&amp;quot;, along with a detailed analysis, but in brief: the largest acceptable timestep is 0.0025, and a particularly bad choice would be 0.015 as it does not reach equilibrium.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Running Simulations under Specific Conditions&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 13. We need to choose gamma so that the temperature is correct T=fancy T if we multiply every velocity by γ. Solve the following two equations to determine gamma:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_2.png|center|200px]]&lt;br /&gt;
&lt;br /&gt;
Starting from the 2&amp;lt;sup&amp;gt;nd&amp;lt;/sup&amp;gt; equation,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_1.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 14: (Use the manual to find out the importance of the three numbers 100 1000 100000.) 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 (&amp;quot;run 100000&amp;quot;), how much time will you simulate? (DOUBLE CHECK THIS PART WITH OLLIE!)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Firstly, averages are taken for blocks of 100 values at a time to form the first set of averaged values (where av&amp;lt;sub&amp;gt;100,n&amp;lt;/sub&amp;gt; is the average value for the n&amp;lt;sup&amp;gt;th&amp;lt;/sup&amp;gt; block of 100 values). These values are then themselves averaged in blocks of 1000 values to form a second set of averaged values (av&amp;lt;sub&amp;gt;100,1&amp;lt;/sub&amp;gt; + av&amp;lt;sub&amp;gt;100,2&amp;lt;/sub&amp;gt; + ... + av&amp;lt;sub&amp;gt;100,1000&amp;lt;/sub&amp;gt;)/1000 = av&amp;lt;sub&amp;gt;1000,1&amp;lt;/sub&amp;gt;. Finally, these values are averaged once more in blocks of 100000 values.&lt;br /&gt;
&lt;br /&gt;
The amount of time simulated can be found by multiplying the number of steps by the value of the timestep (eg. 100,000 steps of a 0.001 timestep simulates 100 seconds).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 15: Plot density as a function of temperature for both of the pressures that you simulated. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figure 2 in &amp;quot;Results and Discussion: Equations of State in the NpT Ensemble&amp;quot; for the plot and subsequent discussion.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Heat Capacity Calculation&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 16: Run simulations at densities of 0.2, 0.8 and temperatures of 2.0, 2.2, 2.4, 2.6, 2.8, plotting C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;/V as a function of temperature, where V is the volume of the simulation cell, for both of your densities. Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the plot of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;/V as a function of temperature, please see Figure 3 in &amp;quot;Results and Discussion: Calculation of Heat Capacity&amp;quot; and the subsequent discussion on why the trend was as expected. A copy of the input script can be found in &amp;quot;Method: Part 3: Calculation of Heat Capacity&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Structural Properties and the Radial Distribution Function&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 17: Plot the RDFs for the three systems on the same axes. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figure 4 in &amp;quot;Results and Discussion: Radial Distribution Functions&amp;quot; for the plot and analysis. &lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Dynamical Properties and the Diffusion Coefficient&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 18: Make a plot for each of your simulations, showing the mean squared displacement as a function of timestep. Are these as you would expect? Estimate D in each case. Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figures 6-11 and Table 1 in &amp;quot;Results and Discussion: Diffusion Coefficient&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 19: Evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator. On the same graph, with x range 0 to 500, plot C(τ) with Ω = 1/(2π) and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. Why is the harmonic oscillator VACF very different to the Lennard Jones solid and liquid?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_3.png|700px]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_2.png|700px]]&lt;br /&gt;
&lt;br /&gt;
See also &amp;quot;Results and Discussion: Diffusion Coefficient&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 20: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Results and Discussion: Diffusion Coefficient&amp;quot;.&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665585</id>
		<title>Rep:Gm1110LiquidSim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665585"/>
		<updated>2018-02-16T13:53:14Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: /* Equations of State in the NpT Ensemble */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
The main aim of the experiment was to determine the diffusion coefficient for the solid, liquid and vapour phases of a Lennard-Jones fluid using both the mean squared displacement method and velocity autocorrelation function method.&lt;br /&gt;
&lt;br /&gt;
In order to achieve this, it was first necessary to determine an appropriate timestep with which to run simulations, and investigate the effect of temperature and pressure on the density of the system. Other aims included seeing how heat capacity varied as a function of temperature for different densities, and calculating the radial distribution function for the three phases from simulations using VMD.    &lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
All simulations of the Lennard-Jones fluid were run using the LAMMPS software, and all quantities used were in reduced units.&lt;br /&gt;
&lt;br /&gt;
=== Part 1: Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
A simulation box consisting of 10 x 10 x 10 unit cells of a simple cubic lattice with an atomic density of 0.8 was defined. The atomic mass was set to 1.0 and the Lennard-Jones pairwise interaction cutoff distance was set to 3.0. The pairwise forcefield coefficients ε (potential well depth) and σ (zero-potential distance) were both set to 1.0. Five simulations were run for differing timestep values (0.0010, 0.0025, 0.0075, 0.0100 and 0.0150).&lt;br /&gt;
&lt;br /&gt;
=== Part 2: Equations of State in the NpT Ensemble ===&lt;br /&gt;
The simulation box was increased to consist of 15 x 15 x 15 unit cells of the same simple cubic lattice defined in part 1. A total of ten simulations were run in the NpT ensemble, varying temperature (2.0, 4.0, 6.0, 8.0 and 10.0) at two different densities (1.8 and 2.8) using the timestep value of 0.0025 determined in Part 1.&lt;br /&gt;
&lt;br /&gt;
=== Part 3: Calculation of Heat Capacity ===&lt;br /&gt;
The simulation box from Part 2 was used, with the density altered to take the values 0.2 and 0.8. Five simulations were run for each, with varying values of temperature (2.0, 2.2, 2.4, 2.6 and 2.8). A copy of the script written for this simulation can be found by clicking the image below:&lt;br /&gt;
[[File:gm1110_LS_M_3_1.png|centre|thumb|Copy of Script]]&lt;br /&gt;
&lt;br /&gt;
=== Part 4: Radial Distribution Functions ===&lt;br /&gt;
The simulation boxes used previously were altered to take a timestep of 0.002 and a L-J cutoff distance of 3.2, after which the solid, liquid and vapour phases were defined as having (density, temperature) values of (1.2, 1.2), (0.8, 1.2) and (0.05, 1.1) respectively. In particular, the solid phase was defined as having a face-centred cubic lattice, instead of the simple cubic lattice used for the liquid and vapour phases. VMD was used to analyse the trajectories for the three phases, with the distance between points in the generated RDF set to 0.05.&lt;br /&gt;
&lt;br /&gt;
=== Part 5: Diffusion Coefficient ===&lt;br /&gt;
The results from Part 4 were used to graph the mean squared displacement as a function of time, after which the gradient of the linear portion of the graph was extracted and used to calculate the diffusion coefficient from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_M_5_1.png|centre|150px]]&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were also calculated from the velocity autocorrelation function from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_M_5_2.png|centre|180px]]&lt;br /&gt;
&lt;br /&gt;
where [[File:gm1110_LS_M_5_3.png|150px]] is the velocity autocorrelation function.&lt;br /&gt;
&lt;br /&gt;
==Results and Discussion==&lt;br /&gt;
&lt;br /&gt;
=== Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
Simulations were run using the five different timesteps 0.0010, 0.0025, 0.0075, 0.0100 and 0.0150, and a plot of the results can be seen below (Figure 1).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_1_1.png|centre|thumb|Figure 1. A plot of total energy (reduced units) against time comparing simulations run using five different timestep values]]&lt;br /&gt;
&lt;br /&gt;
It was observed that the simulation run with a timestep of 0.0150 did not equilibrate. This was thought to have potentially been due to the timestep being too large, and therefore the simulation was missing too much detail to accurately simulate the fluid. The simulations run for timesteps of 0.0100 and 0.0075 did equilibrate (supporting the previous hypothesis that the 0.0150 timestep was too large), but converged at the wrong energy (approximately -3.181 and -3.183 respectively), indicating that the timesteps were still not quite small enough.&lt;br /&gt;
&lt;br /&gt;
The final two simulations run at timesteps of 0.0025 and 0.0010 both equilibrated to the same, correct energy (approximately -3.184), indicating that both would be suitable for use in further simulations. It is preferable, however, to maximise the timestep when running simulations as a smaller timestep requires more data points, and is therefore more “expensive” and takes longer to run for no real added value. Hence it was decided that a timestep of 0.0025 would be suitable for running further simulations.    &lt;br /&gt;
&lt;br /&gt;
=== Equations of State in the NpT Ensemble ===&lt;br /&gt;
Although specific values for temperature and pressure are specified for the simulations, in reality, the temperature and pressure of a system fluctuates over time and may therefore deviate away from the inputted values. Hence, the simulation calculates the pressure of the system at the end of every timestep, and adjusts the size of the simulation box such that the pressure once again corresponds to the specified value. Pressure controlled simulations are thus in the NpT ensemble and so volume (and therefore density) is not constant.&lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the resulting densities were plotted against temperature, along with values predicted by the ideal gas law and can be seen below (Figure 2).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_2_1.png|centre|thumb|Figure 2. Plot showing density as a function of temperature at pressures of 1.8 and 2.8 (all in reduced units), with error bars, and a plot of the densities predicted by the ideal gas law]]&lt;br /&gt;
&lt;br /&gt;
Clearly, the simulated densities are lower than those predicted by the ideal gas law, and the discrepancy increases with increasing pressure. This is due to the fact that the ideal gas law assumes perfectly elastic collisions between point particles, but in reality, intermolecular repulsive forces cause the simulated densities to be lower. In addition, an increase in pressure causes the molecules to be pushed closer together and increases both the number of collisions as well as the repulsive forces, leading to a greater deviation from ideality.    &lt;br /&gt;
&lt;br /&gt;
=== Calculation of Heat Capacity ===&lt;br /&gt;
Switching to the NVT ensemble, the heat capacity of the system can be determined by considering the magnitude of fluctuations in the system’s energy from its average equilibrium state from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_1.png|centre|250px]]            &lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the average heat capacities were plotted as a function of temperature (Figure 3).        &lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_2.png|centre|thumb|Figure 3. Plot of average heat capacity against temperature for densities of 0.8 and 0.2]]Heat capacity is a measure of the amount of energy required to increase the temperature of a substance. It is clear that the heat capacity is lower, and therefore easier to heat, for lower density systems as the particles are more spaced apart. This means that they are able to gain thermal energy more easily as they have more room for increased vibrations without an increase of repulsive forces or collisions compared to a higher density system. It was also noted that the heat capacity decreased with increasing temperature. This is due to the fact that at higher temperatures, the gap between energy levels decreases as the particles occupy higher energy states, thus making it easier for the particles to be promoted to higher energy levels.&lt;br /&gt;
&lt;br /&gt;
It is also clear that heat capacity decreases with increasing temperature (ie it is easier to heat a hotter object). This is due to the fact that as temperature increases, more rotational and vibrational energy levels become thermally accessible, leading to a faster increase in internal energy and thus a lower heat capacity.&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Functions ===&lt;br /&gt;
Radial distribution functions (g(r)) were calculated for the solid, liquid and vapour phases (see Figure 4) to check that the simulations were correctly reproducing the structural features of each phase. RDFs are essentially probability distribution functions for the likelihood of finding a particle at a given distance r away from a reference particle, and also gives information on the coordination sphere of the reference particle. The integral of the RDF (Figure 5) is also useful as it gives information on the number of atoms found at a distance r.&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_1.png|centre|thumb|Figure 4. Radial distribution function against displacement from a reference atom]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_2.png|centre|thumb|Figure 5. Integral of the radial distribution function against displacement]]&lt;br /&gt;
&lt;br /&gt;
For small r, all three phases have g(r) ~ 0, indicating an atomic density of zero as there exists a minimum distance at which atoms can approach each other. Also, g(r) tends to 1 for all three phases with increasing r, which represents the fact that the local density becomes equivalent to the mean density of the system as a whole.&lt;br /&gt;
&lt;br /&gt;
The graph of the solid phase shows sharp oscillating peaks, indicating that the atoms are strongly confined to their positions in the crystalline lattice, and the high degree of ordering means that although the osciallations do tend to g(r) = 1 for large r, this occurs much more slowly than for the other two phases. The first peak corresponds to the atoms nearest neighbours (of which there are 12), and the second and third peak correspond to the second and third nearest neighbours respectively (of which there are 6 and 24). &lt;br /&gt;
&lt;br /&gt;
The graph for the liquid phase shows broad, gently oscillating peaks that rapidly decay to g(r) = 1. As with the solid phase, the oscillations indicate some structure in the system whereby the atoms are loosely bound to their original positions, but the broader peaks indicate that they have much more freedom to move away from their positions. &lt;br /&gt;
&lt;br /&gt;
The graph for the vapour phase shows a single peak at approximately r = 1, after which it quickly decays back to g(r) = 1. This shows that the structure has very little to no order, and the particles are free to move unbound to any specific position. &lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|MSD Graphs (1,000 atoms)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_7.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_8.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_9.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 6. Graph of solid phase MSD for 1,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 7. Graph of fluid phase MSD for 1,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 8. Graph of vapour phase MSD for 1,000 atoms(with trendline)&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The general trends displayed in Figures 6-8 are as expected: the simulation does eventually establish linear behaviour, with the gradients increasing exponentially going from the solid to vapour phases. It is well known that diffusion in the vapour phase occurs much more readily than in the fluid phase, and more readily in the fluid phase than solid phase, and given that the diffusion coefficient is linearly correlated to the gradient of the mean square displacement, it was expected that the gradients of the graphs would increase in this manner. It was noted that the linear region of the solid phase plot (Figure 6) was quite noisy, but it was thought that this may be due to the small simulation size of 1,000 atoms.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|MSD Graphs (1,000,000 atoms)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_10.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_11.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_12.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 9. Graph of solid phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 10. Graph of fluid phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 11. Graph of vapour phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results from the simulation with 1,000,000 atoms (Figures 9-11) support the observations made with the 1,000 atom simulation. The only noticeable improvement from the 1,000 atom simulation was the reduction in noise of the linear region of the solid phase (Figure 9), suggesting that the assumption made previously to consider the more noisy region in Figure 6 as linear was correct, and that increasing the sample size did indeed improve the smoothness and accuracy of the curve.&lt;br /&gt;
&lt;br /&gt;
The gradient for the linear region of the plots were determined and used to calculate the diffusion coefficients (see table below).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=4|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Solid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Liquid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Vapour Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-6.17x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0688 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;2.27 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-6.83x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0698 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;2.47 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The results obtained are reasonable figures. In comparison with the 1,000,000 atom simulation, the values calculated for the diffusion coefficient with 1,000 atoms yielded a 9.7%, 1.4% and 8.0% error for the solid, liquid and vapour phases respectively. This suggests that for systems involving atoms that are at either extreme with regards to their range of motion, a larger atomic sample size would be suitable for simulations, whereas for fluids, more time-efficient simulations can be accurately conducted using the smaller 1,000 atom sample size.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient was also calculated using the velocity autocorrelation function (henceforth VACF).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|VACF Graphs&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_13.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_14.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_15.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 12. Graph of solid, liquid phase and simple harmonic oscillator VACF for 1,000 atoms&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 13. Running integral of solid, fluid and vapour phase VACF for 1,000 atoms&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 14. Running integral of solid, fluid and vapour phase VACF for 1,000,000 atoms&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=4|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Solid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Liquid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Vapour Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-1.84x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0783 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;3.06 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;4.55x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0901 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;3.27 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Generally, the results show that the diffusion coefficients calculated using the VACF method and MSD method are both to the same order of magnitude, although the coefficients calculated via the VACF were 29-32% greater for the fluid and vapour phases.&lt;br /&gt;
&lt;br /&gt;
The largest source of error in estimating the diffusion coefficient using the VACF was the number of atoms used in the simulations. This can be seen more clearly in Figures 16 and 17 which compare the VACF calculated for the fluid and vapour phases. The 1,000 atom simulation is clearly more noisy than the 1,000,000 atom simulation, indicating that the 1,000,000 atom simulation increases the reliability and accuracy of the results.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|VACF Graph Comparisons&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_18.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_19.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_20.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 15. Running integral of solid phase VACF for 1,000 and 1,000,000 atom simulations&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 16. Running integral of fluid phase VACF for 1,000 and 1,000,000 atom simulations&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 17. Running integral of vapour phase VACF for 1,000 and 1,000,000 atom simulations&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
It was determined that a suitable timestep value for the simulations was 0.0025&lt;br /&gt;
&lt;br /&gt;
For a 1,000,000 atom simulation, the diffusion coefficients were calculated to be -6.83x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;, 0.0698 and 2.47 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; for the solid, fluid and vapour phases respectively using the mean square displacement method, and 4.55x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;, 0.0901 and 3.27 m&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; using the velocity autocorrelation function.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
==Tasks==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Introduction to Molecular Dynamics Simulations&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 1. For a default timestep value 0.1, estimate the positions of the maxima in the ERROR column as a function of time.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_1_1.png|centre|thumb|Figure 18. Plot showing the positions of the error maxima as a function of time, with a best fit line]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 2. (Experiment with different values of the timestep.) What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using a timestep of 0.1990 meant that the total energy did not change by more than 1% over the course of the simulation (Figure 19).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_2_1.png|centre|thumb|Figure 19. Plot showing the total energy during the simulation using a timestep of 0.1990]]&lt;br /&gt;
&lt;br /&gt;
The simulations are being run in isolated systems which requires total energy conservation, so large fluctuations in the energy would lead to inaccurate results. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 3. For a single Lennard-Jones interaction, find the separation, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;, and work out the well depth. Evaluate the integrals when σ = ε = 1.0.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i) The Lennard-Jones interaction is given by:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_1.png|200px]]&lt;br /&gt;
&lt;br /&gt;
Since r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; when ɸ = 0,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(ii) The force is given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_3.png|250px]]&lt;br /&gt;
&lt;br /&gt;
So at the separation r&amp;lt;sub&amp;gt;0 &amp;lt;/sub&amp;gt;= σ,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_4.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iii) The equilibrium separation r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs at the point at which all forces vanish, ie. when F = 0, so&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_5.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iv) And the well depth is therefore given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_6.png|270px]]&lt;br /&gt;
&lt;br /&gt;
(v)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_7.png|370px]]&lt;br /&gt;
&lt;br /&gt;
(vi)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_8.png|400px]]&lt;br /&gt;
&lt;br /&gt;
(vii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_9.png|370px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4. Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10,000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_1.png|550px]]&lt;br /&gt;
&lt;br /&gt;
For 10,000 water molecules,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_3.png|230px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 5. Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After the timestep, the atom would be at position (0.5 + 0.7, 0.5 + 0.6, 0.5 + 0.2) = (1.2, 1.1, 0.7). Applying the boundary conditions, this is equivalent to the position (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 6. The Lennard-Jones parameters for argon are sigma = 0.34nm, ε/k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt; = 120K. If the LJ cutoff is r&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 1.5 in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_1.png|140px]]&lt;br /&gt;
&lt;br /&gt;
(ii) It was previously determined in Task 1 that the well depth is - ε, so in real units,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_4.png|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(iii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_3.png|130px]]&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Equilibration&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 7. Why do you think giving atoms random starting coordinates causes problems in simulations?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If two atoms are generated too close to one another, then they would experience a large repulsive force, and would disrupt the behaviour of the surrounding atoms, causing the simulation to become inaccurate. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 8. Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_1.png|380px]]&lt;br /&gt;
&lt;br /&gt;
(ii) For a face-centred cubic lattice, note that the unit cell contains four atoms, as opposed to one atom with a simple cubic lattice. Then&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_4.png|460px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 9. Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is 1 atom contained within each unit cell. However for face-centred cubic lattices, each unit cell contains 4 atoms so four times as many atoms are created than with the simple lattice (ie. 4000 atoms).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 10. Given that we are specifying x&amp;lt;sub&amp;gt;i &amp;lt;/sub&amp;gt;(0) and v&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; (0), which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We will be using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 11. In the code section &amp;quot;Specify Timestep&amp;quot;, the second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write &amp;quot;timestep 0.001 // run 100000&amp;quot;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Defining the variable timestep allows us to reference the variable multiple times throughout the simulation if required, whilst preventing errors and making it easier to alter the code if we want to run the simulation for different timestep values. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 12. Make plots of energy, temperature, and pressure, against time for the 0.001 timestep experiment. Does the simulation reach equilibrium? How long does this take? Make a single plot of energy vs time for all of the timesteps. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice and why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_12_1.png|centre|thumb|Figure 20. Plot of energy against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_2.png|centre|thumb|Figure 21. Plot of temperature against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_3.png|centre|thumb|Figure 22. Plot of pressure against time for the 0.001 timestep experiment]]&lt;br /&gt;
&lt;br /&gt;
The 0.001 timestep experiment reaches equilibrium very quickly, within approximately 0.2s. &lt;br /&gt;
&lt;br /&gt;
A single plot of energy vs time for all of the timesteps can be found in &amp;quot;Results &amp;amp; Discussion: Investigation into Simulation Timestep in the NVE Ensemble Figure 1&amp;quot;, along with a detailed analysis, but in brief: the largest acceptable timestep is 0.0025, and a particularly bad choice would be 0.015 as it does not reach equilibrium.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Running Simulations under Specific Conditions&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 13. We need to choose gamma so that the temperature is correct T=fancy T if we multiply every velocity by γ. Solve the following two equations to determine gamma:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_2.png|center|200px]]&lt;br /&gt;
&lt;br /&gt;
Starting from the 2&amp;lt;sup&amp;gt;nd&amp;lt;/sup&amp;gt; equation,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_1.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 14: (Use the manual to find out the importance of the three numbers 100 1000 100000.) 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 (&amp;quot;run 100000&amp;quot;), how much time will you simulate? (DOUBLE CHECK THIS PART WITH OLLIE!)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Firstly, averages are taken for blocks of 100 values at a time to form the first set of averaged values (where av&amp;lt;sub&amp;gt;100,n&amp;lt;/sub&amp;gt; is the average value for the n&amp;lt;sup&amp;gt;th&amp;lt;/sup&amp;gt; block of 100 values). These values are then themselves averaged in blocks of 1000 values to form a second set of averaged values (av&amp;lt;sub&amp;gt;100,1&amp;lt;/sub&amp;gt; + av&amp;lt;sub&amp;gt;100,2&amp;lt;/sub&amp;gt; + ... + av&amp;lt;sub&amp;gt;100,1000&amp;lt;/sub&amp;gt;)/1000 = av&amp;lt;sub&amp;gt;1000,1&amp;lt;/sub&amp;gt;. Finally, these values are averaged once more in blocks of 100000 values.&lt;br /&gt;
&lt;br /&gt;
The amount of time simulated can be found by multiplying the number of steps by the value of the timestep (eg. 100,000 steps of a 0.001 timestep simulates 100 seconds).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 15: Plot density as a function of temperature for both of the pressures that you simulated. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figure 2 in &amp;quot;Results and Discussion: Equations of State in the NpT Ensemble&amp;quot; for the plot and subsequent discussion.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Heat Capacity Calculation&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 16: Run simulations at densities of 0.2, 0.8 and temperatures of 2.0, 2.2, 2.4, 2.6, 2.8, plotting C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;/V as a function of temperature, where V is the volume of the simulation cell, for both of your densities. Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the plot of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;/V as a function of temperature, please see Figure 3 in &amp;quot;Results and Discussion: Calculation of Heat Capacity&amp;quot; and the subsequent discussion on why the trend was as expected. A copy of the input script can be found in &amp;quot;Method: Part 3: Calculation of Heat Capacity&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Structural Properties and the Radial Distribution Function&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 17: Plot the RDFs for the three systems on the same axes. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figure 4 in &amp;quot;Results and Discussion: Radial Distribution Functions&amp;quot; for the plot and analysis. &lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Dynamical Properties and the Diffusion Coefficient&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 18: Make a plot for each of your simulations, showing the mean squared displacement as a function of timestep. Are these as you would expect? Estimate D in each case. Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figures 6-11 and Table 1 in &amp;quot;Results and Discussion: Diffusion Coefficient&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 19: Evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator. On the same graph, with x range 0 to 500, plot C(τ) with Ω = 1/(2π) and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. Why is the harmonic oscillator VACF very different to the Lennard Jones solid and liquid?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_3.png|700px]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_2.png|700px]]&lt;br /&gt;
&lt;br /&gt;
See also &amp;quot;Results and Discussion: Diffusion Coefficient&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 20: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Results and Discussion: Diffusion Coefficient&amp;quot;.&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665584</id>
		<title>Rep:Gm1110LiquidSim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665584"/>
		<updated>2018-02-16T12:01:01Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
The main aim of the experiment was to determine the diffusion coefficient for the solid, liquid and vapour phases of a Lennard-Jones fluid using both the mean squared displacement method and velocity autocorrelation function method.&lt;br /&gt;
&lt;br /&gt;
In order to achieve this, it was first necessary to determine an appropriate timestep with which to run simulations, and investigate the effect of temperature and pressure on the density of the system. Other aims included seeing how heat capacity varied as a function of temperature for different densities, and calculating the radial distribution function for the three phases from simulations using VMD.    &lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
All simulations of the Lennard-Jones fluid were run using the LAMMPS software, and all quantities used were in reduced units.&lt;br /&gt;
&lt;br /&gt;
=== Part 1: Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
A simulation box consisting of 10 x 10 x 10 unit cells of a simple cubic lattice with an atomic density of 0.8 was defined. The atomic mass was set to 1.0 and the Lennard-Jones pairwise interaction cutoff distance was set to 3.0. The pairwise forcefield coefficients ε (potential well depth) and σ (zero-potential distance) were both set to 1.0. Five simulations were run for differing timestep values (0.0010, 0.0025, 0.0075, 0.0100 and 0.0150).&lt;br /&gt;
&lt;br /&gt;
=== Part 2: Equations of State in the NpT Ensemble ===&lt;br /&gt;
The simulation box was increased to consist of 15 x 15 x 15 unit cells of the same simple cubic lattice defined in part 1. A total of ten simulations were run in the NpT ensemble, varying temperature (2.0, 4.0, 6.0, 8.0 and 10.0) at two different densities (1.8 and 2.8) using the timestep value of 0.0025 determined in Part 1.&lt;br /&gt;
&lt;br /&gt;
=== Part 3: Calculation of Heat Capacity ===&lt;br /&gt;
The simulation box from Part 2 was used, with the density altered to take the values 0.2 and 0.8. Five simulations were run for each, with varying values of temperature (2.0, 2.2, 2.4, 2.6 and 2.8). A copy of the script written for this simulation can be found by clicking the image below:&lt;br /&gt;
[[File:gm1110_LS_M_3_1.png|centre|thumb|Copy of Script]]&lt;br /&gt;
&lt;br /&gt;
=== Part 4: Radial Distribution Functions ===&lt;br /&gt;
The simulation boxes used previously were altered to take a timestep of 0.002 and a L-J cutoff distance of 3.2, after which the solid, liquid and vapour phases were defined as having (density, temperature) values of (1.2, 1.2), (0.8, 1.2) and (0.05, 1.1) respectively. In particular, the solid phase was defined as having a face-centred cubic lattice, instead of the simple cubic lattice used for the liquid and vapour phases. VMD was used to analyse the trajectories for the three phases, with the distance between points in the generated RDF set to 0.05.&lt;br /&gt;
&lt;br /&gt;
=== Part 5: Diffusion Coefficient ===&lt;br /&gt;
The results from Part 4 were used to graph the mean squared displacement as a function of time, after which the gradient of the linear portion of the graph was extracted and used to calculate the diffusion coefficient from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_M_5_1.png|centre|150px]]&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were also calculated from the velocity autocorrelation function from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_M_5_2.png|centre|180px]]&lt;br /&gt;
&lt;br /&gt;
where [[File:gm1110_LS_M_5_3.png|150px]] is the velocity autocorrelation function.&lt;br /&gt;
&lt;br /&gt;
==Results and Discussion==&lt;br /&gt;
&lt;br /&gt;
=== Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
Simulations were run using the five different timesteps 0.0010, 0.0025, 0.0075, 0.0100 and 0.0150, and a plot of the results can be seen below (Figure 1).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_1_1.png|centre|thumb|Figure 1. A plot of total energy (reduced units) against time comparing simulations run using five different timestep values]]&lt;br /&gt;
&lt;br /&gt;
It was observed that the simulation run with a timestep of 0.0150 did not equilibrate. This was thought to have potentially been due to the timestep being too large, and therefore the simulation was missing too much detail to accurately simulate the fluid. The simulations run for timesteps of 0.0100 and 0.0075 did equilibrate (supporting the previous hypothesis that the 0.0150 timestep was too large), but converged at the wrong energy (approximately -3.181 and -3.183 respectively), indicating that the timesteps were still not quite small enough.&lt;br /&gt;
&lt;br /&gt;
The final two simulations run at timesteps of 0.0025 and 0.0010 both equilibrated to the same, correct energy (approximately -3.184), indicating that both would be suitable for use in further simulations. It is preferable, however, to maximise the timestep when running simulations as a smaller timestep requires more data points, and is therefore more “expensive” and takes longer to run for no real added value. Hence it was decided that a timestep of 0.0025 would be suitable for running further simulations.    &lt;br /&gt;
&lt;br /&gt;
=== Equations of State in the NpT Ensemble ===&lt;br /&gt;
Although specific values for temperature and pressure are specified for the simulations, in reality, the temperature and pressure of a system fluctuates over time and may therefore deviate away from the inputted values. Hence, the simulation calculates the pressure of the system at the end of every timestep, and adjusts the size of the simulation box such that the pressure once again corresponds to the specified value. Pressure controlled simulations are thus in the NpT ensemble and so volume (and therefore density) is not constant.&lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the resulting densities were plotted against temperature, along with values predicted by the ideal gas law and can be seen below (Figure 2).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_2_1.png|centre|thumb|Figure 2. Plot showing density as a function of temperature at pressures of 1.8 and 2.8 (all in reduced units), with error bars, and a plot of the densities predicted by the ideal gas law]]&lt;br /&gt;
&lt;br /&gt;
Clearly, the simulated densities are lower than those predicted by the ideal gas law, and the discrepancy increases with increasing pressure. This is due to the fact that the ideal gas law assumes perfectly elastic collisions between point particles, but in reality, intermolecular repulsive forces cause the simulated densities to be lower. In addition, an increase in pressure causes the molecules to be pushed closer together and increases both the number of collisions as well as the repulsive forces, leading to a greater deviation from ideality.    &lt;br /&gt;
&lt;br /&gt;
=== Calculation of Heat Capacity ===&lt;br /&gt;
Switching to the NVT ensemble, the heat capacity of the system can be determined by considering the magnitude of fluctuations in the system’s energy from its average equilibrium state from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_1.png|centre|250px]]            &lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the average heat capacities were plotted as a function of temperature (Figure 3).        &lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_2.png|centre|thumb|Figure 3. Plot of average heat capacity against temperature for densities of 0.8 and 0.2]]Heat capacity is a measure of the amount of energy required to increase the temperature of a substance. It is clear that the heat capacity is lower, and therefore easier to heat, for lower density systems as the particles are more spaced apart. This means that they are able to gain thermal energy more easily as they have more room for increased vibrations without an increase of repulsive forces or collisions compared to a higher density system. It was also noted that the heat capacity decreased with increasing temperature. This is due to the fact that at higher temperatures, the gap between energy levels decreases as the particles occupy higher energy states, thus making it easier for the particles to be promoted to higher energy levels.&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Functions ===&lt;br /&gt;
Radial distribution functions (g(r)) were calculated for the solid, liquid and vapour phases (see Figure 4) to check that the simulations were correctly reproducing the structural features of each phase. RDFs are essentially probability distribution functions for the likelihood of finding a particle at a given distance r away from a reference particle, and also gives information on the coordination sphere of the reference particle. The integral of the RDF (Figure 5) is also useful as it gives information on the number of atoms found at a distance r.&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_1.png|centre|thumb|Figure 4. Radial distribution function against displacement from a reference atom]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_2.png|centre|thumb|Figure 5. Integral of the radial distribution function against displacement]]&lt;br /&gt;
&lt;br /&gt;
For small r, all three phases have g(r) ~ 0, indicating an atomic density of zero as there exists a minimum distance at which atoms can approach each other. Also, g(r) tends to 1 for all three phases with increasing r, which represents the fact that the local density becomes equivalent to the mean density of the system as a whole.&lt;br /&gt;
&lt;br /&gt;
The graph of the solid phase shows sharp oscillating peaks, indicating that the atoms are strongly confined to their positions in the crystalline lattice, and the high degree of ordering means that although the osciallations do tend to g(r) = 1 for large r, this occurs much more slowly than for the other two phases. The first peak corresponds to the atoms nearest neighbours (of which there are 12), and the second and third peak correspond to the second and third nearest neighbours respectively (of which there are 6 and 24). &lt;br /&gt;
&lt;br /&gt;
The graph for the liquid phase shows broad, gently oscillating peaks that rapidly decay to g(r) = 1. As with the solid phase, the oscillations indicate some structure in the system whereby the atoms are loosely bound to their original positions, but the broader peaks indicate that they have much more freedom to move away from their positions. &lt;br /&gt;
&lt;br /&gt;
The graph for the vapour phase shows a single peak at approximately r = 1, after which it quickly decays back to g(r) = 1. This shows that the structure has very little to no order, and the particles are free to move unbound to any specific position. &lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|MSD Graphs (1,000 atoms)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_7.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_8.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_9.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 6. Graph of solid phase MSD for 1,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 7. Graph of fluid phase MSD for 1,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 8. Graph of vapour phase MSD for 1,000 atoms(with trendline)&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The general trends displayed in Figures 6-8 are as expected: the simulation does eventually establish linear behaviour, with the gradients increasing exponentially going from the solid to vapour phases. It is well known that diffusion in the vapour phase occurs much more readily than in the fluid phase, and more readily in the fluid phase than solid phase, and given that the diffusion coefficient is linearly correlated to the gradient of the mean square displacement, it was expected that the gradients of the graphs would increase in this manner. It was noted that the linear region of the solid phase plot (Figure 6) was quite noisy, but it was thought that this may be due to the small simulation size of 1,000 atoms.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|MSD Graphs (1,000,000 atoms)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_10.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_11.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_12.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 9. Graph of solid phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 10. Graph of fluid phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 11. Graph of vapour phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results from the simulation with 1,000,000 atoms (Figures 9-11) support the observations made with the 1,000 atom simulation. The only noticeable improvement from the 1,000 atom simulation was the reduction in noise of the linear region of the solid phase (Figure 9), suggesting that the assumption made previously to consider the more noisy region in Figure 6 as linear was correct, and that increasing the sample size did indeed improve the smoothness and accuracy of the curve.&lt;br /&gt;
&lt;br /&gt;
The gradient for the linear region of the plots were determined and used to calculate the diffusion coefficients (see table below).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=4|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Solid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Liquid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Vapour Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-6.17x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0688 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;2.27 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-6.83x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0698 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;2.47 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The results obtained are reasonable figures. In comparison with the 1,000,000 atom simulation, the values calculated for the diffusion coefficient with 1,000 atoms yielded a 9.7%, 1.4% and 8.0% error for the solid, liquid and vapour phases respectively. This suggests that for systems involving atoms that are at either extreme with regards to their range of motion, a larger atomic sample size would be suitable for simulations, whereas for fluids, more time-efficient simulations can be accurately conducted using the smaller 1,000 atom sample size.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient was also calculated using the velocity autocorrelation function (henceforth VACF).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|VACF Graphs&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_13.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_14.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_15.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 12. Graph of solid, liquid phase and simple harmonic oscillator VACF for 1,000 atoms&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 13. Running integral of solid, fluid and vapour phase VACF for 1,000 atoms&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 14. Running integral of solid, fluid and vapour phase VACF for 1,000,000 atoms&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=4|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Solid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Liquid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Vapour Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-1.84x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0783 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;3.06 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;4.55x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0901 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;3.27 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Generally, the results show that the diffusion coefficients calculated using the VACF method and MSD method are both to the same order of magnitude, although the coefficients calculated via the VACF were 29-32% greater for the fluid and vapour phases.&lt;br /&gt;
&lt;br /&gt;
The largest source of error in estimating the diffusion coefficient using the VACF was the number of atoms used in the simulations. This can be seen more clearly in Figures 16 and 17 which compare the VACF calculated for the fluid and vapour phases. The 1,000 atom simulation is clearly more noisy than the 1,000,000 atom simulation, indicating that the 1,000,000 atom simulation increases the reliability and accuracy of the results.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|VACF Graph Comparisons&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_18.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_19.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_20.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 15. Running integral of solid phase VACF for 1,000 and 1,000,000 atom simulations&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 16. Running integral of fluid phase VACF for 1,000 and 1,000,000 atom simulations&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 17. Running integral of vapour phase VACF for 1,000 and 1,000,000 atom simulations&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
It was determined that a suitable timestep value for the simulations was 0.0025&lt;br /&gt;
&lt;br /&gt;
For a 1,000,000 atom simulation, the diffusion coefficients were calculated to be -6.83x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;, 0.0698 and 2.47 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; for the solid, fluid and vapour phases respectively using the mean square displacement method, and 4.55x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;, 0.0901 and 3.27 m&amp;lt;sup&amp;gt;2 &amp;lt;/sup&amp;gt;s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; using the velocity autocorrelation function.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
==Tasks==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Introduction to Molecular Dynamics Simulations&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 1. For a default timestep value 0.1, estimate the positions of the maxima in the ERROR column as a function of time.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_1_1.png|centre|thumb|Figure 18. Plot showing the positions of the error maxima as a function of time, with a best fit line]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 2. (Experiment with different values of the timestep.) What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using a timestep of 0.1990 meant that the total energy did not change by more than 1% over the course of the simulation (Figure 19).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_2_1.png|centre|thumb|Figure 19. Plot showing the total energy during the simulation using a timestep of 0.1990]]&lt;br /&gt;
&lt;br /&gt;
The simulations are being run in isolated systems which requires total energy conservation, so large fluctuations in the energy would lead to inaccurate results. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 3. For a single Lennard-Jones interaction, find the separation, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;, and work out the well depth. Evaluate the integrals when σ = ε = 1.0.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i) The Lennard-Jones interaction is given by:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_1.png|200px]]&lt;br /&gt;
&lt;br /&gt;
Since r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; when ɸ = 0,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(ii) The force is given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_3.png|250px]]&lt;br /&gt;
&lt;br /&gt;
So at the separation r&amp;lt;sub&amp;gt;0 &amp;lt;/sub&amp;gt;= σ,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_4.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iii) The equilibrium separation r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs at the point at which all forces vanish, ie. when F = 0, so&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_5.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iv) And the well depth is therefore given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_6.png|270px]]&lt;br /&gt;
&lt;br /&gt;
(v)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_7.png|370px]]&lt;br /&gt;
&lt;br /&gt;
(vi)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_8.png|400px]]&lt;br /&gt;
&lt;br /&gt;
(vii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_9.png|370px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4. Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10,000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_1.png|550px]]&lt;br /&gt;
&lt;br /&gt;
For 10,000 water molecules,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_3.png|230px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 5. Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After the timestep, the atom would be at position (0.5 + 0.7, 0.5 + 0.6, 0.5 + 0.2) = (1.2, 1.1, 0.7). Applying the boundary conditions, this is equivalent to the position (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 6. The Lennard-Jones parameters for argon are sigma = 0.34nm, ε/k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt; = 120K. If the LJ cutoff is r&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 1.5 in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_1.png|140px]]&lt;br /&gt;
&lt;br /&gt;
(ii) It was previously determined in Task 1 that the well depth is - ε, so in real units,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_4.png|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(iii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_3.png|130px]]&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Equilibration&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 7. Why do you think giving atoms random starting coordinates causes problems in simulations?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If two atoms are generated too close to one another, then they would experience a large repulsive force, and would disrupt the behaviour of the surrounding atoms, causing the simulation to become inaccurate. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 8. Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_1.png|380px]]&lt;br /&gt;
&lt;br /&gt;
(ii) For a face-centred cubic lattice, note that the unit cell contains four atoms, as opposed to one atom with a simple cubic lattice. Then&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_4.png|460px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 9. Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is 1 atom contained within each unit cell. However for face-centred cubic lattices, each unit cell contains 4 atoms so four times as many atoms are created than with the simple lattice (ie. 4000 atoms).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 10. Given that we are specifying x&amp;lt;sub&amp;gt;i &amp;lt;/sub&amp;gt;(0) and v&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; (0), which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We will be using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 11. In the code section &amp;quot;Specify Timestep&amp;quot;, the second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write &amp;quot;timestep 0.001 // run 100000&amp;quot;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Defining the variable timestep allows us to reference the variable multiple times throughout the simulation if required, whilst preventing errors and making it easier to alter the code if we want to run the simulation for different timestep values. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 12. Make plots of energy, temperature, and pressure, against time for the 0.001 timestep experiment. Does the simulation reach equilibrium? How long does this take? Make a single plot of energy vs time for all of the timesteps. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice and why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_12_1.png|centre|thumb|Figure 20. Plot of energy against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_2.png|centre|thumb|Figure 21. Plot of temperature against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_3.png|centre|thumb|Figure 22. Plot of pressure against time for the 0.001 timestep experiment]]&lt;br /&gt;
&lt;br /&gt;
The 0.001 timestep experiment reaches equilibrium very quickly, within approximately 0.2s. &lt;br /&gt;
&lt;br /&gt;
A single plot of energy vs time for all of the timesteps can be found in &amp;quot;Results &amp;amp; Discussion: Investigation into Simulation Timestep in the NVE Ensemble Figure 1&amp;quot;, along with a detailed analysis, but in brief: the largest acceptable timestep is 0.0025, and a particularly bad choice would be 0.015 as it does not reach equilibrium.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Running Simulations under Specific Conditions&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 13. We need to choose gamma so that the temperature is correct T=fancy T if we multiply every velocity by γ. Solve the following two equations to determine gamma:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_2.png|center|200px]]&lt;br /&gt;
&lt;br /&gt;
Starting from the 2&amp;lt;sup&amp;gt;nd&amp;lt;/sup&amp;gt; equation,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_1.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 14: (Use the manual to find out the importance of the three numbers 100 1000 100000.) 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 (&amp;quot;run 100000&amp;quot;), how much time will you simulate? (DOUBLE CHECK THIS PART WITH OLLIE!)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Firstly, averages are taken for blocks of 100 values at a time to form the first set of averaged values (where av&amp;lt;sub&amp;gt;100,n&amp;lt;/sub&amp;gt; is the average value for the n&amp;lt;sup&amp;gt;th&amp;lt;/sup&amp;gt; block of 100 values). These values are then themselves averaged in blocks of 1000 values to form a second set of averaged values (av&amp;lt;sub&amp;gt;100,1&amp;lt;/sub&amp;gt; + av&amp;lt;sub&amp;gt;100,2&amp;lt;/sub&amp;gt; + ... + av&amp;lt;sub&amp;gt;100,1000&amp;lt;/sub&amp;gt;)/1000 = av&amp;lt;sub&amp;gt;1000,1&amp;lt;/sub&amp;gt;. Finally, these values are averaged once more in blocks of 100000 values.&lt;br /&gt;
&lt;br /&gt;
The amount of time simulated can be found by multiplying the number of steps by the value of the timestep (eg. 100,000 steps of a 0.001 timestep simulates 100 seconds).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 15: Plot density as a function of temperature for both of the pressures that you simulated. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figure 2 in &amp;quot;Results and Discussion: Equations of State in the NpT Ensemble&amp;quot; for the plot and subsequent discussion.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Heat Capacity Calculation&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 16: Run simulations at densities of 0.2, 0.8 and temperatures of 2.0, 2.2, 2.4, 2.6, 2.8, plotting C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;/V as a function of temperature, where V is the volume of the simulation cell, for both of your densities. Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the plot of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;/V as a function of temperature, please see Figure 3 in &amp;quot;Results and Discussion: Calculation of Heat Capacity&amp;quot; and the subsequent discussion on why the trend was as expected. A copy of the input script can be found in &amp;quot;Method: Part 3: Calculation of Heat Capacity&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Structural Properties and the Radial Distribution Function&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 17: Plot the RDFs for the three systems on the same axes. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figure 4 in &amp;quot;Results and Discussion: Radial Distribution Functions&amp;quot; for the plot and analysis. &lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Dynamical Properties and the Diffusion Coefficient&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 18: Make a plot for each of your simulations, showing the mean squared displacement as a function of timestep. Are these as you would expect? Estimate D in each case. Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figures 6-11 and Table 1 in &amp;quot;Results and Discussion: Diffusion Coefficient&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 19: Evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator. On the same graph, with x range 0 to 500, plot C(τ) with Ω = 1/(2π) and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. Why is the harmonic oscillator VACF very different to the Lennard Jones solid and liquid?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_3.png|700px]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_2.png|700px]]&lt;br /&gt;
&lt;br /&gt;
See also &amp;quot;Results and Discussion: Diffusion Coefficient&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 20: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Results and Discussion: Diffusion Coefficient&amp;quot;.&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665583</id>
		<title>Rep:Gm1110LiquidSim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665583"/>
		<updated>2018-02-16T11:37:22Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: /* Dynamical Properties and the Diffusion Coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
The main aim of the experiment was to determine the diffusion coefficient for the solid, liquid and vapour phases of a Lennard-Jones fluid using both the mean squared displacement method and velocity autocorrelation function method.&lt;br /&gt;
&lt;br /&gt;
In order to achieve this, it was first necessary to determine an appropriate timestep with which to run simulations, and investigate the effect of temperature and pressure on the density of the system. Other aims included seeing how heat capacity varied as a function of temperature for different densities, and calculating the radial distribution function for the three phases from simulations using VMD.    &lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
All simulations of the Lennard-Jones fluid were run using the LAMMPS software, and all quantities used were in reduced units.&lt;br /&gt;
&lt;br /&gt;
=== Part 1: Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
A simulation box consisting of 10 x 10 x 10 unit cells of a simple cubic lattice with an atomic density of 0.8 was defined. The atomic mass was set to 1.0 and the Lennard-Jones pairwise interaction cutoff distance was set to 3.0. The pairwise forcefield coefficients ε (potential well depth) and σ (zero-potential distance) were both set to 1.0. Five simulations were run for differing timestep values (0.0010, 0.0025, 0.0075, 0.0100 and 0.0150).&lt;br /&gt;
&lt;br /&gt;
=== Part 2: Equations of State in the NpT Ensemble ===&lt;br /&gt;
The simulation box was increased to consist of 15 x 15 x 15 unit cells of the same simple cubic lattice defined in part 1. A total of ten simulations were run in the NpT ensemble, varying temperature (2.0, 4.0, 6.0, 8.0 and 10.0) at two different densities (1.8 and 2.8) using the timestep value of 0.0025 determined in Part 1.&lt;br /&gt;
&lt;br /&gt;
=== Part 3: Calculation of Heat Capacity ===&lt;br /&gt;
The simulation box from Part 2 was used, with the density altered to take the values 0.2 and 0.8. Five simulations were run for each, with varying values of temperature (2.0, 2.2, 2.4, 2.6 and 2.8). A copy of the script written for this simulation can be found by clicking the image below:&lt;br /&gt;
[[File:gm1110_LS_M_3_1.png|centre|thumb|Copy of Script]]&lt;br /&gt;
&lt;br /&gt;
=== Part 4: Radial Distribution Functions ===&lt;br /&gt;
The simulation boxes used previously were altered to take a timestep of 0.002 and a L-J cutoff distance of 3.2, after which the solid, liquid and vapour phases were defined as having (density, temperature) values of (1.2, 1.2), (0.8, 1.2) and (0.05, 1.1) respectively. In particular, the solid phase was defined as having a face-centred cubic lattice, instead of the simple cubic lattice used for the liquid and vapour phases. VMD was used to analyse the trajectories for the three phases, with the distance between points in the generated RDF set to 0.05.&lt;br /&gt;
&lt;br /&gt;
=== Part 5: Diffusion Coefficient ===&lt;br /&gt;
The results from Part 4 were used to graph the mean squared displacement as a function of time, after which the gradient of the linear portion of the graph was extracted and used to calculate the diffusion coefficient from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_M_5_1.png|centre|150px]]&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were also calculated from the velocity autocorrelation function from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_M_5_2.png|centre|180px]]&lt;br /&gt;
&lt;br /&gt;
where [[File:gm1110_LS_M_5_3.png|150px]] is the velocity autocorrelation function.&lt;br /&gt;
&lt;br /&gt;
==Results and Discussion==&lt;br /&gt;
&lt;br /&gt;
=== Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
Simulations were run using the five different timesteps 0.0010, 0.0025, 0.0075, 0.0100 and 0.0150, and a plot of the results can be seen below (Figure 1).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_1_1.png|centre|thumb|Figure 1. A plot of total energy (reduced units) against time comparing simulations run using five different timestep values]]&lt;br /&gt;
&lt;br /&gt;
It was observed that the simulation run with a timestep of 0.0150 did not equilibrate. This was thought to have potentially been due to the timestep being too large, and therefore the simulation was missing too much detail to accurately simulate the fluid. The simulations run for timesteps of 0.0100 and 0.0075 did equilibrate (supporting the previous hypothesis that the 0.0150 timestep was too large), but converged at the wrong energy (approximately -3.181 and -3.183 respectively), indicating that the timesteps were still not quite small enough.&lt;br /&gt;
&lt;br /&gt;
The final two simulations run at timesteps of 0.0025 and 0.0010 both equilibrated to the same, correct energy (approximately -3.184), indicating that both would be suitable for use in further simulations. It is preferable, however, to maximise the timestep when running simulations as a smaller timestep requires more data points, and is therefore more “expensive” and takes longer to run for no real added value. Hence it was decided that a timestep of 0.0025 would be suitable for running further simulations.    &lt;br /&gt;
&lt;br /&gt;
=== Equations of State in the NpT Ensemble ===&lt;br /&gt;
Although specific values for temperature and pressure are specified for the simulations, in reality, the temperature and pressure of a system fluctuates over time and may therefore deviate away from the inputted values. Hence, the simulation calculates the pressure of the system at the end of every timestep, and adjusts the size of the simulation box such that the pressure once again corresponds to the specified value. Pressure controlled simulations are thus in the NpT ensemble and so volume (and therefore density) is not constant.&lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the resulting densities were plotted against temperature, along with values predicted by the ideal gas law and can be seen below (Figure 2).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_2_1.png|centre|thumb|Figure 2. Plot showing density as a function of temperature at pressures of 1.8 and 2.8 (all in reduced units), with error bars, and a plot of the densities predicted by the ideal gas law]]&lt;br /&gt;
&lt;br /&gt;
Clearly, the simulated densities are lower than those predicted by the ideal gas law, and the discrepancy increases with increasing pressure. This is due to the fact that the ideal gas law assumes perfectly elastic collisions between point particles, but in reality, intermolecular repulsive forces cause the simulated densities to be lower. In addition, an increase in pressure causes the molecules to be pushed closer together and increases both the number of collisions as well as the repulsive forces, leading to a greater deviation from ideality.    &lt;br /&gt;
&lt;br /&gt;
=== Calculation of Heat Capacity ===&lt;br /&gt;
Switching to the NVT ensemble, the heat capacity of the system can be determined by considering the magnitude of fluctuations in the system’s energy from its average equilibrium state from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_1.png|centre|250px]]            &lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the average heat capacities were plotted as a function of temperature (Figure 3).        &lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_2.png|centre|thumb|Figure 3. Plot of average heat capacity against temperature for densities of 0.8 and 0.2]]Heat capacity is a measure of the amount of energy required to increase the temperature of a substance. It is clear that the heat capacity is lower, and therefore easier to heat, for lower density systems as the particles are more spaced apart. This means that they are able to gain thermal energy more easily as they have more room for increased vibrations without an increase of repulsive forces or collisions compared to a higher density system. It was also noted that the heat capacity decreased with increasing temperature. This is due to the fact that at higher temperatures, the gap between energy levels decreases as the particles occupy higher energy states, thus making it easier for the particles to be promoted to higher energy levels.&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Functions ===&lt;br /&gt;
Radial distribution functions (g(r)) were calculated for the solid, liquid and vapour phases (see Figure 4) to check that the simulations were correctly reproducing the structural features of each phase. RDFs are essentially probability distribution functions for the likelihood of finding a particle at a given distance r away from a reference particle, and also gives information on the coordination sphere of the reference particle. The integral of the RDF (Figure 5) is also useful as it gives information on the number of atoms found at a distance r.&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_1.png|centre|thumb|Figure 4. Radial distribution function against displacement from a reference atom]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_2.png|centre|thumb|Figure 5. Integral of the radial distribution function against displacement]]&lt;br /&gt;
&lt;br /&gt;
For small r, all three phases have g(r) ~ 0, indicating an atomic density of zero as there exists a minimum distance at which atoms can approach each other. Also, g(r) tends to 1 for all three phases with increasing r, which represents the fact that the local density becomes equivalent to the mean density of the system as a whole.&lt;br /&gt;
&lt;br /&gt;
The graph of the solid phase shows sharp oscillating peaks, indicating that the atoms are strongly confined to their positions in the crystalline lattice, and the high degree of ordering means that although the osciallations do tend to g(r) = 1 for large r, this occurs much more slowly than for the other two phases. The first peak corresponds to the atoms nearest neighbours (of which there are 12), and the second and third peak correspond to the second and third nearest neighbours respectively (of which there are 6 and 24). &lt;br /&gt;
&lt;br /&gt;
The graph for the liquid phase shows broad, gently oscillating peaks that rapidly decay to g(r) = 1. As with the solid phase, the oscillations indicate some structure in the system whereby the atoms are loosely bound to their original positions, but the broader peaks indicate that they have much more freedom to move away from their positions. &lt;br /&gt;
&lt;br /&gt;
The graph for the vapour phase shows a single peak at approximately r = 1, after which it quickly decays back to g(r) = 1. This shows that the structure has very little to no order, and the particles are free to move unbound to any specific position. &lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|MSD Graphs (1,000 atoms)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_7.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_8.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_9.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 6. Graph of solid phase MSD for 1,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 7. Graph of fluid phase MSD for 1,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 8. Graph of vapour phase MSD for 1,000 atoms(with trendline)&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The general trends displayed in Figures 6-8 are as expected: the simulation does eventually establish linear behaviour, with the gradients increasing exponentially going from the solid to vapour phases. It is well known that diffusion in the vapour phase occurs much more readily than in the fluid phase, and more readily in the fluid phase than solid phase, and given that the diffusion coefficient is linearly correlated to the gradient of the mean square displacement, it was expected that the gradients of the graphs would increase in this manner. It was noted that the linear region of the solid phase plot (Figure 6) was quite noisy, but it was thought that this may be due to the small simulation size of 1,000 atoms.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|MSD Graphs (1,000,000 atoms)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_10.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_11.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_12.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 9. Graph of solid phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 10. Graph of fluid phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 11. Graph of vapour phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results from the simulation with 1,000,000 atoms (Figures 9-11) support the observations made with the 1,000 atom simulation. The only noticeable improvement from the 1,000 atom simulation was the reduction in noise of the linear region of the solid phase (Figure 9), suggesting that the assumption made previously to consider the more noisy region in Figure 6 as linear was correct, and that increasing the sample size did indeed improve the smoothness and accuracy of the curve.&lt;br /&gt;
&lt;br /&gt;
The gradient for the linear region of the plots were determined and used to calculate the diffusion coefficients (see table below).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=4|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Solid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Liquid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Vapour Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-6.17x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0688 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;2.27 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-6.83x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0698 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;2.47 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The results obtained are reasonable figures. In comparison with the 1,000,000 atom simulation, the values calculated for the diffusion coefficient with 1,000 atoms yielded a 9.7%, 1.4% and 8.0% error for the solid, liquid and vapour phases respectively. This suggests that for systems involving atoms that are at either extreme with regards to their range of motion, a larger atomic sample size would be suitable for simulations, whereas for fluids, more time-efficient simulations can be accurately conducted using the smaller 1,000 atom sample size.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient was also calculated using the velocity autocorrelation function (henceforth VACF).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|VACF Graphs&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_13.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_14.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_15.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 12. Graph of solid, liquid phase and simple harmonic oscillator VACF for 1,000 atoms&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 13. Running integral of solid, fluid and vapour phase VACF for 1,000 atoms&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 14. Running integral of solid, fluid and vapour phase VACF for 1,000,000 atoms&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=4|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Solid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Liquid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Vapour Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-1.84x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0783 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;3.06 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;4.55x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0901 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;3.27 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Generally, the results show that the diffusion coefficients calculated using the VACF method and MSD method are both to the same order of magnitude, although the coefficients calculated via the VACF were 29-32% greater for the fluid and vapour phases.&lt;br /&gt;
&lt;br /&gt;
The largest source of error in estimating the diffusion coefficient using the VACF was the number of atoms used in the simulations. This can be seen more clearly in Figures 16 and 17 which compare the VACF calculated for the fluid and vapour phases. The 1,000 atom simulation is clearly more noisy than the 1,000,000 atom simulation, indicating that the 1,000,000 atom simulation increases the reliability and accuracy of the results.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|VACF Graph Comparisons&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_18.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_19.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_20.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 15. Running integral of solid phase VACF for 1,000 and 1,000,000 atom simulations&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 16. Running integral of fluid phase VACF for 1,000 and 1,000,000 atom simulations&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 17. Running integral of vapour phase VACF for 1,000 and 1,000,000 atom simulations&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
==Tasks==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Introduction to Molecular Dynamics Simulations&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 1. For a default timestep value 0.1, estimate the positions of the maxima in the ERROR column as a function of time.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_1_1.png|centre|thumb|Figure 18. Plot showing the positions of the error maxima as a function of time, with a best fit line]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 2. (Experiment with different values of the timestep.) What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using a timestep of 0.1990 meant that the total energy did not change by more than 1% over the course of the simulation (Figure 19).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_2_1.png|centre|thumb|Figure 19. Plot showing the total energy during the simulation using a timestep of 0.1990]]&lt;br /&gt;
&lt;br /&gt;
The simulations are being run in isolated systems which requires total energy conservation, so large fluctuations in the energy would lead to inaccurate results. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 3. For a single Lennard-Jones interaction, find the separation, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;, and work out the well depth. Evaluate the integrals when σ = ε = 1.0.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i) The Lennard-Jones interaction is given by:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_1.png|200px]]&lt;br /&gt;
&lt;br /&gt;
Since r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; when ɸ = 0,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(ii) The force is given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_3.png|250px]]&lt;br /&gt;
&lt;br /&gt;
So at the separation r&amp;lt;sub&amp;gt;0 &amp;lt;/sub&amp;gt;= σ,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_4.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iii) The equilibrium separation r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs at the point at which all forces vanish, ie. when F = 0, so&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_5.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iv) And the well depth is therefore given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_6.png|270px]]&lt;br /&gt;
&lt;br /&gt;
(v)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_7.png|370px]]&lt;br /&gt;
&lt;br /&gt;
(vi)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_8.png|400px]]&lt;br /&gt;
&lt;br /&gt;
(vii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_9.png|370px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4. Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10,000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_1.png|550px]]&lt;br /&gt;
&lt;br /&gt;
For 10,000 water molecules,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_3.png|230px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 5. Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After the timestep, the atom would be at position (0.5 + 0.7, 0.5 + 0.6, 0.5 + 0.2) = (1.2, 1.1, 0.7). Applying the boundary conditions, this is equivalent to the position (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 6. The Lennard-Jones parameters for argon are sigma = 0.34nm, ε/k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt; = 120K. If the LJ cutoff is r&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 1.5 in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_1.png|140px]]&lt;br /&gt;
&lt;br /&gt;
(ii) It was previously determined in Task 1 that the well depth is - ε, so in real units,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_4.png|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(iii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_3.png|130px]]&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Equilibration&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 7. Why do you think giving atoms random starting coordinates causes problems in simulations?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If two atoms are generated too close to one another, then they would experience a large repulsive force, and would disrupt the behaviour of the surrounding atoms, causing the simulation to become inaccurate. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 8. Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_1.png|380px]]&lt;br /&gt;
&lt;br /&gt;
(ii) For a face-centred cubic lattice, note that the unit cell contains four atoms, as opposed to one atom with a simple cubic lattice. Then&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_4.png|460px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 9. Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is 1 atom contained within each unit cell. However for face-centred cubic lattices, each unit cell contains 4 atoms so four times as many atoms are created than with the simple lattice (ie. 4000 atoms).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 10. Given that we are specifying x&amp;lt;sub&amp;gt;i &amp;lt;/sub&amp;gt;(0) and v&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; (0), which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We will be using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 11. In the code section &amp;quot;Specify Timestep&amp;quot;, the second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write &amp;quot;timestep 0.001 // run 100000&amp;quot;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Defining the variable timestep allows us to reference the variable multiple times throughout the simulation if required, whilst preventing errors and making it easier to alter the code if we want to run the simulation for different timestep values. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 12. Make plots of energy, temperature, and pressure, against time for the 0.001 timestep experiment. Does the simulation reach equilibrium? How long does this take? Make a single plot of energy vs time for all of the timesteps. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice and why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_12_1.png|centre|thumb|Figure 20. Plot of energy against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_2.png|centre|thumb|Figure 21. Plot of temperature against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_3.png|centre|thumb|Figure 22. Plot of pressure against time for the 0.001 timestep experiment]]&lt;br /&gt;
&lt;br /&gt;
The 0.001 timestep experiment reaches equilibrium very quickly, within approximately 0.2s. &lt;br /&gt;
&lt;br /&gt;
A single plot of energy vs time for all of the timesteps can be found in &amp;quot;Results &amp;amp; Discussion: Investigation into Simulation Timestep in the NVE Ensemble Figure 1&amp;quot;, along with a detailed analysis, but in brief: the largest acceptable timestep is 0.0025, and a particularly bad choice would be 0.015 as it does not reach equilibrium.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Running Simulations under Specific Conditions&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 13. We need to choose gamma so that the temperature is correct T=fancy T if we multiply every velocity by γ. Solve the following two equations to determine gamma:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_2.png|center|200px]]&lt;br /&gt;
&lt;br /&gt;
Starting from the 2&amp;lt;sup&amp;gt;nd&amp;lt;/sup&amp;gt; equation,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_1.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 14: (Use the manual to find out the importance of the three numbers 100 1000 100000.) 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 (&amp;quot;run 100000&amp;quot;), how much time will you simulate? (DOUBLE CHECK THIS PART WITH OLLIE!)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Firstly, averages are taken for blocks of 100 values at a time to form the first set of averaged values (where av&amp;lt;sub&amp;gt;100,n&amp;lt;/sub&amp;gt; is the average value for the n&amp;lt;sup&amp;gt;th&amp;lt;/sup&amp;gt; block of 100 values). These values are then themselves averaged in blocks of 1000 values to form a second set of averaged values (av&amp;lt;sub&amp;gt;100,1&amp;lt;/sub&amp;gt; + av&amp;lt;sub&amp;gt;100,2&amp;lt;/sub&amp;gt; + ... + av&amp;lt;sub&amp;gt;100,1000&amp;lt;/sub&amp;gt;)/1000 = av&amp;lt;sub&amp;gt;1000,1&amp;lt;/sub&amp;gt;. Finally, these values are averaged once more in blocks of 100000 values.&lt;br /&gt;
&lt;br /&gt;
The amount of time simulated can be found by multiplying the number of steps by the value of the timestep (eg. 100,000 steps of a 0.001 timestep simulates 100 seconds).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 15: Plot density as a function of temperature for both of the pressures that you simulated. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figure 2 in &amp;quot;Results and Discussion: Equations of State in the NpT Ensemble&amp;quot; for the plot and subsequent discussion.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Heat Capacity Calculation&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 16: Run simulations at densities of 0.2, 0.8 and temperatures of 2.0, 2.2, 2.4, 2.6, 2.8, plotting C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;/V as a function of temperature, where V is the volume of the simulation cell, for both of your densities. Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the plot of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;/V as a function of temperature, please see Figure 3 in &amp;quot;Results and Discussion: Calculation of Heat Capacity&amp;quot; and the subsequent discussion on why the trend was as expected. A copy of the input script can be found in &amp;quot;Method: Part 3: Calculation of Heat Capacity&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Structural Properties and the Radial Distribution Function&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 17: Plot the RDFs for the three systems on the same axes. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figure 4 in &amp;quot;Results and Discussion: Radial Distribution Functions&amp;quot; for the plot and analysis. &lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Dynamical Properties and the Diffusion Coefficient&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 18: Make a plot for each of your simulations, showing the mean squared displacement as a function of timestep. Are these as you would expect? Estimate D in each case. Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figures 6-11 and Table 1 in &amp;quot;Results and Discussion: Diffusion Coefficient&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 19: Evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator. On the same graph, with x range 0 to 500, plot C(τ) with Ω = 1/(2π) and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. Why is the harmonic oscillator VACF very different to the Lennard Jones solid and liquid?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_3.png|700px]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_2.png|700px]]&lt;br /&gt;
&lt;br /&gt;
See also &amp;quot;Results and Discussion: Diffusion Coefficient&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 20: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See &amp;quot;Results and Discussion: Diffusion Coefficient&amp;quot;.&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665582</id>
		<title>Rep:Gm1110LiquidSim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665582"/>
		<updated>2018-02-16T11:32:41Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: /* Equilibration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
The main aim of the experiment was to determine the diffusion coefficient for the solid, liquid and vapour phases of a Lennard-Jones fluid using both the mean squared displacement method and velocity autocorrelation function method.&lt;br /&gt;
&lt;br /&gt;
In order to achieve this, it was first necessary to determine an appropriate timestep with which to run simulations, and investigate the effect of temperature and pressure on the density of the system. Other aims included seeing how heat capacity varied as a function of temperature for different densities, and calculating the radial distribution function for the three phases from simulations using VMD.    &lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
All simulations of the Lennard-Jones fluid were run using the LAMMPS software, and all quantities used were in reduced units.&lt;br /&gt;
&lt;br /&gt;
=== Part 1: Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
A simulation box consisting of 10 x 10 x 10 unit cells of a simple cubic lattice with an atomic density of 0.8 was defined. The atomic mass was set to 1.0 and the Lennard-Jones pairwise interaction cutoff distance was set to 3.0. The pairwise forcefield coefficients ε (potential well depth) and σ (zero-potential distance) were both set to 1.0. Five simulations were run for differing timestep values (0.0010, 0.0025, 0.0075, 0.0100 and 0.0150).&lt;br /&gt;
&lt;br /&gt;
=== Part 2: Equations of State in the NpT Ensemble ===&lt;br /&gt;
The simulation box was increased to consist of 15 x 15 x 15 unit cells of the same simple cubic lattice defined in part 1. A total of ten simulations were run in the NpT ensemble, varying temperature (2.0, 4.0, 6.0, 8.0 and 10.0) at two different densities (1.8 and 2.8) using the timestep value of 0.0025 determined in Part 1.&lt;br /&gt;
&lt;br /&gt;
=== Part 3: Calculation of Heat Capacity ===&lt;br /&gt;
The simulation box from Part 2 was used, with the density altered to take the values 0.2 and 0.8. Five simulations were run for each, with varying values of temperature (2.0, 2.2, 2.4, 2.6 and 2.8). A copy of the script written for this simulation can be found by clicking the image below:&lt;br /&gt;
[[File:gm1110_LS_M_3_1.png|centre|thumb|Copy of Script]]&lt;br /&gt;
&lt;br /&gt;
=== Part 4: Radial Distribution Functions ===&lt;br /&gt;
The simulation boxes used previously were altered to take a timestep of 0.002 and a L-J cutoff distance of 3.2, after which the solid, liquid and vapour phases were defined as having (density, temperature) values of (1.2, 1.2), (0.8, 1.2) and (0.05, 1.1) respectively. In particular, the solid phase was defined as having a face-centred cubic lattice, instead of the simple cubic lattice used for the liquid and vapour phases. VMD was used to analyse the trajectories for the three phases, with the distance between points in the generated RDF set to 0.05.&lt;br /&gt;
&lt;br /&gt;
=== Part 5: Diffusion Coefficient ===&lt;br /&gt;
The results from Part 4 were used to graph the mean squared displacement as a function of time, after which the gradient of the linear portion of the graph was extracted and used to calculate the diffusion coefficient from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_M_5_1.png|centre|150px]]&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were also calculated from the velocity autocorrelation function from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_M_5_2.png|centre|180px]]&lt;br /&gt;
&lt;br /&gt;
where [[File:gm1110_LS_M_5_3.png|150px]] is the velocity autocorrelation function.&lt;br /&gt;
&lt;br /&gt;
==Results and Discussion==&lt;br /&gt;
&lt;br /&gt;
=== Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
Simulations were run using the five different timesteps 0.0010, 0.0025, 0.0075, 0.0100 and 0.0150, and a plot of the results can be seen below (Figure 1).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_1_1.png|centre|thumb|Figure 1. A plot of total energy (reduced units) against time comparing simulations run using five different timestep values]]&lt;br /&gt;
&lt;br /&gt;
It was observed that the simulation run with a timestep of 0.0150 did not equilibrate. This was thought to have potentially been due to the timestep being too large, and therefore the simulation was missing too much detail to accurately simulate the fluid. The simulations run for timesteps of 0.0100 and 0.0075 did equilibrate (supporting the previous hypothesis that the 0.0150 timestep was too large), but converged at the wrong energy (approximately -3.181 and -3.183 respectively), indicating that the timesteps were still not quite small enough.&lt;br /&gt;
&lt;br /&gt;
The final two simulations run at timesteps of 0.0025 and 0.0010 both equilibrated to the same, correct energy (approximately -3.184), indicating that both would be suitable for use in further simulations. It is preferable, however, to maximise the timestep when running simulations as a smaller timestep requires more data points, and is therefore more “expensive” and takes longer to run for no real added value. Hence it was decided that a timestep of 0.0025 would be suitable for running further simulations.    &lt;br /&gt;
&lt;br /&gt;
=== Equations of State in the NpT Ensemble ===&lt;br /&gt;
Although specific values for temperature and pressure are specified for the simulations, in reality, the temperature and pressure of a system fluctuates over time and may therefore deviate away from the inputted values. Hence, the simulation calculates the pressure of the system at the end of every timestep, and adjusts the size of the simulation box such that the pressure once again corresponds to the specified value. Pressure controlled simulations are thus in the NpT ensemble and so volume (and therefore density) is not constant.&lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the resulting densities were plotted against temperature, along with values predicted by the ideal gas law and can be seen below (Figure 2).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_2_1.png|centre|thumb|Figure 2. Plot showing density as a function of temperature at pressures of 1.8 and 2.8 (all in reduced units), with error bars, and a plot of the densities predicted by the ideal gas law]]&lt;br /&gt;
&lt;br /&gt;
Clearly, the simulated densities are lower than those predicted by the ideal gas law, and the discrepancy increases with increasing pressure. This is due to the fact that the ideal gas law assumes perfectly elastic collisions between point particles, but in reality, intermolecular repulsive forces cause the simulated densities to be lower. In addition, an increase in pressure causes the molecules to be pushed closer together and increases both the number of collisions as well as the repulsive forces, leading to a greater deviation from ideality.    &lt;br /&gt;
&lt;br /&gt;
=== Calculation of Heat Capacity ===&lt;br /&gt;
Switching to the NVT ensemble, the heat capacity of the system can be determined by considering the magnitude of fluctuations in the system’s energy from its average equilibrium state from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_1.png|centre|250px]]            &lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the average heat capacities were plotted as a function of temperature (Figure 3).        &lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_2.png|centre|thumb|Figure 3. Plot of average heat capacity against temperature for densities of 0.8 and 0.2]]Heat capacity is a measure of the amount of energy required to increase the temperature of a substance. It is clear that the heat capacity is lower, and therefore easier to heat, for lower density systems as the particles are more spaced apart. This means that they are able to gain thermal energy more easily as they have more room for increased vibrations without an increase of repulsive forces or collisions compared to a higher density system. It was also noted that the heat capacity decreased with increasing temperature. This is due to the fact that at higher temperatures, the gap between energy levels decreases as the particles occupy higher energy states, thus making it easier for the particles to be promoted to higher energy levels.&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Functions ===&lt;br /&gt;
Radial distribution functions (g(r)) were calculated for the solid, liquid and vapour phases (see Figure 4) to check that the simulations were correctly reproducing the structural features of each phase. RDFs are essentially probability distribution functions for the likelihood of finding a particle at a given distance r away from a reference particle, and also gives information on the coordination sphere of the reference particle. The integral of the RDF (Figure 5) is also useful as it gives information on the number of atoms found at a distance r.&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_1.png|centre|thumb|Figure 4. Radial distribution function against displacement from a reference atom]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_2.png|centre|thumb|Figure 5. Integral of the radial distribution function against displacement]]&lt;br /&gt;
&lt;br /&gt;
For small r, all three phases have g(r) ~ 0, indicating an atomic density of zero as there exists a minimum distance at which atoms can approach each other. Also, g(r) tends to 1 for all three phases with increasing r, which represents the fact that the local density becomes equivalent to the mean density of the system as a whole.&lt;br /&gt;
&lt;br /&gt;
The graph of the solid phase shows sharp oscillating peaks, indicating that the atoms are strongly confined to their positions in the crystalline lattice, and the high degree of ordering means that although the osciallations do tend to g(r) = 1 for large r, this occurs much more slowly than for the other two phases. The first peak corresponds to the atoms nearest neighbours (of which there are 12), and the second and third peak correspond to the second and third nearest neighbours respectively (of which there are 6 and 24). &lt;br /&gt;
&lt;br /&gt;
The graph for the liquid phase shows broad, gently oscillating peaks that rapidly decay to g(r) = 1. As with the solid phase, the oscillations indicate some structure in the system whereby the atoms are loosely bound to their original positions, but the broader peaks indicate that they have much more freedom to move away from their positions. &lt;br /&gt;
&lt;br /&gt;
The graph for the vapour phase shows a single peak at approximately r = 1, after which it quickly decays back to g(r) = 1. This shows that the structure has very little to no order, and the particles are free to move unbound to any specific position. &lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|MSD Graphs (1,000 atoms)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_7.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_8.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_9.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 6. Graph of solid phase MSD for 1,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 7. Graph of fluid phase MSD for 1,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 8. Graph of vapour phase MSD for 1,000 atoms(with trendline)&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The general trends displayed in Figures 6-8 are as expected: the simulation does eventually establish linear behaviour, with the gradients increasing exponentially going from the solid to vapour phases. It is well known that diffusion in the vapour phase occurs much more readily than in the fluid phase, and more readily in the fluid phase than solid phase, and given that the diffusion coefficient is linearly correlated to the gradient of the mean square displacement, it was expected that the gradients of the graphs would increase in this manner. It was noted that the linear region of the solid phase plot (Figure 6) was quite noisy, but it was thought that this may be due to the small simulation size of 1,000 atoms.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|MSD Graphs (1,000,000 atoms)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_10.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_11.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_12.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 9. Graph of solid phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 10. Graph of fluid phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 11. Graph of vapour phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results from the simulation with 1,000,000 atoms (Figures 9-11) support the observations made with the 1,000 atom simulation. The only noticeable improvement from the 1,000 atom simulation was the reduction in noise of the linear region of the solid phase (Figure 9), suggesting that the assumption made previously to consider the more noisy region in Figure 6 as linear was correct, and that increasing the sample size did indeed improve the smoothness and accuracy of the curve.&lt;br /&gt;
&lt;br /&gt;
The gradient for the linear region of the plots were determined and used to calculate the diffusion coefficients (see table below).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=4|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Solid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Liquid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Vapour Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-6.17x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0688 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;2.27 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-6.83x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0698 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;2.47 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The results obtained are reasonable figures. In comparison with the 1,000,000 atom simulation, the values calculated for the diffusion coefficient with 1,000 atoms yielded a 9.7%, 1.4% and 8.0% error for the solid, liquid and vapour phases respectively. This suggests that for systems involving atoms that are at either extreme with regards to their range of motion, a larger atomic sample size would be suitable for simulations, whereas for fluids, more time-efficient simulations can be accurately conducted using the smaller 1,000 atom sample size.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient was also calculated using the velocity autocorrelation function (henceforth VACF).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|VACF Graphs&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_13.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_14.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_15.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 12. Graph of solid, liquid phase and simple harmonic oscillator VACF for 1,000 atoms&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 13. Running integral of solid, fluid and vapour phase VACF for 1,000 atoms&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 14. Running integral of solid, fluid and vapour phase VACF for 1,000,000 atoms&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=4|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Solid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Liquid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Vapour Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-1.84x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0783 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;3.06 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;4.55x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0901 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;3.27 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Generally, the results show that the diffusion coefficients calculated using the VACF method and MSD method are both to the same order of magnitude, although the coefficients calculated via the VACF were 29-32% greater for the fluid and vapour phases.&lt;br /&gt;
&lt;br /&gt;
The largest source of error in estimating the diffusion coefficient using the VACF was the number of atoms used in the simulations. This can be seen more clearly in Figures 16 and 17 which compare the VACF calculated for the fluid and vapour phases. The 1,000 atom simulation is clearly more noisy than the 1,000,000 atom simulation, indicating that the 1,000,000 atom simulation increases the reliability and accuracy of the results.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|VACF Graph Comparisons&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_18.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_19.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_20.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 15. Running integral of solid phase VACF for 1,000 and 1,000,000 atom simulations&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 16. Running integral of fluid phase VACF for 1,000 and 1,000,000 atom simulations&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 17. Running integral of vapour phase VACF for 1,000 and 1,000,000 atom simulations&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
==Tasks==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Introduction to Molecular Dynamics Simulations&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 1. For a default timestep value 0.1, estimate the positions of the maxima in the ERROR column as a function of time.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_1_1.png|centre|thumb|Figure 18. Plot showing the positions of the error maxima as a function of time, with a best fit line]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 2. (Experiment with different values of the timestep.) What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using a timestep of 0.1990 meant that the total energy did not change by more than 1% over the course of the simulation (Figure 19).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_2_1.png|centre|thumb|Figure 19. Plot showing the total energy during the simulation using a timestep of 0.1990]]&lt;br /&gt;
&lt;br /&gt;
The simulations are being run in isolated systems which requires total energy conservation, so large fluctuations in the energy would lead to inaccurate results. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 3. For a single Lennard-Jones interaction, find the separation, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;, and work out the well depth. Evaluate the integrals when σ = ε = 1.0.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i) The Lennard-Jones interaction is given by:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_1.png|200px]]&lt;br /&gt;
&lt;br /&gt;
Since r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; when ɸ = 0,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(ii) The force is given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_3.png|250px]]&lt;br /&gt;
&lt;br /&gt;
So at the separation r&amp;lt;sub&amp;gt;0 &amp;lt;/sub&amp;gt;= σ,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_4.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iii) The equilibrium separation r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs at the point at which all forces vanish, ie. when F = 0, so&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_5.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iv) And the well depth is therefore given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_6.png|270px]]&lt;br /&gt;
&lt;br /&gt;
(v)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_7.png|370px]]&lt;br /&gt;
&lt;br /&gt;
(vi)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_8.png|400px]]&lt;br /&gt;
&lt;br /&gt;
(vii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_9.png|370px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4. Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10,000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_1.png|550px]]&lt;br /&gt;
&lt;br /&gt;
For 10,000 water molecules,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_3.png|230px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 5. Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After the timestep, the atom would be at position (0.5 + 0.7, 0.5 + 0.6, 0.5 + 0.2) = (1.2, 1.1, 0.7). Applying the boundary conditions, this is equivalent to the position (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 6. The Lennard-Jones parameters for argon are sigma = 0.34nm, ε/k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt; = 120K. If the LJ cutoff is r&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 1.5 in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_1.png|140px]]&lt;br /&gt;
&lt;br /&gt;
(ii) It was previously determined in Task 1 that the well depth is - ε, so in real units,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_4.png|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(iii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_3.png|130px]]&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Equilibration&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 7. Why do you think giving atoms random starting coordinates causes problems in simulations?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If two atoms are generated too close to one another, then they would experience a large repulsive force, and would disrupt the behaviour of the surrounding atoms, causing the simulation to become inaccurate. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 8. Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_1.png|380px]]&lt;br /&gt;
&lt;br /&gt;
(ii) For a face-centred cubic lattice, note that the unit cell contains four atoms, as opposed to one atom with a simple cubic lattice. Then&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_4.png|460px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 9. Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is 1 atom contained within each unit cell. However for face-centred cubic lattices, each unit cell contains 4 atoms so four times as many atoms are created than with the simple lattice (ie. 4000 atoms).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 10. Given that we are specifying x&amp;lt;sub&amp;gt;i &amp;lt;/sub&amp;gt;(0) and v&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; (0), which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We will be using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 11. In the code section &amp;quot;Specify Timestep&amp;quot;, the second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write &amp;quot;timestep 0.001 // run 100000&amp;quot;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Defining the variable timestep allows us to reference the variable multiple times throughout the simulation if required, whilst preventing errors and making it easier to alter the code if we want to run the simulation for different timestep values. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 12. Make plots of energy, temperature, and pressure, against time for the 0.001 timestep experiment. Does the simulation reach equilibrium? How long does this take? Make a single plot of energy vs time for all of the timesteps. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice and why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_12_1.png|centre|thumb|Figure 20. Plot of energy against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_2.png|centre|thumb|Figure 21. Plot of temperature against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_3.png|centre|thumb|Figure 22. Plot of pressure against time for the 0.001 timestep experiment]]&lt;br /&gt;
&lt;br /&gt;
The 0.001 timestep experiment reaches equilibrium very quickly, within approximately 0.2s. &lt;br /&gt;
&lt;br /&gt;
A single plot of energy vs time for all of the timesteps can be found in &amp;quot;Results &amp;amp; Discussion: Investigation into Simulation Timestep in the NVE Ensemble Figure 1&amp;quot;, along with a detailed analysis, but in brief: the largest acceptable timestep is 0.0025, and a particularly bad choice would be 0.015 as it does not reach equilibrium.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Running Simulations under Specific Conditions&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 13. We need to choose gamma so that the temperature is correct T=fancy T if we multiply every velocity by γ. Solve the following two equations to determine gamma:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_2.png|center|200px]]&lt;br /&gt;
&lt;br /&gt;
Starting from the 2&amp;lt;sup&amp;gt;nd&amp;lt;/sup&amp;gt; equation,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_1.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 14: (Use the manual to find out the importance of the three numbers 100 1000 100000.) 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 (&amp;quot;run 100000&amp;quot;), how much time will you simulate? (DOUBLE CHECK THIS PART WITH OLLIE!)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Firstly, averages are taken for blocks of 100 values at a time to form the first set of averaged values (where av&amp;lt;sub&amp;gt;100,n&amp;lt;/sub&amp;gt; is the average value for the n&amp;lt;sup&amp;gt;th&amp;lt;/sup&amp;gt; block of 100 values). These values are then themselves averaged in blocks of 1000 values to form a second set of averaged values (av&amp;lt;sub&amp;gt;100,1&amp;lt;/sub&amp;gt; + av&amp;lt;sub&amp;gt;100,2&amp;lt;/sub&amp;gt; + ... + av&amp;lt;sub&amp;gt;100,1000&amp;lt;/sub&amp;gt;)/1000 = av&amp;lt;sub&amp;gt;1000,1&amp;lt;/sub&amp;gt;. Finally, these values are averaged once more in blocks of 100000 values.&lt;br /&gt;
&lt;br /&gt;
The amount of time simulated can be found by multiplying the number of steps by the value of the timestep (eg. 100,000 steps of a 0.001 timestep simulates 100 seconds).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 15: Plot density as a function of temperature for both of the pressures that you simulated. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figure 2 in &amp;quot;Results and Discussion: Equations of State in the NpT Ensemble&amp;quot; for the plot and subsequent discussion.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Heat Capacity Calculation&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 16: Run simulations at densities of 0.2, 0.8 and temperatures of 2.0, 2.2, 2.4, 2.6, 2.8, plotting C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;/V as a function of temperature, where V is the volume of the simulation cell, for both of your densities. Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the plot of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;/V as a function of temperature, please see Figure 3 in &amp;quot;Results and Discussion: Calculation of Heat Capacity&amp;quot; and the subsequent discussion on why the trend was as expected. A copy of the input script can be found in &amp;quot;Method: Part 3: Calculation of Heat Capacity&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Structural Properties and the Radial Distribution Function&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 17: Plot the RDFs for the three systems on the same axes. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figure 4 in &amp;quot;Results and Discussion: Radial Distribution Functions&amp;quot; for the plot and analysis. WHAT IS THE LATTICE SPACING? &lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Dynamical Properties and the Diffusion Coefficient&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 18: Make a plot for each of your simulations (solid/liquid/vapour), showing the mean squared displacement (&amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate D in each case. (Be careful with units!) Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 19: Evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (show working). On the same graph, with x range 0 to 500, plot C(tau) with omega = 1/2pi and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. Why is the harmonic oscillator VACF very different to the Lennard Jones solid and liquid? (Attach a copy of your plot)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_3.png|700px]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_2.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 20: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665581</id>
		<title>Rep:Gm1110LiquidSim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665581"/>
		<updated>2018-02-16T11:32:05Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: /* Introduction to Molecular Dynamics Simulations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
The main aim of the experiment was to determine the diffusion coefficient for the solid, liquid and vapour phases of a Lennard-Jones fluid using both the mean squared displacement method and velocity autocorrelation function method.&lt;br /&gt;
&lt;br /&gt;
In order to achieve this, it was first necessary to determine an appropriate timestep with which to run simulations, and investigate the effect of temperature and pressure on the density of the system. Other aims included seeing how heat capacity varied as a function of temperature for different densities, and calculating the radial distribution function for the three phases from simulations using VMD.    &lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
All simulations of the Lennard-Jones fluid were run using the LAMMPS software, and all quantities used were in reduced units.&lt;br /&gt;
&lt;br /&gt;
=== Part 1: Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
A simulation box consisting of 10 x 10 x 10 unit cells of a simple cubic lattice with an atomic density of 0.8 was defined. The atomic mass was set to 1.0 and the Lennard-Jones pairwise interaction cutoff distance was set to 3.0. The pairwise forcefield coefficients ε (potential well depth) and σ (zero-potential distance) were both set to 1.0. Five simulations were run for differing timestep values (0.0010, 0.0025, 0.0075, 0.0100 and 0.0150).&lt;br /&gt;
&lt;br /&gt;
=== Part 2: Equations of State in the NpT Ensemble ===&lt;br /&gt;
The simulation box was increased to consist of 15 x 15 x 15 unit cells of the same simple cubic lattice defined in part 1. A total of ten simulations were run in the NpT ensemble, varying temperature (2.0, 4.0, 6.0, 8.0 and 10.0) at two different densities (1.8 and 2.8) using the timestep value of 0.0025 determined in Part 1.&lt;br /&gt;
&lt;br /&gt;
=== Part 3: Calculation of Heat Capacity ===&lt;br /&gt;
The simulation box from Part 2 was used, with the density altered to take the values 0.2 and 0.8. Five simulations were run for each, with varying values of temperature (2.0, 2.2, 2.4, 2.6 and 2.8). A copy of the script written for this simulation can be found by clicking the image below:&lt;br /&gt;
[[File:gm1110_LS_M_3_1.png|centre|thumb|Copy of Script]]&lt;br /&gt;
&lt;br /&gt;
=== Part 4: Radial Distribution Functions ===&lt;br /&gt;
The simulation boxes used previously were altered to take a timestep of 0.002 and a L-J cutoff distance of 3.2, after which the solid, liquid and vapour phases were defined as having (density, temperature) values of (1.2, 1.2), (0.8, 1.2) and (0.05, 1.1) respectively. In particular, the solid phase was defined as having a face-centred cubic lattice, instead of the simple cubic lattice used for the liquid and vapour phases. VMD was used to analyse the trajectories for the three phases, with the distance between points in the generated RDF set to 0.05.&lt;br /&gt;
&lt;br /&gt;
=== Part 5: Diffusion Coefficient ===&lt;br /&gt;
The results from Part 4 were used to graph the mean squared displacement as a function of time, after which the gradient of the linear portion of the graph was extracted and used to calculate the diffusion coefficient from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_M_5_1.png|centre|150px]]&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were also calculated from the velocity autocorrelation function from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_M_5_2.png|centre|180px]]&lt;br /&gt;
&lt;br /&gt;
where [[File:gm1110_LS_M_5_3.png|150px]] is the velocity autocorrelation function.&lt;br /&gt;
&lt;br /&gt;
==Results and Discussion==&lt;br /&gt;
&lt;br /&gt;
=== Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
Simulations were run using the five different timesteps 0.0010, 0.0025, 0.0075, 0.0100 and 0.0150, and a plot of the results can be seen below (Figure 1).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_1_1.png|centre|thumb|Figure 1. A plot of total energy (reduced units) against time comparing simulations run using five different timestep values]]&lt;br /&gt;
&lt;br /&gt;
It was observed that the simulation run with a timestep of 0.0150 did not equilibrate. This was thought to have potentially been due to the timestep being too large, and therefore the simulation was missing too much detail to accurately simulate the fluid. The simulations run for timesteps of 0.0100 and 0.0075 did equilibrate (supporting the previous hypothesis that the 0.0150 timestep was too large), but converged at the wrong energy (approximately -3.181 and -3.183 respectively), indicating that the timesteps were still not quite small enough.&lt;br /&gt;
&lt;br /&gt;
The final two simulations run at timesteps of 0.0025 and 0.0010 both equilibrated to the same, correct energy (approximately -3.184), indicating that both would be suitable for use in further simulations. It is preferable, however, to maximise the timestep when running simulations as a smaller timestep requires more data points, and is therefore more “expensive” and takes longer to run for no real added value. Hence it was decided that a timestep of 0.0025 would be suitable for running further simulations.    &lt;br /&gt;
&lt;br /&gt;
=== Equations of State in the NpT Ensemble ===&lt;br /&gt;
Although specific values for temperature and pressure are specified for the simulations, in reality, the temperature and pressure of a system fluctuates over time and may therefore deviate away from the inputted values. Hence, the simulation calculates the pressure of the system at the end of every timestep, and adjusts the size of the simulation box such that the pressure once again corresponds to the specified value. Pressure controlled simulations are thus in the NpT ensemble and so volume (and therefore density) is not constant.&lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the resulting densities were plotted against temperature, along with values predicted by the ideal gas law and can be seen below (Figure 2).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_2_1.png|centre|thumb|Figure 2. Plot showing density as a function of temperature at pressures of 1.8 and 2.8 (all in reduced units), with error bars, and a plot of the densities predicted by the ideal gas law]]&lt;br /&gt;
&lt;br /&gt;
Clearly, the simulated densities are lower than those predicted by the ideal gas law, and the discrepancy increases with increasing pressure. This is due to the fact that the ideal gas law assumes perfectly elastic collisions between point particles, but in reality, intermolecular repulsive forces cause the simulated densities to be lower. In addition, an increase in pressure causes the molecules to be pushed closer together and increases both the number of collisions as well as the repulsive forces, leading to a greater deviation from ideality.    &lt;br /&gt;
&lt;br /&gt;
=== Calculation of Heat Capacity ===&lt;br /&gt;
Switching to the NVT ensemble, the heat capacity of the system can be determined by considering the magnitude of fluctuations in the system’s energy from its average equilibrium state from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_1.png|centre|250px]]            &lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the average heat capacities were plotted as a function of temperature (Figure 3).        &lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_2.png|centre|thumb|Figure 3. Plot of average heat capacity against temperature for densities of 0.8 and 0.2]]Heat capacity is a measure of the amount of energy required to increase the temperature of a substance. It is clear that the heat capacity is lower, and therefore easier to heat, for lower density systems as the particles are more spaced apart. This means that they are able to gain thermal energy more easily as they have more room for increased vibrations without an increase of repulsive forces or collisions compared to a higher density system. It was also noted that the heat capacity decreased with increasing temperature. This is due to the fact that at higher temperatures, the gap between energy levels decreases as the particles occupy higher energy states, thus making it easier for the particles to be promoted to higher energy levels.&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Functions ===&lt;br /&gt;
Radial distribution functions (g(r)) were calculated for the solid, liquid and vapour phases (see Figure 4) to check that the simulations were correctly reproducing the structural features of each phase. RDFs are essentially probability distribution functions for the likelihood of finding a particle at a given distance r away from a reference particle, and also gives information on the coordination sphere of the reference particle. The integral of the RDF (Figure 5) is also useful as it gives information on the number of atoms found at a distance r.&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_1.png|centre|thumb|Figure 4. Radial distribution function against displacement from a reference atom]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_2.png|centre|thumb|Figure 5. Integral of the radial distribution function against displacement]]&lt;br /&gt;
&lt;br /&gt;
For small r, all three phases have g(r) ~ 0, indicating an atomic density of zero as there exists a minimum distance at which atoms can approach each other. Also, g(r) tends to 1 for all three phases with increasing r, which represents the fact that the local density becomes equivalent to the mean density of the system as a whole.&lt;br /&gt;
&lt;br /&gt;
The graph of the solid phase shows sharp oscillating peaks, indicating that the atoms are strongly confined to their positions in the crystalline lattice, and the high degree of ordering means that although the osciallations do tend to g(r) = 1 for large r, this occurs much more slowly than for the other two phases. The first peak corresponds to the atoms nearest neighbours (of which there are 12), and the second and third peak correspond to the second and third nearest neighbours respectively (of which there are 6 and 24). &lt;br /&gt;
&lt;br /&gt;
The graph for the liquid phase shows broad, gently oscillating peaks that rapidly decay to g(r) = 1. As with the solid phase, the oscillations indicate some structure in the system whereby the atoms are loosely bound to their original positions, but the broader peaks indicate that they have much more freedom to move away from their positions. &lt;br /&gt;
&lt;br /&gt;
The graph for the vapour phase shows a single peak at approximately r = 1, after which it quickly decays back to g(r) = 1. This shows that the structure has very little to no order, and the particles are free to move unbound to any specific position. &lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|MSD Graphs (1,000 atoms)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_7.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_8.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_9.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 6. Graph of solid phase MSD for 1,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 7. Graph of fluid phase MSD for 1,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 8. Graph of vapour phase MSD for 1,000 atoms(with trendline)&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The general trends displayed in Figures 6-8 are as expected: the simulation does eventually establish linear behaviour, with the gradients increasing exponentially going from the solid to vapour phases. It is well known that diffusion in the vapour phase occurs much more readily than in the fluid phase, and more readily in the fluid phase than solid phase, and given that the diffusion coefficient is linearly correlated to the gradient of the mean square displacement, it was expected that the gradients of the graphs would increase in this manner. It was noted that the linear region of the solid phase plot (Figure 6) was quite noisy, but it was thought that this may be due to the small simulation size of 1,000 atoms.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|MSD Graphs (1,000,000 atoms)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_10.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_11.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_12.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 9. Graph of solid phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 10. Graph of fluid phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 11. Graph of vapour phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results from the simulation with 1,000,000 atoms (Figures 9-11) support the observations made with the 1,000 atom simulation. The only noticeable improvement from the 1,000 atom simulation was the reduction in noise of the linear region of the solid phase (Figure 9), suggesting that the assumption made previously to consider the more noisy region in Figure 6 as linear was correct, and that increasing the sample size did indeed improve the smoothness and accuracy of the curve.&lt;br /&gt;
&lt;br /&gt;
The gradient for the linear region of the plots were determined and used to calculate the diffusion coefficients (see table below).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=4|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Solid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Liquid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Vapour Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-6.17x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0688 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;2.27 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-6.83x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0698 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;2.47 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The results obtained are reasonable figures. In comparison with the 1,000,000 atom simulation, the values calculated for the diffusion coefficient with 1,000 atoms yielded a 9.7%, 1.4% and 8.0% error for the solid, liquid and vapour phases respectively. This suggests that for systems involving atoms that are at either extreme with regards to their range of motion, a larger atomic sample size would be suitable for simulations, whereas for fluids, more time-efficient simulations can be accurately conducted using the smaller 1,000 atom sample size.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient was also calculated using the velocity autocorrelation function (henceforth VACF).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|VACF Graphs&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_13.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_14.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_15.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 12. Graph of solid, liquid phase and simple harmonic oscillator VACF for 1,000 atoms&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 13. Running integral of solid, fluid and vapour phase VACF for 1,000 atoms&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 14. Running integral of solid, fluid and vapour phase VACF for 1,000,000 atoms&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=4|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Solid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Liquid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Vapour Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-1.84x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0783 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;3.06 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;4.55x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0901 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;3.27 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Generally, the results show that the diffusion coefficients calculated using the VACF method and MSD method are both to the same order of magnitude, although the coefficients calculated via the VACF were 29-32% greater for the fluid and vapour phases.&lt;br /&gt;
&lt;br /&gt;
The largest source of error in estimating the diffusion coefficient using the VACF was the number of atoms used in the simulations. This can be seen more clearly in Figures 16 and 17 which compare the VACF calculated for the fluid and vapour phases. The 1,000 atom simulation is clearly more noisy than the 1,000,000 atom simulation, indicating that the 1,000,000 atom simulation increases the reliability and accuracy of the results.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|VACF Graph Comparisons&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_18.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_19.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_20.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 15. Running integral of solid phase VACF for 1,000 and 1,000,000 atom simulations&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 16. Running integral of fluid phase VACF for 1,000 and 1,000,000 atom simulations&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 17. Running integral of vapour phase VACF for 1,000 and 1,000,000 atom simulations&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
==Tasks==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Introduction to Molecular Dynamics Simulations&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 1. For a default timestep value 0.1, estimate the positions of the maxima in the ERROR column as a function of time.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_1_1.png|centre|thumb|Figure 18. Plot showing the positions of the error maxima as a function of time, with a best fit line]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 2. (Experiment with different values of the timestep.) What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using a timestep of 0.1990 meant that the total energy did not change by more than 1% over the course of the simulation (Figure 19).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_2_1.png|centre|thumb|Figure 19. Plot showing the total energy during the simulation using a timestep of 0.1990]]&lt;br /&gt;
&lt;br /&gt;
The simulations are being run in isolated systems which requires total energy conservation, so large fluctuations in the energy would lead to inaccurate results. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 3. For a single Lennard-Jones interaction, find the separation, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;, and work out the well depth. Evaluate the integrals when σ = ε = 1.0.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i) The Lennard-Jones interaction is given by:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_1.png|200px]]&lt;br /&gt;
&lt;br /&gt;
Since r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; when ɸ = 0,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(ii) The force is given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_3.png|250px]]&lt;br /&gt;
&lt;br /&gt;
So at the separation r&amp;lt;sub&amp;gt;0 &amp;lt;/sub&amp;gt;= σ,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_4.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iii) The equilibrium separation r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs at the point at which all forces vanish, ie. when F = 0, so&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_5.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iv) And the well depth is therefore given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_6.png|270px]]&lt;br /&gt;
&lt;br /&gt;
(v)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_7.png|370px]]&lt;br /&gt;
&lt;br /&gt;
(vi)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_8.png|400px]]&lt;br /&gt;
&lt;br /&gt;
(vii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_9.png|370px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4. Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10,000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_1.png|550px]]&lt;br /&gt;
&lt;br /&gt;
For 10,000 water molecules,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_3.png|230px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 5. Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After the timestep, the atom would be at position (0.5 + 0.7, 0.5 + 0.6, 0.5 + 0.2) = (1.2, 1.1, 0.7). Applying the boundary conditions, this is equivalent to the position (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 6. The Lennard-Jones parameters for argon are sigma = 0.34nm, ε/k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt; = 120K. If the LJ cutoff is r&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 1.5 in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_1.png|140px]]&lt;br /&gt;
&lt;br /&gt;
(ii) It was previously determined in Task 1 that the well depth is - ε, so in real units,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_4.png|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(iii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_3.png|130px]]&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Equilibration&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 7. Why do you think giving atoms random starting coordinates causes problems in simulations?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If two atoms are generated too close to one another, then they would experience a large repulsive force, and would disrupt the behaviour of the surrounding atoms, causing the simulation to become inaccurate. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 8. Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_1.png|380px]]&lt;br /&gt;
&lt;br /&gt;
(ii) For a face-centred cubic lattice, note that the unit cell contains four atoms, as opposed to one atom with a simple cubic lattice. Then&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_4.png|460px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 9. Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is 1 atom contained within each unit cell. However for face-centred cubic lattices, each unit cell contains 4 atoms so four times as many atoms are created than with the simple lattice (ie. 4000 atoms).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 10. Given that we are specifying x&amp;lt;sub&amp;gt;i &amp;lt;/sub&amp;gt;(0) and v&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; (0), which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We will be using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 11. In the code section &amp;quot;Specify Timestep&amp;quot;, the second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write &amp;quot;timestep 0.001 // run 100000&amp;quot;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Defining the variable timestep allows us to reference the variable multiple times throughout the simulation if required, whilst preventing errors and making it easier to alter the code if we want to run the simulation for different timestep values. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 12. Make plots of energy, temperature, and pressure, against time for the 0.001 timestep experiment. Does the simulation reach equilibrium? How long does this take? Make a single plot of energy vs time for all of the timesteps. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice and why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_12_1.png|centre|thumb|Figure X. Plot of energy against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_2.png|centre|thumb|Figure X. Plot of temperature against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_3.png|centre|thumb|Figure X. Plot of pressure against time for the 0.001 timestep experiment]]&lt;br /&gt;
&lt;br /&gt;
The 0.001 timestep experiment reaches equilibrium very quickly, within approximately 0.2s. &lt;br /&gt;
&lt;br /&gt;
A single plot of energy vs time for all of the timesteps can be found in &amp;quot;Results &amp;amp; Discussion: Investigation into Simulation Timestep in the NVE Ensemble Figure 1&amp;quot;, along with a detailed analysis, but in brief: the largest acceptable timestep is 0.0025, and a particularly bad choice would be 0.015 as it does not reach equilibrium.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Running Simulations under Specific Conditions&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 13. We need to choose gamma so that the temperature is correct T=fancy T if we multiply every velocity by γ. Solve the following two equations to determine gamma:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_2.png|center|200px]]&lt;br /&gt;
&lt;br /&gt;
Starting from the 2&amp;lt;sup&amp;gt;nd&amp;lt;/sup&amp;gt; equation,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_1.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 14: (Use the manual to find out the importance of the three numbers 100 1000 100000.) 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 (&amp;quot;run 100000&amp;quot;), how much time will you simulate? (DOUBLE CHECK THIS PART WITH OLLIE!)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Firstly, averages are taken for blocks of 100 values at a time to form the first set of averaged values (where av&amp;lt;sub&amp;gt;100,n&amp;lt;/sub&amp;gt; is the average value for the n&amp;lt;sup&amp;gt;th&amp;lt;/sup&amp;gt; block of 100 values). These values are then themselves averaged in blocks of 1000 values to form a second set of averaged values (av&amp;lt;sub&amp;gt;100,1&amp;lt;/sub&amp;gt; + av&amp;lt;sub&amp;gt;100,2&amp;lt;/sub&amp;gt; + ... + av&amp;lt;sub&amp;gt;100,1000&amp;lt;/sub&amp;gt;)/1000 = av&amp;lt;sub&amp;gt;1000,1&amp;lt;/sub&amp;gt;. Finally, these values are averaged once more in blocks of 100000 values.&lt;br /&gt;
&lt;br /&gt;
The amount of time simulated can be found by multiplying the number of steps by the value of the timestep (eg. 100,000 steps of a 0.001 timestep simulates 100 seconds).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 15: Plot density as a function of temperature for both of the pressures that you simulated. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figure 2 in &amp;quot;Results and Discussion: Equations of State in the NpT Ensemble&amp;quot; for the plot and subsequent discussion.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Heat Capacity Calculation&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 16: Run simulations at densities of 0.2, 0.8 and temperatures of 2.0, 2.2, 2.4, 2.6, 2.8, plotting C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;/V as a function of temperature, where V is the volume of the simulation cell, for both of your densities. Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the plot of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;/V as a function of temperature, please see Figure 3 in &amp;quot;Results and Discussion: Calculation of Heat Capacity&amp;quot; and the subsequent discussion on why the trend was as expected. A copy of the input script can be found in &amp;quot;Method: Part 3: Calculation of Heat Capacity&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Structural Properties and the Radial Distribution Function&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 17: Plot the RDFs for the three systems on the same axes. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figure 4 in &amp;quot;Results and Discussion: Radial Distribution Functions&amp;quot; for the plot and analysis. WHAT IS THE LATTICE SPACING? &lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Dynamical Properties and the Diffusion Coefficient&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 18: Make a plot for each of your simulations (solid/liquid/vapour), showing the mean squared displacement (&amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate D in each case. (Be careful with units!) Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 19: Evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (show working). On the same graph, with x range 0 to 500, plot C(tau) with omega = 1/2pi and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. Why is the harmonic oscillator VACF very different to the Lennard Jones solid and liquid? (Attach a copy of your plot)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_3.png|700px]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_2.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 20: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665580</id>
		<title>Rep:Gm1110LiquidSim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665580"/>
		<updated>2018-02-16T11:31:08Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: /* Methods */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
The main aim of the experiment was to determine the diffusion coefficient for the solid, liquid and vapour phases of a Lennard-Jones fluid using both the mean squared displacement method and velocity autocorrelation function method.&lt;br /&gt;
&lt;br /&gt;
In order to achieve this, it was first necessary to determine an appropriate timestep with which to run simulations, and investigate the effect of temperature and pressure on the density of the system. Other aims included seeing how heat capacity varied as a function of temperature for different densities, and calculating the radial distribution function for the three phases from simulations using VMD.    &lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
All simulations of the Lennard-Jones fluid were run using the LAMMPS software, and all quantities used were in reduced units.&lt;br /&gt;
&lt;br /&gt;
=== Part 1: Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
A simulation box consisting of 10 x 10 x 10 unit cells of a simple cubic lattice with an atomic density of 0.8 was defined. The atomic mass was set to 1.0 and the Lennard-Jones pairwise interaction cutoff distance was set to 3.0. The pairwise forcefield coefficients ε (potential well depth) and σ (zero-potential distance) were both set to 1.0. Five simulations were run for differing timestep values (0.0010, 0.0025, 0.0075, 0.0100 and 0.0150).&lt;br /&gt;
&lt;br /&gt;
=== Part 2: Equations of State in the NpT Ensemble ===&lt;br /&gt;
The simulation box was increased to consist of 15 x 15 x 15 unit cells of the same simple cubic lattice defined in part 1. A total of ten simulations were run in the NpT ensemble, varying temperature (2.0, 4.0, 6.0, 8.0 and 10.0) at two different densities (1.8 and 2.8) using the timestep value of 0.0025 determined in Part 1.&lt;br /&gt;
&lt;br /&gt;
=== Part 3: Calculation of Heat Capacity ===&lt;br /&gt;
The simulation box from Part 2 was used, with the density altered to take the values 0.2 and 0.8. Five simulations were run for each, with varying values of temperature (2.0, 2.2, 2.4, 2.6 and 2.8). A copy of the script written for this simulation can be found by clicking the image below:&lt;br /&gt;
[[File:gm1110_LS_M_3_1.png|centre|thumb|Copy of Script]]&lt;br /&gt;
&lt;br /&gt;
=== Part 4: Radial Distribution Functions ===&lt;br /&gt;
The simulation boxes used previously were altered to take a timestep of 0.002 and a L-J cutoff distance of 3.2, after which the solid, liquid and vapour phases were defined as having (density, temperature) values of (1.2, 1.2), (0.8, 1.2) and (0.05, 1.1) respectively. In particular, the solid phase was defined as having a face-centred cubic lattice, instead of the simple cubic lattice used for the liquid and vapour phases. VMD was used to analyse the trajectories for the three phases, with the distance between points in the generated RDF set to 0.05.&lt;br /&gt;
&lt;br /&gt;
=== Part 5: Diffusion Coefficient ===&lt;br /&gt;
The results from Part 4 were used to graph the mean squared displacement as a function of time, after which the gradient of the linear portion of the graph was extracted and used to calculate the diffusion coefficient from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_M_5_1.png|centre|150px]]&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were also calculated from the velocity autocorrelation function from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_M_5_2.png|centre|180px]]&lt;br /&gt;
&lt;br /&gt;
where [[File:gm1110_LS_M_5_3.png|150px]] is the velocity autocorrelation function.&lt;br /&gt;
&lt;br /&gt;
==Results and Discussion==&lt;br /&gt;
&lt;br /&gt;
=== Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
Simulations were run using the five different timesteps 0.0010, 0.0025, 0.0075, 0.0100 and 0.0150, and a plot of the results can be seen below (Figure 1).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_1_1.png|centre|thumb|Figure 1. A plot of total energy (reduced units) against time comparing simulations run using five different timestep values]]&lt;br /&gt;
&lt;br /&gt;
It was observed that the simulation run with a timestep of 0.0150 did not equilibrate. This was thought to have potentially been due to the timestep being too large, and therefore the simulation was missing too much detail to accurately simulate the fluid. The simulations run for timesteps of 0.0100 and 0.0075 did equilibrate (supporting the previous hypothesis that the 0.0150 timestep was too large), but converged at the wrong energy (approximately -3.181 and -3.183 respectively), indicating that the timesteps were still not quite small enough.&lt;br /&gt;
&lt;br /&gt;
The final two simulations run at timesteps of 0.0025 and 0.0010 both equilibrated to the same, correct energy (approximately -3.184), indicating that both would be suitable for use in further simulations. It is preferable, however, to maximise the timestep when running simulations as a smaller timestep requires more data points, and is therefore more “expensive” and takes longer to run for no real added value. Hence it was decided that a timestep of 0.0025 would be suitable for running further simulations.    &lt;br /&gt;
&lt;br /&gt;
=== Equations of State in the NpT Ensemble ===&lt;br /&gt;
Although specific values for temperature and pressure are specified for the simulations, in reality, the temperature and pressure of a system fluctuates over time and may therefore deviate away from the inputted values. Hence, the simulation calculates the pressure of the system at the end of every timestep, and adjusts the size of the simulation box such that the pressure once again corresponds to the specified value. Pressure controlled simulations are thus in the NpT ensemble and so volume (and therefore density) is not constant.&lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the resulting densities were plotted against temperature, along with values predicted by the ideal gas law and can be seen below (Figure 2).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_2_1.png|centre|thumb|Figure 2. Plot showing density as a function of temperature at pressures of 1.8 and 2.8 (all in reduced units), with error bars, and a plot of the densities predicted by the ideal gas law]]&lt;br /&gt;
&lt;br /&gt;
Clearly, the simulated densities are lower than those predicted by the ideal gas law, and the discrepancy increases with increasing pressure. This is due to the fact that the ideal gas law assumes perfectly elastic collisions between point particles, but in reality, intermolecular repulsive forces cause the simulated densities to be lower. In addition, an increase in pressure causes the molecules to be pushed closer together and increases both the number of collisions as well as the repulsive forces, leading to a greater deviation from ideality.    &lt;br /&gt;
&lt;br /&gt;
=== Calculation of Heat Capacity ===&lt;br /&gt;
Switching to the NVT ensemble, the heat capacity of the system can be determined by considering the magnitude of fluctuations in the system’s energy from its average equilibrium state from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_1.png|centre|250px]]            &lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the average heat capacities were plotted as a function of temperature (Figure 3).        &lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_2.png|centre|thumb|Figure 3. Plot of average heat capacity against temperature for densities of 0.8 and 0.2]]Heat capacity is a measure of the amount of energy required to increase the temperature of a substance. It is clear that the heat capacity is lower, and therefore easier to heat, for lower density systems as the particles are more spaced apart. This means that they are able to gain thermal energy more easily as they have more room for increased vibrations without an increase of repulsive forces or collisions compared to a higher density system. It was also noted that the heat capacity decreased with increasing temperature. This is due to the fact that at higher temperatures, the gap between energy levels decreases as the particles occupy higher energy states, thus making it easier for the particles to be promoted to higher energy levels.&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Functions ===&lt;br /&gt;
Radial distribution functions (g(r)) were calculated for the solid, liquid and vapour phases (see Figure 4) to check that the simulations were correctly reproducing the structural features of each phase. RDFs are essentially probability distribution functions for the likelihood of finding a particle at a given distance r away from a reference particle, and also gives information on the coordination sphere of the reference particle. The integral of the RDF (Figure 5) is also useful as it gives information on the number of atoms found at a distance r.&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_1.png|centre|thumb|Figure 4. Radial distribution function against displacement from a reference atom]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_2.png|centre|thumb|Figure 5. Integral of the radial distribution function against displacement]]&lt;br /&gt;
&lt;br /&gt;
For small r, all three phases have g(r) ~ 0, indicating an atomic density of zero as there exists a minimum distance at which atoms can approach each other. Also, g(r) tends to 1 for all three phases with increasing r, which represents the fact that the local density becomes equivalent to the mean density of the system as a whole.&lt;br /&gt;
&lt;br /&gt;
The graph of the solid phase shows sharp oscillating peaks, indicating that the atoms are strongly confined to their positions in the crystalline lattice, and the high degree of ordering means that although the osciallations do tend to g(r) = 1 for large r, this occurs much more slowly than for the other two phases. The first peak corresponds to the atoms nearest neighbours (of which there are 12), and the second and third peak correspond to the second and third nearest neighbours respectively (of which there are 6 and 24). &lt;br /&gt;
&lt;br /&gt;
The graph for the liquid phase shows broad, gently oscillating peaks that rapidly decay to g(r) = 1. As with the solid phase, the oscillations indicate some structure in the system whereby the atoms are loosely bound to their original positions, but the broader peaks indicate that they have much more freedom to move away from their positions. &lt;br /&gt;
&lt;br /&gt;
The graph for the vapour phase shows a single peak at approximately r = 1, after which it quickly decays back to g(r) = 1. This shows that the structure has very little to no order, and the particles are free to move unbound to any specific position. &lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|MSD Graphs (1,000 atoms)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_7.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_8.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_9.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 6. Graph of solid phase MSD for 1,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 7. Graph of fluid phase MSD for 1,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 8. Graph of vapour phase MSD for 1,000 atoms(with trendline)&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The general trends displayed in Figures 6-8 are as expected: the simulation does eventually establish linear behaviour, with the gradients increasing exponentially going from the solid to vapour phases. It is well known that diffusion in the vapour phase occurs much more readily than in the fluid phase, and more readily in the fluid phase than solid phase, and given that the diffusion coefficient is linearly correlated to the gradient of the mean square displacement, it was expected that the gradients of the graphs would increase in this manner. It was noted that the linear region of the solid phase plot (Figure 6) was quite noisy, but it was thought that this may be due to the small simulation size of 1,000 atoms.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|MSD Graphs (1,000,000 atoms)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_10.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_11.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_12.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 9. Graph of solid phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 10. Graph of fluid phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 11. Graph of vapour phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results from the simulation with 1,000,000 atoms (Figures 9-11) support the observations made with the 1,000 atom simulation. The only noticeable improvement from the 1,000 atom simulation was the reduction in noise of the linear region of the solid phase (Figure 9), suggesting that the assumption made previously to consider the more noisy region in Figure 6 as linear was correct, and that increasing the sample size did indeed improve the smoothness and accuracy of the curve.&lt;br /&gt;
&lt;br /&gt;
The gradient for the linear region of the plots were determined and used to calculate the diffusion coefficients (see table below).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=4|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Solid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Liquid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Vapour Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-6.17x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0688 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;2.27 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-6.83x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0698 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;2.47 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The results obtained are reasonable figures. In comparison with the 1,000,000 atom simulation, the values calculated for the diffusion coefficient with 1,000 atoms yielded a 9.7%, 1.4% and 8.0% error for the solid, liquid and vapour phases respectively. This suggests that for systems involving atoms that are at either extreme with regards to their range of motion, a larger atomic sample size would be suitable for simulations, whereas for fluids, more time-efficient simulations can be accurately conducted using the smaller 1,000 atom sample size.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient was also calculated using the velocity autocorrelation function (henceforth VACF).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|VACF Graphs&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_13.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_14.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_15.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 12. Graph of solid, liquid phase and simple harmonic oscillator VACF for 1,000 atoms&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 13. Running integral of solid, fluid and vapour phase VACF for 1,000 atoms&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 14. Running integral of solid, fluid and vapour phase VACF for 1,000,000 atoms&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=4|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Solid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Liquid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Vapour Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-1.84x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0783 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;3.06 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;4.55x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0901 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;3.27 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Generally, the results show that the diffusion coefficients calculated using the VACF method and MSD method are both to the same order of magnitude, although the coefficients calculated via the VACF were 29-32% greater for the fluid and vapour phases.&lt;br /&gt;
&lt;br /&gt;
The largest source of error in estimating the diffusion coefficient using the VACF was the number of atoms used in the simulations. This can be seen more clearly in Figures 16 and 17 which compare the VACF calculated for the fluid and vapour phases. The 1,000 atom simulation is clearly more noisy than the 1,000,000 atom simulation, indicating that the 1,000,000 atom simulation increases the reliability and accuracy of the results.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|VACF Graph Comparisons&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_18.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_19.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_20.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 15. Running integral of solid phase VACF for 1,000 and 1,000,000 atom simulations&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 16. Running integral of fluid phase VACF for 1,000 and 1,000,000 atom simulations&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 17. Running integral of vapour phase VACF for 1,000 and 1,000,000 atom simulations&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
==Tasks==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Introduction to Molecular Dynamics Simulations&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 1. For a default timestep value 0.1, estimate the positions of the maxima in the ERROR column as a function of time.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_1_1.png|centre|thumb|Figure X. Plot showing the positions of the error maxima as a function of time, with a best fit line]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 2. (Experiment with different values of the timestep.) What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using a timestep of 0.1990 meant that the total energy did not change by more than 1% over the course of the simulation (Figure X).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_2_1.png|centre|thumb|Figure X. Plot showing the total energy during the simulation using a timestep of 0.1990]]&lt;br /&gt;
&lt;br /&gt;
The simulations are being run in isolated systems which requires total energy conservation, so large fluctuations in the energy would lead to inaccurate results. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 3. For a single Lennard-Jones interaction, find the separation, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;, and work out the well depth. Evaluate the integrals when σ = ε = 1.0.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i) The Lennard-Jones interaction is given by:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_1.png|200px]]&lt;br /&gt;
&lt;br /&gt;
Since r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; when ɸ = 0,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(ii) The force is given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_3.png|250px]]&lt;br /&gt;
&lt;br /&gt;
So at the separation r&amp;lt;sub&amp;gt;0 &amp;lt;/sub&amp;gt;= σ,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_4.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iii) The equilibrium separation r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs at the point at which all forces vanish, ie. when F = 0, so&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_5.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iv) And the well depth is therefore given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_6.png|270px]]&lt;br /&gt;
&lt;br /&gt;
(v)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_7.png|370px]]&lt;br /&gt;
&lt;br /&gt;
(vi)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_8.png|400px]]&lt;br /&gt;
&lt;br /&gt;
(vii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_9.png|370px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4. Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10,000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_1.png|550px]]&lt;br /&gt;
&lt;br /&gt;
For 10,000 water molecules,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_3.png|230px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 5. Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After the timestep, the atom would be at position (0.5 + 0.7, 0.5 + 0.6, 0.5 + 0.2) = (1.2, 1.1, 0.7). Applying the boundary conditions, this is equivalent to the position (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 6. The Lennard-Jones parameters for argon are sigma = 0.34nm, ε/k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt; = 120K. If the LJ cutoff is r&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 1.5 in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_1.png|140px]]&lt;br /&gt;
&lt;br /&gt;
(ii) It was previously determined in Task 1 that the well depth is - ε, so in real units,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_4.png|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(iii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_3.png|130px]]&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Equilibration&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 7. Why do you think giving atoms random starting coordinates causes problems in simulations?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If two atoms are generated too close to one another, then they would experience a large repulsive force, and would disrupt the behaviour of the surrounding atoms, causing the simulation to become inaccurate. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 8. Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_1.png|380px]]&lt;br /&gt;
&lt;br /&gt;
(ii) For a face-centred cubic lattice, note that the unit cell contains four atoms, as opposed to one atom with a simple cubic lattice. Then&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_4.png|460px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 9. Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is 1 atom contained within each unit cell. However for face-centred cubic lattices, each unit cell contains 4 atoms so four times as many atoms are created than with the simple lattice (ie. 4000 atoms).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 10. Given that we are specifying x&amp;lt;sub&amp;gt;i &amp;lt;/sub&amp;gt;(0) and v&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; (0), which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We will be using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 11. In the code section &amp;quot;Specify Timestep&amp;quot;, the second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write &amp;quot;timestep 0.001 // run 100000&amp;quot;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Defining the variable timestep allows us to reference the variable multiple times throughout the simulation if required, whilst preventing errors and making it easier to alter the code if we want to run the simulation for different timestep values. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 12. Make plots of energy, temperature, and pressure, against time for the 0.001 timestep experiment. Does the simulation reach equilibrium? How long does this take? Make a single plot of energy vs time for all of the timesteps. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice and why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_12_1.png|centre|thumb|Figure X. Plot of energy against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_2.png|centre|thumb|Figure X. Plot of temperature against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_3.png|centre|thumb|Figure X. Plot of pressure against time for the 0.001 timestep experiment]]&lt;br /&gt;
&lt;br /&gt;
The 0.001 timestep experiment reaches equilibrium very quickly, within approximately 0.2s. &lt;br /&gt;
&lt;br /&gt;
A single plot of energy vs time for all of the timesteps can be found in &amp;quot;Results &amp;amp; Discussion: Investigation into Simulation Timestep in the NVE Ensemble Figure 1&amp;quot;, along with a detailed analysis, but in brief: the largest acceptable timestep is 0.0025, and a particularly bad choice would be 0.015 as it does not reach equilibrium.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Running Simulations under Specific Conditions&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 13. We need to choose gamma so that the temperature is correct T=fancy T if we multiply every velocity by γ. Solve the following two equations to determine gamma:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_2.png|center|200px]]&lt;br /&gt;
&lt;br /&gt;
Starting from the 2&amp;lt;sup&amp;gt;nd&amp;lt;/sup&amp;gt; equation,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_1.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 14: (Use the manual to find out the importance of the three numbers 100 1000 100000.) 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 (&amp;quot;run 100000&amp;quot;), how much time will you simulate? (DOUBLE CHECK THIS PART WITH OLLIE!)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Firstly, averages are taken for blocks of 100 values at a time to form the first set of averaged values (where av&amp;lt;sub&amp;gt;100,n&amp;lt;/sub&amp;gt; is the average value for the n&amp;lt;sup&amp;gt;th&amp;lt;/sup&amp;gt; block of 100 values). These values are then themselves averaged in blocks of 1000 values to form a second set of averaged values (av&amp;lt;sub&amp;gt;100,1&amp;lt;/sub&amp;gt; + av&amp;lt;sub&amp;gt;100,2&amp;lt;/sub&amp;gt; + ... + av&amp;lt;sub&amp;gt;100,1000&amp;lt;/sub&amp;gt;)/1000 = av&amp;lt;sub&amp;gt;1000,1&amp;lt;/sub&amp;gt;. Finally, these values are averaged once more in blocks of 100000 values.&lt;br /&gt;
&lt;br /&gt;
The amount of time simulated can be found by multiplying the number of steps by the value of the timestep (eg. 100,000 steps of a 0.001 timestep simulates 100 seconds).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 15: Plot density as a function of temperature for both of the pressures that you simulated. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figure 2 in &amp;quot;Results and Discussion: Equations of State in the NpT Ensemble&amp;quot; for the plot and subsequent discussion.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Heat Capacity Calculation&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 16: Run simulations at densities of 0.2, 0.8 and temperatures of 2.0, 2.2, 2.4, 2.6, 2.8, plotting C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;/V as a function of temperature, where V is the volume of the simulation cell, for both of your densities. Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the plot of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;/V as a function of temperature, please see Figure 3 in &amp;quot;Results and Discussion: Calculation of Heat Capacity&amp;quot; and the subsequent discussion on why the trend was as expected. A copy of the input script can be found in &amp;quot;Method: Part 3: Calculation of Heat Capacity&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Structural Properties and the Radial Distribution Function&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 17: Plot the RDFs for the three systems on the same axes. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figure 4 in &amp;quot;Results and Discussion: Radial Distribution Functions&amp;quot; for the plot and analysis. WHAT IS THE LATTICE SPACING? &lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Dynamical Properties and the Diffusion Coefficient&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 18: Make a plot for each of your simulations (solid/liquid/vapour), showing the mean squared displacement (&amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate D in each case. (Be careful with units!) Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 19: Evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (show working). On the same graph, with x range 0 to 500, plot C(tau) with omega = 1/2pi and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. Why is the harmonic oscillator VACF very different to the Lennard Jones solid and liquid? (Attach a copy of your plot)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_3.png|700px]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_2.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 20: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gm1110_LS_M_5_3.png&amp;diff=665579</id>
		<title>File:Gm1110 LS M 5 3.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gm1110_LS_M_5_3.png&amp;diff=665579"/>
		<updated>2018-02-16T11:30:17Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gm1110_LS_M_5_2.png&amp;diff=665578</id>
		<title>File:Gm1110 LS M 5 2.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gm1110_LS_M_5_2.png&amp;diff=665578"/>
		<updated>2018-02-16T11:29:44Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665577</id>
		<title>Rep:Gm1110LiquidSim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665577"/>
		<updated>2018-02-16T11:28:51Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: /* Diffusion Coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
The main aim of the experiment was to determine the diffusion coefficient for the solid, liquid and vapour phases of a Lennard-Jones fluid using both the mean squared displacement method and velocity autocorrelation function method.&lt;br /&gt;
&lt;br /&gt;
In order to achieve this, it was first necessary to determine an appropriate timestep with which to run simulations, and investigate the effect of temperature and pressure on the density of the system. Other aims included seeing how heat capacity varied as a function of temperature for different densities, and calculating the radial distribution function for the three phases from simulations using VMD.    &lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
All simulations of the Lennard-Jones fluid were run using the LAMMPS software, and all quantities used were in reduced units.&lt;br /&gt;
&lt;br /&gt;
=== Part 1: Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
A simulation box consisting of 10 x 10 x 10 unit cells of a simple cubic lattice with an atomic density of 0.8 was defined. The atomic mass was set to 1.0 and the Lennard-Jones pairwise interaction cutoff distance was set to 3.0. The pairwise forcefield coefficients ε (potential well depth) and σ (zero-potential distance) were both set to 1.0. Five simulations were run for differing timestep values (0.0010, 0.0025, 0.0075, 0.0100 and 0.0150).&lt;br /&gt;
&lt;br /&gt;
=== Part 2: Equations of State in the NpT Ensemble ===&lt;br /&gt;
The simulation box was increased to consist of 15 x 15 x 15 unit cells of the same simple cubic lattice defined in part 1. A total of ten simulations were run in the NpT ensemble, varying temperature (2.0, 4.0, 6.0, 8.0 and 10.0) at two different densities (1.8 and 2.8) using the timestep value of 0.0025 determined in Part 1.&lt;br /&gt;
&lt;br /&gt;
=== Part 3: Calculation of Heat Capacity ===&lt;br /&gt;
The simulation box from Part 2 was used, with the density altered to take the values 0.2 and 0.8. Five simulations were run for each, with varying values of temperature (2.0, 2.2, 2.4, 2.6 and 2.8). A copy of the script written for this simulation can be found by clicking the image below:&lt;br /&gt;
[[File:gm1110_LS_M_3_1.png|centre|thumb|Copy of Script]]&lt;br /&gt;
&lt;br /&gt;
=== Part 4: Radial Distribution Functions ===&lt;br /&gt;
The simulation boxes used previously were altered to take a timestep of 0.002 and a L-J cutoff distance of 3.2, after which the solid, liquid and vapour phases were defined as having (density, temperature) values of (1.2, 1.2), (0.8, 1.2) and (0.05, 1.1) respectively. In particular, the solid phase was defined as having a face-centred cubic lattice, instead of the simple cubic lattice used for the liquid and vapour phases. VMD was used to analyse the trajectories for the three phases, with the distance between points in the generated RDF set to 0.05.&lt;br /&gt;
&lt;br /&gt;
=== Part 5: Diffusion Coefficient ===&lt;br /&gt;
The results from Part 4 were used to graph the mean squared displacement as a function of time, after which the gradient of the linear portion of the graph was extracted and used to calculate the diffusion coefficient from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_M_5_1.png|centre|150px]]&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were also calculated from the velocity autocorrelation function from the equation:&lt;br /&gt;
&lt;br /&gt;
where is the velocity autocorrelation function.&lt;br /&gt;
&lt;br /&gt;
==Results and Discussion==&lt;br /&gt;
&lt;br /&gt;
=== Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
Simulations were run using the five different timesteps 0.0010, 0.0025, 0.0075, 0.0100 and 0.0150, and a plot of the results can be seen below (Figure 1).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_1_1.png|centre|thumb|Figure 1. A plot of total energy (reduced units) against time comparing simulations run using five different timestep values]]&lt;br /&gt;
&lt;br /&gt;
It was observed that the simulation run with a timestep of 0.0150 did not equilibrate. This was thought to have potentially been due to the timestep being too large, and therefore the simulation was missing too much detail to accurately simulate the fluid. The simulations run for timesteps of 0.0100 and 0.0075 did equilibrate (supporting the previous hypothesis that the 0.0150 timestep was too large), but converged at the wrong energy (approximately -3.181 and -3.183 respectively), indicating that the timesteps were still not quite small enough.&lt;br /&gt;
&lt;br /&gt;
The final two simulations run at timesteps of 0.0025 and 0.0010 both equilibrated to the same, correct energy (approximately -3.184), indicating that both would be suitable for use in further simulations. It is preferable, however, to maximise the timestep when running simulations as a smaller timestep requires more data points, and is therefore more “expensive” and takes longer to run for no real added value. Hence it was decided that a timestep of 0.0025 would be suitable for running further simulations.    &lt;br /&gt;
&lt;br /&gt;
=== Equations of State in the NpT Ensemble ===&lt;br /&gt;
Although specific values for temperature and pressure are specified for the simulations, in reality, the temperature and pressure of a system fluctuates over time and may therefore deviate away from the inputted values. Hence, the simulation calculates the pressure of the system at the end of every timestep, and adjusts the size of the simulation box such that the pressure once again corresponds to the specified value. Pressure controlled simulations are thus in the NpT ensemble and so volume (and therefore density) is not constant.&lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the resulting densities were plotted against temperature, along with values predicted by the ideal gas law and can be seen below (Figure 2).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_2_1.png|centre|thumb|Figure 2. Plot showing density as a function of temperature at pressures of 1.8 and 2.8 (all in reduced units), with error bars, and a plot of the densities predicted by the ideal gas law]]&lt;br /&gt;
&lt;br /&gt;
Clearly, the simulated densities are lower than those predicted by the ideal gas law, and the discrepancy increases with increasing pressure. This is due to the fact that the ideal gas law assumes perfectly elastic collisions between point particles, but in reality, intermolecular repulsive forces cause the simulated densities to be lower. In addition, an increase in pressure causes the molecules to be pushed closer together and increases both the number of collisions as well as the repulsive forces, leading to a greater deviation from ideality.    &lt;br /&gt;
&lt;br /&gt;
=== Calculation of Heat Capacity ===&lt;br /&gt;
Switching to the NVT ensemble, the heat capacity of the system can be determined by considering the magnitude of fluctuations in the system’s energy from its average equilibrium state from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_1.png|centre|250px]]            &lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the average heat capacities were plotted as a function of temperature (Figure 3).        &lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_2.png|centre|thumb|Figure 3. Plot of average heat capacity against temperature for densities of 0.8 and 0.2]]Heat capacity is a measure of the amount of energy required to increase the temperature of a substance. It is clear that the heat capacity is lower, and therefore easier to heat, for lower density systems as the particles are more spaced apart. This means that they are able to gain thermal energy more easily as they have more room for increased vibrations without an increase of repulsive forces or collisions compared to a higher density system. It was also noted that the heat capacity decreased with increasing temperature. This is due to the fact that at higher temperatures, the gap between energy levels decreases as the particles occupy higher energy states, thus making it easier for the particles to be promoted to higher energy levels.&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Functions ===&lt;br /&gt;
Radial distribution functions (g(r)) were calculated for the solid, liquid and vapour phases (see Figure 4) to check that the simulations were correctly reproducing the structural features of each phase. RDFs are essentially probability distribution functions for the likelihood of finding a particle at a given distance r away from a reference particle, and also gives information on the coordination sphere of the reference particle. The integral of the RDF (Figure 5) is also useful as it gives information on the number of atoms found at a distance r.&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_1.png|centre|thumb|Figure 4. Radial distribution function against displacement from a reference atom]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_2.png|centre|thumb|Figure 5. Integral of the radial distribution function against displacement]]&lt;br /&gt;
&lt;br /&gt;
For small r, all three phases have g(r) ~ 0, indicating an atomic density of zero as there exists a minimum distance at which atoms can approach each other. Also, g(r) tends to 1 for all three phases with increasing r, which represents the fact that the local density becomes equivalent to the mean density of the system as a whole.&lt;br /&gt;
&lt;br /&gt;
The graph of the solid phase shows sharp oscillating peaks, indicating that the atoms are strongly confined to their positions in the crystalline lattice, and the high degree of ordering means that although the osciallations do tend to g(r) = 1 for large r, this occurs much more slowly than for the other two phases. The first peak corresponds to the atoms nearest neighbours (of which there are 12), and the second and third peak correspond to the second and third nearest neighbours respectively (of which there are 6 and 24). &lt;br /&gt;
&lt;br /&gt;
The graph for the liquid phase shows broad, gently oscillating peaks that rapidly decay to g(r) = 1. As with the solid phase, the oscillations indicate some structure in the system whereby the atoms are loosely bound to their original positions, but the broader peaks indicate that they have much more freedom to move away from their positions. &lt;br /&gt;
&lt;br /&gt;
The graph for the vapour phase shows a single peak at approximately r = 1, after which it quickly decays back to g(r) = 1. This shows that the structure has very little to no order, and the particles are free to move unbound to any specific position. &lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|MSD Graphs (1,000 atoms)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_7.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_8.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_9.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 6. Graph of solid phase MSD for 1,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 7. Graph of fluid phase MSD for 1,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 8. Graph of vapour phase MSD for 1,000 atoms(with trendline)&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The general trends displayed in Figures 6-8 are as expected: the simulation does eventually establish linear behaviour, with the gradients increasing exponentially going from the solid to vapour phases. It is well known that diffusion in the vapour phase occurs much more readily than in the fluid phase, and more readily in the fluid phase than solid phase, and given that the diffusion coefficient is linearly correlated to the gradient of the mean square displacement, it was expected that the gradients of the graphs would increase in this manner. It was noted that the linear region of the solid phase plot (Figure 6) was quite noisy, but it was thought that this may be due to the small simulation size of 1,000 atoms.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|MSD Graphs (1,000,000 atoms)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_10.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_11.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_12.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 9. Graph of solid phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 10. Graph of fluid phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 11. Graph of vapour phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results from the simulation with 1,000,000 atoms (Figures 9-11) support the observations made with the 1,000 atom simulation. The only noticeable improvement from the 1,000 atom simulation was the reduction in noise of the linear region of the solid phase (Figure 9), suggesting that the assumption made previously to consider the more noisy region in Figure 6 as linear was correct, and that increasing the sample size did indeed improve the smoothness and accuracy of the curve.&lt;br /&gt;
&lt;br /&gt;
The gradient for the linear region of the plots were determined and used to calculate the diffusion coefficients (see table below).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=4|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Solid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Liquid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Vapour Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-6.17x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0688 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;2.27 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-6.83x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0698 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;2.47 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The results obtained are reasonable figures. In comparison with the 1,000,000 atom simulation, the values calculated for the diffusion coefficient with 1,000 atoms yielded a 9.7%, 1.4% and 8.0% error for the solid, liquid and vapour phases respectively. This suggests that for systems involving atoms that are at either extreme with regards to their range of motion, a larger atomic sample size would be suitable for simulations, whereas for fluids, more time-efficient simulations can be accurately conducted using the smaller 1,000 atom sample size.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient was also calculated using the velocity autocorrelation function (henceforth VACF).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|VACF Graphs&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_13.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_14.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_15.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 12. Graph of solid, liquid phase and simple harmonic oscillator VACF for 1,000 atoms&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 13. Running integral of solid, fluid and vapour phase VACF for 1,000 atoms&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 14. Running integral of solid, fluid and vapour phase VACF for 1,000,000 atoms&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=4|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Solid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Liquid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Vapour Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-1.84x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0783 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;3.06 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;4.55x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0901 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;3.27 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Generally, the results show that the diffusion coefficients calculated using the VACF method and MSD method are both to the same order of magnitude, although the coefficients calculated via the VACF were 29-32% greater for the fluid and vapour phases.&lt;br /&gt;
&lt;br /&gt;
The largest source of error in estimating the diffusion coefficient using the VACF was the number of atoms used in the simulations. This can be seen more clearly in Figures 16 and 17 which compare the VACF calculated for the fluid and vapour phases. The 1,000 atom simulation is clearly more noisy than the 1,000,000 atom simulation, indicating that the 1,000,000 atom simulation increases the reliability and accuracy of the results.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|VACF Graph Comparisons&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_18.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_19.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_20.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 15. Running integral of solid phase VACF for 1,000 and 1,000,000 atom simulations&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 16. Running integral of fluid phase VACF for 1,000 and 1,000,000 atom simulations&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 17. Running integral of vapour phase VACF for 1,000 and 1,000,000 atom simulations&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
==Tasks==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Introduction to Molecular Dynamics Simulations&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 1. For a default timestep value 0.1, estimate the positions of the maxima in the ERROR column as a function of time.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_1_1.png|centre|thumb|Figure X. Plot showing the positions of the error maxima as a function of time, with a best fit line]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 2. (Experiment with different values of the timestep.) What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using a timestep of 0.1990 meant that the total energy did not change by more than 1% over the course of the simulation (Figure X).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_2_1.png|centre|thumb|Figure X. Plot showing the total energy during the simulation using a timestep of 0.1990]]&lt;br /&gt;
&lt;br /&gt;
The simulations are being run in isolated systems which requires total energy conservation, so large fluctuations in the energy would lead to inaccurate results. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 3. For a single Lennard-Jones interaction, find the separation, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;, and work out the well depth. Evaluate the integrals when σ = ε = 1.0.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i) The Lennard-Jones interaction is given by:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_1.png|200px]]&lt;br /&gt;
&lt;br /&gt;
Since r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; when ɸ = 0,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(ii) The force is given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_3.png|250px]]&lt;br /&gt;
&lt;br /&gt;
So at the separation r&amp;lt;sub&amp;gt;0 &amp;lt;/sub&amp;gt;= σ,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_4.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iii) The equilibrium separation r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs at the point at which all forces vanish, ie. when F = 0, so&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_5.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iv) And the well depth is therefore given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_6.png|270px]]&lt;br /&gt;
&lt;br /&gt;
(v)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_7.png|370px]]&lt;br /&gt;
&lt;br /&gt;
(vi)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_8.png|400px]]&lt;br /&gt;
&lt;br /&gt;
(vii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_9.png|370px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4. Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10,000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_1.png|550px]]&lt;br /&gt;
&lt;br /&gt;
For 10,000 water molecules,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_3.png|230px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 5. Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After the timestep, the atom would be at position (0.5 + 0.7, 0.5 + 0.6, 0.5 + 0.2) = (1.2, 1.1, 0.7). Applying the boundary conditions, this is equivalent to the position (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 6. The Lennard-Jones parameters for argon are sigma = 0.34nm, ε/k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt; = 120K. If the LJ cutoff is r&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 1.5 in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_1.png|140px]]&lt;br /&gt;
&lt;br /&gt;
(ii) It was previously determined in Task 1 that the well depth is - ε, so in real units,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_4.png|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(iii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_3.png|130px]]&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Equilibration&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 7. Why do you think giving atoms random starting coordinates causes problems in simulations?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If two atoms are generated too close to one another, then they would experience a large repulsive force, and would disrupt the behaviour of the surrounding atoms, causing the simulation to become inaccurate. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 8. Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_1.png|380px]]&lt;br /&gt;
&lt;br /&gt;
(ii) For a face-centred cubic lattice, note that the unit cell contains four atoms, as opposed to one atom with a simple cubic lattice. Then&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_4.png|460px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 9. Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is 1 atom contained within each unit cell. However for face-centred cubic lattices, each unit cell contains 4 atoms so four times as many atoms are created than with the simple lattice (ie. 4000 atoms).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 10. Given that we are specifying x&amp;lt;sub&amp;gt;i &amp;lt;/sub&amp;gt;(0) and v&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; (0), which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We will be using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 11. In the code section &amp;quot;Specify Timestep&amp;quot;, the second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write &amp;quot;timestep 0.001 // run 100000&amp;quot;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Defining the variable timestep allows us to reference the variable multiple times throughout the simulation if required, whilst preventing errors and making it easier to alter the code if we want to run the simulation for different timestep values. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 12. Make plots of energy, temperature, and pressure, against time for the 0.001 timestep experiment. Does the simulation reach equilibrium? How long does this take? Make a single plot of energy vs time for all of the timesteps. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice and why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_12_1.png|centre|thumb|Figure X. Plot of energy against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_2.png|centre|thumb|Figure X. Plot of temperature against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_3.png|centre|thumb|Figure X. Plot of pressure against time for the 0.001 timestep experiment]]&lt;br /&gt;
&lt;br /&gt;
The 0.001 timestep experiment reaches equilibrium very quickly, within approximately 0.2s. &lt;br /&gt;
&lt;br /&gt;
A single plot of energy vs time for all of the timesteps can be found in &amp;quot;Results &amp;amp; Discussion: Investigation into Simulation Timestep in the NVE Ensemble Figure 1&amp;quot;, along with a detailed analysis, but in brief: the largest acceptable timestep is 0.0025, and a particularly bad choice would be 0.015 as it does not reach equilibrium.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Running Simulations under Specific Conditions&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 13. We need to choose gamma so that the temperature is correct T=fancy T if we multiply every velocity by γ. Solve the following two equations to determine gamma:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_2.png|center|200px]]&lt;br /&gt;
&lt;br /&gt;
Starting from the 2&amp;lt;sup&amp;gt;nd&amp;lt;/sup&amp;gt; equation,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_1.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 14: (Use the manual to find out the importance of the three numbers 100 1000 100000.) 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 (&amp;quot;run 100000&amp;quot;), how much time will you simulate? (DOUBLE CHECK THIS PART WITH OLLIE!)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Firstly, averages are taken for blocks of 100 values at a time to form the first set of averaged values (where av&amp;lt;sub&amp;gt;100,n&amp;lt;/sub&amp;gt; is the average value for the n&amp;lt;sup&amp;gt;th&amp;lt;/sup&amp;gt; block of 100 values). These values are then themselves averaged in blocks of 1000 values to form a second set of averaged values (av&amp;lt;sub&amp;gt;100,1&amp;lt;/sub&amp;gt; + av&amp;lt;sub&amp;gt;100,2&amp;lt;/sub&amp;gt; + ... + av&amp;lt;sub&amp;gt;100,1000&amp;lt;/sub&amp;gt;)/1000 = av&amp;lt;sub&amp;gt;1000,1&amp;lt;/sub&amp;gt;. Finally, these values are averaged once more in blocks of 100000 values.&lt;br /&gt;
&lt;br /&gt;
The amount of time simulated can be found by multiplying the number of steps by the value of the timestep (eg. 100,000 steps of a 0.001 timestep simulates 100 seconds).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 15: Plot density as a function of temperature for both of the pressures that you simulated. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figure 2 in &amp;quot;Results and Discussion: Equations of State in the NpT Ensemble&amp;quot; for the plot and subsequent discussion.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Heat Capacity Calculation&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 16: Run simulations at densities of 0.2, 0.8 and temperatures of 2.0, 2.2, 2.4, 2.6, 2.8, plotting C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;/V as a function of temperature, where V is the volume of the simulation cell, for both of your densities. Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the plot of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;/V as a function of temperature, please see Figure 3 in &amp;quot;Results and Discussion: Calculation of Heat Capacity&amp;quot; and the subsequent discussion on why the trend was as expected. A copy of the input script can be found in &amp;quot;Method: Part 3: Calculation of Heat Capacity&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Structural Properties and the Radial Distribution Function&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 17: Plot the RDFs for the three systems on the same axes. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figure 4 in &amp;quot;Results and Discussion: Radial Distribution Functions&amp;quot; for the plot and analysis. WHAT IS THE LATTICE SPACING? &lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Dynamical Properties and the Diffusion Coefficient&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 18: Make a plot for each of your simulations (solid/liquid/vapour), showing the mean squared displacement (&amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate D in each case. (Be careful with units!) Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 19: Evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (show working). On the same graph, with x range 0 to 500, plot C(tau) with omega = 1/2pi and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. Why is the harmonic oscillator VACF very different to the Lennard Jones solid and liquid? (Attach a copy of your plot)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_3.png|700px]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_2.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 20: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665576</id>
		<title>Rep:Gm1110LiquidSim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665576"/>
		<updated>2018-02-15T19:18:07Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: /* Diffusion Coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
The main aim of the experiment was to determine the diffusion coefficient for the solid, liquid and vapour phases of a Lennard-Jones fluid using both the mean squared displacement method and velocity autocorrelation function method.&lt;br /&gt;
&lt;br /&gt;
In order to achieve this, it was first necessary to determine an appropriate timestep with which to run simulations, and investigate the effect of temperature and pressure on the density of the system. Other aims included seeing how heat capacity varied as a function of temperature for different densities, and calculating the radial distribution function for the three phases from simulations using VMD.    &lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
All simulations of the Lennard-Jones fluid were run using the LAMMPS software, and all quantities used were in reduced units.&lt;br /&gt;
&lt;br /&gt;
=== Part 1: Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
A simulation box consisting of 10 x 10 x 10 unit cells of a simple cubic lattice with an atomic density of 0.8 was defined. The atomic mass was set to 1.0 and the Lennard-Jones pairwise interaction cutoff distance was set to 3.0. The pairwise forcefield coefficients ε (potential well depth) and σ (zero-potential distance) were both set to 1.0. Five simulations were run for differing timestep values (0.0010, 0.0025, 0.0075, 0.0100 and 0.0150).&lt;br /&gt;
&lt;br /&gt;
=== Part 2: Equations of State in the NpT Ensemble ===&lt;br /&gt;
The simulation box was increased to consist of 15 x 15 x 15 unit cells of the same simple cubic lattice defined in part 1. A total of ten simulations were run in the NpT ensemble, varying temperature (2.0, 4.0, 6.0, 8.0 and 10.0) at two different densities (1.8 and 2.8) using the timestep value of 0.0025 determined in Part 1.&lt;br /&gt;
&lt;br /&gt;
=== Part 3: Calculation of Heat Capacity ===&lt;br /&gt;
The simulation box from Part 2 was used, with the density altered to take the values 0.2 and 0.8. Five simulations were run for each, with varying values of temperature (2.0, 2.2, 2.4, 2.6 and 2.8). A copy of the script written for this simulation can be found by clicking the image below:&lt;br /&gt;
[[File:gm1110_LS_M_3_1.png|centre|thumb|Copy of Script]]&lt;br /&gt;
&lt;br /&gt;
=== Part 4: Radial Distribution Functions ===&lt;br /&gt;
The simulation boxes used previously were altered to take a timestep of 0.002 and a L-J cutoff distance of 3.2, after which the solid, liquid and vapour phases were defined as having (density, temperature) values of (1.2, 1.2), (0.8, 1.2) and (0.05, 1.1) respectively. In particular, the solid phase was defined as having a face-centred cubic lattice, instead of the simple cubic lattice used for the liquid and vapour phases. VMD was used to analyse the trajectories for the three phases, with the distance between points in the generated RDF set to 0.05.&lt;br /&gt;
&lt;br /&gt;
=== Part 5: Diffusion Coefficient ===&lt;br /&gt;
The results from Part 4 were used to graph the mean squared displacement as a function of time, after which the gradient of the linear portion of the graph was extracted and used to calculate the diffusion coefficient from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_M_5_1.png|centre|150px]]&lt;br /&gt;
&lt;br /&gt;
The procedure was then repeated using 1 million atoms.&lt;br /&gt;
&lt;br /&gt;
==Results and Discussion==&lt;br /&gt;
&lt;br /&gt;
=== Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
Simulations were run using the five different timesteps 0.0010, 0.0025, 0.0075, 0.0100 and 0.0150, and a plot of the results can be seen below (Figure 1).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_1_1.png|centre|thumb|Figure 1. A plot of total energy (reduced units) against time comparing simulations run using five different timestep values]]&lt;br /&gt;
&lt;br /&gt;
It was observed that the simulation run with a timestep of 0.0150 did not equilibrate. This was thought to have potentially been due to the timestep being too large, and therefore the simulation was missing too much detail to accurately simulate the fluid. The simulations run for timesteps of 0.0100 and 0.0075 did equilibrate (supporting the previous hypothesis that the 0.0150 timestep was too large), but converged at the wrong energy (approximately -3.181 and -3.183 respectively), indicating that the timesteps were still not quite small enough.&lt;br /&gt;
&lt;br /&gt;
The final two simulations run at timesteps of 0.0025 and 0.0010 both equilibrated to the same, correct energy (approximately -3.184), indicating that both would be suitable for use in further simulations. It is preferable, however, to maximise the timestep when running simulations as a smaller timestep requires more data points, and is therefore more “expensive” and takes longer to run for no real added value. Hence it was decided that a timestep of 0.0025 would be suitable for running further simulations.    &lt;br /&gt;
&lt;br /&gt;
=== Equations of State in the NpT Ensemble ===&lt;br /&gt;
Although specific values for temperature and pressure are specified for the simulations, in reality, the temperature and pressure of a system fluctuates over time and may therefore deviate away from the inputted values. Hence, the simulation calculates the pressure of the system at the end of every timestep, and adjusts the size of the simulation box such that the pressure once again corresponds to the specified value. Pressure controlled simulations are thus in the NpT ensemble and so volume (and therefore density) is not constant.&lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the resulting densities were plotted against temperature, along with values predicted by the ideal gas law and can be seen below (Figure 2).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_2_1.png|centre|thumb|Figure 2. Plot showing density as a function of temperature at pressures of 1.8 and 2.8 (all in reduced units), with error bars, and a plot of the densities predicted by the ideal gas law]]&lt;br /&gt;
&lt;br /&gt;
Clearly, the simulated densities are lower than those predicted by the ideal gas law, and the discrepancy increases with increasing pressure. This is due to the fact that the ideal gas law assumes perfectly elastic collisions between point particles, but in reality, intermolecular repulsive forces cause the simulated densities to be lower. In addition, an increase in pressure causes the molecules to be pushed closer together and increases both the number of collisions as well as the repulsive forces, leading to a greater deviation from ideality.    &lt;br /&gt;
&lt;br /&gt;
=== Calculation of Heat Capacity ===&lt;br /&gt;
Switching to the NVT ensemble, the heat capacity of the system can be determined by considering the magnitude of fluctuations in the system’s energy from its average equilibrium state from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_1.png|centre|250px]]            &lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the average heat capacities were plotted as a function of temperature (Figure 3).        &lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_2.png|centre|thumb|Figure 3. Plot of average heat capacity against temperature for densities of 0.8 and 0.2]]Heat capacity is a measure of the amount of energy required to increase the temperature of a substance. It is clear that the heat capacity is lower, and therefore easier to heat, for lower density systems as the particles are more spaced apart. This means that they are able to gain thermal energy more easily as they have more room for increased vibrations without an increase of repulsive forces or collisions compared to a higher density system. It was also noted that the heat capacity decreased with increasing temperature. This is due to the fact that at higher temperatures, the gap between energy levels decreases as the particles occupy higher energy states, thus making it easier for the particles to be promoted to higher energy levels.&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Functions ===&lt;br /&gt;
Radial distribution functions (g(r)) were calculated for the solid, liquid and vapour phases (see Figure 4) to check that the simulations were correctly reproducing the structural features of each phase. RDFs are essentially probability distribution functions for the likelihood of finding a particle at a given distance r away from a reference particle, and also gives information on the coordination sphere of the reference particle. The integral of the RDF (Figure 5) is also useful as it gives information on the number of atoms found at a distance r.&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_1.png|centre|thumb|Figure 4. Radial distribution function against displacement from a reference atom]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_2.png|centre|thumb|Figure 5. Integral of the radial distribution function against displacement]]&lt;br /&gt;
&lt;br /&gt;
For small r, all three phases have g(r) ~ 0, indicating an atomic density of zero as there exists a minimum distance at which atoms can approach each other. Also, g(r) tends to 1 for all three phases with increasing r, which represents the fact that the local density becomes equivalent to the mean density of the system as a whole.&lt;br /&gt;
&lt;br /&gt;
The graph of the solid phase shows sharp oscillating peaks, indicating that the atoms are strongly confined to their positions in the crystalline lattice, and the high degree of ordering means that although the osciallations do tend to g(r) = 1 for large r, this occurs much more slowly than for the other two phases. The first peak corresponds to the atoms nearest neighbours (of which there are 12), and the second and third peak correspond to the second and third nearest neighbours respectively (of which there are 6 and 24). &lt;br /&gt;
&lt;br /&gt;
The graph for the liquid phase shows broad, gently oscillating peaks that rapidly decay to g(r) = 1. As with the solid phase, the oscillations indicate some structure in the system whereby the atoms are loosely bound to their original positions, but the broader peaks indicate that they have much more freedom to move away from their positions. &lt;br /&gt;
&lt;br /&gt;
The graph for the vapour phase shows a single peak at approximately r = 1, after which it quickly decays back to g(r) = 1. This shows that the structure has very little to no order, and the particles are free to move unbound to any specific position. &lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|MSD Graphs (1,000 atoms)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_7.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_8.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_9.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 6. Graph of solid phase MSD for 1,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 7. Graph of fluid phase MSD for 1,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 8. Graph of vapour phase MSD for 1,000 atoms(with trendline)&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The general trends displayed in Figures 6-8 are as expected: the simulation does eventually establish linear behaviour, with the gradients increasing exponentially going from the solid to vapour phases. It is well known that diffusion in the vapour phase occurs much more readily than in the fluid phase, and more readily in the fluid phase than solid phase, and given that the diffusion coefficient is linearly correlated to the gradient of the mean square displacement, it was expected that the gradients of the graphs would increase in this manner. It was noted that the linear region of the solid phase plot (Figure 6) was quite noisy, but it was thought that this may be due to the small simulation size of 1,000 atoms.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|MSD Graphs (1,000,000 atoms)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_10.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_11.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_12.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 9. Graph of solid phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 10. Graph of fluid phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 11. Graph of vapour phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results from the simulation with 1,000,000 atoms (Figures 9-11) support the observations made with the 1,000 atom simulation. The only noticeable improvement from the 1,000 atom simulation was the reduction in noise of the linear region of the solid phase (Figure 9), suggesting that the assumption made previously to consider the more noisy region in Figure 6 as linear was correct, and that increasing the sample size did indeed improve the smoothness and accuracy of the curve.&lt;br /&gt;
&lt;br /&gt;
The gradient for the linear region of the plots were determined and used to calculate the diffusion coefficients (see table below).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=4|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Solid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Liquid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Vapour Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-6.17x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0688 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;2.27 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-6.83x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0698 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;2.47 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The results obtained are reasonable figures. In comparison with the 1,000,000 atom simulation, the values calculated for the diffusion coefficient with 1,000 atoms yielded a 9.7%, 1.4% and 8.0% error for the solid, liquid and vapour phases respectively. This suggests that for systems involving atoms that are at either extreme with regards to their range of motion, a larger atomic sample size would be suitable for simulations, whereas for fluids, more time-efficient simulations can be accurately conducted using the smaller 1,000 atom sample size.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient was also calculated using the velocity autocorrelation function (henceforth VACF).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|VACF Graphs&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_13.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_14.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_15.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 12. Graph of solid, liquid phase and simple harmonic oscillator VACF for 1,000 atoms&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 13. Running integral of solid, fluid and vapour phase VACF for 1,000 atoms&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 14. Running integral of solid, fluid and vapour phase VACF for 1,000,000 atoms&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=4|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Solid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Liquid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Vapour Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-1.84x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0783 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;3.06 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;4.55x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0901 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;3.27 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The largest source of error in estimating the diffusion coefficient using the VACF was the number of atoms used in the simulations&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|VACF Graph Comparisons&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_18.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_19.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_20.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 15. Running integral of solid phase VACF for 1,000 and 1,000,000 atom simulations&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 16. Running integral of fluid phase VACF for 1,000 and 1,000,000 atom simulations&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 17. Running integral of vapour phase VACF for 1,000 and 1,000,000 atom simulations&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
==Tasks==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Introduction to Molecular Dynamics Simulations&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 1. For a default timestep value 0.1, estimate the positions of the maxima in the ERROR column as a function of time.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_1_1.png|centre|thumb|Figure X. Plot showing the positions of the error maxima as a function of time, with a best fit line]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 2. (Experiment with different values of the timestep.) What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using a timestep of 0.1990 meant that the total energy did not change by more than 1% over the course of the simulation (Figure X).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_2_1.png|centre|thumb|Figure X. Plot showing the total energy during the simulation using a timestep of 0.1990]]&lt;br /&gt;
&lt;br /&gt;
The simulations are being run in isolated systems which requires total energy conservation, so large fluctuations in the energy would lead to inaccurate results. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 3. For a single Lennard-Jones interaction, find the separation, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;, and work out the well depth. Evaluate the integrals when σ = ε = 1.0.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i) The Lennard-Jones interaction is given by:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_1.png|200px]]&lt;br /&gt;
&lt;br /&gt;
Since r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; when ɸ = 0,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(ii) The force is given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_3.png|250px]]&lt;br /&gt;
&lt;br /&gt;
So at the separation r&amp;lt;sub&amp;gt;0 &amp;lt;/sub&amp;gt;= σ,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_4.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iii) The equilibrium separation r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs at the point at which all forces vanish, ie. when F = 0, so&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_5.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iv) And the well depth is therefore given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_6.png|270px]]&lt;br /&gt;
&lt;br /&gt;
(v)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_7.png|370px]]&lt;br /&gt;
&lt;br /&gt;
(vi)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_8.png|400px]]&lt;br /&gt;
&lt;br /&gt;
(vii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_9.png|370px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4. Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10,000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_1.png|550px]]&lt;br /&gt;
&lt;br /&gt;
For 10,000 water molecules,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_3.png|230px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 5. Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After the timestep, the atom would be at position (0.5 + 0.7, 0.5 + 0.6, 0.5 + 0.2) = (1.2, 1.1, 0.7). Applying the boundary conditions, this is equivalent to the position (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 6. The Lennard-Jones parameters for argon are sigma = 0.34nm, ε/k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt; = 120K. If the LJ cutoff is r&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 1.5 in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_1.png|140px]]&lt;br /&gt;
&lt;br /&gt;
(ii) It was previously determined in Task 1 that the well depth is - ε, so in real units,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_4.png|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(iii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_3.png|130px]]&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Equilibration&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 7. Why do you think giving atoms random starting coordinates causes problems in simulations?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If two atoms are generated too close to one another, then they would experience a large repulsive force, and would disrupt the behaviour of the surrounding atoms, causing the simulation to become inaccurate. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 8. Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_1.png|380px]]&lt;br /&gt;
&lt;br /&gt;
(ii) For a face-centred cubic lattice, note that the unit cell contains four atoms, as opposed to one atom with a simple cubic lattice. Then&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_4.png|460px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 9. Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is 1 atom contained within each unit cell. However for face-centred cubic lattices, each unit cell contains 4 atoms so four times as many atoms are created than with the simple lattice (ie. 4000 atoms).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 10. Given that we are specifying x&amp;lt;sub&amp;gt;i &amp;lt;/sub&amp;gt;(0) and v&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; (0), which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We will be using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 11. In the code section &amp;quot;Specify Timestep&amp;quot;, the second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write &amp;quot;timestep 0.001 // run 100000&amp;quot;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Defining the variable timestep allows us to reference the variable multiple times throughout the simulation if required, whilst preventing errors and making it easier to alter the code if we want to run the simulation for different timestep values. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 12. Make plots of energy, temperature, and pressure, against time for the 0.001 timestep experiment. Does the simulation reach equilibrium? How long does this take? Make a single plot of energy vs time for all of the timesteps. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice and why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_12_1.png|centre|thumb|Figure X. Plot of energy against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_2.png|centre|thumb|Figure X. Plot of temperature against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_3.png|centre|thumb|Figure X. Plot of pressure against time for the 0.001 timestep experiment]]&lt;br /&gt;
&lt;br /&gt;
The 0.001 timestep experiment reaches equilibrium very quickly, within approximately 0.2s. &lt;br /&gt;
&lt;br /&gt;
A single plot of energy vs time for all of the timesteps can be found in &amp;quot;Results &amp;amp; Discussion: Investigation into Simulation Timestep in the NVE Ensemble Figure 1&amp;quot;, along with a detailed analysis, but in brief: the largest acceptable timestep is 0.0025, and a particularly bad choice would be 0.015 as it does not reach equilibrium.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Running Simulations under Specific Conditions&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 13. We need to choose gamma so that the temperature is correct T=fancy T if we multiply every velocity by γ. Solve the following two equations to determine gamma:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_2.png|center|200px]]&lt;br /&gt;
&lt;br /&gt;
Starting from the 2&amp;lt;sup&amp;gt;nd&amp;lt;/sup&amp;gt; equation,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_1.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 14: (Use the manual to find out the importance of the three numbers 100 1000 100000.) 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 (&amp;quot;run 100000&amp;quot;), how much time will you simulate? (DOUBLE CHECK THIS PART WITH OLLIE!)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Firstly, averages are taken for blocks of 100 values at a time to form the first set of averaged values (where av&amp;lt;sub&amp;gt;100,n&amp;lt;/sub&amp;gt; is the average value for the n&amp;lt;sup&amp;gt;th&amp;lt;/sup&amp;gt; block of 100 values). These values are then themselves averaged in blocks of 1000 values to form a second set of averaged values (av&amp;lt;sub&amp;gt;100,1&amp;lt;/sub&amp;gt; + av&amp;lt;sub&amp;gt;100,2&amp;lt;/sub&amp;gt; + ... + av&amp;lt;sub&amp;gt;100,1000&amp;lt;/sub&amp;gt;)/1000 = av&amp;lt;sub&amp;gt;1000,1&amp;lt;/sub&amp;gt;. Finally, these values are averaged once more in blocks of 100000 values.&lt;br /&gt;
&lt;br /&gt;
The amount of time simulated can be found by multiplying the number of steps by the value of the timestep (eg. 100,000 steps of a 0.001 timestep simulates 100 seconds).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 15: Plot density as a function of temperature for both of the pressures that you simulated. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figure 2 in &amp;quot;Results and Discussion: Equations of State in the NpT Ensemble&amp;quot; for the plot and subsequent discussion.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Heat Capacity Calculation&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 16: Run simulations at densities of 0.2, 0.8 and temperatures of 2.0, 2.2, 2.4, 2.6, 2.8, plotting C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;/V as a function of temperature, where V is the volume of the simulation cell, for both of your densities. Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the plot of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;/V as a function of temperature, please see Figure 3 in &amp;quot;Results and Discussion: Calculation of Heat Capacity&amp;quot; and the subsequent discussion on why the trend was as expected. A copy of the input script can be found in &amp;quot;Method: Part 3: Calculation of Heat Capacity&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Structural Properties and the Radial Distribution Function&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 17: Plot the RDFs for the three systems on the same axes. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figure 4 in &amp;quot;Results and Discussion: Radial Distribution Functions&amp;quot; for the plot and analysis. WHAT IS THE LATTICE SPACING? &lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Dynamical Properties and the Diffusion Coefficient&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 18: Make a plot for each of your simulations (solid/liquid/vapour), showing the mean squared displacement (&amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate D in each case. (Be careful with units!) Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 19: Evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (show working). On the same graph, with x range 0 to 500, plot C(tau) with omega = 1/2pi and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. Why is the harmonic oscillator VACF very different to the Lennard Jones solid and liquid? (Attach a copy of your plot)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_3.png|700px]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_2.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 20: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665575</id>
		<title>Rep:Gm1110LiquidSim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665575"/>
		<updated>2018-02-15T18:28:14Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: /* Diffusion Coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
The main aim of the experiment was to determine the diffusion coefficient for the solid, liquid and vapour phases of a Lennard-Jones fluid using both the mean squared displacement method and velocity autocorrelation function method.&lt;br /&gt;
&lt;br /&gt;
In order to achieve this, it was first necessary to determine an appropriate timestep with which to run simulations, and investigate the effect of temperature and pressure on the density of the system. Other aims included seeing how heat capacity varied as a function of temperature for different densities, and calculating the radial distribution function for the three phases from simulations using VMD.    &lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
All simulations of the Lennard-Jones fluid were run using the LAMMPS software, and all quantities used were in reduced units.&lt;br /&gt;
&lt;br /&gt;
=== Part 1: Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
A simulation box consisting of 10 x 10 x 10 unit cells of a simple cubic lattice with an atomic density of 0.8 was defined. The atomic mass was set to 1.0 and the Lennard-Jones pairwise interaction cutoff distance was set to 3.0. The pairwise forcefield coefficients ε (potential well depth) and σ (zero-potential distance) were both set to 1.0. Five simulations were run for differing timestep values (0.0010, 0.0025, 0.0075, 0.0100 and 0.0150).&lt;br /&gt;
&lt;br /&gt;
=== Part 2: Equations of State in the NpT Ensemble ===&lt;br /&gt;
The simulation box was increased to consist of 15 x 15 x 15 unit cells of the same simple cubic lattice defined in part 1. A total of ten simulations were run in the NpT ensemble, varying temperature (2.0, 4.0, 6.0, 8.0 and 10.0) at two different densities (1.8 and 2.8) using the timestep value of 0.0025 determined in Part 1.&lt;br /&gt;
&lt;br /&gt;
=== Part 3: Calculation of Heat Capacity ===&lt;br /&gt;
The simulation box from Part 2 was used, with the density altered to take the values 0.2 and 0.8. Five simulations were run for each, with varying values of temperature (2.0, 2.2, 2.4, 2.6 and 2.8). A copy of the script written for this simulation can be found by clicking the image below:&lt;br /&gt;
[[File:gm1110_LS_M_3_1.png|centre|thumb|Copy of Script]]&lt;br /&gt;
&lt;br /&gt;
=== Part 4: Radial Distribution Functions ===&lt;br /&gt;
The simulation boxes used previously were altered to take a timestep of 0.002 and a L-J cutoff distance of 3.2, after which the solid, liquid and vapour phases were defined as having (density, temperature) values of (1.2, 1.2), (0.8, 1.2) and (0.05, 1.1) respectively. In particular, the solid phase was defined as having a face-centred cubic lattice, instead of the simple cubic lattice used for the liquid and vapour phases. VMD was used to analyse the trajectories for the three phases, with the distance between points in the generated RDF set to 0.05.&lt;br /&gt;
&lt;br /&gt;
=== Part 5: Diffusion Coefficient ===&lt;br /&gt;
The results from Part 4 were used to graph the mean squared displacement as a function of time, after which the gradient of the linear portion of the graph was extracted and used to calculate the diffusion coefficient from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_M_5_1.png|centre|150px]]&lt;br /&gt;
&lt;br /&gt;
The procedure was then repeated using 1 million atoms.&lt;br /&gt;
&lt;br /&gt;
==Results and Discussion==&lt;br /&gt;
&lt;br /&gt;
=== Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
Simulations were run using the five different timesteps 0.0010, 0.0025, 0.0075, 0.0100 and 0.0150, and a plot of the results can be seen below (Figure 1).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_1_1.png|centre|thumb|Figure 1. A plot of total energy (reduced units) against time comparing simulations run using five different timestep values]]&lt;br /&gt;
&lt;br /&gt;
It was observed that the simulation run with a timestep of 0.0150 did not equilibrate. This was thought to have potentially been due to the timestep being too large, and therefore the simulation was missing too much detail to accurately simulate the fluid. The simulations run for timesteps of 0.0100 and 0.0075 did equilibrate (supporting the previous hypothesis that the 0.0150 timestep was too large), but converged at the wrong energy (approximately -3.181 and -3.183 respectively), indicating that the timesteps were still not quite small enough.&lt;br /&gt;
&lt;br /&gt;
The final two simulations run at timesteps of 0.0025 and 0.0010 both equilibrated to the same, correct energy (approximately -3.184), indicating that both would be suitable for use in further simulations. It is preferable, however, to maximise the timestep when running simulations as a smaller timestep requires more data points, and is therefore more “expensive” and takes longer to run for no real added value. Hence it was decided that a timestep of 0.0025 would be suitable for running further simulations.    &lt;br /&gt;
&lt;br /&gt;
=== Equations of State in the NpT Ensemble ===&lt;br /&gt;
Although specific values for temperature and pressure are specified for the simulations, in reality, the temperature and pressure of a system fluctuates over time and may therefore deviate away from the inputted values. Hence, the simulation calculates the pressure of the system at the end of every timestep, and adjusts the size of the simulation box such that the pressure once again corresponds to the specified value. Pressure controlled simulations are thus in the NpT ensemble and so volume (and therefore density) is not constant.&lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the resulting densities were plotted against temperature, along with values predicted by the ideal gas law and can be seen below (Figure 2).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_2_1.png|centre|thumb|Figure 2. Plot showing density as a function of temperature at pressures of 1.8 and 2.8 (all in reduced units), with error bars, and a plot of the densities predicted by the ideal gas law]]&lt;br /&gt;
&lt;br /&gt;
Clearly, the simulated densities are lower than those predicted by the ideal gas law, and the discrepancy increases with increasing pressure. This is due to the fact that the ideal gas law assumes perfectly elastic collisions between point particles, but in reality, intermolecular repulsive forces cause the simulated densities to be lower. In addition, an increase in pressure causes the molecules to be pushed closer together and increases both the number of collisions as well as the repulsive forces, leading to a greater deviation from ideality.    &lt;br /&gt;
&lt;br /&gt;
=== Calculation of Heat Capacity ===&lt;br /&gt;
Switching to the NVT ensemble, the heat capacity of the system can be determined by considering the magnitude of fluctuations in the system’s energy from its average equilibrium state from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_1.png|centre|250px]]            &lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the average heat capacities were plotted as a function of temperature (Figure 3).        &lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_2.png|centre|thumb|Figure 3. Plot of average heat capacity against temperature for densities of 0.8 and 0.2]]Heat capacity is a measure of the amount of energy required to increase the temperature of a substance. It is clear that the heat capacity is lower, and therefore easier to heat, for lower density systems as the particles are more spaced apart. This means that they are able to gain thermal energy more easily as they have more room for increased vibrations without an increase of repulsive forces or collisions compared to a higher density system. It was also noted that the heat capacity decreased with increasing temperature. This is due to the fact that at higher temperatures, the gap between energy levels decreases as the particles occupy higher energy states, thus making it easier for the particles to be promoted to higher energy levels.&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Functions ===&lt;br /&gt;
Radial distribution functions (g(r)) were calculated for the solid, liquid and vapour phases (see Figure 4) to check that the simulations were correctly reproducing the structural features of each phase. RDFs are essentially probability distribution functions for the likelihood of finding a particle at a given distance r away from a reference particle, and also gives information on the coordination sphere of the reference particle. The integral of the RDF (Figure 5) is also useful as it gives information on the number of atoms found at a distance r.&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_1.png|centre|thumb|Figure 4. Radial distribution function against displacement from a reference atom]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_2.png|centre|thumb|Figure 5. Integral of the radial distribution function against displacement]]&lt;br /&gt;
&lt;br /&gt;
For small r, all three phases have g(r) ~ 0, indicating an atomic density of zero as there exists a minimum distance at which atoms can approach each other. Also, g(r) tends to 1 for all three phases with increasing r, which represents the fact that the local density becomes equivalent to the mean density of the system as a whole.&lt;br /&gt;
&lt;br /&gt;
The graph of the solid phase shows sharp oscillating peaks, indicating that the atoms are strongly confined to their positions in the crystalline lattice, and the high degree of ordering means that although the osciallations do tend to g(r) = 1 for large r, this occurs much more slowly than for the other two phases. The first peak corresponds to the atoms nearest neighbours (of which there are 12), and the second and third peak correspond to the second and third nearest neighbours respectively (of which there are 6 and 24). &lt;br /&gt;
&lt;br /&gt;
The graph for the liquid phase shows broad, gently oscillating peaks that rapidly decay to g(r) = 1. As with the solid phase, the oscillations indicate some structure in the system whereby the atoms are loosely bound to their original positions, but the broader peaks indicate that they have much more freedom to move away from their positions. &lt;br /&gt;
&lt;br /&gt;
The graph for the vapour phase shows a single peak at approximately r = 1, after which it quickly decays back to g(r) = 1. This shows that the structure has very little to no order, and the particles are free to move unbound to any specific position. &lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|MSD Graphs (1,000 atoms)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_7.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_8.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_9.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 6. Graph of solid phase MSD for 1,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 7. Graph of fluid phase MSD for 1,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 8. Graph of vapour phase MSD for 1,000 atoms(with trendline)&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The general trends displayed in Figures 6-8 are as expected: the simulation does eventually establish linear behaviour, with the gradients increasing exponentially going from the solid to vapour phases. It is well known that diffusion in the vapour phase occurs much more readily than in the fluid phase, and more readily in the fluid phase than solid phase, and given that the diffusion coefficient is linearly correlated to the gradient of the mean square displacement, it was expected that the gradients of the graphs would increase in this manner. It was noted that the linear region of the solid phase plot (Figure 6) was quite noisy, but it was thought that this may be due to the small simulation size of 1,000 atoms.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|MSD Graphs (1,000,000 atoms)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_10.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_11.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_12.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 9. Graph of solid phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 10. Graph of fluid phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 11. Graph of vapour phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results from the simulation with 1,000,000 atoms (Figures 9-11) support the observations made with the 1,000 atom simulation. The only noticeable improvement from the 1,000 atom simulation was the reduction in noise of the linear region of the solid phase (Figure 9), suggesting that the assumption made previously to consider the more noisy region in Figure 6 as linear was correct, and that increasing the sample size did indeed improve the smoothness and accuracy of the curve.&lt;br /&gt;
&lt;br /&gt;
The gradient for the linear region of the plots were determined and used to calculate the diffusion coefficients (see table below).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=4|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Solid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Liquid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Vapour Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-6.17x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0688 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;2.27 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-6.83x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0698 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;2.47 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The results obtained are reasonable figures. In comparison with the 1,000,000 atom simulation, the values calculated for the diffusion coefficient with 1,000 atoms yielded a 9.7%, 1.4% and 8.0% error for the solid, liquid and vapour phases respectively. This suggests that for systems involving atoms that are at either extreme with regards to their range of motion, a larger atomic sample size would be suitable for simulations, whereas for fluids, more time-efficient simulations can be accurately conducted using the smaller 1,000 atom sample size.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient was also calculated using the velocity autocorrelation function (henceforth VACF).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|VACF Graphs&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_13.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_14.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_15.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 12. Graph of solid, liquid phase and simple harmonic oscillator VACF for 1,000 atoms&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 13. Running integral of solid, fluid and vapour phase VACF for 1,000 atoms&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 14. Running integral of solid, fluid and vapour phase VACF for 1,000,000 atoms&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The largest source of error in estimating the diffusion coefficient using the VACF was the number of atoms used in the simulations&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|VACF Graph Comparisons&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_18.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_19.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_20.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 15. Running integral of solid phase VACF for 1,000 and 1,000,000 atom simulations&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 16. Running integral of fluid phase VACF for 1,000 and 1,000,000 atom simulations&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 17. Running integral of vapour phase VACF for 1,000 and 1,000,000 atom simulations&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
==Tasks==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Introduction to Molecular Dynamics Simulations&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 1. For a default timestep value 0.1, estimate the positions of the maxima in the ERROR column as a function of time.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_1_1.png|centre|thumb|Figure X. Plot showing the positions of the error maxima as a function of time, with a best fit line]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 2. (Experiment with different values of the timestep.) What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using a timestep of 0.1990 meant that the total energy did not change by more than 1% over the course of the simulation (Figure X).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_2_1.png|centre|thumb|Figure X. Plot showing the total energy during the simulation using a timestep of 0.1990]]&lt;br /&gt;
&lt;br /&gt;
The simulations are being run in isolated systems which requires total energy conservation, so large fluctuations in the energy would lead to inaccurate results. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 3. For a single Lennard-Jones interaction, find the separation, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;, and work out the well depth. Evaluate the integrals when σ = ε = 1.0.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i) The Lennard-Jones interaction is given by:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_1.png|200px]]&lt;br /&gt;
&lt;br /&gt;
Since r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; when ɸ = 0,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(ii) The force is given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_3.png|250px]]&lt;br /&gt;
&lt;br /&gt;
So at the separation r&amp;lt;sub&amp;gt;0 &amp;lt;/sub&amp;gt;= σ,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_4.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iii) The equilibrium separation r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs at the point at which all forces vanish, ie. when F = 0, so&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_5.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iv) And the well depth is therefore given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_6.png|270px]]&lt;br /&gt;
&lt;br /&gt;
(v)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_7.png|370px]]&lt;br /&gt;
&lt;br /&gt;
(vi)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_8.png|400px]]&lt;br /&gt;
&lt;br /&gt;
(vii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_9.png|370px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4. Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10,000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_1.png|550px]]&lt;br /&gt;
&lt;br /&gt;
For 10,000 water molecules,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_3.png|230px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 5. Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After the timestep, the atom would be at position (0.5 + 0.7, 0.5 + 0.6, 0.5 + 0.2) = (1.2, 1.1, 0.7). Applying the boundary conditions, this is equivalent to the position (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 6. The Lennard-Jones parameters for argon are sigma = 0.34nm, ε/k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt; = 120K. If the LJ cutoff is r&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 1.5 in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_1.png|140px]]&lt;br /&gt;
&lt;br /&gt;
(ii) It was previously determined in Task 1 that the well depth is - ε, so in real units,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_4.png|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(iii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_3.png|130px]]&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Equilibration&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 7. Why do you think giving atoms random starting coordinates causes problems in simulations?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If two atoms are generated too close to one another, then they would experience a large repulsive force, and would disrupt the behaviour of the surrounding atoms, causing the simulation to become inaccurate. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 8. Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_1.png|380px]]&lt;br /&gt;
&lt;br /&gt;
(ii) For a face-centred cubic lattice, note that the unit cell contains four atoms, as opposed to one atom with a simple cubic lattice. Then&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_4.png|460px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 9. Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is 1 atom contained within each unit cell. However for face-centred cubic lattices, each unit cell contains 4 atoms so four times as many atoms are created than with the simple lattice (ie. 4000 atoms).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 10. Given that we are specifying x&amp;lt;sub&amp;gt;i &amp;lt;/sub&amp;gt;(0) and v&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; (0), which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We will be using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 11. In the code section &amp;quot;Specify Timestep&amp;quot;, the second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write &amp;quot;timestep 0.001 // run 100000&amp;quot;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Defining the variable timestep allows us to reference the variable multiple times throughout the simulation if required, whilst preventing errors and making it easier to alter the code if we want to run the simulation for different timestep values. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 12. Make plots of energy, temperature, and pressure, against time for the 0.001 timestep experiment. Does the simulation reach equilibrium? How long does this take? Make a single plot of energy vs time for all of the timesteps. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice and why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_12_1.png|centre|thumb|Figure X. Plot of energy against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_2.png|centre|thumb|Figure X. Plot of temperature against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_3.png|centre|thumb|Figure X. Plot of pressure against time for the 0.001 timestep experiment]]&lt;br /&gt;
&lt;br /&gt;
The 0.001 timestep experiment reaches equilibrium very quickly, within approximately 0.2s. &lt;br /&gt;
&lt;br /&gt;
A single plot of energy vs time for all of the timesteps can be found in &amp;quot;Results &amp;amp; Discussion: Investigation into Simulation Timestep in the NVE Ensemble Figure 1&amp;quot;, along with a detailed analysis, but in brief: the largest acceptable timestep is 0.0025, and a particularly bad choice would be 0.015 as it does not reach equilibrium.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Running Simulations under Specific Conditions&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 13. We need to choose gamma so that the temperature is correct T=fancy T if we multiply every velocity by γ. Solve the following two equations to determine gamma:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_2.png|center|200px]]&lt;br /&gt;
&lt;br /&gt;
Starting from the 2&amp;lt;sup&amp;gt;nd&amp;lt;/sup&amp;gt; equation,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_1.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 14: (Use the manual to find out the importance of the three numbers 100 1000 100000.) 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 (&amp;quot;run 100000&amp;quot;), how much time will you simulate? (DOUBLE CHECK THIS PART WITH OLLIE!)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Firstly, averages are taken for blocks of 100 values at a time to form the first set of averaged values (where av&amp;lt;sub&amp;gt;100,n&amp;lt;/sub&amp;gt; is the average value for the n&amp;lt;sup&amp;gt;th&amp;lt;/sup&amp;gt; block of 100 values). These values are then themselves averaged in blocks of 1000 values to form a second set of averaged values (av&amp;lt;sub&amp;gt;100,1&amp;lt;/sub&amp;gt; + av&amp;lt;sub&amp;gt;100,2&amp;lt;/sub&amp;gt; + ... + av&amp;lt;sub&amp;gt;100,1000&amp;lt;/sub&amp;gt;)/1000 = av&amp;lt;sub&amp;gt;1000,1&amp;lt;/sub&amp;gt;. Finally, these values are averaged once more in blocks of 100000 values.&lt;br /&gt;
&lt;br /&gt;
The amount of time simulated can be found by multiplying the number of steps by the value of the timestep (eg. 100,000 steps of a 0.001 timestep simulates 100 seconds).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 15: Plot density as a function of temperature for both of the pressures that you simulated. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figure 2 in &amp;quot;Results and Discussion: Equations of State in the NpT Ensemble&amp;quot; for the plot and subsequent discussion.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Heat Capacity Calculation&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 16: Run simulations at densities of 0.2, 0.8 and temperatures of 2.0, 2.2, 2.4, 2.6, 2.8, plotting C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;/V as a function of temperature, where V is the volume of the simulation cell, for both of your densities. Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the plot of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;/V as a function of temperature, please see Figure 3 in &amp;quot;Results and Discussion: Calculation of Heat Capacity&amp;quot; and the subsequent discussion on why the trend was as expected. A copy of the input script can be found in &amp;quot;Method: Part 3: Calculation of Heat Capacity&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Structural Properties and the Radial Distribution Function&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 17: Plot the RDFs for the three systems on the same axes. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figure 4 in &amp;quot;Results and Discussion: Radial Distribution Functions&amp;quot; for the plot and analysis. WHAT IS THE LATTICE SPACING? &lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Dynamical Properties and the Diffusion Coefficient&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 18: Make a plot for each of your simulations (solid/liquid/vapour), showing the mean squared displacement (&amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate D in each case. (Be careful with units!) Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 19: Evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (show working). On the same graph, with x range 0 to 500, plot C(tau) with omega = 1/2pi and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. Why is the harmonic oscillator VACF very different to the Lennard Jones solid and liquid? (Attach a copy of your plot)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_3.png|700px]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_2.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 20: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gm1110_LS_R_D_5_20.png&amp;diff=665574</id>
		<title>File:Gm1110 LS R D 5 20.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gm1110_LS_R_D_5_20.png&amp;diff=665574"/>
		<updated>2018-02-15T17:03:14Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gm1110_LS_R_D_5_19.png&amp;diff=665573</id>
		<title>File:Gm1110 LS R D 5 19.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gm1110_LS_R_D_5_19.png&amp;diff=665573"/>
		<updated>2018-02-15T17:02:45Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gm1110_LS_R_D_5_18.png&amp;diff=665572</id>
		<title>File:Gm1110 LS R D 5 18.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gm1110_LS_R_D_5_18.png&amp;diff=665572"/>
		<updated>2018-02-15T17:02:08Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gm1110_LS_R_D_5_15.png&amp;diff=665566</id>
		<title>File:Gm1110 LS R D 5 15.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gm1110_LS_R_D_5_15.png&amp;diff=665566"/>
		<updated>2018-02-15T13:48:20Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: Gm1110 uploaded a new version of File:Gm1110 LS R D 5 15.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gm1110_LS_R_D_5_14.png&amp;diff=665565</id>
		<title>File:Gm1110 LS R D 5 14.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gm1110_LS_R_D_5_14.png&amp;diff=665565"/>
		<updated>2018-02-15T13:46:07Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: Gm1110 uploaded a new version of File:Gm1110 LS R D 5 14.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665564</id>
		<title>Rep:Gm1110LiquidSim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665564"/>
		<updated>2018-02-15T12:41:03Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: /* Diffusion Coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
The main aim of the experiment was to determine the diffusion coefficient for the solid, liquid and vapour phases of a Lennard-Jones fluid using both the mean squared displacement method and velocity autocorrelation function method.&lt;br /&gt;
&lt;br /&gt;
In order to achieve this, it was first necessary to determine an appropriate timestep with which to run simulations, and investigate the effect of temperature and pressure on the density of the system. Other aims included seeing how heat capacity varied as a function of temperature for different densities, and calculating the radial distribution function for the three phases from simulations using VMD.    &lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
All simulations of the Lennard-Jones fluid were run using the LAMMPS software, and all quantities used were in reduced units.&lt;br /&gt;
&lt;br /&gt;
=== Part 1: Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
A simulation box consisting of 10 x 10 x 10 unit cells of a simple cubic lattice with an atomic density of 0.8 was defined. The atomic mass was set to 1.0 and the Lennard-Jones pairwise interaction cutoff distance was set to 3.0. The pairwise forcefield coefficients ε (potential well depth) and σ (zero-potential distance) were both set to 1.0. Five simulations were run for differing timestep values (0.0010, 0.0025, 0.0075, 0.0100 and 0.0150).&lt;br /&gt;
&lt;br /&gt;
=== Part 2: Equations of State in the NpT Ensemble ===&lt;br /&gt;
The simulation box was increased to consist of 15 x 15 x 15 unit cells of the same simple cubic lattice defined in part 1. A total of ten simulations were run in the NpT ensemble, varying temperature (2.0, 4.0, 6.0, 8.0 and 10.0) at two different densities (1.8 and 2.8) using the timestep value of 0.0025 determined in Part 1.&lt;br /&gt;
&lt;br /&gt;
=== Part 3: Calculation of Heat Capacity ===&lt;br /&gt;
The simulation box from Part 2 was used, with the density altered to take the values 0.2 and 0.8. Five simulations were run for each, with varying values of temperature (2.0, 2.2, 2.4, 2.6 and 2.8). A copy of the script written for this simulation can be found by clicking the image below:&lt;br /&gt;
[[File:gm1110_LS_M_3_1.png|centre|thumb|Copy of Script]]&lt;br /&gt;
&lt;br /&gt;
=== Part 4: Radial Distribution Functions ===&lt;br /&gt;
The simulation boxes used previously were altered to take a timestep of 0.002 and a L-J cutoff distance of 3.2, after which the solid, liquid and vapour phases were defined as having (density, temperature) values of (1.2, 1.2), (0.8, 1.2) and (0.05, 1.1) respectively. In particular, the solid phase was defined as having a face-centred cubic lattice, instead of the simple cubic lattice used for the liquid and vapour phases. VMD was used to analyse the trajectories for the three phases, with the distance between points in the generated RDF set to 0.05.&lt;br /&gt;
&lt;br /&gt;
=== Part 5: Diffusion Coefficient ===&lt;br /&gt;
The results from Part 4 were used to graph the mean squared displacement as a function of time, after which the gradient of the linear portion of the graph was extracted and used to calculate the diffusion coefficient from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_M_5_1.png|centre|150px]]&lt;br /&gt;
&lt;br /&gt;
The procedure was then repeated using 1 million atoms.&lt;br /&gt;
&lt;br /&gt;
==Results and Discussion==&lt;br /&gt;
&lt;br /&gt;
=== Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
Simulations were run using the five different timesteps 0.0010, 0.0025, 0.0075, 0.0100 and 0.0150, and a plot of the results can be seen below (Figure 1).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_1_1.png|centre|thumb|Figure 1. A plot of total energy (reduced units) against time comparing simulations run using five different timestep values]]&lt;br /&gt;
&lt;br /&gt;
It was observed that the simulation run with a timestep of 0.0150 did not equilibrate. This was thought to have potentially been due to the timestep being too large, and therefore the simulation was missing too much detail to accurately simulate the fluid. The simulations run for timesteps of 0.0100 and 0.0075 did equilibrate (supporting the previous hypothesis that the 0.0150 timestep was too large), but converged at the wrong energy (approximately -3.181 and -3.183 respectively), indicating that the timesteps were still not quite small enough.&lt;br /&gt;
&lt;br /&gt;
The final two simulations run at timesteps of 0.0025 and 0.0010 both equilibrated to the same, correct energy (approximately -3.184), indicating that both would be suitable for use in further simulations. It is preferable, however, to maximise the timestep when running simulations as a smaller timestep requires more data points, and is therefore more “expensive” and takes longer to run for no real added value. Hence it was decided that a timestep of 0.0025 would be suitable for running further simulations.    &lt;br /&gt;
&lt;br /&gt;
=== Equations of State in the NpT Ensemble ===&lt;br /&gt;
Although specific values for temperature and pressure are specified for the simulations, in reality, the temperature and pressure of a system fluctuates over time and may therefore deviate away from the inputted values. Hence, the simulation calculates the pressure of the system at the end of every timestep, and adjusts the size of the simulation box such that the pressure once again corresponds to the specified value. Pressure controlled simulations are thus in the NpT ensemble and so volume (and therefore density) is not constant.&lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the resulting densities were plotted against temperature, along with values predicted by the ideal gas law and can be seen below (Figure 2).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_2_1.png|centre|thumb|Figure 2. Plot showing density as a function of temperature at pressures of 1.8 and 2.8 (all in reduced units), with error bars, and a plot of the densities predicted by the ideal gas law]]&lt;br /&gt;
&lt;br /&gt;
Clearly, the simulated densities are lower than those predicted by the ideal gas law, and the discrepancy increases with increasing pressure. This is due to the fact that the ideal gas law assumes perfectly elastic collisions between point particles, but in reality, intermolecular repulsive forces cause the simulated densities to be lower. In addition, an increase in pressure causes the molecules to be pushed closer together and increases both the number of collisions as well as the repulsive forces, leading to a greater deviation from ideality.    &lt;br /&gt;
&lt;br /&gt;
=== Calculation of Heat Capacity ===&lt;br /&gt;
Switching to the NVT ensemble, the heat capacity of the system can be determined by considering the magnitude of fluctuations in the system’s energy from its average equilibrium state from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_1.png|centre|250px]]            &lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the average heat capacities were plotted as a function of temperature (Figure 3).        &lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_2.png|centre|thumb|Figure 3. Plot of average heat capacity against temperature for densities of 0.8 and 0.2]]Heat capacity is a measure of the amount of energy required to increase the temperature of a substance. It is clear that the heat capacity is lower, and therefore easier to heat, for lower density systems as the particles are more spaced apart. This means that they are able to gain thermal energy more easily as they have more room for increased vibrations without an increase of repulsive forces or collisions compared to a higher density system. It was also noted that the heat capacity decreased with increasing temperature. This is due to the fact that at higher temperatures, the gap between energy levels decreases as the particles occupy higher energy states, thus making it easier for the particles to be promoted to higher energy levels.&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Functions ===&lt;br /&gt;
Radial distribution functions (g(r)) were calculated for the solid, liquid and vapour phases (see Figure 4) to check that the simulations were correctly reproducing the structural features of each phase. RDFs are essentially probability distribution functions for the likelihood of finding a particle at a given distance r away from a reference particle, and also gives information on the coordination sphere of the reference particle. The integral of the RDF (Figure 5) is also useful as it gives information on the number of atoms found at a distance r.&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_1.png|centre|thumb|Figure 4. Radial distribution function against displacement from a reference atom]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_2.png|centre|thumb|Figure 5. Integral of the radial distribution function against displacement]]&lt;br /&gt;
&lt;br /&gt;
For small r, all three phases have g(r) ~ 0, indicating an atomic density of zero as there exists a minimum distance at which atoms can approach each other. Also, g(r) tends to 1 for all three phases with increasing r, which represents the fact that the local density becomes equivalent to the mean density of the system as a whole.&lt;br /&gt;
&lt;br /&gt;
The graph of the solid phase shows sharp oscillating peaks, indicating that the atoms are strongly confined to their positions in the crystalline lattice, and the high degree of ordering means that although the osciallations do tend to g(r) = 1 for large r, this occurs much more slowly than for the other two phases. The first peak corresponds to the atoms nearest neighbours (of which there are 12), and the second and third peak correspond to the second and third nearest neighbours respectively (of which there are 6 and 24). &lt;br /&gt;
&lt;br /&gt;
The graph for the liquid phase shows broad, gently oscillating peaks that rapidly decay to g(r) = 1. As with the solid phase, the oscillations indicate some structure in the system whereby the atoms are loosely bound to their original positions, but the broader peaks indicate that they have much more freedom to move away from their positions. &lt;br /&gt;
&lt;br /&gt;
The graph for the vapour phase shows a single peak at approximately r = 1, after which it quickly decays back to g(r) = 1. This shows that the structure has very little to no order, and the particles are free to move unbound to any specific position. &lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|MSD Graphs (1,000 atoms)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_7.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_8.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_9.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 6. Graph of solid phase MSD for 1,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 7. Graph of fluid phase MSD for 1,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 8. Graph of vapour phase MSD for 1,000 atoms(with trendline)&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The general trends displayed in Figures 6-8 are as expected: the simulation does eventually establish linear behaviour, with the gradients increasing exponentially going from the solid to vapour phases. It is well known that diffusion in the vapour phase occurs much more readily than in the fluid phase, and more readily in the fluid phase than solid phase, and given that the diffusion coefficient is linearly correlated to the gradient of the mean square displacement, it was expected that the gradients of the graphs would increase in this manner. It was noted that the linear region of the solid phase plot (Figure 6) was quite noisy, but it was thought that this may be due to the small simulation size of 1,000 atoms.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|MSD Graphs (1,000,000 atoms)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_10.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_11.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_12.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 9. Graph of solid phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 10. Graph of fluid phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 11. Graph of vapour phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results from the simulation with 1,000,000 atoms (Figures 9-11) support the observations made with the 1,000 atom simulation. The only noticeable improvement from the 1,000 atom simulation was the reduction in noise of the linear region of the solid phase (Figure 9), suggesting that the assumption made previously to consider the more noisy region in Figure 6 as linear was correct, and that increasing the sample size did indeed improve the smoothness and accuracy of the curve.&lt;br /&gt;
&lt;br /&gt;
The gradient for the linear region of the plots were determined and used to calculate the diffusion coefficients (see table below).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=4|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Solid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Liquid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Vapour Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-6.17x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0688 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;2.27 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-6.83x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0698 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;2.47 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The results obtained are reasonable figures. In comparison with the 1,000,000 atom simulation, the values calculated for the diffusion coefficient with 1,000 atoms yielded a 9.7%, 1.4% and 8.0% error for the solid, liquid and vapour phases respectively. This suggests that for systems involving atoms that are at either extreme with regards to their range of motion, a larger atomic sample size would be suitable for simulations, whereas for fluids, more time-efficient simulations can be accurately conducted using the smaller 1,000 atom sample size.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient was also calculated using the velocity autocorrelation function (henceforth VACF).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|VACF Graphs&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_13.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_14.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_15.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 12. Graph of solid, liquid phase and simple harmonic oscillator VACF for 1,000 atoms&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 13. Running integral of solid, fluid and vapour phase VACF for 1,000 atoms&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 14. Running integral of solid, fluid and vapour phase VACF for 1,000,000 atoms&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
==Tasks==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Introduction to Molecular Dynamics Simulations&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 1. For a default timestep value 0.1, estimate the positions of the maxima in the ERROR column as a function of time.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_1_1.png|centre|thumb|Figure X. Plot showing the positions of the error maxima as a function of time, with a best fit line]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 2. (Experiment with different values of the timestep.) What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using a timestep of 0.1990 meant that the total energy did not change by more than 1% over the course of the simulation (Figure X).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_2_1.png|centre|thumb|Figure X. Plot showing the total energy during the simulation using a timestep of 0.1990]]&lt;br /&gt;
&lt;br /&gt;
The simulations are being run in isolated systems which requires total energy conservation, so large fluctuations in the energy would lead to inaccurate results. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 3. For a single Lennard-Jones interaction, find the separation, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;, and work out the well depth. Evaluate the integrals when σ = ε = 1.0.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i) The Lennard-Jones interaction is given by:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_1.png|200px]]&lt;br /&gt;
&lt;br /&gt;
Since r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; when ɸ = 0,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(ii) The force is given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_3.png|250px]]&lt;br /&gt;
&lt;br /&gt;
So at the separation r&amp;lt;sub&amp;gt;0 &amp;lt;/sub&amp;gt;= σ,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_4.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iii) The equilibrium separation r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs at the point at which all forces vanish, ie. when F = 0, so&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_5.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iv) And the well depth is therefore given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_6.png|270px]]&lt;br /&gt;
&lt;br /&gt;
(v)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_7.png|370px]]&lt;br /&gt;
&lt;br /&gt;
(vi)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_8.png|400px]]&lt;br /&gt;
&lt;br /&gt;
(vii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_9.png|370px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4. Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10,000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_1.png|550px]]&lt;br /&gt;
&lt;br /&gt;
For 10,000 water molecules,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_3.png|230px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 5. Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After the timestep, the atom would be at position (0.5 + 0.7, 0.5 + 0.6, 0.5 + 0.2) = (1.2, 1.1, 0.7). Applying the boundary conditions, this is equivalent to the position (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 6. The Lennard-Jones parameters for argon are sigma = 0.34nm, ε/k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt; = 120K. If the LJ cutoff is r&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 1.5 in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_1.png|140px]]&lt;br /&gt;
&lt;br /&gt;
(ii) It was previously determined in Task 1 that the well depth is - ε, so in real units,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_4.png|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(iii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_3.png|130px]]&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Equilibration&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 7. Why do you think giving atoms random starting coordinates causes problems in simulations?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If two atoms are generated too close to one another, then they would experience a large repulsive force, and would disrupt the behaviour of the surrounding atoms, causing the simulation to become inaccurate. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 8. Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_1.png|380px]]&lt;br /&gt;
&lt;br /&gt;
(ii) For a face-centred cubic lattice, note that the unit cell contains four atoms, as opposed to one atom with a simple cubic lattice. Then&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_4.png|460px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 9. Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is 1 atom contained within each unit cell. However for face-centred cubic lattices, each unit cell contains 4 atoms so four times as many atoms are created than with the simple lattice (ie. 4000 atoms).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 10. Given that we are specifying x&amp;lt;sub&amp;gt;i &amp;lt;/sub&amp;gt;(0) and v&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; (0), which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We will be using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 11. In the code section &amp;quot;Specify Timestep&amp;quot;, the second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write &amp;quot;timestep 0.001 // run 100000&amp;quot;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Defining the variable timestep allows us to reference the variable multiple times throughout the simulation if required, whilst preventing errors and making it easier to alter the code if we want to run the simulation for different timestep values. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 12. Make plots of energy, temperature, and pressure, against time for the 0.001 timestep experiment. Does the simulation reach equilibrium? How long does this take? Make a single plot of energy vs time for all of the timesteps. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice and why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_12_1.png|centre|thumb|Figure X. Plot of energy against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_2.png|centre|thumb|Figure X. Plot of temperature against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_3.png|centre|thumb|Figure X. Plot of pressure against time for the 0.001 timestep experiment]]&lt;br /&gt;
&lt;br /&gt;
The 0.001 timestep experiment reaches equilibrium very quickly, within approximately 0.2s. &lt;br /&gt;
&lt;br /&gt;
A single plot of energy vs time for all of the timesteps can be found in &amp;quot;Results &amp;amp; Discussion: Investigation into Simulation Timestep in the NVE Ensemble Figure 1&amp;quot;, along with a detailed analysis, but in brief: the largest acceptable timestep is 0.0025, and a particularly bad choice would be 0.015 as it does not reach equilibrium.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Running Simulations under Specific Conditions&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 13. We need to choose gamma so that the temperature is correct T=fancy T if we multiply every velocity by γ. Solve the following two equations to determine gamma:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_2.png|center|200px]]&lt;br /&gt;
&lt;br /&gt;
Starting from the 2&amp;lt;sup&amp;gt;nd&amp;lt;/sup&amp;gt; equation,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_1.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 14: (Use the manual to find out the importance of the three numbers 100 1000 100000.) 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 (&amp;quot;run 100000&amp;quot;), how much time will you simulate? (DOUBLE CHECK THIS PART WITH OLLIE!)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Firstly, averages are taken for blocks of 100 values at a time to form the first set of averaged values (where av&amp;lt;sub&amp;gt;100,n&amp;lt;/sub&amp;gt; is the average value for the n&amp;lt;sup&amp;gt;th&amp;lt;/sup&amp;gt; block of 100 values). These values are then themselves averaged in blocks of 1000 values to form a second set of averaged values (av&amp;lt;sub&amp;gt;100,1&amp;lt;/sub&amp;gt; + av&amp;lt;sub&amp;gt;100,2&amp;lt;/sub&amp;gt; + ... + av&amp;lt;sub&amp;gt;100,1000&amp;lt;/sub&amp;gt;)/1000 = av&amp;lt;sub&amp;gt;1000,1&amp;lt;/sub&amp;gt;. Finally, these values are averaged once more in blocks of 100000 values.&lt;br /&gt;
&lt;br /&gt;
The amount of time simulated can be found by multiplying the number of steps by the value of the timestep (eg. 100,000 steps of a 0.001 timestep simulates 100 seconds).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 15: Plot density as a function of temperature for both of the pressures that you simulated. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figure 2 in &amp;quot;Results and Discussion: Equations of State in the NpT Ensemble&amp;quot; for the plot and subsequent discussion.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Heat Capacity Calculation&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 16: Run simulations at densities of 0.2, 0.8 and temperatures of 2.0, 2.2, 2.4, 2.6, 2.8, plotting C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;/V as a function of temperature, where V is the volume of the simulation cell, for both of your densities. Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the plot of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;/V as a function of temperature, please see Figure 3 in &amp;quot;Results and Discussion: Calculation of Heat Capacity&amp;quot; and the subsequent discussion on why the trend was as expected. A copy of the input script can be found in &amp;quot;Method: Part 3: Calculation of Heat Capacity&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Structural Properties and the Radial Distribution Function&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 17: Plot the RDFs for the three systems on the same axes. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figure 4 in &amp;quot;Results and Discussion: Radial Distribution Functions&amp;quot; for the plot and analysis. WHAT IS THE LATTICE SPACING? &lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Dynamical Properties and the Diffusion Coefficient&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 18: Make a plot for each of your simulations (solid/liquid/vapour), showing the mean squared displacement (&amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate D in each case. (Be careful with units!) Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 19: Evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (show working). On the same graph, with x range 0 to 500, plot C(tau) with omega = 1/2pi and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. Why is the harmonic oscillator VACF very different to the Lennard Jones solid and liquid? (Attach a copy of your plot)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_3.png|700px]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_2.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 20: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gm1110_LS_R_D_5_15.png&amp;diff=665563</id>
		<title>File:Gm1110 LS R D 5 15.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gm1110_LS_R_D_5_15.png&amp;diff=665563"/>
		<updated>2018-02-15T12:30:04Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gm1110_LS_R_D_5_14.png&amp;diff=665562</id>
		<title>File:Gm1110 LS R D 5 14.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gm1110_LS_R_D_5_14.png&amp;diff=665562"/>
		<updated>2018-02-15T12:29:46Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gm1110_LS_R_D_5_13.png&amp;diff=665561</id>
		<title>File:Gm1110 LS R D 5 13.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gm1110_LS_R_D_5_13.png&amp;diff=665561"/>
		<updated>2018-02-15T12:29:07Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665555</id>
		<title>Rep:Gm1110LiquidSim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665555"/>
		<updated>2018-02-14T15:08:28Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: /* Diffusion Coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
The main aim of the experiment was to determine the diffusion coefficient for the solid, liquid and vapour phases of a Lennard-Jones fluid using both the mean squared displacement method and velocity autocorrelation function method.&lt;br /&gt;
&lt;br /&gt;
In order to achieve this, it was first necessary to determine an appropriate timestep with which to run simulations, and investigate the effect of temperature and pressure on the density of the system. Other aims included seeing how heat capacity varied as a function of temperature for different densities, and calculating the radial distribution function for the three phases from simulations using VMD.    &lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
All simulations of the Lennard-Jones fluid were run using the LAMMPS software, and all quantities used were in reduced units.&lt;br /&gt;
&lt;br /&gt;
=== Part 1: Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
A simulation box consisting of 10 x 10 x 10 unit cells of a simple cubic lattice with an atomic density of 0.8 was defined. The atomic mass was set to 1.0 and the Lennard-Jones pairwise interaction cutoff distance was set to 3.0. The pairwise forcefield coefficients ε (potential well depth) and σ (zero-potential distance) were both set to 1.0. Five simulations were run for differing timestep values (0.0010, 0.0025, 0.0075, 0.0100 and 0.0150).&lt;br /&gt;
&lt;br /&gt;
=== Part 2: Equations of State in the NpT Ensemble ===&lt;br /&gt;
The simulation box was increased to consist of 15 x 15 x 15 unit cells of the same simple cubic lattice defined in part 1. A total of ten simulations were run in the NpT ensemble, varying temperature (2.0, 4.0, 6.0, 8.0 and 10.0) at two different densities (1.8 and 2.8) using the timestep value of 0.0025 determined in Part 1.&lt;br /&gt;
&lt;br /&gt;
=== Part 3: Calculation of Heat Capacity ===&lt;br /&gt;
The simulation box from Part 2 was used, with the density altered to take the values 0.2 and 0.8. Five simulations were run for each, with varying values of temperature (2.0, 2.2, 2.4, 2.6 and 2.8). A copy of the script written for this simulation can be found by clicking the image below:&lt;br /&gt;
[[File:gm1110_LS_M_3_1.png|centre|thumb|Copy of Script]]&lt;br /&gt;
&lt;br /&gt;
=== Part 4: Radial Distribution Functions ===&lt;br /&gt;
The simulation boxes used previously were altered to take a timestep of 0.002 and a L-J cutoff distance of 3.2, after which the solid, liquid and vapour phases were defined as having (density, temperature) values of (1.2, 1.2), (0.8, 1.2) and (0.05, 1.1) respectively. In particular, the solid phase was defined as having a face-centred cubic lattice, instead of the simple cubic lattice used for the liquid and vapour phases. VMD was used to analyse the trajectories for the three phases, with the distance between points in the generated RDF set to 0.05.&lt;br /&gt;
&lt;br /&gt;
=== Part 5: Diffusion Coefficient ===&lt;br /&gt;
The results from Part 4 were used to graph the mean squared displacement as a function of time, after which the gradient of the linear portion of the graph was extracted and used to calculate the diffusion coefficient from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_M_5_1.png|centre|150px]]&lt;br /&gt;
&lt;br /&gt;
The procedure was then repeated using 1 million atoms.&lt;br /&gt;
&lt;br /&gt;
==Results and Discussion==&lt;br /&gt;
&lt;br /&gt;
=== Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
Simulations were run using the five different timesteps 0.0010, 0.0025, 0.0075, 0.0100 and 0.0150, and a plot of the results can be seen below (Figure 1).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_1_1.png|centre|thumb|Figure 1. A plot of total energy (reduced units) against time comparing simulations run using five different timestep values]]&lt;br /&gt;
&lt;br /&gt;
It was observed that the simulation run with a timestep of 0.0150 did not equilibrate. This was thought to have potentially been due to the timestep being too large, and therefore the simulation was missing too much detail to accurately simulate the fluid. The simulations run for timesteps of 0.0100 and 0.0075 did equilibrate (supporting the previous hypothesis that the 0.0150 timestep was too large), but converged at the wrong energy (approximately -3.181 and -3.183 respectively), indicating that the timesteps were still not quite small enough.&lt;br /&gt;
&lt;br /&gt;
The final two simulations run at timesteps of 0.0025 and 0.0010 both equilibrated to the same, correct energy (approximately -3.184), indicating that both would be suitable for use in further simulations. It is preferable, however, to maximise the timestep when running simulations as a smaller timestep requires more data points, and is therefore more “expensive” and takes longer to run for no real added value. Hence it was decided that a timestep of 0.0025 would be suitable for running further simulations.    &lt;br /&gt;
&lt;br /&gt;
=== Equations of State in the NpT Ensemble ===&lt;br /&gt;
Although specific values for temperature and pressure are specified for the simulations, in reality, the temperature and pressure of a system fluctuates over time and may therefore deviate away from the inputted values. Hence, the simulation calculates the pressure of the system at the end of every timestep, and adjusts the size of the simulation box such that the pressure once again corresponds to the specified value. Pressure controlled simulations are thus in the NpT ensemble and so volume (and therefore density) is not constant.&lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the resulting densities were plotted against temperature, along with values predicted by the ideal gas law and can be seen below (Figure 2).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_2_1.png|centre|thumb|Figure 2. Plot showing density as a function of temperature at pressures of 1.8 and 2.8 (all in reduced units), with error bars, and a plot of the densities predicted by the ideal gas law]]&lt;br /&gt;
&lt;br /&gt;
Clearly, the simulated densities are lower than those predicted by the ideal gas law, and the discrepancy increases with increasing pressure. This is due to the fact that the ideal gas law assumes perfectly elastic collisions between point particles, but in reality, intermolecular repulsive forces cause the simulated densities to be lower. In addition, an increase in pressure causes the molecules to be pushed closer together and increases both the number of collisions as well as the repulsive forces, leading to a greater deviation from ideality.    &lt;br /&gt;
&lt;br /&gt;
=== Calculation of Heat Capacity ===&lt;br /&gt;
Switching to the NVT ensemble, the heat capacity of the system can be determined by considering the magnitude of fluctuations in the system’s energy from its average equilibrium state from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_1.png|centre|250px]]            &lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the average heat capacities were plotted as a function of temperature (Figure 3).        &lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_2.png|centre|thumb|Figure 3. Plot of average heat capacity against temperature for densities of 0.8 and 0.2]]Heat capacity is a measure of the amount of energy required to increase the temperature of a substance. It is clear that the heat capacity is lower, and therefore easier to heat, for lower density systems as the particles are more spaced apart. This means that they are able to gain thermal energy more easily as they have more room for increased vibrations without an increase of repulsive forces or collisions compared to a higher density system. It was also noted that the heat capacity decreased with increasing temperature. This is due to the fact that at higher temperatures, the gap between energy levels decreases as the particles occupy higher energy states, thus making it easier for the particles to be promoted to higher energy levels.&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Functions ===&lt;br /&gt;
Radial distribution functions (g(r)) were calculated for the solid, liquid and vapour phases (see Figure 4) to check that the simulations were correctly reproducing the structural features of each phase. RDFs are essentially probability distribution functions for the likelihood of finding a particle at a given distance r away from a reference particle, and also gives information on the coordination sphere of the reference particle. The integral of the RDF (Figure 5) is also useful as it gives information on the number of atoms found at a distance r.&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_1.png|centre|thumb|Figure 4. Radial distribution function against displacement from a reference atom]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_2.png|centre|thumb|Figure 5. Integral of the radial distribution function against displacement]]&lt;br /&gt;
&lt;br /&gt;
For small r, all three phases have g(r) ~ 0, indicating an atomic density of zero as there exists a minimum distance at which atoms can approach each other. Also, g(r) tends to 1 for all three phases with increasing r, which represents the fact that the local density becomes equivalent to the mean density of the system as a whole.&lt;br /&gt;
&lt;br /&gt;
The graph of the solid phase shows sharp oscillating peaks, indicating that the atoms are strongly confined to their positions in the crystalline lattice, and the high degree of ordering means that although the osciallations do tend to g(r) = 1 for large r, this occurs much more slowly than for the other two phases. The first peak corresponds to the atoms nearest neighbours (of which there are 12), and the second and third peak correspond to the second and third nearest neighbours respectively (of which there are 6 and 24). &lt;br /&gt;
&lt;br /&gt;
The graph for the liquid phase shows broad, gently oscillating peaks that rapidly decay to g(r) = 1. As with the solid phase, the oscillations indicate some structure in the system whereby the atoms are loosely bound to their original positions, but the broader peaks indicate that they have much more freedom to move away from their positions. &lt;br /&gt;
&lt;br /&gt;
The graph for the vapour phase shows a single peak at approximately r = 1, after which it quickly decays back to g(r) = 1. This shows that the structure has very little to no order, and the particles are free to move unbound to any specific position. &lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|MSD Graphs (1,000 atoms)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_7.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_8.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_9.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 6. Graph of solid phase MSD for 1,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 7. Graph of fluid phase MSD for 1,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 8. Graph of vapour phase MSD for 1,000 atoms(with trendline)&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The general trends displayed in Figures 6-8 are as expected: the simulation does eventually establish linear behaviour, with the gradients increasing exponentially going from the solid to vapour phases. It is well known that diffusion in the vapour phase occurs much more readily than in the fluid phase, and more readily in the fluid phase than solid phase, and given that the diffusion coefficient is linearly correlated to the gradient of the mean square displacement, it was expected that the gradients of the graphs would increase in this manner. It was noted that the linear region of the solid phase plot (Figure 6) was quite noisy, but it was thought that this may be due to the small simulation size of 1,000 atoms.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|MSD Graphs (1,000,000 atoms)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_10.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_11.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_12.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 9. Graph of solid phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 10. Graph of fluid phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 11. Graph of vapour phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results from the simulation with 1,000,000 atoms (Figures 9-11) support the observations made with the 1,000 atom simulation. The only noticeable improvement from the 1,000 atom simulation was the reduction in noise of the linear region of the solid phase (Figure 9), suggesting that the assumption made previously to consider the more noisy region in Figure 6 as linear was correct, and that increasing the sample size did indeed improve the smoothness and accuracy of the curve.&lt;br /&gt;
&lt;br /&gt;
The gradient for the linear region of the plots were determined and used to calculate the diffusion coefficients (see table below).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=4|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Solid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Liquid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Vapour Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-6.17x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0688 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;2.27 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-6.83x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0698 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;2.47 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The results obtained are reasonable figures. In comparison with the 1,000,000 atom simulation, the values calculated for the diffusion coefficient with 1,000 atoms yielded a 9.7%, 1.4% and 8.0% error for the solid, liquid and vapour phases respectively. This suggests that for systems involving atoms that are at either extreme with regards to their range of motion, a larger atomic sample size would be suitable for simulations, whereas for fluids, more time-efficient simulations can be accurately conducted using the smaller 1,000 atom sample size. &lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
==Tasks==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Introduction to Molecular Dynamics Simulations&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 1. For a default timestep value 0.1, estimate the positions of the maxima in the ERROR column as a function of time.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_1_1.png|centre|thumb|Figure X. Plot showing the positions of the error maxima as a function of time, with a best fit line]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 2. (Experiment with different values of the timestep.) What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using a timestep of 0.1990 meant that the total energy did not change by more than 1% over the course of the simulation (Figure X).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_2_1.png|centre|thumb|Figure X. Plot showing the total energy during the simulation using a timestep of 0.1990]]&lt;br /&gt;
&lt;br /&gt;
The simulations are being run in isolated systems which requires total energy conservation, so large fluctuations in the energy would lead to inaccurate results. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 3. For a single Lennard-Jones interaction, find the separation, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;, and work out the well depth. Evaluate the integrals when σ = ε = 1.0.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i) The Lennard-Jones interaction is given by:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_1.png|200px]]&lt;br /&gt;
&lt;br /&gt;
Since r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; when ɸ = 0,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(ii) The force is given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_3.png|250px]]&lt;br /&gt;
&lt;br /&gt;
So at the separation r&amp;lt;sub&amp;gt;0 &amp;lt;/sub&amp;gt;= σ,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_4.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iii) The equilibrium separation r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs at the point at which all forces vanish, ie. when F = 0, so&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_5.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iv) And the well depth is therefore given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_6.png|270px]]&lt;br /&gt;
&lt;br /&gt;
(v)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_7.png|370px]]&lt;br /&gt;
&lt;br /&gt;
(vi)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_8.png|400px]]&lt;br /&gt;
&lt;br /&gt;
(vii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_9.png|370px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4. Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10,000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_1.png|550px]]&lt;br /&gt;
&lt;br /&gt;
For 10,000 water molecules,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_3.png|230px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 5. Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After the timestep, the atom would be at position (0.5 + 0.7, 0.5 + 0.6, 0.5 + 0.2) = (1.2, 1.1, 0.7). Applying the boundary conditions, this is equivalent to the position (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 6. The Lennard-Jones parameters for argon are sigma = 0.34nm, ε/k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt; = 120K. If the LJ cutoff is r&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 1.5 in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_1.png|140px]]&lt;br /&gt;
&lt;br /&gt;
(ii) It was previously determined in Task 1 that the well depth is - ε, so in real units,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_4.png|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(iii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_3.png|130px]]&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Equilibration&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 7. Why do you think giving atoms random starting coordinates causes problems in simulations?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If two atoms are generated too close to one another, then they would experience a large repulsive force, and would disrupt the behaviour of the surrounding atoms, causing the simulation to become inaccurate. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 8. Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_1.png|380px]]&lt;br /&gt;
&lt;br /&gt;
(ii) For a face-centred cubic lattice, note that the unit cell contains four atoms, as opposed to one atom with a simple cubic lattice. Then&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_4.png|460px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 9. Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is 1 atom contained within each unit cell. However for face-centred cubic lattices, each unit cell contains 4 atoms so four times as many atoms are created than with the simple lattice (ie. 4000 atoms).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 10. Given that we are specifying x&amp;lt;sub&amp;gt;i &amp;lt;/sub&amp;gt;(0) and v&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; (0), which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We will be using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 11. In the code section &amp;quot;Specify Timestep&amp;quot;, the second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write &amp;quot;timestep 0.001 // run 100000&amp;quot;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Defining the variable timestep allows us to reference the variable multiple times throughout the simulation if required, whilst preventing errors and making it easier to alter the code if we want to run the simulation for different timestep values. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 12. Make plots of energy, temperature, and pressure, against time for the 0.001 timestep experiment. Does the simulation reach equilibrium? How long does this take? Make a single plot of energy vs time for all of the timesteps. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice and why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_12_1.png|centre|thumb|Figure X. Plot of energy against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_2.png|centre|thumb|Figure X. Plot of temperature against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_3.png|centre|thumb|Figure X. Plot of pressure against time for the 0.001 timestep experiment]]&lt;br /&gt;
&lt;br /&gt;
The 0.001 timestep experiment reaches equilibrium very quickly, within approximately 0.2s. &lt;br /&gt;
&lt;br /&gt;
A single plot of energy vs time for all of the timesteps can be found in &amp;quot;Results &amp;amp; Discussion: Investigation into Simulation Timestep in the NVE Ensemble Figure 1&amp;quot;, along with a detailed analysis, but in brief: the largest acceptable timestep is 0.0025, and a particularly bad choice would be 0.015 as it does not reach equilibrium.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Running Simulations under Specific Conditions&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 13. We need to choose gamma so that the temperature is correct T=fancy T if we multiply every velocity by γ. Solve the following two equations to determine gamma:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_2.png|center|200px]]&lt;br /&gt;
&lt;br /&gt;
Starting from the 2&amp;lt;sup&amp;gt;nd&amp;lt;/sup&amp;gt; equation,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_1.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 14: (Use the manual to find out the importance of the three numbers 100 1000 100000.) 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 (&amp;quot;run 100000&amp;quot;), how much time will you simulate? (DOUBLE CHECK THIS PART WITH OLLIE!)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Firstly, averages are taken for blocks of 100 values at a time to form the first set of averaged values (where av&amp;lt;sub&amp;gt;100,n&amp;lt;/sub&amp;gt; is the average value for the n&amp;lt;sup&amp;gt;th&amp;lt;/sup&amp;gt; block of 100 values). These values are then themselves averaged in blocks of 1000 values to form a second set of averaged values (av&amp;lt;sub&amp;gt;100,1&amp;lt;/sub&amp;gt; + av&amp;lt;sub&amp;gt;100,2&amp;lt;/sub&amp;gt; + ... + av&amp;lt;sub&amp;gt;100,1000&amp;lt;/sub&amp;gt;)/1000 = av&amp;lt;sub&amp;gt;1000,1&amp;lt;/sub&amp;gt;. Finally, these values are averaged once more in blocks of 100000 values.&lt;br /&gt;
&lt;br /&gt;
The amount of time simulated can be found by multiplying the number of steps by the value of the timestep (eg. 100,000 steps of a 0.001 timestep simulates 100 seconds).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 15: Plot density as a function of temperature for both of the pressures that you simulated. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figure 2 in &amp;quot;Results and Discussion: Equations of State in the NpT Ensemble&amp;quot; for the plot and subsequent discussion.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Heat Capacity Calculation&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 16: Run simulations at densities of 0.2, 0.8 and temperatures of 2.0, 2.2, 2.4, 2.6, 2.8, plotting C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;/V as a function of temperature, where V is the volume of the simulation cell, for both of your densities. Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the plot of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;/V as a function of temperature, please see Figure 3 in &amp;quot;Results and Discussion: Calculation of Heat Capacity&amp;quot; and the subsequent discussion on why the trend was as expected. A copy of the input script can be found in &amp;quot;Method: Part 3: Calculation of Heat Capacity&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Structural Properties and the Radial Distribution Function&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 17: Plot the RDFs for the three systems on the same axes. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figure 4 in &amp;quot;Results and Discussion: Radial Distribution Functions&amp;quot; for the plot and analysis. WHAT IS THE LATTICE SPACING? &lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Dynamical Properties and the Diffusion Coefficient&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 18: Make a plot for each of your simulations (solid/liquid/vapour), showing the mean squared displacement (&amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate D in each case. (Be careful with units!) Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 19: Evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (show working). On the same graph, with x range 0 to 500, plot C(tau) with omega = 1/2pi and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. Why is the harmonic oscillator VACF very different to the Lennard Jones solid and liquid? (Attach a copy of your plot)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_3.png|700px]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_2.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 20: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665554</id>
		<title>Rep:Gm1110LiquidSim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665554"/>
		<updated>2018-02-14T14:48:00Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: /* Diffusion Coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
The main aim of the experiment was to determine the diffusion coefficient for the solid, liquid and vapour phases of a Lennard-Jones fluid using both the mean squared displacement method and velocity autocorrelation function method.&lt;br /&gt;
&lt;br /&gt;
In order to achieve this, it was first necessary to determine an appropriate timestep with which to run simulations, and investigate the effect of temperature and pressure on the density of the system. Other aims included seeing how heat capacity varied as a function of temperature for different densities, and calculating the radial distribution function for the three phases from simulations using VMD.    &lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
All simulations of the Lennard-Jones fluid were run using the LAMMPS software, and all quantities used were in reduced units.&lt;br /&gt;
&lt;br /&gt;
=== Part 1: Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
A simulation box consisting of 10 x 10 x 10 unit cells of a simple cubic lattice with an atomic density of 0.8 was defined. The atomic mass was set to 1.0 and the Lennard-Jones pairwise interaction cutoff distance was set to 3.0. The pairwise forcefield coefficients ε (potential well depth) and σ (zero-potential distance) were both set to 1.0. Five simulations were run for differing timestep values (0.0010, 0.0025, 0.0075, 0.0100 and 0.0150).&lt;br /&gt;
&lt;br /&gt;
=== Part 2: Equations of State in the NpT Ensemble ===&lt;br /&gt;
The simulation box was increased to consist of 15 x 15 x 15 unit cells of the same simple cubic lattice defined in part 1. A total of ten simulations were run in the NpT ensemble, varying temperature (2.0, 4.0, 6.0, 8.0 and 10.0) at two different densities (1.8 and 2.8) using the timestep value of 0.0025 determined in Part 1.&lt;br /&gt;
&lt;br /&gt;
=== Part 3: Calculation of Heat Capacity ===&lt;br /&gt;
The simulation box from Part 2 was used, with the density altered to take the values 0.2 and 0.8. Five simulations were run for each, with varying values of temperature (2.0, 2.2, 2.4, 2.6 and 2.8). A copy of the script written for this simulation can be found by clicking the image below:&lt;br /&gt;
[[File:gm1110_LS_M_3_1.png|centre|thumb|Copy of Script]]&lt;br /&gt;
&lt;br /&gt;
=== Part 4: Radial Distribution Functions ===&lt;br /&gt;
The simulation boxes used previously were altered to take a timestep of 0.002 and a L-J cutoff distance of 3.2, after which the solid, liquid and vapour phases were defined as having (density, temperature) values of (1.2, 1.2), (0.8, 1.2) and (0.05, 1.1) respectively. In particular, the solid phase was defined as having a face-centred cubic lattice, instead of the simple cubic lattice used for the liquid and vapour phases. VMD was used to analyse the trajectories for the three phases, with the distance between points in the generated RDF set to 0.05.&lt;br /&gt;
&lt;br /&gt;
=== Part 5: Diffusion Coefficient ===&lt;br /&gt;
The results from Part 4 were used to graph the mean squared displacement as a function of time, after which the gradient of the linear portion of the graph was extracted and used to calculate the diffusion coefficient from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_M_5_1.png|centre|150px]]&lt;br /&gt;
&lt;br /&gt;
The procedure was then repeated using 1 million atoms.&lt;br /&gt;
&lt;br /&gt;
==Results and Discussion==&lt;br /&gt;
&lt;br /&gt;
=== Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
Simulations were run using the five different timesteps 0.0010, 0.0025, 0.0075, 0.0100 and 0.0150, and a plot of the results can be seen below (Figure 1).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_1_1.png|centre|thumb|Figure 1. A plot of total energy (reduced units) against time comparing simulations run using five different timestep values]]&lt;br /&gt;
&lt;br /&gt;
It was observed that the simulation run with a timestep of 0.0150 did not equilibrate. This was thought to have potentially been due to the timestep being too large, and therefore the simulation was missing too much detail to accurately simulate the fluid. The simulations run for timesteps of 0.0100 and 0.0075 did equilibrate (supporting the previous hypothesis that the 0.0150 timestep was too large), but converged at the wrong energy (approximately -3.181 and -3.183 respectively), indicating that the timesteps were still not quite small enough.&lt;br /&gt;
&lt;br /&gt;
The final two simulations run at timesteps of 0.0025 and 0.0010 both equilibrated to the same, correct energy (approximately -3.184), indicating that both would be suitable for use in further simulations. It is preferable, however, to maximise the timestep when running simulations as a smaller timestep requires more data points, and is therefore more “expensive” and takes longer to run for no real added value. Hence it was decided that a timestep of 0.0025 would be suitable for running further simulations.    &lt;br /&gt;
&lt;br /&gt;
=== Equations of State in the NpT Ensemble ===&lt;br /&gt;
Although specific values for temperature and pressure are specified for the simulations, in reality, the temperature and pressure of a system fluctuates over time and may therefore deviate away from the inputted values. Hence, the simulation calculates the pressure of the system at the end of every timestep, and adjusts the size of the simulation box such that the pressure once again corresponds to the specified value. Pressure controlled simulations are thus in the NpT ensemble and so volume (and therefore density) is not constant.&lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the resulting densities were plotted against temperature, along with values predicted by the ideal gas law and can be seen below (Figure 2).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_2_1.png|centre|thumb|Figure 2. Plot showing density as a function of temperature at pressures of 1.8 and 2.8 (all in reduced units), with error bars, and a plot of the densities predicted by the ideal gas law]]&lt;br /&gt;
&lt;br /&gt;
Clearly, the simulated densities are lower than those predicted by the ideal gas law, and the discrepancy increases with increasing pressure. This is due to the fact that the ideal gas law assumes perfectly elastic collisions between point particles, but in reality, intermolecular repulsive forces cause the simulated densities to be lower. In addition, an increase in pressure causes the molecules to be pushed closer together and increases both the number of collisions as well as the repulsive forces, leading to a greater deviation from ideality.    &lt;br /&gt;
&lt;br /&gt;
=== Calculation of Heat Capacity ===&lt;br /&gt;
Switching to the NVT ensemble, the heat capacity of the system can be determined by considering the magnitude of fluctuations in the system’s energy from its average equilibrium state from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_1.png|centre|250px]]            &lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the average heat capacities were plotted as a function of temperature (Figure 3).        &lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_2.png|centre|thumb|Figure 3. Plot of average heat capacity against temperature for densities of 0.8 and 0.2]]Heat capacity is a measure of the amount of energy required to increase the temperature of a substance. It is clear that the heat capacity is lower, and therefore easier to heat, for lower density systems as the particles are more spaced apart. This means that they are able to gain thermal energy more easily as they have more room for increased vibrations without an increase of repulsive forces or collisions compared to a higher density system. It was also noted that the heat capacity decreased with increasing temperature. This is due to the fact that at higher temperatures, the gap between energy levels decreases as the particles occupy higher energy states, thus making it easier for the particles to be promoted to higher energy levels.&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Functions ===&lt;br /&gt;
Radial distribution functions (g(r)) were calculated for the solid, liquid and vapour phases (see Figure 4) to check that the simulations were correctly reproducing the structural features of each phase. RDFs are essentially probability distribution functions for the likelihood of finding a particle at a given distance r away from a reference particle, and also gives information on the coordination sphere of the reference particle. The integral of the RDF (Figure 5) is also useful as it gives information on the number of atoms found at a distance r.&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_1.png|centre|thumb|Figure 4. Radial distribution function against displacement from a reference atom]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_2.png|centre|thumb|Figure 5. Integral of the radial distribution function against displacement]]&lt;br /&gt;
&lt;br /&gt;
For small r, all three phases have g(r) ~ 0, indicating an atomic density of zero as there exists a minimum distance at which atoms can approach each other. Also, g(r) tends to 1 for all three phases with increasing r, which represents the fact that the local density becomes equivalent to the mean density of the system as a whole.&lt;br /&gt;
&lt;br /&gt;
The graph of the solid phase shows sharp oscillating peaks, indicating that the atoms are strongly confined to their positions in the crystalline lattice, and the high degree of ordering means that although the osciallations do tend to g(r) = 1 for large r, this occurs much more slowly than for the other two phases. The first peak corresponds to the atoms nearest neighbours (of which there are 12), and the second and third peak correspond to the second and third nearest neighbours respectively (of which there are 6 and 24). &lt;br /&gt;
&lt;br /&gt;
The graph for the liquid phase shows broad, gently oscillating peaks that rapidly decay to g(r) = 1. As with the solid phase, the oscillations indicate some structure in the system whereby the atoms are loosely bound to their original positions, but the broader peaks indicate that they have much more freedom to move away from their positions. &lt;br /&gt;
&lt;br /&gt;
The graph for the vapour phase shows a single peak at approximately r = 1, after which it quickly decays back to g(r) = 1. This shows that the structure has very little to no order, and the particles are free to move unbound to any specific position. &lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|MSD Graphs (1,000 atoms)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_7.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_8.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_9.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 6. Graph of solid phase MSD for 1,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 7. Graph of fluid phase MSD for 1,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 8. Graph of vapour phase MSD for 1,000 atoms(with trendline)&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The general trends displayed in Figures 6-8 are as expected: the simulation does eventually establish linear behaviour, with the gradients increasing exponentially going from the solid to vapour phases. It is well known that diffusion in the vapour phase occurs much more readily than in the fluid phase, and more readily in the fluid phase than solid phase, and given that the diffusion coefficient is linearly correlated to the gradient of the mean square displacement, it was expected that the gradients of the graphs would increase in this manner. It was noted that the linear region of the solid phase plot (Figure 6) was quite noisy, but it was thought that this may be due to the small simulation size of 1,000 atoms.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|MSD Graphs (1,000,000 atoms)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_10.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_11.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_12.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 9. Graph of solid phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 10. Graph of fluid phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 11. Graph of vapour phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results from the simulation with 1,000,000 atoms (Figures 9-11) support the observations made with the 1,000 atom simulation. The only noticeable improvement from the 1,000 atom simulation was the reduction in noise of the linear region of the solid phase (Figure 9), suggesting that the assumption made previously to consider the more noisy region in Figure 6 as linear was correct, and that increasing the sample size did indeed improve the smoothness and accuracy of the curve.&lt;br /&gt;
&lt;br /&gt;
The gradient for the linear region of the plots were determined and used to calculate the diffusion coefficients (see table below).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=4|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Solid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Liquid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Vapour Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-6.17x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0688 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;2.27 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-6.83x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0698 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;2.47 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The results obtained are reasonable figures. In comparison with the 1,000,000 atom simulation, the values calculated for the diffusion coefficient with 1,000 atoms yielded a 9.7%, 1.4% and 8.0% error for the solid, liquid and vapour phases respectively. This suggests that for systems involving atoms that are at either extreme with regards to their range of motion, a larger atomic sample size would be suitable for simulations, whereas for the more middling fluids, more time-efficient simulations can be conducted for the loosely bound fluids with &lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
==Tasks==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Introduction to Molecular Dynamics Simulations&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 1. For a default timestep value 0.1, estimate the positions of the maxima in the ERROR column as a function of time.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_1_1.png|centre|thumb|Figure X. Plot showing the positions of the error maxima as a function of time, with a best fit line]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 2. (Experiment with different values of the timestep.) What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using a timestep of 0.1990 meant that the total energy did not change by more than 1% over the course of the simulation (Figure X).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_2_1.png|centre|thumb|Figure X. Plot showing the total energy during the simulation using a timestep of 0.1990]]&lt;br /&gt;
&lt;br /&gt;
The simulations are being run in isolated systems which requires total energy conservation, so large fluctuations in the energy would lead to inaccurate results. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 3. For a single Lennard-Jones interaction, find the separation, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;, and work out the well depth. Evaluate the integrals when σ = ε = 1.0.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i) The Lennard-Jones interaction is given by:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_1.png|200px]]&lt;br /&gt;
&lt;br /&gt;
Since r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; when ɸ = 0,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(ii) The force is given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_3.png|250px]]&lt;br /&gt;
&lt;br /&gt;
So at the separation r&amp;lt;sub&amp;gt;0 &amp;lt;/sub&amp;gt;= σ,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_4.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iii) The equilibrium separation r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs at the point at which all forces vanish, ie. when F = 0, so&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_5.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iv) And the well depth is therefore given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_6.png|270px]]&lt;br /&gt;
&lt;br /&gt;
(v)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_7.png|370px]]&lt;br /&gt;
&lt;br /&gt;
(vi)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_8.png|400px]]&lt;br /&gt;
&lt;br /&gt;
(vii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_9.png|370px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4. Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10,000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_1.png|550px]]&lt;br /&gt;
&lt;br /&gt;
For 10,000 water molecules,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_3.png|230px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 5. Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After the timestep, the atom would be at position (0.5 + 0.7, 0.5 + 0.6, 0.5 + 0.2) = (1.2, 1.1, 0.7). Applying the boundary conditions, this is equivalent to the position (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 6. The Lennard-Jones parameters for argon are sigma = 0.34nm, ε/k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt; = 120K. If the LJ cutoff is r&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 1.5 in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_1.png|140px]]&lt;br /&gt;
&lt;br /&gt;
(ii) It was previously determined in Task 1 that the well depth is - ε, so in real units,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_4.png|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(iii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_3.png|130px]]&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Equilibration&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 7. Why do you think giving atoms random starting coordinates causes problems in simulations?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If two atoms are generated too close to one another, then they would experience a large repulsive force, and would disrupt the behaviour of the surrounding atoms, causing the simulation to become inaccurate. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 8. Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_1.png|380px]]&lt;br /&gt;
&lt;br /&gt;
(ii) For a face-centred cubic lattice, note that the unit cell contains four atoms, as opposed to one atom with a simple cubic lattice. Then&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_4.png|460px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 9. Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is 1 atom contained within each unit cell. However for face-centred cubic lattices, each unit cell contains 4 atoms so four times as many atoms are created than with the simple lattice (ie. 4000 atoms).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 10. Given that we are specifying x&amp;lt;sub&amp;gt;i &amp;lt;/sub&amp;gt;(0) and v&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; (0), which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We will be using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 11. In the code section &amp;quot;Specify Timestep&amp;quot;, the second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write &amp;quot;timestep 0.001 // run 100000&amp;quot;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Defining the variable timestep allows us to reference the variable multiple times throughout the simulation if required, whilst preventing errors and making it easier to alter the code if we want to run the simulation for different timestep values. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 12. Make plots of energy, temperature, and pressure, against time for the 0.001 timestep experiment. Does the simulation reach equilibrium? How long does this take? Make a single plot of energy vs time for all of the timesteps. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice and why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_12_1.png|centre|thumb|Figure X. Plot of energy against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_2.png|centre|thumb|Figure X. Plot of temperature against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_3.png|centre|thumb|Figure X. Plot of pressure against time for the 0.001 timestep experiment]]&lt;br /&gt;
&lt;br /&gt;
The 0.001 timestep experiment reaches equilibrium very quickly, within approximately 0.2s. &lt;br /&gt;
&lt;br /&gt;
A single plot of energy vs time for all of the timesteps can be found in &amp;quot;Results &amp;amp; Discussion: Investigation into Simulation Timestep in the NVE Ensemble Figure 1&amp;quot;, along with a detailed analysis, but in brief: the largest acceptable timestep is 0.0025, and a particularly bad choice would be 0.015 as it does not reach equilibrium.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Running Simulations under Specific Conditions&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 13. We need to choose gamma so that the temperature is correct T=fancy T if we multiply every velocity by γ. Solve the following two equations to determine gamma:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_2.png|center|200px]]&lt;br /&gt;
&lt;br /&gt;
Starting from the 2&amp;lt;sup&amp;gt;nd&amp;lt;/sup&amp;gt; equation,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_1.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 14: (Use the manual to find out the importance of the three numbers 100 1000 100000.) 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 (&amp;quot;run 100000&amp;quot;), how much time will you simulate? (DOUBLE CHECK THIS PART WITH OLLIE!)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Firstly, averages are taken for blocks of 100 values at a time to form the first set of averaged values (where av&amp;lt;sub&amp;gt;100,n&amp;lt;/sub&amp;gt; is the average value for the n&amp;lt;sup&amp;gt;th&amp;lt;/sup&amp;gt; block of 100 values). These values are then themselves averaged in blocks of 1000 values to form a second set of averaged values (av&amp;lt;sub&amp;gt;100,1&amp;lt;/sub&amp;gt; + av&amp;lt;sub&amp;gt;100,2&amp;lt;/sub&amp;gt; + ... + av&amp;lt;sub&amp;gt;100,1000&amp;lt;/sub&amp;gt;)/1000 = av&amp;lt;sub&amp;gt;1000,1&amp;lt;/sub&amp;gt;. Finally, these values are averaged once more in blocks of 100000 values.&lt;br /&gt;
&lt;br /&gt;
The amount of time simulated can be found by multiplying the number of steps by the value of the timestep (eg. 100,000 steps of a 0.001 timestep simulates 100 seconds).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 15: Plot density as a function of temperature for both of the pressures that you simulated. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figure 2 in &amp;quot;Results and Discussion: Equations of State in the NpT Ensemble&amp;quot; for the plot and subsequent discussion.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Heat Capacity Calculation&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 16: Run simulations at densities of 0.2, 0.8 and temperatures of 2.0, 2.2, 2.4, 2.6, 2.8, plotting C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;/V as a function of temperature, where V is the volume of the simulation cell, for both of your densities. Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the plot of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;/V as a function of temperature, please see Figure 3 in &amp;quot;Results and Discussion: Calculation of Heat Capacity&amp;quot; and the subsequent discussion on why the trend was as expected. A copy of the input script can be found in &amp;quot;Method: Part 3: Calculation of Heat Capacity&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Structural Properties and the Radial Distribution Function&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 17: Plot the RDFs for the three systems on the same axes. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figure 4 in &amp;quot;Results and Discussion: Radial Distribution Functions&amp;quot; for the plot and analysis. WHAT IS THE LATTICE SPACING? &lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Dynamical Properties and the Diffusion Coefficient&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 18: Make a plot for each of your simulations (solid/liquid/vapour), showing the mean squared displacement (&amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate D in each case. (Be careful with units!) Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 19: Evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (show working). On the same graph, with x range 0 to 500, plot C(tau) with omega = 1/2pi and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. Why is the harmonic oscillator VACF very different to the Lennard Jones solid and liquid? (Attach a copy of your plot)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_3.png|700px]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_2.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 20: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665551</id>
		<title>Rep:Gm1110LiquidSim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665551"/>
		<updated>2018-02-14T14:30:51Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: /* Diffusion Coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
The main aim of the experiment was to determine the diffusion coefficient for the solid, liquid and vapour phases of a Lennard-Jones fluid using both the mean squared displacement method and velocity autocorrelation function method.&lt;br /&gt;
&lt;br /&gt;
In order to achieve this, it was first necessary to determine an appropriate timestep with which to run simulations, and investigate the effect of temperature and pressure on the density of the system. Other aims included seeing how heat capacity varied as a function of temperature for different densities, and calculating the radial distribution function for the three phases from simulations using VMD.    &lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
All simulations of the Lennard-Jones fluid were run using the LAMMPS software, and all quantities used were in reduced units.&lt;br /&gt;
&lt;br /&gt;
=== Part 1: Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
A simulation box consisting of 10 x 10 x 10 unit cells of a simple cubic lattice with an atomic density of 0.8 was defined. The atomic mass was set to 1.0 and the Lennard-Jones pairwise interaction cutoff distance was set to 3.0. The pairwise forcefield coefficients ε (potential well depth) and σ (zero-potential distance) were both set to 1.0. Five simulations were run for differing timestep values (0.0010, 0.0025, 0.0075, 0.0100 and 0.0150).&lt;br /&gt;
&lt;br /&gt;
=== Part 2: Equations of State in the NpT Ensemble ===&lt;br /&gt;
The simulation box was increased to consist of 15 x 15 x 15 unit cells of the same simple cubic lattice defined in part 1. A total of ten simulations were run in the NpT ensemble, varying temperature (2.0, 4.0, 6.0, 8.0 and 10.0) at two different densities (1.8 and 2.8) using the timestep value of 0.0025 determined in Part 1.&lt;br /&gt;
&lt;br /&gt;
=== Part 3: Calculation of Heat Capacity ===&lt;br /&gt;
The simulation box from Part 2 was used, with the density altered to take the values 0.2 and 0.8. Five simulations were run for each, with varying values of temperature (2.0, 2.2, 2.4, 2.6 and 2.8). A copy of the script written for this simulation can be found by clicking the image below:&lt;br /&gt;
[[File:gm1110_LS_M_3_1.png|centre|thumb|Copy of Script]]&lt;br /&gt;
&lt;br /&gt;
=== Part 4: Radial Distribution Functions ===&lt;br /&gt;
The simulation boxes used previously were altered to take a timestep of 0.002 and a L-J cutoff distance of 3.2, after which the solid, liquid and vapour phases were defined as having (density, temperature) values of (1.2, 1.2), (0.8, 1.2) and (0.05, 1.1) respectively. In particular, the solid phase was defined as having a face-centred cubic lattice, instead of the simple cubic lattice used for the liquid and vapour phases. VMD was used to analyse the trajectories for the three phases, with the distance between points in the generated RDF set to 0.05.&lt;br /&gt;
&lt;br /&gt;
=== Part 5: Diffusion Coefficient ===&lt;br /&gt;
The results from Part 4 were used to graph the mean squared displacement as a function of time, after which the gradient of the linear portion of the graph was extracted and used to calculate the diffusion coefficient from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_M_5_1.png|centre|150px]]&lt;br /&gt;
&lt;br /&gt;
The procedure was then repeated using 1 million atoms.&lt;br /&gt;
&lt;br /&gt;
==Results and Discussion==&lt;br /&gt;
&lt;br /&gt;
=== Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
Simulations were run using the five different timesteps 0.0010, 0.0025, 0.0075, 0.0100 and 0.0150, and a plot of the results can be seen below (Figure 1).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_1_1.png|centre|thumb|Figure 1. A plot of total energy (reduced units) against time comparing simulations run using five different timestep values]]&lt;br /&gt;
&lt;br /&gt;
It was observed that the simulation run with a timestep of 0.0150 did not equilibrate. This was thought to have potentially been due to the timestep being too large, and therefore the simulation was missing too much detail to accurately simulate the fluid. The simulations run for timesteps of 0.0100 and 0.0075 did equilibrate (supporting the previous hypothesis that the 0.0150 timestep was too large), but converged at the wrong energy (approximately -3.181 and -3.183 respectively), indicating that the timesteps were still not quite small enough.&lt;br /&gt;
&lt;br /&gt;
The final two simulations run at timesteps of 0.0025 and 0.0010 both equilibrated to the same, correct energy (approximately -3.184), indicating that both would be suitable for use in further simulations. It is preferable, however, to maximise the timestep when running simulations as a smaller timestep requires more data points, and is therefore more “expensive” and takes longer to run for no real added value. Hence it was decided that a timestep of 0.0025 would be suitable for running further simulations.    &lt;br /&gt;
&lt;br /&gt;
=== Equations of State in the NpT Ensemble ===&lt;br /&gt;
Although specific values for temperature and pressure are specified for the simulations, in reality, the temperature and pressure of a system fluctuates over time and may therefore deviate away from the inputted values. Hence, the simulation calculates the pressure of the system at the end of every timestep, and adjusts the size of the simulation box such that the pressure once again corresponds to the specified value. Pressure controlled simulations are thus in the NpT ensemble and so volume (and therefore density) is not constant.&lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the resulting densities were plotted against temperature, along with values predicted by the ideal gas law and can be seen below (Figure 2).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_2_1.png|centre|thumb|Figure 2. Plot showing density as a function of temperature at pressures of 1.8 and 2.8 (all in reduced units), with error bars, and a plot of the densities predicted by the ideal gas law]]&lt;br /&gt;
&lt;br /&gt;
Clearly, the simulated densities are lower than those predicted by the ideal gas law, and the discrepancy increases with increasing pressure. This is due to the fact that the ideal gas law assumes perfectly elastic collisions between point particles, but in reality, intermolecular repulsive forces cause the simulated densities to be lower. In addition, an increase in pressure causes the molecules to be pushed closer together and increases both the number of collisions as well as the repulsive forces, leading to a greater deviation from ideality.    &lt;br /&gt;
&lt;br /&gt;
=== Calculation of Heat Capacity ===&lt;br /&gt;
Switching to the NVT ensemble, the heat capacity of the system can be determined by considering the magnitude of fluctuations in the system’s energy from its average equilibrium state from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_1.png|centre|250px]]            &lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the average heat capacities were plotted as a function of temperature (Figure 3).        &lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_2.png|centre|thumb|Figure 3. Plot of average heat capacity against temperature for densities of 0.8 and 0.2]]Heat capacity is a measure of the amount of energy required to increase the temperature of a substance. It is clear that the heat capacity is lower, and therefore easier to heat, for lower density systems as the particles are more spaced apart. This means that they are able to gain thermal energy more easily as they have more room for increased vibrations without an increase of repulsive forces or collisions compared to a higher density system. It was also noted that the heat capacity decreased with increasing temperature. This is due to the fact that at higher temperatures, the gap between energy levels decreases as the particles occupy higher energy states, thus making it easier for the particles to be promoted to higher energy levels.&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Functions ===&lt;br /&gt;
Radial distribution functions (g(r)) were calculated for the solid, liquid and vapour phases (see Figure 4) to check that the simulations were correctly reproducing the structural features of each phase. RDFs are essentially probability distribution functions for the likelihood of finding a particle at a given distance r away from a reference particle, and also gives information on the coordination sphere of the reference particle. The integral of the RDF (Figure 5) is also useful as it gives information on the number of atoms found at a distance r.&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_1.png|centre|thumb|Figure 4. Radial distribution function against displacement from a reference atom]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_2.png|centre|thumb|Figure 5. Integral of the radial distribution function against displacement]]&lt;br /&gt;
&lt;br /&gt;
For small r, all three phases have g(r) ~ 0, indicating an atomic density of zero as there exists a minimum distance at which atoms can approach each other. Also, g(r) tends to 1 for all three phases with increasing r, which represents the fact that the local density becomes equivalent to the mean density of the system as a whole.&lt;br /&gt;
&lt;br /&gt;
The graph of the solid phase shows sharp oscillating peaks, indicating that the atoms are strongly confined to their positions in the crystalline lattice, and the high degree of ordering means that although the osciallations do tend to g(r) = 1 for large r, this occurs much more slowly than for the other two phases. The first peak corresponds to the atoms nearest neighbours (of which there are 12), and the second and third peak correspond to the second and third nearest neighbours respectively (of which there are 6 and 24). &lt;br /&gt;
&lt;br /&gt;
The graph for the liquid phase shows broad, gently oscillating peaks that rapidly decay to g(r) = 1. As with the solid phase, the oscillations indicate some structure in the system whereby the atoms are loosely bound to their original positions, but the broader peaks indicate that they have much more freedom to move away from their positions. &lt;br /&gt;
&lt;br /&gt;
The graph for the vapour phase shows a single peak at approximately r = 1, after which it quickly decays back to g(r) = 1. This shows that the structure has very little to no order, and the particles are free to move unbound to any specific position. &lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|MSD Graphs (1,000 atoms)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_7.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_8.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_9.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 6. Graph of solid phase MSD for 1,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 7. Graph of fluid phase MSD for 1,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 8. Graph of vapour phase MSD for 1,000 atoms(with trendline)&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
The general trends displayed in Figures 6-8 are as expected: the simulation does eventually establish linear behaviour, with the gradients increasing exponentially going from the solid to vapour phases. It is well known that diffusion in the vapour phase occurs much more readily than in the fluid phase, and more readily in the fluid phase than solid phase, and given that the diffusion coefficient is linearly correlated to the gradient of the mean square displacement, it was expected that the gradients of the graphs would increase in this manner.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|MSD Graphs (1,000,000 atoms)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_10.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_11.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_12.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 9. Graph of solid phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 10. Graph of fluid phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 11. Graph of vapour phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The gradient for the linear region of the plots were determined and used to calculate the diffusion coefficients (see table below).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=4|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Solid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Liquid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Vapour Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-6.17x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0688 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;2.27 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-6.83x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0698 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;2.47 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
==Tasks==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Introduction to Molecular Dynamics Simulations&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 1. For a default timestep value 0.1, estimate the positions of the maxima in the ERROR column as a function of time.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_1_1.png|centre|thumb|Figure X. Plot showing the positions of the error maxima as a function of time, with a best fit line]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 2. (Experiment with different values of the timestep.) What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using a timestep of 0.1990 meant that the total energy did not change by more than 1% over the course of the simulation (Figure X).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_2_1.png|centre|thumb|Figure X. Plot showing the total energy during the simulation using a timestep of 0.1990]]&lt;br /&gt;
&lt;br /&gt;
The simulations are being run in isolated systems which requires total energy conservation, so large fluctuations in the energy would lead to inaccurate results. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 3. For a single Lennard-Jones interaction, find the separation, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;, and work out the well depth. Evaluate the integrals when σ = ε = 1.0.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i) The Lennard-Jones interaction is given by:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_1.png|200px]]&lt;br /&gt;
&lt;br /&gt;
Since r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; when ɸ = 0,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(ii) The force is given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_3.png|250px]]&lt;br /&gt;
&lt;br /&gt;
So at the separation r&amp;lt;sub&amp;gt;0 &amp;lt;/sub&amp;gt;= σ,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_4.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iii) The equilibrium separation r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs at the point at which all forces vanish, ie. when F = 0, so&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_5.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iv) And the well depth is therefore given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_6.png|270px]]&lt;br /&gt;
&lt;br /&gt;
(v)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_7.png|370px]]&lt;br /&gt;
&lt;br /&gt;
(vi)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_8.png|400px]]&lt;br /&gt;
&lt;br /&gt;
(vii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_9.png|370px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4. Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10,000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_1.png|550px]]&lt;br /&gt;
&lt;br /&gt;
For 10,000 water molecules,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_3.png|230px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 5. Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After the timestep, the atom would be at position (0.5 + 0.7, 0.5 + 0.6, 0.5 + 0.2) = (1.2, 1.1, 0.7). Applying the boundary conditions, this is equivalent to the position (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 6. The Lennard-Jones parameters for argon are sigma = 0.34nm, ε/k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt; = 120K. If the LJ cutoff is r&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 1.5 in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_1.png|140px]]&lt;br /&gt;
&lt;br /&gt;
(ii) It was previously determined in Task 1 that the well depth is - ε, so in real units,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_4.png|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(iii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_3.png|130px]]&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Equilibration&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 7. Why do you think giving atoms random starting coordinates causes problems in simulations?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If two atoms are generated too close to one another, then they would experience a large repulsive force, and would disrupt the behaviour of the surrounding atoms, causing the simulation to become inaccurate. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 8. Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_1.png|380px]]&lt;br /&gt;
&lt;br /&gt;
(ii) For a face-centred cubic lattice, note that the unit cell contains four atoms, as opposed to one atom with a simple cubic lattice. Then&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_4.png|460px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 9. Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is 1 atom contained within each unit cell. However for face-centred cubic lattices, each unit cell contains 4 atoms so four times as many atoms are created than with the simple lattice (ie. 4000 atoms).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 10. Given that we are specifying x&amp;lt;sub&amp;gt;i &amp;lt;/sub&amp;gt;(0) and v&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; (0), which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We will be using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 11. In the code section &amp;quot;Specify Timestep&amp;quot;, the second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write &amp;quot;timestep 0.001 // run 100000&amp;quot;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Defining the variable timestep allows us to reference the variable multiple times throughout the simulation if required, whilst preventing errors and making it easier to alter the code if we want to run the simulation for different timestep values. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 12. Make plots of energy, temperature, and pressure, against time for the 0.001 timestep experiment. Does the simulation reach equilibrium? How long does this take? Make a single plot of energy vs time for all of the timesteps. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice and why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_12_1.png|centre|thumb|Figure X. Plot of energy against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_2.png|centre|thumb|Figure X. Plot of temperature against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_3.png|centre|thumb|Figure X. Plot of pressure against time for the 0.001 timestep experiment]]&lt;br /&gt;
&lt;br /&gt;
The 0.001 timestep experiment reaches equilibrium very quickly, within approximately 0.2s. &lt;br /&gt;
&lt;br /&gt;
A single plot of energy vs time for all of the timesteps can be found in &amp;quot;Results &amp;amp; Discussion: Investigation into Simulation Timestep in the NVE Ensemble Figure 1&amp;quot;, along with a detailed analysis, but in brief: the largest acceptable timestep is 0.0025, and a particularly bad choice would be 0.015 as it does not reach equilibrium.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Running Simulations under Specific Conditions&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 13. We need to choose gamma so that the temperature is correct T=fancy T if we multiply every velocity by γ. Solve the following two equations to determine gamma:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_2.png|center|200px]]&lt;br /&gt;
&lt;br /&gt;
Starting from the 2&amp;lt;sup&amp;gt;nd&amp;lt;/sup&amp;gt; equation,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_1.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 14: (Use the manual to find out the importance of the three numbers 100 1000 100000.) 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 (&amp;quot;run 100000&amp;quot;), how much time will you simulate? (DOUBLE CHECK THIS PART WITH OLLIE!)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Firstly, averages are taken for blocks of 100 values at a time to form the first set of averaged values (where av&amp;lt;sub&amp;gt;100,n&amp;lt;/sub&amp;gt; is the average value for the n&amp;lt;sup&amp;gt;th&amp;lt;/sup&amp;gt; block of 100 values). These values are then themselves averaged in blocks of 1000 values to form a second set of averaged values (av&amp;lt;sub&amp;gt;100,1&amp;lt;/sub&amp;gt; + av&amp;lt;sub&amp;gt;100,2&amp;lt;/sub&amp;gt; + ... + av&amp;lt;sub&amp;gt;100,1000&amp;lt;/sub&amp;gt;)/1000 = av&amp;lt;sub&amp;gt;1000,1&amp;lt;/sub&amp;gt;. Finally, these values are averaged once more in blocks of 100000 values.&lt;br /&gt;
&lt;br /&gt;
The amount of time simulated can be found by multiplying the number of steps by the value of the timestep (eg. 100,000 steps of a 0.001 timestep simulates 100 seconds).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 15: Plot density as a function of temperature for both of the pressures that you simulated. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figure 2 in &amp;quot;Results and Discussion: Equations of State in the NpT Ensemble&amp;quot; for the plot and subsequent discussion.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Heat Capacity Calculation&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 16: Run simulations at densities of 0.2, 0.8 and temperatures of 2.0, 2.2, 2.4, 2.6, 2.8, plotting C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;/V as a function of temperature, where V is the volume of the simulation cell, for both of your densities. Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the plot of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;/V as a function of temperature, please see Figure 3 in &amp;quot;Results and Discussion: Calculation of Heat Capacity&amp;quot; and the subsequent discussion on why the trend was as expected. A copy of the input script can be found in &amp;quot;Method: Part 3: Calculation of Heat Capacity&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Structural Properties and the Radial Distribution Function&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 17: Plot the RDFs for the three systems on the same axes. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figure 4 in &amp;quot;Results and Discussion: Radial Distribution Functions&amp;quot; for the plot and analysis. WHAT IS THE LATTICE SPACING? &lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Dynamical Properties and the Diffusion Coefficient&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 18: Make a plot for each of your simulations (solid/liquid/vapour), showing the mean squared displacement (&amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate D in each case. (Be careful with units!) Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 19: Evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (show working). On the same graph, with x range 0 to 500, plot C(tau) with omega = 1/2pi and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. Why is the harmonic oscillator VACF very different to the Lennard Jones solid and liquid? (Attach a copy of your plot)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_3.png|700px]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_2.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 20: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665545</id>
		<title>Rep:Gm1110LiquidSim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665545"/>
		<updated>2018-02-14T14:19:55Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: /* Diffusion Coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
The main aim of the experiment was to determine the diffusion coefficient for the solid, liquid and vapour phases of a Lennard-Jones fluid using both the mean squared displacement method and velocity autocorrelation function method.&lt;br /&gt;
&lt;br /&gt;
In order to achieve this, it was first necessary to determine an appropriate timestep with which to run simulations, and investigate the effect of temperature and pressure on the density of the system. Other aims included seeing how heat capacity varied as a function of temperature for different densities, and calculating the radial distribution function for the three phases from simulations using VMD.    &lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
All simulations of the Lennard-Jones fluid were run using the LAMMPS software, and all quantities used were in reduced units.&lt;br /&gt;
&lt;br /&gt;
=== Part 1: Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
A simulation box consisting of 10 x 10 x 10 unit cells of a simple cubic lattice with an atomic density of 0.8 was defined. The atomic mass was set to 1.0 and the Lennard-Jones pairwise interaction cutoff distance was set to 3.0. The pairwise forcefield coefficients ε (potential well depth) and σ (zero-potential distance) were both set to 1.0. Five simulations were run for differing timestep values (0.0010, 0.0025, 0.0075, 0.0100 and 0.0150).&lt;br /&gt;
&lt;br /&gt;
=== Part 2: Equations of State in the NpT Ensemble ===&lt;br /&gt;
The simulation box was increased to consist of 15 x 15 x 15 unit cells of the same simple cubic lattice defined in part 1. A total of ten simulations were run in the NpT ensemble, varying temperature (2.0, 4.0, 6.0, 8.0 and 10.0) at two different densities (1.8 and 2.8) using the timestep value of 0.0025 determined in Part 1.&lt;br /&gt;
&lt;br /&gt;
=== Part 3: Calculation of Heat Capacity ===&lt;br /&gt;
The simulation box from Part 2 was used, with the density altered to take the values 0.2 and 0.8. Five simulations were run for each, with varying values of temperature (2.0, 2.2, 2.4, 2.6 and 2.8). A copy of the script written for this simulation can be found by clicking the image below:&lt;br /&gt;
[[File:gm1110_LS_M_3_1.png|centre|thumb|Copy of Script]]&lt;br /&gt;
&lt;br /&gt;
=== Part 4: Radial Distribution Functions ===&lt;br /&gt;
The simulation boxes used previously were altered to take a timestep of 0.002 and a L-J cutoff distance of 3.2, after which the solid, liquid and vapour phases were defined as having (density, temperature) values of (1.2, 1.2), (0.8, 1.2) and (0.05, 1.1) respectively. In particular, the solid phase was defined as having a face-centred cubic lattice, instead of the simple cubic lattice used for the liquid and vapour phases. VMD was used to analyse the trajectories for the three phases, with the distance between points in the generated RDF set to 0.05.&lt;br /&gt;
&lt;br /&gt;
=== Part 5: Diffusion Coefficient ===&lt;br /&gt;
The results from Part 4 were used to graph the mean squared displacement as a function of time, after which the gradient of the linear portion of the graph was extracted and used to calculate the diffusion coefficient from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_M_5_1.png|centre|150px]]&lt;br /&gt;
&lt;br /&gt;
The procedure was then repeated using 1 million atoms.&lt;br /&gt;
&lt;br /&gt;
==Results and Discussion==&lt;br /&gt;
&lt;br /&gt;
=== Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
Simulations were run using the five different timesteps 0.0010, 0.0025, 0.0075, 0.0100 and 0.0150, and a plot of the results can be seen below (Figure 1).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_1_1.png|centre|thumb|Figure 1. A plot of total energy (reduced units) against time comparing simulations run using five different timestep values]]&lt;br /&gt;
&lt;br /&gt;
It was observed that the simulation run with a timestep of 0.0150 did not equilibrate. This was thought to have potentially been due to the timestep being too large, and therefore the simulation was missing too much detail to accurately simulate the fluid. The simulations run for timesteps of 0.0100 and 0.0075 did equilibrate (supporting the previous hypothesis that the 0.0150 timestep was too large), but converged at the wrong energy (approximately -3.181 and -3.183 respectively), indicating that the timesteps were still not quite small enough.&lt;br /&gt;
&lt;br /&gt;
The final two simulations run at timesteps of 0.0025 and 0.0010 both equilibrated to the same, correct energy (approximately -3.184), indicating that both would be suitable for use in further simulations. It is preferable, however, to maximise the timestep when running simulations as a smaller timestep requires more data points, and is therefore more “expensive” and takes longer to run for no real added value. Hence it was decided that a timestep of 0.0025 would be suitable for running further simulations.    &lt;br /&gt;
&lt;br /&gt;
=== Equations of State in the NpT Ensemble ===&lt;br /&gt;
Although specific values for temperature and pressure are specified for the simulations, in reality, the temperature and pressure of a system fluctuates over time and may therefore deviate away from the inputted values. Hence, the simulation calculates the pressure of the system at the end of every timestep, and adjusts the size of the simulation box such that the pressure once again corresponds to the specified value. Pressure controlled simulations are thus in the NpT ensemble and so volume (and therefore density) is not constant.&lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the resulting densities were plotted against temperature, along with values predicted by the ideal gas law and can be seen below (Figure 2).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_2_1.png|centre|thumb|Figure 2. Plot showing density as a function of temperature at pressures of 1.8 and 2.8 (all in reduced units), with error bars, and a plot of the densities predicted by the ideal gas law]]&lt;br /&gt;
&lt;br /&gt;
Clearly, the simulated densities are lower than those predicted by the ideal gas law, and the discrepancy increases with increasing pressure. This is due to the fact that the ideal gas law assumes perfectly elastic collisions between point particles, but in reality, intermolecular repulsive forces cause the simulated densities to be lower. In addition, an increase in pressure causes the molecules to be pushed closer together and increases both the number of collisions as well as the repulsive forces, leading to a greater deviation from ideality.    &lt;br /&gt;
&lt;br /&gt;
=== Calculation of Heat Capacity ===&lt;br /&gt;
Switching to the NVT ensemble, the heat capacity of the system can be determined by considering the magnitude of fluctuations in the system’s energy from its average equilibrium state from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_1.png|centre|250px]]            &lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the average heat capacities were plotted as a function of temperature (Figure 3).        &lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_2.png|centre|thumb|Figure 3. Plot of average heat capacity against temperature for densities of 0.8 and 0.2]]Heat capacity is a measure of the amount of energy required to increase the temperature of a substance. It is clear that the heat capacity is lower, and therefore easier to heat, for lower density systems as the particles are more spaced apart. This means that they are able to gain thermal energy more easily as they have more room for increased vibrations without an increase of repulsive forces or collisions compared to a higher density system. It was also noted that the heat capacity decreased with increasing temperature. This is due to the fact that at higher temperatures, the gap between energy levels decreases as the particles occupy higher energy states, thus making it easier for the particles to be promoted to higher energy levels.&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Functions ===&lt;br /&gt;
Radial distribution functions (g(r)) were calculated for the solid, liquid and vapour phases (see Figure 4) to check that the simulations were correctly reproducing the structural features of each phase. RDFs are essentially probability distribution functions for the likelihood of finding a particle at a given distance r away from a reference particle, and also gives information on the coordination sphere of the reference particle. The integral of the RDF (Figure 5) is also useful as it gives information on the number of atoms found at a distance r.&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_1.png|centre|thumb|Figure 4. Radial distribution function against displacement from a reference atom]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_2.png|centre|thumb|Figure 5. Integral of the radial distribution function against displacement]]&lt;br /&gt;
&lt;br /&gt;
For small r, all three phases have g(r) ~ 0, indicating an atomic density of zero as there exists a minimum distance at which atoms can approach each other. Also, g(r) tends to 1 for all three phases with increasing r, which represents the fact that the local density becomes equivalent to the mean density of the system as a whole.&lt;br /&gt;
&lt;br /&gt;
The graph of the solid phase shows sharp oscillating peaks, indicating that the atoms are strongly confined to their positions in the crystalline lattice, and the high degree of ordering means that although the osciallations do tend to g(r) = 1 for large r, this occurs much more slowly than for the other two phases. The first peak corresponds to the atoms nearest neighbours (of which there are 12), and the second and third peak correspond to the second and third nearest neighbours respectively (of which there are 6 and 24). &lt;br /&gt;
&lt;br /&gt;
The graph for the liquid phase shows broad, gently oscillating peaks that rapidly decay to g(r) = 1. As with the solid phase, the oscillations indicate some structure in the system whereby the atoms are loosely bound to their original positions, but the broader peaks indicate that they have much more freedom to move away from their positions. &lt;br /&gt;
&lt;br /&gt;
The graph for the vapour phase shows a single peak at approximately r = 1, after which it quickly decays back to g(r) = 1. This shows that the structure has very little to no order, and the particles are free to move unbound to any specific position. &lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|MSD Graphs (1,000 atoms)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_7.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_8.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_9.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 6. Graph of solid phase MSD for 1,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 7. Graph of fluid phase MSD for 1,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 8. Graph of vapour phase MSD for 1,000 atoms(with trendline)&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|MSD Graphs (1,000,000 atoms)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_10.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_11.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_12.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Figure 9. Graph of solid phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 10. Graph of fluid phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Figure 11. Graph of vapour phase MSD for 1,000,000 atoms (with trendline)&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The gradient for the linear region of the plots were determined and used to calculate the diffusion coefficients (see table below).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=4|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Solid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Liquid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Vapour Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-6.17x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0688 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;2.27 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-6.83x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0698 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;2.47 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
==Tasks==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Introduction to Molecular Dynamics Simulations&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 1. For a default timestep value 0.1, estimate the positions of the maxima in the ERROR column as a function of time.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_1_1.png|centre|thumb|Figure X. Plot showing the positions of the error maxima as a function of time, with a best fit line]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 2. (Experiment with different values of the timestep.) What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using a timestep of 0.1990 meant that the total energy did not change by more than 1% over the course of the simulation (Figure X).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_2_1.png|centre|thumb|Figure X. Plot showing the total energy during the simulation using a timestep of 0.1990]]&lt;br /&gt;
&lt;br /&gt;
The simulations are being run in isolated systems which requires total energy conservation, so large fluctuations in the energy would lead to inaccurate results. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 3. For a single Lennard-Jones interaction, find the separation, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;, and work out the well depth. Evaluate the integrals when σ = ε = 1.0.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i) The Lennard-Jones interaction is given by:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_1.png|200px]]&lt;br /&gt;
&lt;br /&gt;
Since r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; when ɸ = 0,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(ii) The force is given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_3.png|250px]]&lt;br /&gt;
&lt;br /&gt;
So at the separation r&amp;lt;sub&amp;gt;0 &amp;lt;/sub&amp;gt;= σ,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_4.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iii) The equilibrium separation r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs at the point at which all forces vanish, ie. when F = 0, so&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_5.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iv) And the well depth is therefore given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_6.png|270px]]&lt;br /&gt;
&lt;br /&gt;
(v)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_7.png|370px]]&lt;br /&gt;
&lt;br /&gt;
(vi)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_8.png|400px]]&lt;br /&gt;
&lt;br /&gt;
(vii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_9.png|370px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4. Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10,000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_1.png|550px]]&lt;br /&gt;
&lt;br /&gt;
For 10,000 water molecules,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_3.png|230px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 5. Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After the timestep, the atom would be at position (0.5 + 0.7, 0.5 + 0.6, 0.5 + 0.2) = (1.2, 1.1, 0.7). Applying the boundary conditions, this is equivalent to the position (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 6. The Lennard-Jones parameters for argon are sigma = 0.34nm, ε/k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt; = 120K. If the LJ cutoff is r&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 1.5 in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_1.png|140px]]&lt;br /&gt;
&lt;br /&gt;
(ii) It was previously determined in Task 1 that the well depth is - ε, so in real units,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_4.png|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(iii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_3.png|130px]]&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Equilibration&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 7. Why do you think giving atoms random starting coordinates causes problems in simulations?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If two atoms are generated too close to one another, then they would experience a large repulsive force, and would disrupt the behaviour of the surrounding atoms, causing the simulation to become inaccurate. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 8. Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_1.png|380px]]&lt;br /&gt;
&lt;br /&gt;
(ii) For a face-centred cubic lattice, note that the unit cell contains four atoms, as opposed to one atom with a simple cubic lattice. Then&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_4.png|460px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 9. Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is 1 atom contained within each unit cell. However for face-centred cubic lattices, each unit cell contains 4 atoms so four times as many atoms are created than with the simple lattice (ie. 4000 atoms).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 10. Given that we are specifying x&amp;lt;sub&amp;gt;i &amp;lt;/sub&amp;gt;(0) and v&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; (0), which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We will be using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 11. In the code section &amp;quot;Specify Timestep&amp;quot;, the second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write &amp;quot;timestep 0.001 // run 100000&amp;quot;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Defining the variable timestep allows us to reference the variable multiple times throughout the simulation if required, whilst preventing errors and making it easier to alter the code if we want to run the simulation for different timestep values. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 12. Make plots of energy, temperature, and pressure, against time for the 0.001 timestep experiment. Does the simulation reach equilibrium? How long does this take? Make a single plot of energy vs time for all of the timesteps. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice and why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_12_1.png|centre|thumb|Figure X. Plot of energy against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_2.png|centre|thumb|Figure X. Plot of temperature against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_3.png|centre|thumb|Figure X. Plot of pressure against time for the 0.001 timestep experiment]]&lt;br /&gt;
&lt;br /&gt;
The 0.001 timestep experiment reaches equilibrium very quickly, within approximately 0.2s. &lt;br /&gt;
&lt;br /&gt;
A single plot of energy vs time for all of the timesteps can be found in &amp;quot;Results &amp;amp; Discussion: Investigation into Simulation Timestep in the NVE Ensemble Figure 1&amp;quot;, along with a detailed analysis, but in brief: the largest acceptable timestep is 0.0025, and a particularly bad choice would be 0.015 as it does not reach equilibrium.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Running Simulations under Specific Conditions&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 13. We need to choose gamma so that the temperature is correct T=fancy T if we multiply every velocity by γ. Solve the following two equations to determine gamma:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_2.png|center|200px]]&lt;br /&gt;
&lt;br /&gt;
Starting from the 2&amp;lt;sup&amp;gt;nd&amp;lt;/sup&amp;gt; equation,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_1.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 14: (Use the manual to find out the importance of the three numbers 100 1000 100000.) 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 (&amp;quot;run 100000&amp;quot;), how much time will you simulate? (DOUBLE CHECK THIS PART WITH OLLIE!)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Firstly, averages are taken for blocks of 100 values at a time to form the first set of averaged values (where av&amp;lt;sub&amp;gt;100,n&amp;lt;/sub&amp;gt; is the average value for the n&amp;lt;sup&amp;gt;th&amp;lt;/sup&amp;gt; block of 100 values). These values are then themselves averaged in blocks of 1000 values to form a second set of averaged values (av&amp;lt;sub&amp;gt;100,1&amp;lt;/sub&amp;gt; + av&amp;lt;sub&amp;gt;100,2&amp;lt;/sub&amp;gt; + ... + av&amp;lt;sub&amp;gt;100,1000&amp;lt;/sub&amp;gt;)/1000 = av&amp;lt;sub&amp;gt;1000,1&amp;lt;/sub&amp;gt;. Finally, these values are averaged once more in blocks of 100000 values.&lt;br /&gt;
&lt;br /&gt;
The amount of time simulated can be found by multiplying the number of steps by the value of the timestep (eg. 100,000 steps of a 0.001 timestep simulates 100 seconds).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 15: Plot density as a function of temperature for both of the pressures that you simulated. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figure 2 in &amp;quot;Results and Discussion: Equations of State in the NpT Ensemble&amp;quot; for the plot and subsequent discussion.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Heat Capacity Calculation&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 16: Run simulations at densities of 0.2, 0.8 and temperatures of 2.0, 2.2, 2.4, 2.6, 2.8, plotting C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;/V as a function of temperature, where V is the volume of the simulation cell, for both of your densities. Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the plot of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;/V as a function of temperature, please see Figure 3 in &amp;quot;Results and Discussion: Calculation of Heat Capacity&amp;quot; and the subsequent discussion on why the trend was as expected. A copy of the input script can be found in &amp;quot;Method: Part 3: Calculation of Heat Capacity&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Structural Properties and the Radial Distribution Function&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 17: Plot the RDFs for the three systems on the same axes. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figure 4 in &amp;quot;Results and Discussion: Radial Distribution Functions&amp;quot; for the plot and analysis. WHAT IS THE LATTICE SPACING? &lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Dynamical Properties and the Diffusion Coefficient&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 18: Make a plot for each of your simulations (solid/liquid/vapour), showing the mean squared displacement (&amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate D in each case. (Be careful with units!) Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 19: Evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (show working). On the same graph, with x range 0 to 500, plot C(tau) with omega = 1/2pi and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. Why is the harmonic oscillator VACF very different to the Lennard Jones solid and liquid? (Attach a copy of your plot)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_3.png|700px]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_2.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 20: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gm1110_LS_R_D_5_12.png&amp;diff=665544</id>
		<title>File:Gm1110 LS R D 5 12.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gm1110_LS_R_D_5_12.png&amp;diff=665544"/>
		<updated>2018-02-14T14:19:27Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gm1110_LS_R_D_5_11.png&amp;diff=665543</id>
		<title>File:Gm1110 LS R D 5 11.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gm1110_LS_R_D_5_11.png&amp;diff=665543"/>
		<updated>2018-02-14T14:19:10Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gm1110_LS_R_D_5_10.png&amp;diff=665542</id>
		<title>File:Gm1110 LS R D 5 10.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gm1110_LS_R_D_5_10.png&amp;diff=665542"/>
		<updated>2018-02-14T14:18:53Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gm1110_LS_R_D_5_9.png&amp;diff=665541</id>
		<title>File:Gm1110 LS R D 5 9.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gm1110_LS_R_D_5_9.png&amp;diff=665541"/>
		<updated>2018-02-14T14:18:35Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gm1110_LS_R_D_5_8.png&amp;diff=665540</id>
		<title>File:Gm1110 LS R D 5 8.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gm1110_LS_R_D_5_8.png&amp;diff=665540"/>
		<updated>2018-02-14T14:18:19Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gm1110_LS_R_D_5_7.png&amp;diff=665539</id>
		<title>File:Gm1110 LS R D 5 7.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gm1110_LS_R_D_5_7.png&amp;diff=665539"/>
		<updated>2018-02-14T14:18:01Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665536</id>
		<title>Rep:Gm1110LiquidSim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665536"/>
		<updated>2018-02-14T14:00:01Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: /* Heat Capacity Calculation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
The main aim of the experiment was to determine the diffusion coefficient for the solid, liquid and vapour phases of a Lennard-Jones fluid using both the mean squared displacement method and velocity autocorrelation function method.&lt;br /&gt;
&lt;br /&gt;
In order to achieve this, it was first necessary to determine an appropriate timestep with which to run simulations, and investigate the effect of temperature and pressure on the density of the system. Other aims included seeing how heat capacity varied as a function of temperature for different densities, and calculating the radial distribution function for the three phases from simulations using VMD.    &lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
All simulations of the Lennard-Jones fluid were run using the LAMMPS software, and all quantities used were in reduced units.&lt;br /&gt;
&lt;br /&gt;
=== Part 1: Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
A simulation box consisting of 10 x 10 x 10 unit cells of a simple cubic lattice with an atomic density of 0.8 was defined. The atomic mass was set to 1.0 and the Lennard-Jones pairwise interaction cutoff distance was set to 3.0. The pairwise forcefield coefficients ε (potential well depth) and σ (zero-potential distance) were both set to 1.0. Five simulations were run for differing timestep values (0.0010, 0.0025, 0.0075, 0.0100 and 0.0150).&lt;br /&gt;
&lt;br /&gt;
=== Part 2: Equations of State in the NpT Ensemble ===&lt;br /&gt;
The simulation box was increased to consist of 15 x 15 x 15 unit cells of the same simple cubic lattice defined in part 1. A total of ten simulations were run in the NpT ensemble, varying temperature (2.0, 4.0, 6.0, 8.0 and 10.0) at two different densities (1.8 and 2.8) using the timestep value of 0.0025 determined in Part 1.&lt;br /&gt;
&lt;br /&gt;
=== Part 3: Calculation of Heat Capacity ===&lt;br /&gt;
The simulation box from Part 2 was used, with the density altered to take the values 0.2 and 0.8. Five simulations were run for each, with varying values of temperature (2.0, 2.2, 2.4, 2.6 and 2.8). A copy of the script written for this simulation can be found by clicking the image below:&lt;br /&gt;
[[File:gm1110_LS_M_3_1.png|centre|thumb|Copy of Script]]&lt;br /&gt;
&lt;br /&gt;
=== Part 4: Radial Distribution Functions ===&lt;br /&gt;
The simulation boxes used previously were altered to take a timestep of 0.002 and a L-J cutoff distance of 3.2, after which the solid, liquid and vapour phases were defined as having (density, temperature) values of (1.2, 1.2), (0.8, 1.2) and (0.05, 1.1) respectively. In particular, the solid phase was defined as having a face-centred cubic lattice, instead of the simple cubic lattice used for the liquid and vapour phases. VMD was used to analyse the trajectories for the three phases, with the distance between points in the generated RDF set to 0.05.&lt;br /&gt;
&lt;br /&gt;
=== Part 5: Diffusion Coefficient ===&lt;br /&gt;
The results from Part 4 were used to graph the mean squared displacement as a function of time, after which the gradient of the linear portion of the graph was extracted and used to calculate the diffusion coefficient from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_M_5_1.png|centre|150px]]&lt;br /&gt;
&lt;br /&gt;
The procedure was then repeated using 1 million atoms.&lt;br /&gt;
&lt;br /&gt;
==Results and Discussion==&lt;br /&gt;
&lt;br /&gt;
=== Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
Simulations were run using the five different timesteps 0.0010, 0.0025, 0.0075, 0.0100 and 0.0150, and a plot of the results can be seen below (Figure 1).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_1_1.png|centre|thumb|Figure 1. A plot of total energy (reduced units) against time comparing simulations run using five different timestep values]]&lt;br /&gt;
&lt;br /&gt;
It was observed that the simulation run with a timestep of 0.0150 did not equilibrate. This was thought to have potentially been due to the timestep being too large, and therefore the simulation was missing too much detail to accurately simulate the fluid. The simulations run for timesteps of 0.0100 and 0.0075 did equilibrate (supporting the previous hypothesis that the 0.0150 timestep was too large), but converged at the wrong energy (approximately -3.181 and -3.183 respectively), indicating that the timesteps were still not quite small enough.&lt;br /&gt;
&lt;br /&gt;
The final two simulations run at timesteps of 0.0025 and 0.0010 both equilibrated to the same, correct energy (approximately -3.184), indicating that both would be suitable for use in further simulations. It is preferable, however, to maximise the timestep when running simulations as a smaller timestep requires more data points, and is therefore more “expensive” and takes longer to run for no real added value. Hence it was decided that a timestep of 0.0025 would be suitable for running further simulations.    &lt;br /&gt;
&lt;br /&gt;
=== Equations of State in the NpT Ensemble ===&lt;br /&gt;
Although specific values for temperature and pressure are specified for the simulations, in reality, the temperature and pressure of a system fluctuates over time and may therefore deviate away from the inputted values. Hence, the simulation calculates the pressure of the system at the end of every timestep, and adjusts the size of the simulation box such that the pressure once again corresponds to the specified value. Pressure controlled simulations are thus in the NpT ensemble and so volume (and therefore density) is not constant.&lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the resulting densities were plotted against temperature, along with values predicted by the ideal gas law and can be seen below (Figure 2).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_2_1.png|centre|thumb|Figure 2. Plot showing density as a function of temperature at pressures of 1.8 and 2.8 (all in reduced units), with error bars, and a plot of the densities predicted by the ideal gas law]]&lt;br /&gt;
&lt;br /&gt;
Clearly, the simulated densities are lower than those predicted by the ideal gas law, and the discrepancy increases with increasing pressure. This is due to the fact that the ideal gas law assumes perfectly elastic collisions between point particles, but in reality, intermolecular repulsive forces cause the simulated densities to be lower. In addition, an increase in pressure causes the molecules to be pushed closer together and increases both the number of collisions as well as the repulsive forces, leading to a greater deviation from ideality.    &lt;br /&gt;
&lt;br /&gt;
=== Calculation of Heat Capacity ===&lt;br /&gt;
Switching to the NVT ensemble, the heat capacity of the system can be determined by considering the magnitude of fluctuations in the system’s energy from its average equilibrium state from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_1.png|centre|250px]]            &lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the average heat capacities were plotted as a function of temperature (Figure 3).        &lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_2.png|centre|thumb|Figure 3. Plot of average heat capacity against temperature for densities of 0.8 and 0.2]]Heat capacity is a measure of the amount of energy required to increase the temperature of a substance. It is clear that the heat capacity is lower, and therefore easier to heat, for lower density systems as the particles are more spaced apart. This means that they are able to gain thermal energy more easily as they have more room for increased vibrations without an increase of repulsive forces or collisions compared to a higher density system. It was also noted that the heat capacity decreased with increasing temperature. This is due to the fact that at higher temperatures, the gap between energy levels decreases as the particles occupy higher energy states, thus making it easier for the particles to be promoted to higher energy levels.&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Functions ===&lt;br /&gt;
Radial distribution functions (g(r)) were calculated for the solid, liquid and vapour phases (see Figure 4) to check that the simulations were correctly reproducing the structural features of each phase. RDFs are essentially probability distribution functions for the likelihood of finding a particle at a given distance r away from a reference particle, and also gives information on the coordination sphere of the reference particle. The integral of the RDF (Figure 5) is also useful as it gives information on the number of atoms found at a distance r.&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_1.png|centre|thumb|Figure 4. Radial distribution function against displacement from a reference atom]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_2.png|centre|thumb|Figure 5. Integral of the radial distribution function against displacement]]&lt;br /&gt;
&lt;br /&gt;
For small r, all three phases have g(r) ~ 0, indicating an atomic density of zero as there exists a minimum distance at which atoms can approach each other. Also, g(r) tends to 1 for all three phases with increasing r, which represents the fact that the local density becomes equivalent to the mean density of the system as a whole.&lt;br /&gt;
&lt;br /&gt;
The graph of the solid phase shows sharp oscillating peaks, indicating that the atoms are strongly confined to their positions in the crystalline lattice, and the high degree of ordering means that although the osciallations do tend to g(r) = 1 for large r, this occurs much more slowly than for the other two phases. The first peak corresponds to the atoms nearest neighbours (of which there are 12), and the second and third peak correspond to the second and third nearest neighbours respectively (of which there are 6 and 24). &lt;br /&gt;
&lt;br /&gt;
The graph for the liquid phase shows broad, gently oscillating peaks that rapidly decay to g(r) = 1. As with the solid phase, the oscillations indicate some structure in the system whereby the atoms are loosely bound to their original positions, but the broader peaks indicate that they have much more freedom to move away from their positions. &lt;br /&gt;
&lt;br /&gt;
The graph for the vapour phase shows a single peak at approximately r = 1, after which it quickly decays back to g(r) = 1. This shows that the structure has very little to no order, and the particles are free to move unbound to any specific position. &lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|MSD Graphs (1,000 atoms)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_1.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_2.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_3.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Solid MSD&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Fluid MSD&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Vapour MSD&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|MSD Graphs (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_4.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_5.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_6.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Solid MSD&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Fluid MSD&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Vapour MSD&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The gradient for the linear region of the plots were determined and used to calculate the diffusion coefficients (see table below).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=4|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Solid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Liquid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Vapour Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-6.17x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0688 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;2.27 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-6.83x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0698 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;2.47 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
==Tasks==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Introduction to Molecular Dynamics Simulations&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 1. For a default timestep value 0.1, estimate the positions of the maxima in the ERROR column as a function of time.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_1_1.png|centre|thumb|Figure X. Plot showing the positions of the error maxima as a function of time, with a best fit line]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 2. (Experiment with different values of the timestep.) What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using a timestep of 0.1990 meant that the total energy did not change by more than 1% over the course of the simulation (Figure X).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_2_1.png|centre|thumb|Figure X. Plot showing the total energy during the simulation using a timestep of 0.1990]]&lt;br /&gt;
&lt;br /&gt;
The simulations are being run in isolated systems which requires total energy conservation, so large fluctuations in the energy would lead to inaccurate results. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 3. For a single Lennard-Jones interaction, find the separation, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;, and work out the well depth. Evaluate the integrals when σ = ε = 1.0.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i) The Lennard-Jones interaction is given by:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_1.png|200px]]&lt;br /&gt;
&lt;br /&gt;
Since r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; when ɸ = 0,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(ii) The force is given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_3.png|250px]]&lt;br /&gt;
&lt;br /&gt;
So at the separation r&amp;lt;sub&amp;gt;0 &amp;lt;/sub&amp;gt;= σ,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_4.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iii) The equilibrium separation r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs at the point at which all forces vanish, ie. when F = 0, so&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_5.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iv) And the well depth is therefore given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_6.png|270px]]&lt;br /&gt;
&lt;br /&gt;
(v)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_7.png|370px]]&lt;br /&gt;
&lt;br /&gt;
(vi)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_8.png|400px]]&lt;br /&gt;
&lt;br /&gt;
(vii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_9.png|370px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4. Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10,000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_1.png|550px]]&lt;br /&gt;
&lt;br /&gt;
For 10,000 water molecules,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_3.png|230px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 5. Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After the timestep, the atom would be at position (0.5 + 0.7, 0.5 + 0.6, 0.5 + 0.2) = (1.2, 1.1, 0.7). Applying the boundary conditions, this is equivalent to the position (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 6. The Lennard-Jones parameters for argon are sigma = 0.34nm, ε/k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt; = 120K. If the LJ cutoff is r&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 1.5 in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_1.png|140px]]&lt;br /&gt;
&lt;br /&gt;
(ii) It was previously determined in Task 1 that the well depth is - ε, so in real units,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_4.png|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(iii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_3.png|130px]]&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Equilibration&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 7. Why do you think giving atoms random starting coordinates causes problems in simulations?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If two atoms are generated too close to one another, then they would experience a large repulsive force, and would disrupt the behaviour of the surrounding atoms, causing the simulation to become inaccurate. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 8. Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_1.png|380px]]&lt;br /&gt;
&lt;br /&gt;
(ii) For a face-centred cubic lattice, note that the unit cell contains four atoms, as opposed to one atom with a simple cubic lattice. Then&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_4.png|460px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 9. Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is 1 atom contained within each unit cell. However for face-centred cubic lattices, each unit cell contains 4 atoms so four times as many atoms are created than with the simple lattice (ie. 4000 atoms).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 10. Given that we are specifying x&amp;lt;sub&amp;gt;i &amp;lt;/sub&amp;gt;(0) and v&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; (0), which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We will be using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 11. In the code section &amp;quot;Specify Timestep&amp;quot;, the second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write &amp;quot;timestep 0.001 // run 100000&amp;quot;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Defining the variable timestep allows us to reference the variable multiple times throughout the simulation if required, whilst preventing errors and making it easier to alter the code if we want to run the simulation for different timestep values. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 12. Make plots of energy, temperature, and pressure, against time for the 0.001 timestep experiment. Does the simulation reach equilibrium? How long does this take? Make a single plot of energy vs time for all of the timesteps. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice and why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_12_1.png|centre|thumb|Figure X. Plot of energy against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_2.png|centre|thumb|Figure X. Plot of temperature against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_3.png|centre|thumb|Figure X. Plot of pressure against time for the 0.001 timestep experiment]]&lt;br /&gt;
&lt;br /&gt;
The 0.001 timestep experiment reaches equilibrium very quickly, within approximately 0.2s. &lt;br /&gt;
&lt;br /&gt;
A single plot of energy vs time for all of the timesteps can be found in &amp;quot;Results &amp;amp; Discussion: Investigation into Simulation Timestep in the NVE Ensemble Figure 1&amp;quot;, along with a detailed analysis, but in brief: the largest acceptable timestep is 0.0025, and a particularly bad choice would be 0.015 as it does not reach equilibrium.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Running Simulations under Specific Conditions&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 13. We need to choose gamma so that the temperature is correct T=fancy T if we multiply every velocity by γ. Solve the following two equations to determine gamma:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_2.png|center|200px]]&lt;br /&gt;
&lt;br /&gt;
Starting from the 2&amp;lt;sup&amp;gt;nd&amp;lt;/sup&amp;gt; equation,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_1.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 14: (Use the manual to find out the importance of the three numbers 100 1000 100000.) 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 (&amp;quot;run 100000&amp;quot;), how much time will you simulate? (DOUBLE CHECK THIS PART WITH OLLIE!)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Firstly, averages are taken for blocks of 100 values at a time to form the first set of averaged values (where av&amp;lt;sub&amp;gt;100,n&amp;lt;/sub&amp;gt; is the average value for the n&amp;lt;sup&amp;gt;th&amp;lt;/sup&amp;gt; block of 100 values). These values are then themselves averaged in blocks of 1000 values to form a second set of averaged values (av&amp;lt;sub&amp;gt;100,1&amp;lt;/sub&amp;gt; + av&amp;lt;sub&amp;gt;100,2&amp;lt;/sub&amp;gt; + ... + av&amp;lt;sub&amp;gt;100,1000&amp;lt;/sub&amp;gt;)/1000 = av&amp;lt;sub&amp;gt;1000,1&amp;lt;/sub&amp;gt;. Finally, these values are averaged once more in blocks of 100000 values.&lt;br /&gt;
&lt;br /&gt;
The amount of time simulated can be found by multiplying the number of steps by the value of the timestep (eg. 100,000 steps of a 0.001 timestep simulates 100 seconds).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 15: Plot density as a function of temperature for both of the pressures that you simulated. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figure 2 in &amp;quot;Results and Discussion: Equations of State in the NpT Ensemble&amp;quot; for the plot and subsequent discussion.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Heat Capacity Calculation&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 16: Run simulations at densities of 0.2, 0.8 and temperatures of 2.0, 2.2, 2.4, 2.6, 2.8, plotting C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;/V as a function of temperature, where V is the volume of the simulation cell, for both of your densities. Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the plot of C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;/V as a function of temperature, please see Figure 3 in &amp;quot;Results and Discussion: Calculation of Heat Capacity&amp;quot; and the subsequent discussion on why the trend was as expected. A copy of the input script can be found in &amp;quot;Method: Part 3: Calculation of Heat Capacity&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Structural Properties and the Radial Distribution Function&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 17: Plot the RDFs for the three systems on the same axes. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figure 4 in &amp;quot;Results and Discussion: Radial Distribution Functions&amp;quot; for the plot and analysis. WHAT IS THE LATTICE SPACING? &lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Dynamical Properties and the Diffusion Coefficient&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 18: Make a plot for each of your simulations (solid/liquid/vapour), showing the mean squared displacement (&amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate D in each case. (Be careful with units!) Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 19: Evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (show working). On the same graph, with x range 0 to 500, plot C(tau) with omega = 1/2pi and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. Why is the harmonic oscillator VACF very different to the Lennard Jones solid and liquid? (Attach a copy of your plot)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_3.png|700px]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_2.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 20: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665534</id>
		<title>Rep:Gm1110LiquidSim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665534"/>
		<updated>2018-02-14T13:49:36Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: /* Diffusion Coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
The main aim of the experiment was to determine the diffusion coefficient for the solid, liquid and vapour phases of a Lennard-Jones fluid using both the mean squared displacement method and velocity autocorrelation function method.&lt;br /&gt;
&lt;br /&gt;
In order to achieve this, it was first necessary to determine an appropriate timestep with which to run simulations, and investigate the effect of temperature and pressure on the density of the system. Other aims included seeing how heat capacity varied as a function of temperature for different densities, and calculating the radial distribution function for the three phases from simulations using VMD.    &lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
All simulations of the Lennard-Jones fluid were run using the LAMMPS software, and all quantities used were in reduced units.&lt;br /&gt;
&lt;br /&gt;
=== Part 1: Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
A simulation box consisting of 10 x 10 x 10 unit cells of a simple cubic lattice with an atomic density of 0.8 was defined. The atomic mass was set to 1.0 and the Lennard-Jones pairwise interaction cutoff distance was set to 3.0. The pairwise forcefield coefficients ε (potential well depth) and σ (zero-potential distance) were both set to 1.0. Five simulations were run for differing timestep values (0.0010, 0.0025, 0.0075, 0.0100 and 0.0150).&lt;br /&gt;
&lt;br /&gt;
=== Part 2: Equations of State in the NpT Ensemble ===&lt;br /&gt;
The simulation box was increased to consist of 15 x 15 x 15 unit cells of the same simple cubic lattice defined in part 1. A total of ten simulations were run in the NpT ensemble, varying temperature (2.0, 4.0, 6.0, 8.0 and 10.0) at two different densities (1.8 and 2.8) using the timestep value of 0.0025 determined in Part 1.&lt;br /&gt;
&lt;br /&gt;
=== Part 3: Calculation of Heat Capacity ===&lt;br /&gt;
The simulation box from Part 2 was used, with the density altered to take the values 0.2 and 0.8. Five simulations were run for each, with varying values of temperature (2.0, 2.2, 2.4, 2.6 and 2.8). A copy of the script written for this simulation can be found by clicking the image below:&lt;br /&gt;
[[File:gm1110_LS_M_3_1.png|centre|thumb|Copy of Script]]&lt;br /&gt;
&lt;br /&gt;
=== Part 4: Radial Distribution Functions ===&lt;br /&gt;
The simulation boxes used previously were altered to take a timestep of 0.002 and a L-J cutoff distance of 3.2, after which the solid, liquid and vapour phases were defined as having (density, temperature) values of (1.2, 1.2), (0.8, 1.2) and (0.05, 1.1) respectively. In particular, the solid phase was defined as having a face-centred cubic lattice, instead of the simple cubic lattice used for the liquid and vapour phases. VMD was used to analyse the trajectories for the three phases, with the distance between points in the generated RDF set to 0.05.&lt;br /&gt;
&lt;br /&gt;
=== Part 5: Diffusion Coefficient ===&lt;br /&gt;
The results from Part 4 were used to graph the mean squared displacement as a function of time, after which the gradient of the linear portion of the graph was extracted and used to calculate the diffusion coefficient from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_M_5_1.png|centre|150px]]&lt;br /&gt;
&lt;br /&gt;
The procedure was then repeated using 1 million atoms.&lt;br /&gt;
&lt;br /&gt;
==Results and Discussion==&lt;br /&gt;
&lt;br /&gt;
=== Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
Simulations were run using the five different timesteps 0.0010, 0.0025, 0.0075, 0.0100 and 0.0150, and a plot of the results can be seen below (Figure 1).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_1_1.png|centre|thumb|Figure 1. A plot of total energy (reduced units) against time comparing simulations run using five different timestep values]]&lt;br /&gt;
&lt;br /&gt;
It was observed that the simulation run with a timestep of 0.0150 did not equilibrate. This was thought to have potentially been due to the timestep being too large, and therefore the simulation was missing too much detail to accurately simulate the fluid. The simulations run for timesteps of 0.0100 and 0.0075 did equilibrate (supporting the previous hypothesis that the 0.0150 timestep was too large), but converged at the wrong energy (approximately -3.181 and -3.183 respectively), indicating that the timesteps were still not quite small enough.&lt;br /&gt;
&lt;br /&gt;
The final two simulations run at timesteps of 0.0025 and 0.0010 both equilibrated to the same, correct energy (approximately -3.184), indicating that both would be suitable for use in further simulations. It is preferable, however, to maximise the timestep when running simulations as a smaller timestep requires more data points, and is therefore more “expensive” and takes longer to run for no real added value. Hence it was decided that a timestep of 0.0025 would be suitable for running further simulations.    &lt;br /&gt;
&lt;br /&gt;
=== Equations of State in the NpT Ensemble ===&lt;br /&gt;
Although specific values for temperature and pressure are specified for the simulations, in reality, the temperature and pressure of a system fluctuates over time and may therefore deviate away from the inputted values. Hence, the simulation calculates the pressure of the system at the end of every timestep, and adjusts the size of the simulation box such that the pressure once again corresponds to the specified value. Pressure controlled simulations are thus in the NpT ensemble and so volume (and therefore density) is not constant.&lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the resulting densities were plotted against temperature, along with values predicted by the ideal gas law and can be seen below (Figure 2).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_2_1.png|centre|thumb|Figure 2. Plot showing density as a function of temperature at pressures of 1.8 and 2.8 (all in reduced units), with error bars, and a plot of the densities predicted by the ideal gas law]]&lt;br /&gt;
&lt;br /&gt;
Clearly, the simulated densities are lower than those predicted by the ideal gas law, and the discrepancy increases with increasing pressure. This is due to the fact that the ideal gas law assumes perfectly elastic collisions between point particles, but in reality, intermolecular repulsive forces cause the simulated densities to be lower. In addition, an increase in pressure causes the molecules to be pushed closer together and increases both the number of collisions as well as the repulsive forces, leading to a greater deviation from ideality.    &lt;br /&gt;
&lt;br /&gt;
=== Calculation of Heat Capacity ===&lt;br /&gt;
Switching to the NVT ensemble, the heat capacity of the system can be determined by considering the magnitude of fluctuations in the system’s energy from its average equilibrium state from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_1.png|centre|250px]]            &lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the average heat capacities were plotted as a function of temperature (Figure 3).        &lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_2.png|centre|thumb|Figure 3. Plot of average heat capacity against temperature for densities of 0.8 and 0.2]]Heat capacity is a measure of the amount of energy required to increase the temperature of a substance. It is clear that the heat capacity is lower, and therefore easier to heat, for lower density systems as the particles are more spaced apart. This means that they are able to gain thermal energy more easily as they have more room for increased vibrations without an increase of repulsive forces or collisions compared to a higher density system. It was also noted that the heat capacity decreased with increasing temperature. This is due to the fact that at higher temperatures, the gap between energy levels decreases as the particles occupy higher energy states, thus making it easier for the particles to be promoted to higher energy levels.&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Functions ===&lt;br /&gt;
Radial distribution functions (g(r)) were calculated for the solid, liquid and vapour phases (see Figure 4) to check that the simulations were correctly reproducing the structural features of each phase. RDFs are essentially probability distribution functions for the likelihood of finding a particle at a given distance r away from a reference particle, and also gives information on the coordination sphere of the reference particle. The integral of the RDF (Figure 5) is also useful as it gives information on the number of atoms found at a distance r.&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_1.png|centre|thumb|Figure 4. Radial distribution function against displacement from a reference atom]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_2.png|centre|thumb|Figure 5. Integral of the radial distribution function against displacement]]&lt;br /&gt;
&lt;br /&gt;
For small r, all three phases have g(r) ~ 0, indicating an atomic density of zero as there exists a minimum distance at which atoms can approach each other. Also, g(r) tends to 1 for all three phases with increasing r, which represents the fact that the local density becomes equivalent to the mean density of the system as a whole.&lt;br /&gt;
&lt;br /&gt;
The graph of the solid phase shows sharp oscillating peaks, indicating that the atoms are strongly confined to their positions in the crystalline lattice, and the high degree of ordering means that although the osciallations do tend to g(r) = 1 for large r, this occurs much more slowly than for the other two phases. The first peak corresponds to the atoms nearest neighbours (of which there are 12), and the second and third peak correspond to the second and third nearest neighbours respectively (of which there are 6 and 24). &lt;br /&gt;
&lt;br /&gt;
The graph for the liquid phase shows broad, gently oscillating peaks that rapidly decay to g(r) = 1. As with the solid phase, the oscillations indicate some structure in the system whereby the atoms are loosely bound to their original positions, but the broader peaks indicate that they have much more freedom to move away from their positions. &lt;br /&gt;
&lt;br /&gt;
The graph for the vapour phase shows a single peak at approximately r = 1, after which it quickly decays back to g(r) = 1. This shows that the structure has very little to no order, and the particles are free to move unbound to any specific position. &lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|MSD Graphs (1,000 atoms)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_1.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_2.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_3.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Solid MSD&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Fluid MSD&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Vapour MSD&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|MSD Graphs (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_4.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_5.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_6.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Solid MSD&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Fluid MSD&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Vapour MSD&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The gradient for the linear region of the plots were determined and used to calculate the diffusion coefficients (see table below).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=4|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Solid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Liquid Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;Vapour Phase&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-6.17x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0688 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;2.27 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;b&amp;gt;1,000,000 atoms&amp;lt;/b&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;-6.83x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;0.0698 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;2.47 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
==Tasks==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Introduction to Molecular Dynamics Simulations&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 1. For a default timestep value 0.1, estimate the positions of the maxima in the ERROR column as a function of time.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_1_1.png|centre|thumb|Figure X. Plot showing the positions of the error maxima as a function of time, with a best fit line]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 2. (Experiment with different values of the timestep.) What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using a timestep of 0.1990 meant that the total energy did not change by more than 1% over the course of the simulation (Figure X).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_2_1.png|centre|thumb|Figure X. Plot showing the total energy during the simulation using a timestep of 0.1990]]&lt;br /&gt;
&lt;br /&gt;
The simulations are being run in isolated systems which requires total energy conservation, so large fluctuations in the energy would lead to inaccurate results. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 3. For a single Lennard-Jones interaction, find the separation, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;, and work out the well depth. Evaluate the integrals when σ = ε = 1.0.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i) The Lennard-Jones interaction is given by:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_1.png|200px]]&lt;br /&gt;
&lt;br /&gt;
Since r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; when ɸ = 0,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(ii) The force is given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_3.png|250px]]&lt;br /&gt;
&lt;br /&gt;
So at the separation r&amp;lt;sub&amp;gt;0 &amp;lt;/sub&amp;gt;= σ,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_4.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iii) The equilibrium separation r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs at the point at which all forces vanish, ie. when F = 0, so&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_5.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iv) And the well depth is therefore given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_6.png|270px]]&lt;br /&gt;
&lt;br /&gt;
(v)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_7.png|370px]]&lt;br /&gt;
&lt;br /&gt;
(vi)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_8.png|400px]]&lt;br /&gt;
&lt;br /&gt;
(vii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_9.png|370px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4. Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10,000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_1.png|550px]]&lt;br /&gt;
&lt;br /&gt;
For 10,000 water molecules,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_3.png|230px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 5. Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After the timestep, the atom would be at position (0.5 + 0.7, 0.5 + 0.6, 0.5 + 0.2) = (1.2, 1.1, 0.7). Applying the boundary conditions, this is equivalent to the position (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 6. The Lennard-Jones parameters for argon are sigma = 0.34nm, ε/k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt; = 120K. If the LJ cutoff is r&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 1.5 in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_1.png|140px]]&lt;br /&gt;
&lt;br /&gt;
(ii) It was previously determined in Task 1 that the well depth is - ε, so in real units,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_4.png|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(iii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_3.png|130px]]&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Equilibration&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 7. Why do you think giving atoms random starting coordinates causes problems in simulations?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If two atoms are generated too close to one another, then they would experience a large repulsive force, and would disrupt the behaviour of the surrounding atoms, causing the simulation to become inaccurate. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 8. Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_1.png|380px]]&lt;br /&gt;
&lt;br /&gt;
(ii) For a face-centred cubic lattice, note that the unit cell contains four atoms, as opposed to one atom with a simple cubic lattice. Then&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_4.png|460px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 9. Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is 1 atom contained within each unit cell. However for face-centred cubic lattices, each unit cell contains 4 atoms so four times as many atoms are created than with the simple lattice (ie. 4000 atoms).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 10. Given that we are specifying x&amp;lt;sub&amp;gt;i &amp;lt;/sub&amp;gt;(0) and v&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; (0), which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We will be using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 11. In the code section &amp;quot;Specify Timestep&amp;quot;, the second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write &amp;quot;timestep 0.001 // run 100000&amp;quot;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Defining the variable timestep allows us to reference the variable multiple times throughout the simulation if required, whilst preventing errors and making it easier to alter the code if we want to run the simulation for different timestep values. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 12. Make plots of energy, temperature, and pressure, against time for the 0.001 timestep experiment. Does the simulation reach equilibrium? How long does this take? Make a single plot of energy vs time for all of the timesteps. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice and why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_12_1.png|centre|thumb|Figure X. Plot of energy against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_2.png|centre|thumb|Figure X. Plot of temperature against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_3.png|centre|thumb|Figure X. Plot of pressure against time for the 0.001 timestep experiment]]&lt;br /&gt;
&lt;br /&gt;
The 0.001 timestep experiment reaches equilibrium very quickly, within approximately 0.2s. &lt;br /&gt;
&lt;br /&gt;
A single plot of energy vs time for all of the timesteps can be found in &amp;quot;Results &amp;amp; Discussion: Investigation into Simulation Timestep in the NVE Ensemble Figure 1&amp;quot;, along with a detailed analysis, but in brief: the largest acceptable timestep is 0.0025, and a particularly bad choice would be 0.015 as it does not reach equilibrium.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Running Simulations under Specific Conditions&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 13. We need to choose gamma so that the temperature is correct T=fancy T if we multiply every velocity by γ. Solve the following two equations to determine gamma:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_2.png|center|200px]]&lt;br /&gt;
&lt;br /&gt;
Starting from the 2&amp;lt;sup&amp;gt;nd&amp;lt;/sup&amp;gt; equation,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_1.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 14: (Use the manual to find out the importance of the three numbers 100 1000 100000.) 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 (&amp;quot;run 100000&amp;quot;), how much time will you simulate? (DOUBLE CHECK THIS PART WITH OLLIE!)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Firstly, averages are taken for blocks of 100 values at a time to form the first set of averaged values (where av&amp;lt;sub&amp;gt;100,n&amp;lt;/sub&amp;gt; is the average value for the n&amp;lt;sup&amp;gt;th&amp;lt;/sup&amp;gt; block of 100 values). These values are then themselves averaged in blocks of 1000 values to form a second set of averaged values (av&amp;lt;sub&amp;gt;100,1&amp;lt;/sub&amp;gt; + av&amp;lt;sub&amp;gt;100,2&amp;lt;/sub&amp;gt; + ... + av&amp;lt;sub&amp;gt;100,1000&amp;lt;/sub&amp;gt;)/1000 = av&amp;lt;sub&amp;gt;1000,1&amp;lt;/sub&amp;gt;. Finally, these values are averaged once more in blocks of 100000 values.&lt;br /&gt;
&lt;br /&gt;
The amount of time simulated can be found by multiplying the number of steps by the value of the timestep (eg. 100,000 steps of a 0.001 timestep simulates 100 seconds).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 15: Plot density as a function of temperature for both of the pressures that you simulated. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figure 2 in &amp;quot;Results and Discussion: Equations of State in the NpT Ensemble&amp;quot; for the plot and subsequent discussion.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Heat Capacity Calculation&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 16: (Run simulations at densities of 0.2, 0.8 and temperatures of 2.0, 2.2, 2.4, 2.6, 2.8.) Plots C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;/V as a function of temperature, where V is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Structural Properties and the Radial Distribution Function&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 17: Plot the RDFs for the three systems (liquid/solid/vapour) on the same axes. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Dynamical Properties and the Diffusion Coefficient&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 18: Make a plot for each of your simulations (solid/liquid/vapour), showing the mean squared displacement (&amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate D in each case. (Be careful with units!) Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 19: Evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (show working). On the same graph, with x range 0 to 500, plot C(tau) with omega = 1/2pi and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. Why is the harmonic oscillator VACF very different to the Lennard Jones solid and liquid? (Attach a copy of your plot)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_3.png|700px]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_2.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 20: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665516</id>
		<title>Rep:Gm1110LiquidSim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665516"/>
		<updated>2018-02-14T12:08:09Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: /* Diffusion Coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
The main aim of the experiment was to determine the diffusion coefficient for the solid, liquid and vapour phases of a Lennard-Jones fluid using both the mean squared displacement method and velocity autocorrelation function method.&lt;br /&gt;
&lt;br /&gt;
In order to achieve this, it was first necessary to determine an appropriate timestep with which to run simulations, and investigate the effect of temperature and pressure on the density of the system. Other aims included seeing how heat capacity varied as a function of temperature for different densities, and calculating the radial distribution function for the three phases from simulations using VMD.    &lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
All simulations of the Lennard-Jones fluid were run using the LAMMPS software, and all quantities used were in reduced units.&lt;br /&gt;
&lt;br /&gt;
=== Part 1: Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
A simulation box consisting of 10 x 10 x 10 unit cells of a simple cubic lattice with an atomic density of 0.8 was defined. The atomic mass was set to 1.0 and the Lennard-Jones pairwise interaction cutoff distance was set to 3.0. The pairwise forcefield coefficients ε (potential well depth) and σ (zero-potential distance) were both set to 1.0. Five simulations were run for differing timestep values (0.0010, 0.0025, 0.0075, 0.0100 and 0.0150).&lt;br /&gt;
&lt;br /&gt;
=== Part 2: Equations of State in the NpT Ensemble ===&lt;br /&gt;
The simulation box was increased to consist of 15 x 15 x 15 unit cells of the same simple cubic lattice defined in part 1. A total of ten simulations were run in the NpT ensemble, varying temperature (2.0, 4.0, 6.0, 8.0 and 10.0) at two different densities (1.8 and 2.8) using the timestep value of 0.0025 determined in Part 1.&lt;br /&gt;
&lt;br /&gt;
=== Part 3: Calculation of Heat Capacity ===&lt;br /&gt;
The simulation box from Part 2 was used, with the density altered to take the values 0.2 and 0.8. Five simulations were run for each, with varying values of temperature (2.0, 2.2, 2.4, 2.6 and 2.8). A copy of the script written for this simulation can be found by clicking the image below:&lt;br /&gt;
[[File:gm1110_LS_M_3_1.png|centre|thumb|Copy of Script]]&lt;br /&gt;
&lt;br /&gt;
=== Part 4: Radial Distribution Functions ===&lt;br /&gt;
The simulation boxes used previously were altered to take a timestep of 0.002 and a L-J cutoff distance of 3.2, after which the solid, liquid and vapour phases were defined as having (density, temperature) values of (1.2, 1.2), (0.8, 1.2) and (0.05, 1.1) respectively. In particular, the solid phase was defined as having a face-centred cubic lattice, instead of the simple cubic lattice used for the liquid and vapour phases. VMD was used to analyse the trajectories for the three phases, with the distance between points in the generated RDF set to 0.05.&lt;br /&gt;
&lt;br /&gt;
=== Part 5: Diffusion Coefficient ===&lt;br /&gt;
The results from Part 4 were used to graph the mean squared displacement as a function of time, after which the gradient of the linear portion of the graph was extracted and used to calculate the diffusion coefficient from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_M_5_1.png|centre|150px]]&lt;br /&gt;
&lt;br /&gt;
The procedure was then repeated using 1 million atoms.&lt;br /&gt;
&lt;br /&gt;
==Results and Discussion==&lt;br /&gt;
&lt;br /&gt;
=== Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
Simulations were run using the five different timesteps 0.0010, 0.0025, 0.0075, 0.0100 and 0.0150, and a plot of the results can be seen below (Figure 1).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_1_1.png|centre|thumb|Figure 1. A plot of total energy (reduced units) against time comparing simulations run using five different timestep values]]&lt;br /&gt;
&lt;br /&gt;
It was observed that the simulation run with a timestep of 0.0150 did not equilibrate. This was thought to have potentially been due to the timestep being too large, and therefore the simulation was missing too much detail to accurately simulate the fluid. The simulations run for timesteps of 0.0100 and 0.0075 did equilibrate (supporting the previous hypothesis that the 0.0150 timestep was too large), but converged at the wrong energy (approximately -3.181 and -3.183 respectively), indicating that the timesteps were still not quite small enough.&lt;br /&gt;
&lt;br /&gt;
The final two simulations run at timesteps of 0.0025 and 0.0010 both equilibrated to the same, correct energy (approximately -3.184), indicating that both would be suitable for use in further simulations. It is preferable, however, to maximise the timestep when running simulations as a smaller timestep requires more data points, and is therefore more “expensive” and takes longer to run for no real added value. Hence it was decided that a timestep of 0.0025 would be suitable for running further simulations.    &lt;br /&gt;
&lt;br /&gt;
=== Equations of State in the NpT Ensemble ===&lt;br /&gt;
Although specific values for temperature and pressure are specified for the simulations, in reality, the temperature and pressure of a system fluctuates over time and may therefore deviate away from the inputted values. Hence, the simulation calculates the pressure of the system at the end of every timestep, and adjusts the size of the simulation box such that the pressure once again corresponds to the specified value. Pressure controlled simulations are thus in the NpT ensemble and so volume (and therefore density) is not constant.&lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the resulting densities were plotted against temperature, along with values predicted by the ideal gas law and can be seen below (Figure 2).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_2_1.png|centre|thumb|Figure 2. Plot showing density as a function of temperature at pressures of 1.8 and 2.8 (all in reduced units), with error bars, and a plot of the densities predicted by the ideal gas law]]&lt;br /&gt;
&lt;br /&gt;
Clearly, the simulated densities are lower than those predicted by the ideal gas law, and the discrepancy increases with increasing pressure. This is due to the fact that the ideal gas law assumes perfectly elastic collisions between point particles, but in reality, intermolecular repulsive forces cause the simulated densities to be lower. In addition, an increase in pressure causes the molecules to be pushed closer together and increases both the number of collisions as well as the repulsive forces, leading to a greater deviation from ideality.    &lt;br /&gt;
&lt;br /&gt;
=== Calculation of Heat Capacity ===&lt;br /&gt;
Switching to the NVT ensemble, the heat capacity of the system can be determined by considering the magnitude of fluctuations in the system’s energy from its average equilibrium state from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_1.png|centre|250px]]            &lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the average heat capacities were plotted as a function of temperature (Figure 3).        &lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_2.png|centre|thumb|Figure 3. Plot of average heat capacity against temperature for densities of 0.8 and 0.2]]Heat capacity is a measure of the amount of energy required to increase the temperature of a substance. It is clear that the heat capacity is lower, and therefore easier to heat, for lower density systems as the particles are more spaced apart. This means that they are able to gain thermal energy more easily as they have more room for increased vibrations without an increase of repulsive forces or collisions compared to a higher density system. It was also noted that the heat capacity decreased with increasing temperature. This is due to the fact that at higher temperatures, the gap between energy levels decreases as the particles occupy higher energy states, thus making it easier for the particles to be promoted to higher energy levels.&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Functions ===&lt;br /&gt;
Radial distribution functions (g(r)) were calculated for the solid, liquid and vapour phases (see Figure 4) to check that the simulations were correctly reproducing the structural features of each phase. RDFs are essentially probability distribution functions for the likelihood of finding a particle at a given distance r away from a reference particle, and also gives information on the coordination sphere of the reference particle. The integral of the RDF (Figure 5) is also useful as it gives information on the number of atoms found at a distance r.&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_1.png|centre|thumb|Figure 4. Radial distribution function against displacement from a reference atom]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_2.png|centre|thumb|Figure 5. Integral of the radial distribution function against displacement]]&lt;br /&gt;
&lt;br /&gt;
For small r, all three phases have g(r) ~ 0, indicating an atomic density of zero as there exists a minimum distance at which atoms can approach each other. Also, g(r) tends to 1 for all three phases with increasing r, which represents the fact that the local density becomes equivalent to the mean density of the system as a whole.&lt;br /&gt;
&lt;br /&gt;
The graph of the solid phase shows sharp oscillating peaks, indicating that the atoms are strongly confined to their positions in the crystalline lattice, and the high degree of ordering means that although the osciallations do tend to g(r) = 1 for large r, this occurs much more slowly than for the other two phases. The first peak corresponds to the atoms nearest neighbours (of which there are 12), and the second and third peak correspond to the second and third nearest neighbours respectively (of which there are 6 and 24). &lt;br /&gt;
&lt;br /&gt;
The graph for the liquid phase shows broad, gently oscillating peaks that rapidly decay to g(r) = 1. As with the solid phase, the oscillations indicate some structure in the system whereby the atoms are loosely bound to their original positions, but the broader peaks indicate that they have much more freedom to move away from their positions. &lt;br /&gt;
&lt;br /&gt;
The graph for the vapour phase shows a single peak at approximately r = 1, after which it quickly decays back to g(r) = 1. This shows that the structure has very little to no order, and the particles are free to move unbound to any specific position. &lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|MSD Graphs&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_1.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_2.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_3.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Solid MSD&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Fluid MSD&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Vapour MSD&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|MSD Graphs (1 million atoms)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_4.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_5.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_6.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Solid MSD&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Fluid MSD&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Vapour MSD&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
==Tasks==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Introduction to Molecular Dynamics Simulations&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 1. For a default timestep value 0.1, estimate the positions of the maxima in the ERROR column as a function of time.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_1_1.png|centre|thumb|Figure X. Plot showing the positions of the error maxima as a function of time, with a best fit line]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 2. (Experiment with different values of the timestep.) What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using a timestep of 0.1990 meant that the total energy did not change by more than 1% over the course of the simulation (Figure X).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_2_1.png|centre|thumb|Figure X. Plot showing the total energy during the simulation using a timestep of 0.1990]]&lt;br /&gt;
&lt;br /&gt;
The simulations are being run in isolated systems which requires total energy conservation, so large fluctuations in the energy would lead to inaccurate results. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 3. For a single Lennard-Jones interaction, find the separation, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;, and work out the well depth. Evaluate the integrals when σ = ε = 1.0.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i) The Lennard-Jones interaction is given by:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_1.png|200px]]&lt;br /&gt;
&lt;br /&gt;
Since r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; when ɸ = 0,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(ii) The force is given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_3.png|250px]]&lt;br /&gt;
&lt;br /&gt;
So at the separation r&amp;lt;sub&amp;gt;0 &amp;lt;/sub&amp;gt;= σ,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_4.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iii) The equilibrium separation r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs at the point at which all forces vanish, ie. when F = 0, so&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_5.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iv) And the well depth is therefore given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_6.png|270px]]&lt;br /&gt;
&lt;br /&gt;
(v)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_7.png|370px]]&lt;br /&gt;
&lt;br /&gt;
(vi)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_8.png|400px]]&lt;br /&gt;
&lt;br /&gt;
(vii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_9.png|370px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4. Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10,000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_1.png|550px]]&lt;br /&gt;
&lt;br /&gt;
For 10,000 water molecules,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_3.png|230px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 5. Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After the timestep, the atom would be at position (0.5 + 0.7, 0.5 + 0.6, 0.5 + 0.2) = (1.2, 1.1, 0.7). Applying the boundary conditions, this is equivalent to the position (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 6. The Lennard-Jones parameters for argon are sigma = 0.34nm, ε/k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt; = 120K. If the LJ cutoff is r&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 1.5 in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_1.png|140px]]&lt;br /&gt;
&lt;br /&gt;
(ii) It was previously determined in Task 1 that the well depth is - ε, so in real units,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_4.png|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(iii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_3.png|130px]]&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Equilibration&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 7. Why do you think giving atoms random starting coordinates causes problems in simulations?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If two atoms are generated too close to one another, then they would experience a large repulsive force, and would disrupt the behaviour of the surrounding atoms, causing the simulation to become inaccurate. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 8. Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_1.png|380px]]&lt;br /&gt;
&lt;br /&gt;
(ii) For a face-centred cubic lattice, note that the unit cell contains four atoms, as opposed to one atom with a simple cubic lattice. Then&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_4.png|460px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 9. Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is 1 atom contained within each unit cell. However for face-centred cubic lattices, each unit cell contains 4 atoms so four times as many atoms are created than with the simple lattice (ie. 4000 atoms).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 10. Given that we are specifying x&amp;lt;sub&amp;gt;i &amp;lt;/sub&amp;gt;(0) and v&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; (0), which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We will be using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 11. In the code section &amp;quot;Specify Timestep&amp;quot;, the second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write &amp;quot;timestep 0.001 // run 100000&amp;quot;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Defining the variable timestep allows us to reference the variable multiple times throughout the simulation if required, whilst preventing errors and making it easier to alter the code if we want to run the simulation for different timestep values. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 12. Make plots of energy, temperature, and pressure, against time for the 0.001 timestep experiment. Does the simulation reach equilibrium? How long does this take? Make a single plot of energy vs time for all of the timesteps. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice and why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_12_1.png|centre|thumb|Figure X. Plot of energy against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_2.png|centre|thumb|Figure X. Plot of temperature against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_3.png|centre|thumb|Figure X. Plot of pressure against time for the 0.001 timestep experiment]]&lt;br /&gt;
&lt;br /&gt;
The 0.001 timestep experiment reaches equilibrium very quickly, within approximately 0.2s. &lt;br /&gt;
&lt;br /&gt;
A single plot of energy vs time for all of the timesteps can be found in &amp;quot;Results &amp;amp; Discussion: Investigation into Simulation Timestep in the NVE Ensemble Figure 1&amp;quot;, along with a detailed analysis, but in brief: the largest acceptable timestep is 0.0025, and a particularly bad choice would be 0.015 as it does not reach equilibrium.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Running Simulations under Specific Conditions&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 13. We need to choose gamma so that the temperature is correct T=fancy T if we multiply every velocity by γ. Solve the following two equations to determine gamma:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_2.png|center|200px]]&lt;br /&gt;
&lt;br /&gt;
Starting from the 2&amp;lt;sup&amp;gt;nd&amp;lt;/sup&amp;gt; equation,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_1.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 14: (Use the manual to find out the importance of the three numbers 100 1000 100000.) 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 (&amp;quot;run 100000&amp;quot;), how much time will you simulate? (DOUBLE CHECK THIS PART WITH OLLIE!)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Firstly, averages are taken for blocks of 100 values at a time to form the first set of averaged values (where av&amp;lt;sub&amp;gt;100,n&amp;lt;/sub&amp;gt; is the average value for the n&amp;lt;sup&amp;gt;th&amp;lt;/sup&amp;gt; block of 100 values). These values are then themselves averaged in blocks of 1000 values to form a second set of averaged values (av&amp;lt;sub&amp;gt;100,1&amp;lt;/sub&amp;gt; + av&amp;lt;sub&amp;gt;100,2&amp;lt;/sub&amp;gt; + ... + av&amp;lt;sub&amp;gt;100,1000&amp;lt;/sub&amp;gt;)/1000 = av&amp;lt;sub&amp;gt;1000,1&amp;lt;/sub&amp;gt;. Finally, these values are averaged once more in blocks of 100000 values.&lt;br /&gt;
&lt;br /&gt;
The amount of time simulated can be found by multiplying the number of steps by the value of the timestep (eg. 100,000 steps of a 0.001 timestep simulates 100 seconds).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 15: Plot density as a function of temperature for both of the pressures that you simulated. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figure 2 in &amp;quot;Results and Discussion: Equations of State in the NpT Ensemble&amp;quot; for the plot and subsequent discussion.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Heat Capacity Calculation&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 16: (Run simulations at densities of 0.2, 0.8 and temperatures of 2.0, 2.2, 2.4, 2.6, 2.8.) Plots C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;/V as a function of temperature, where V is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Structural Properties and the Radial Distribution Function&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 17: Plot the RDFs for the three systems (liquid/solid/vapour) on the same axes. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Dynamical Properties and the Diffusion Coefficient&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 18: Make a plot for each of your simulations (solid/liquid/vapour), showing the mean squared displacement (&amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate D in each case. (Be careful with units!) Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 19: Evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (show working). On the same graph, with x range 0 to 500, plot C(tau) with omega = 1/2pi and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. Why is the harmonic oscillator VACF very different to the Lennard Jones solid and liquid? (Attach a copy of your plot)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_3.png|700px]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_2.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 20: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gm1110_LS_R_D_5_6.png&amp;diff=665515</id>
		<title>File:Gm1110 LS R D 5 6.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gm1110_LS_R_D_5_6.png&amp;diff=665515"/>
		<updated>2018-02-14T12:07:08Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gm1110_LS_R_D_5_5.png&amp;diff=665514</id>
		<title>File:Gm1110 LS R D 5 5.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gm1110_LS_R_D_5_5.png&amp;diff=665514"/>
		<updated>2018-02-14T12:06:48Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gm1110_LS_R_D_5_4.png&amp;diff=665513</id>
		<title>File:Gm1110 LS R D 5 4.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gm1110_LS_R_D_5_4.png&amp;diff=665513"/>
		<updated>2018-02-14T12:06:27Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665503</id>
		<title>Rep:Gm1110LiquidSim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665503"/>
		<updated>2018-02-14T11:54:21Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: /* Diffusion Coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
The main aim of the experiment was to determine the diffusion coefficient for the solid, liquid and vapour phases of a Lennard-Jones fluid using both the mean squared displacement method and velocity autocorrelation function method.&lt;br /&gt;
&lt;br /&gt;
In order to achieve this, it was first necessary to determine an appropriate timestep with which to run simulations, and investigate the effect of temperature and pressure on the density of the system. Other aims included seeing how heat capacity varied as a function of temperature for different densities, and calculating the radial distribution function for the three phases from simulations using VMD.    &lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
All simulations of the Lennard-Jones fluid were run using the LAMMPS software, and all quantities used were in reduced units.&lt;br /&gt;
&lt;br /&gt;
=== Part 1: Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
A simulation box consisting of 10 x 10 x 10 unit cells of a simple cubic lattice with an atomic density of 0.8 was defined. The atomic mass was set to 1.0 and the Lennard-Jones pairwise interaction cutoff distance was set to 3.0. The pairwise forcefield coefficients ε (potential well depth) and σ (zero-potential distance) were both set to 1.0. Five simulations were run for differing timestep values (0.0010, 0.0025, 0.0075, 0.0100 and 0.0150).&lt;br /&gt;
&lt;br /&gt;
=== Part 2: Equations of State in the NpT Ensemble ===&lt;br /&gt;
The simulation box was increased to consist of 15 x 15 x 15 unit cells of the same simple cubic lattice defined in part 1. A total of ten simulations were run in the NpT ensemble, varying temperature (2.0, 4.0, 6.0, 8.0 and 10.0) at two different densities (1.8 and 2.8) using the timestep value of 0.0025 determined in Part 1.&lt;br /&gt;
&lt;br /&gt;
=== Part 3: Calculation of Heat Capacity ===&lt;br /&gt;
The simulation box from Part 2 was used, with the density altered to take the values 0.2 and 0.8. Five simulations were run for each, with varying values of temperature (2.0, 2.2, 2.4, 2.6 and 2.8). A copy of the script written for this simulation can be found by clicking the image below:&lt;br /&gt;
[[File:gm1110_LS_M_3_1.png|centre|thumb|Copy of Script]]&lt;br /&gt;
&lt;br /&gt;
=== Part 4: Radial Distribution Functions ===&lt;br /&gt;
The simulation boxes used previously were altered to take a timestep of 0.002 and a L-J cutoff distance of 3.2, after which the solid, liquid and vapour phases were defined as having (density, temperature) values of (1.2, 1.2), (0.8, 1.2) and (0.05, 1.1) respectively. In particular, the solid phase was defined as having a face-centred cubic lattice, instead of the simple cubic lattice used for the liquid and vapour phases. VMD was used to analyse the trajectories for the three phases, with the distance between points in the generated RDF set to 0.05.&lt;br /&gt;
&lt;br /&gt;
=== Part 5: Diffusion Coefficient ===&lt;br /&gt;
The results from Part 4 were used to graph the mean squared displacement as a function of time, after which the gradient of the linear portion of the graph was extracted and used to calculate the diffusion coefficient from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_M_5_1.png|centre|150px]]&lt;br /&gt;
&lt;br /&gt;
The procedure was then repeated using 1 million atoms.&lt;br /&gt;
&lt;br /&gt;
==Results and Discussion==&lt;br /&gt;
&lt;br /&gt;
=== Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
Simulations were run using the five different timesteps 0.0010, 0.0025, 0.0075, 0.0100 and 0.0150, and a plot of the results can be seen below (Figure 1).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_1_1.png|centre|thumb|Figure 1. A plot of total energy (reduced units) against time comparing simulations run using five different timestep values]]&lt;br /&gt;
&lt;br /&gt;
It was observed that the simulation run with a timestep of 0.0150 did not equilibrate. This was thought to have potentially been due to the timestep being too large, and therefore the simulation was missing too much detail to accurately simulate the fluid. The simulations run for timesteps of 0.0100 and 0.0075 did equilibrate (supporting the previous hypothesis that the 0.0150 timestep was too large), but converged at the wrong energy (approximately -3.181 and -3.183 respectively), indicating that the timesteps were still not quite small enough.&lt;br /&gt;
&lt;br /&gt;
The final two simulations run at timesteps of 0.0025 and 0.0010 both equilibrated to the same, correct energy (approximately -3.184), indicating that both would be suitable for use in further simulations. It is preferable, however, to maximise the timestep when running simulations as a smaller timestep requires more data points, and is therefore more “expensive” and takes longer to run for no real added value. Hence it was decided that a timestep of 0.0025 would be suitable for running further simulations.    &lt;br /&gt;
&lt;br /&gt;
=== Equations of State in the NpT Ensemble ===&lt;br /&gt;
Although specific values for temperature and pressure are specified for the simulations, in reality, the temperature and pressure of a system fluctuates over time and may therefore deviate away from the inputted values. Hence, the simulation calculates the pressure of the system at the end of every timestep, and adjusts the size of the simulation box such that the pressure once again corresponds to the specified value. Pressure controlled simulations are thus in the NpT ensemble and so volume (and therefore density) is not constant.&lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the resulting densities were plotted against temperature, along with values predicted by the ideal gas law and can be seen below (Figure 2).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_2_1.png|centre|thumb|Figure 2. Plot showing density as a function of temperature at pressures of 1.8 and 2.8 (all in reduced units), with error bars, and a plot of the densities predicted by the ideal gas law]]&lt;br /&gt;
&lt;br /&gt;
Clearly, the simulated densities are lower than those predicted by the ideal gas law, and the discrepancy increases with increasing pressure. This is due to the fact that the ideal gas law assumes perfectly elastic collisions between point particles, but in reality, intermolecular repulsive forces cause the simulated densities to be lower. In addition, an increase in pressure causes the molecules to be pushed closer together and increases both the number of collisions as well as the repulsive forces, leading to a greater deviation from ideality.    &lt;br /&gt;
&lt;br /&gt;
=== Calculation of Heat Capacity ===&lt;br /&gt;
Switching to the NVT ensemble, the heat capacity of the system can be determined by considering the magnitude of fluctuations in the system’s energy from its average equilibrium state from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_1.png|centre|250px]]            &lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the average heat capacities were plotted as a function of temperature (Figure 3).        &lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_2.png|centre|thumb|Figure 3. Plot of average heat capacity against temperature for densities of 0.8 and 0.2]]Heat capacity is a measure of the amount of energy required to increase the temperature of a substance. It is clear that the heat capacity is lower, and therefore easier to heat, for lower density systems as the particles are more spaced apart. This means that they are able to gain thermal energy more easily as they have more room for increased vibrations without an increase of repulsive forces or collisions compared to a higher density system. It was also noted that the heat capacity decreased with increasing temperature. This is due to the fact that at higher temperatures, the gap between energy levels decreases as the particles occupy higher energy states, thus making it easier for the particles to be promoted to higher energy levels.&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Functions ===&lt;br /&gt;
Radial distribution functions (g(r)) were calculated for the solid, liquid and vapour phases (see Figure 4) to check that the simulations were correctly reproducing the structural features of each phase. RDFs are essentially probability distribution functions for the likelihood of finding a particle at a given distance r away from a reference particle, and also gives information on the coordination sphere of the reference particle. The integral of the RDF (Figure 5) is also useful as it gives information on the number of atoms found at a distance r.&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_1.png|centre|thumb|Figure 4. Radial distribution function against displacement from a reference atom]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_2.png|centre|thumb|Figure 5. Integral of the radial distribution function against displacement]]&lt;br /&gt;
&lt;br /&gt;
For small r, all three phases have g(r) ~ 0, indicating an atomic density of zero as there exists a minimum distance at which atoms can approach each other. Also, g(r) tends to 1 for all three phases with increasing r, which represents the fact that the local density becomes equivalent to the mean density of the system as a whole.&lt;br /&gt;
&lt;br /&gt;
The graph of the solid phase shows sharp oscillating peaks, indicating that the atoms are strongly confined to their positions in the crystalline lattice, and the high degree of ordering means that although the osciallations do tend to g(r) = 1 for large r, this occurs much more slowly than for the other two phases. The first peak corresponds to the atoms nearest neighbours (of which there are 12), and the second and third peak correspond to the second and third nearest neighbours respectively (of which there are 6 and 24). &lt;br /&gt;
&lt;br /&gt;
The graph for the liquid phase shows broad, gently oscillating peaks that rapidly decay to g(r) = 1. As with the solid phase, the oscillations indicate some structure in the system whereby the atoms are loosely bound to their original positions, but the broader peaks indicate that they have much more freedom to move away from their positions. &lt;br /&gt;
&lt;br /&gt;
The graph for the vapour phase shows a single peak at approximately r = 1, after which it quickly decays back to g(r) = 1. This shows that the structure has very little to no order, and the particles are free to move unbound to any specific position. &lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=100%&lt;br /&gt;
!colspan=3|MSD Graphs&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_1.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_2.png|450px]]&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;[[File:gm1110_LS_R_D_5_3.png|450px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Solid MSD&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Fluid MSD&amp;lt;/center&amp;gt;||&amp;lt;center&amp;gt;Vapour MSD&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
==Tasks==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Introduction to Molecular Dynamics Simulations&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 1. For a default timestep value 0.1, estimate the positions of the maxima in the ERROR column as a function of time.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_1_1.png|centre|thumb|Figure X. Plot showing the positions of the error maxima as a function of time, with a best fit line]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 2. (Experiment with different values of the timestep.) What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using a timestep of 0.1990 meant that the total energy did not change by more than 1% over the course of the simulation (Figure X).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_2_1.png|centre|thumb|Figure X. Plot showing the total energy during the simulation using a timestep of 0.1990]]&lt;br /&gt;
&lt;br /&gt;
The simulations are being run in isolated systems which requires total energy conservation, so large fluctuations in the energy would lead to inaccurate results. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 3. For a single Lennard-Jones interaction, find the separation, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;, and work out the well depth. Evaluate the integrals when σ = ε = 1.0.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i) The Lennard-Jones interaction is given by:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_1.png|200px]]&lt;br /&gt;
&lt;br /&gt;
Since r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; when ɸ = 0,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(ii) The force is given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_3.png|250px]]&lt;br /&gt;
&lt;br /&gt;
So at the separation r&amp;lt;sub&amp;gt;0 &amp;lt;/sub&amp;gt;= σ,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_4.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iii) The equilibrium separation r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs at the point at which all forces vanish, ie. when F = 0, so&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_5.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iv) And the well depth is therefore given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_6.png|270px]]&lt;br /&gt;
&lt;br /&gt;
(v)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_7.png|370px]]&lt;br /&gt;
&lt;br /&gt;
(vi)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_8.png|400px]]&lt;br /&gt;
&lt;br /&gt;
(vii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_9.png|370px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4. Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10,000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_1.png|550px]]&lt;br /&gt;
&lt;br /&gt;
For 10,000 water molecules,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_3.png|230px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 5. Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After the timestep, the atom would be at position (0.5 + 0.7, 0.5 + 0.6, 0.5 + 0.2) = (1.2, 1.1, 0.7). Applying the boundary conditions, this is equivalent to the position (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 6. The Lennard-Jones parameters for argon are sigma = 0.34nm, ε/k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt; = 120K. If the LJ cutoff is r&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 1.5 in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_1.png|140px]]&lt;br /&gt;
&lt;br /&gt;
(ii) It was previously determined in Task 1 that the well depth is - ε, so in real units,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_4.png|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(iii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_3.png|130px]]&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Equilibration&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 7. Why do you think giving atoms random starting coordinates causes problems in simulations?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If two atoms are generated too close to one another, then they would experience a large repulsive force, and would disrupt the behaviour of the surrounding atoms, causing the simulation to become inaccurate. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 8. Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_1.png|380px]]&lt;br /&gt;
&lt;br /&gt;
(ii) For a face-centred cubic lattice, note that the unit cell contains four atoms, as opposed to one atom with a simple cubic lattice. Then&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_4.png|460px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 9. Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is 1 atom contained within each unit cell. However for face-centred cubic lattices, each unit cell contains 4 atoms so four times as many atoms are created than with the simple lattice (ie. 4000 atoms).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 10. Given that we are specifying x&amp;lt;sub&amp;gt;i &amp;lt;/sub&amp;gt;(0) and v&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; (0), which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We will be using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 11. In the code section &amp;quot;Specify Timestep&amp;quot;, the second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write &amp;quot;timestep 0.001 // run 100000&amp;quot;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Defining the variable timestep allows us to reference the variable multiple times throughout the simulation if required, whilst preventing errors and making it easier to alter the code if we want to run the simulation for different timestep values. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 12. Make plots of energy, temperature, and pressure, against time for the 0.001 timestep experiment. Does the simulation reach equilibrium? How long does this take? Make a single plot of energy vs time for all of the timesteps. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice and why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_12_1.png|centre|thumb|Figure X. Plot of energy against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_2.png|centre|thumb|Figure X. Plot of temperature against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_3.png|centre|thumb|Figure X. Plot of pressure against time for the 0.001 timestep experiment]]&lt;br /&gt;
&lt;br /&gt;
The 0.001 timestep experiment reaches equilibrium very quickly, within approximately 0.2s. &lt;br /&gt;
&lt;br /&gt;
A single plot of energy vs time for all of the timesteps can be found in &amp;quot;Results &amp;amp; Discussion: Investigation into Simulation Timestep in the NVE Ensemble Figure 1&amp;quot;, along with a detailed analysis, but in brief: the largest acceptable timestep is 0.0025, and a particularly bad choice would be 0.015 as it does not reach equilibrium.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Running Simulations under Specific Conditions&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 13. We need to choose gamma so that the temperature is correct T=fancy T if we multiply every velocity by γ. Solve the following two equations to determine gamma:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_2.png|center|200px]]&lt;br /&gt;
&lt;br /&gt;
Starting from the 2&amp;lt;sup&amp;gt;nd&amp;lt;/sup&amp;gt; equation,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_1.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 14: (Use the manual to find out the importance of the three numbers 100 1000 100000.) 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 (&amp;quot;run 100000&amp;quot;), how much time will you simulate? (DOUBLE CHECK THIS PART WITH OLLIE!)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Firstly, averages are taken for blocks of 100 values at a time to form the first set of averaged values (where av&amp;lt;sub&amp;gt;100,n&amp;lt;/sub&amp;gt; is the average value for the n&amp;lt;sup&amp;gt;th&amp;lt;/sup&amp;gt; block of 100 values). These values are then themselves averaged in blocks of 1000 values to form a second set of averaged values (av&amp;lt;sub&amp;gt;100,1&amp;lt;/sub&amp;gt; + av&amp;lt;sub&amp;gt;100,2&amp;lt;/sub&amp;gt; + ... + av&amp;lt;sub&amp;gt;100,1000&amp;lt;/sub&amp;gt;)/1000 = av&amp;lt;sub&amp;gt;1000,1&amp;lt;/sub&amp;gt;. Finally, these values are averaged once more in blocks of 100000 values.&lt;br /&gt;
&lt;br /&gt;
The amount of time simulated can be found by multiplying the number of steps by the value of the timestep (eg. 100,000 steps of a 0.001 timestep simulates 100 seconds).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 15: Plot density as a function of temperature for both of the pressures that you simulated. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figure 2 in &amp;quot;Results and Discussion: Equations of State in the NpT Ensemble&amp;quot; for the plot and subsequent discussion.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Heat Capacity Calculation&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 16: (Run simulations at densities of 0.2, 0.8 and temperatures of 2.0, 2.2, 2.4, 2.6, 2.8.) Plots C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;/V as a function of temperature, where V is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Structural Properties and the Radial Distribution Function&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 17: Plot the RDFs for the three systems (liquid/solid/vapour) on the same axes. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Dynamical Properties and the Diffusion Coefficient&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 18: Make a plot for each of your simulations (solid/liquid/vapour), showing the mean squared displacement (&amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate D in each case. (Be careful with units!) Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 19: Evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (show working). On the same graph, with x range 0 to 500, plot C(tau) with omega = 1/2pi and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. Why is the harmonic oscillator VACF very different to the Lennard Jones solid and liquid? (Attach a copy of your plot)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_3.png|700px]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_2.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 20: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gm1110_LS_R_D_5_3.png&amp;diff=665495</id>
		<title>File:Gm1110 LS R D 5 3.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gm1110_LS_R_D_5_3.png&amp;diff=665495"/>
		<updated>2018-02-14T11:47:38Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gm1110_LS_R_D_5_2.png&amp;diff=665493</id>
		<title>File:Gm1110 LS R D 5 2.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gm1110_LS_R_D_5_2.png&amp;diff=665493"/>
		<updated>2018-02-14T11:47:18Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gm1110_LS_R_D_5_1.png&amp;diff=665491</id>
		<title>File:Gm1110 LS R D 5 1.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gm1110_LS_R_D_5_1.png&amp;diff=665491"/>
		<updated>2018-02-14T11:46:47Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665482</id>
		<title>Rep:Gm1110LiquidSim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665482"/>
		<updated>2018-02-14T11:40:59Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: /* Radial Distribution Functions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
The main aim of the experiment was to determine the diffusion coefficient for the solid, liquid and vapour phases of a Lennard-Jones fluid using both the mean squared displacement method and velocity autocorrelation function method.&lt;br /&gt;
&lt;br /&gt;
In order to achieve this, it was first necessary to determine an appropriate timestep with which to run simulations, and investigate the effect of temperature and pressure on the density of the system. Other aims included seeing how heat capacity varied as a function of temperature for different densities, and calculating the radial distribution function for the three phases from simulations using VMD.    &lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
All simulations of the Lennard-Jones fluid were run using the LAMMPS software, and all quantities used were in reduced units.&lt;br /&gt;
&lt;br /&gt;
=== Part 1: Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
A simulation box consisting of 10 x 10 x 10 unit cells of a simple cubic lattice with an atomic density of 0.8 was defined. The atomic mass was set to 1.0 and the Lennard-Jones pairwise interaction cutoff distance was set to 3.0. The pairwise forcefield coefficients ε (potential well depth) and σ (zero-potential distance) were both set to 1.0. Five simulations were run for differing timestep values (0.0010, 0.0025, 0.0075, 0.0100 and 0.0150).&lt;br /&gt;
&lt;br /&gt;
=== Part 2: Equations of State in the NpT Ensemble ===&lt;br /&gt;
The simulation box was increased to consist of 15 x 15 x 15 unit cells of the same simple cubic lattice defined in part 1. A total of ten simulations were run in the NpT ensemble, varying temperature (2.0, 4.0, 6.0, 8.0 and 10.0) at two different densities (1.8 and 2.8) using the timestep value of 0.0025 determined in Part 1.&lt;br /&gt;
&lt;br /&gt;
=== Part 3: Calculation of Heat Capacity ===&lt;br /&gt;
The simulation box from Part 2 was used, with the density altered to take the values 0.2 and 0.8. Five simulations were run for each, with varying values of temperature (2.0, 2.2, 2.4, 2.6 and 2.8). A copy of the script written for this simulation can be found by clicking the image below:&lt;br /&gt;
[[File:gm1110_LS_M_3_1.png|centre|thumb|Copy of Script]]&lt;br /&gt;
&lt;br /&gt;
=== Part 4: Radial Distribution Functions ===&lt;br /&gt;
The simulation boxes used previously were altered to take a timestep of 0.002 and a L-J cutoff distance of 3.2, after which the solid, liquid and vapour phases were defined as having (density, temperature) values of (1.2, 1.2), (0.8, 1.2) and (0.05, 1.1) respectively. In particular, the solid phase was defined as having a face-centred cubic lattice, instead of the simple cubic lattice used for the liquid and vapour phases. VMD was used to analyse the trajectories for the three phases, with the distance between points in the generated RDF set to 0.05.&lt;br /&gt;
&lt;br /&gt;
=== Part 5: Diffusion Coefficient ===&lt;br /&gt;
The results from Part 4 were used to graph the mean squared displacement as a function of time, after which the gradient of the linear portion of the graph was extracted and used to calculate the diffusion coefficient from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_M_5_1.png|centre|150px]]&lt;br /&gt;
&lt;br /&gt;
The procedure was then repeated using 1 million atoms.&lt;br /&gt;
&lt;br /&gt;
==Results and Discussion==&lt;br /&gt;
&lt;br /&gt;
=== Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
Simulations were run using the five different timesteps 0.0010, 0.0025, 0.0075, 0.0100 and 0.0150, and a plot of the results can be seen below (Figure 1).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_1_1.png|centre|thumb|Figure 1. A plot of total energy (reduced units) against time comparing simulations run using five different timestep values]]&lt;br /&gt;
&lt;br /&gt;
It was observed that the simulation run with a timestep of 0.0150 did not equilibrate. This was thought to have potentially been due to the timestep being too large, and therefore the simulation was missing too much detail to accurately simulate the fluid. The simulations run for timesteps of 0.0100 and 0.0075 did equilibrate (supporting the previous hypothesis that the 0.0150 timestep was too large), but converged at the wrong energy (approximately -3.181 and -3.183 respectively), indicating that the timesteps were still not quite small enough.&lt;br /&gt;
&lt;br /&gt;
The final two simulations run at timesteps of 0.0025 and 0.0010 both equilibrated to the same, correct energy (approximately -3.184), indicating that both would be suitable for use in further simulations. It is preferable, however, to maximise the timestep when running simulations as a smaller timestep requires more data points, and is therefore more “expensive” and takes longer to run for no real added value. Hence it was decided that a timestep of 0.0025 would be suitable for running further simulations.    &lt;br /&gt;
&lt;br /&gt;
=== Equations of State in the NpT Ensemble ===&lt;br /&gt;
Although specific values for temperature and pressure are specified for the simulations, in reality, the temperature and pressure of a system fluctuates over time and may therefore deviate away from the inputted values. Hence, the simulation calculates the pressure of the system at the end of every timestep, and adjusts the size of the simulation box such that the pressure once again corresponds to the specified value. Pressure controlled simulations are thus in the NpT ensemble and so volume (and therefore density) is not constant.&lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the resulting densities were plotted against temperature, along with values predicted by the ideal gas law and can be seen below (Figure 2).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_2_1.png|centre|thumb|Figure 2. Plot showing density as a function of temperature at pressures of 1.8 and 2.8 (all in reduced units), with error bars, and a plot of the densities predicted by the ideal gas law]]&lt;br /&gt;
&lt;br /&gt;
Clearly, the simulated densities are lower than those predicted by the ideal gas law, and the discrepancy increases with increasing pressure. This is due to the fact that the ideal gas law assumes perfectly elastic collisions between point particles, but in reality, intermolecular repulsive forces cause the simulated densities to be lower. In addition, an increase in pressure causes the molecules to be pushed closer together and increases both the number of collisions as well as the repulsive forces, leading to a greater deviation from ideality.    &lt;br /&gt;
&lt;br /&gt;
=== Calculation of Heat Capacity ===&lt;br /&gt;
Switching to the NVT ensemble, the heat capacity of the system can be determined by considering the magnitude of fluctuations in the system’s energy from its average equilibrium state from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_1.png|centre|250px]]            &lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the average heat capacities were plotted as a function of temperature (Figure 3).        &lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_2.png|centre|thumb|Figure 3. Plot of average heat capacity against temperature for densities of 0.8 and 0.2]]Heat capacity is a measure of the amount of energy required to increase the temperature of a substance. It is clear that the heat capacity is lower, and therefore easier to heat, for lower density systems as the particles are more spaced apart. This means that they are able to gain thermal energy more easily as they have more room for increased vibrations without an increase of repulsive forces or collisions compared to a higher density system. It was also noted that the heat capacity decreased with increasing temperature. This is due to the fact that at higher temperatures, the gap between energy levels decreases as the particles occupy higher energy states, thus making it easier for the particles to be promoted to higher energy levels.&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Functions ===&lt;br /&gt;
Radial distribution functions (g(r)) were calculated for the solid, liquid and vapour phases (see Figure 4) to check that the simulations were correctly reproducing the structural features of each phase. RDFs are essentially probability distribution functions for the likelihood of finding a particle at a given distance r away from a reference particle, and also gives information on the coordination sphere of the reference particle. The integral of the RDF (Figure 5) is also useful as it gives information on the number of atoms found at a distance r.&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_1.png|centre|thumb|Figure 4. Radial distribution function against displacement from a reference atom]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_2.png|centre|thumb|Figure 5. Integral of the radial distribution function against displacement]]&lt;br /&gt;
&lt;br /&gt;
For small r, all three phases have g(r) ~ 0, indicating an atomic density of zero as there exists a minimum distance at which atoms can approach each other. Also, g(r) tends to 1 for all three phases with increasing r, which represents the fact that the local density becomes equivalent to the mean density of the system as a whole.&lt;br /&gt;
&lt;br /&gt;
The graph of the solid phase shows sharp oscillating peaks, indicating that the atoms are strongly confined to their positions in the crystalline lattice, and the high degree of ordering means that although the osciallations do tend to g(r) = 1 for large r, this occurs much more slowly than for the other two phases. The first peak corresponds to the atoms nearest neighbours (of which there are 12), and the second and third peak correspond to the second and third nearest neighbours respectively (of which there are 6 and 24). &lt;br /&gt;
&lt;br /&gt;
The graph for the liquid phase shows broad, gently oscillating peaks that rapidly decay to g(r) = 1. As with the solid phase, the oscillations indicate some structure in the system whereby the atoms are loosely bound to their original positions, but the broader peaks indicate that they have much more freedom to move away from their positions. &lt;br /&gt;
&lt;br /&gt;
The graph for the vapour phase shows a single peak at approximately r = 1, after which it quickly decays back to g(r) = 1. This shows that the structure has very little to no order, and the particles are free to move unbound to any specific position. &lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
==Tasks==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Introduction to Molecular Dynamics Simulations&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 1. For a default timestep value 0.1, estimate the positions of the maxima in the ERROR column as a function of time.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_1_1.png|centre|thumb|Figure X. Plot showing the positions of the error maxima as a function of time, with a best fit line]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 2. (Experiment with different values of the timestep.) What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using a timestep of 0.1990 meant that the total energy did not change by more than 1% over the course of the simulation (Figure X).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_2_1.png|centre|thumb|Figure X. Plot showing the total energy during the simulation using a timestep of 0.1990]]&lt;br /&gt;
&lt;br /&gt;
The simulations are being run in isolated systems which requires total energy conservation, so large fluctuations in the energy would lead to inaccurate results. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 3. For a single Lennard-Jones interaction, find the separation, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;, and work out the well depth. Evaluate the integrals when σ = ε = 1.0.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i) The Lennard-Jones interaction is given by:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_1.png|200px]]&lt;br /&gt;
&lt;br /&gt;
Since r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; when ɸ = 0,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(ii) The force is given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_3.png|250px]]&lt;br /&gt;
&lt;br /&gt;
So at the separation r&amp;lt;sub&amp;gt;0 &amp;lt;/sub&amp;gt;= σ,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_4.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iii) The equilibrium separation r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs at the point at which all forces vanish, ie. when F = 0, so&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_5.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iv) And the well depth is therefore given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_6.png|270px]]&lt;br /&gt;
&lt;br /&gt;
(v)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_7.png|370px]]&lt;br /&gt;
&lt;br /&gt;
(vi)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_8.png|400px]]&lt;br /&gt;
&lt;br /&gt;
(vii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_9.png|370px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4. Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10,000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_1.png|550px]]&lt;br /&gt;
&lt;br /&gt;
For 10,000 water molecules,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_3.png|230px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 5. Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After the timestep, the atom would be at position (0.5 + 0.7, 0.5 + 0.6, 0.5 + 0.2) = (1.2, 1.1, 0.7). Applying the boundary conditions, this is equivalent to the position (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 6. The Lennard-Jones parameters for argon are sigma = 0.34nm, ε/k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt; = 120K. If the LJ cutoff is r&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 1.5 in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_1.png|140px]]&lt;br /&gt;
&lt;br /&gt;
(ii) It was previously determined in Task 1 that the well depth is - ε, so in real units,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_4.png|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(iii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_3.png|130px]]&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Equilibration&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 7. Why do you think giving atoms random starting coordinates causes problems in simulations?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If two atoms are generated too close to one another, then they would experience a large repulsive force, and would disrupt the behaviour of the surrounding atoms, causing the simulation to become inaccurate. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 8. Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_1.png|380px]]&lt;br /&gt;
&lt;br /&gt;
(ii) For a face-centred cubic lattice, note that the unit cell contains four atoms, as opposed to one atom with a simple cubic lattice. Then&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_4.png|460px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 9. Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is 1 atom contained within each unit cell. However for face-centred cubic lattices, each unit cell contains 4 atoms so four times as many atoms are created than with the simple lattice (ie. 4000 atoms).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 10. Given that we are specifying x&amp;lt;sub&amp;gt;i &amp;lt;/sub&amp;gt;(0) and v&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; (0), which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We will be using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 11. In the code section &amp;quot;Specify Timestep&amp;quot;, the second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write &amp;quot;timestep 0.001 // run 100000&amp;quot;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Defining the variable timestep allows us to reference the variable multiple times throughout the simulation if required, whilst preventing errors and making it easier to alter the code if we want to run the simulation for different timestep values. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 12. Make plots of energy, temperature, and pressure, against time for the 0.001 timestep experiment. Does the simulation reach equilibrium? How long does this take? Make a single plot of energy vs time for all of the timesteps. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice and why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_12_1.png|centre|thumb|Figure X. Plot of energy against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_2.png|centre|thumb|Figure X. Plot of temperature against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_3.png|centre|thumb|Figure X. Plot of pressure against time for the 0.001 timestep experiment]]&lt;br /&gt;
&lt;br /&gt;
The 0.001 timestep experiment reaches equilibrium very quickly, within approximately 0.2s. &lt;br /&gt;
&lt;br /&gt;
A single plot of energy vs time for all of the timesteps can be found in &amp;quot;Results &amp;amp; Discussion: Investigation into Simulation Timestep in the NVE Ensemble Figure 1&amp;quot;, along with a detailed analysis, but in brief: the largest acceptable timestep is 0.0025, and a particularly bad choice would be 0.015 as it does not reach equilibrium.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Running Simulations under Specific Conditions&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 13. We need to choose gamma so that the temperature is correct T=fancy T if we multiply every velocity by γ. Solve the following two equations to determine gamma:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_2.png|center|200px]]&lt;br /&gt;
&lt;br /&gt;
Starting from the 2&amp;lt;sup&amp;gt;nd&amp;lt;/sup&amp;gt; equation,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_1.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 14: (Use the manual to find out the importance of the three numbers 100 1000 100000.) 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 (&amp;quot;run 100000&amp;quot;), how much time will you simulate? (DOUBLE CHECK THIS PART WITH OLLIE!)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Firstly, averages are taken for blocks of 100 values at a time to form the first set of averaged values (where av&amp;lt;sub&amp;gt;100,n&amp;lt;/sub&amp;gt; is the average value for the n&amp;lt;sup&amp;gt;th&amp;lt;/sup&amp;gt; block of 100 values). These values are then themselves averaged in blocks of 1000 values to form a second set of averaged values (av&amp;lt;sub&amp;gt;100,1&amp;lt;/sub&amp;gt; + av&amp;lt;sub&amp;gt;100,2&amp;lt;/sub&amp;gt; + ... + av&amp;lt;sub&amp;gt;100,1000&amp;lt;/sub&amp;gt;)/1000 = av&amp;lt;sub&amp;gt;1000,1&amp;lt;/sub&amp;gt;. Finally, these values are averaged once more in blocks of 100000 values.&lt;br /&gt;
&lt;br /&gt;
The amount of time simulated can be found by multiplying the number of steps by the value of the timestep (eg. 100,000 steps of a 0.001 timestep simulates 100 seconds).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 15: Plot density as a function of temperature for both of the pressures that you simulated. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figure 2 in &amp;quot;Results and Discussion: Equations of State in the NpT Ensemble&amp;quot; for the plot and subsequent discussion.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Heat Capacity Calculation&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 16: (Run simulations at densities of 0.2, 0.8 and temperatures of 2.0, 2.2, 2.4, 2.6, 2.8.) Plots C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;/V as a function of temperature, where V is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Structural Properties and the Radial Distribution Function&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 17: Plot the RDFs for the three systems (liquid/solid/vapour) on the same axes. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Dynamical Properties and the Diffusion Coefficient&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 18: Make a plot for each of your simulations (solid/liquid/vapour), showing the mean squared displacement (&amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate D in each case. (Be careful with units!) Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 19: Evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (show working). On the same graph, with x range 0 to 500, plot C(tau) with omega = 1/2pi and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. Why is the harmonic oscillator VACF very different to the Lennard Jones solid and liquid? (Attach a copy of your plot)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_3.png|700px]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_2.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 20: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665473</id>
		<title>Rep:Gm1110LiquidSim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665473"/>
		<updated>2018-02-14T11:30:22Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: /* Radial Distribution Functions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
The main aim of the experiment was to determine the diffusion coefficient for the solid, liquid and vapour phases of a Lennard-Jones fluid using both the mean squared displacement method and velocity autocorrelation function method.&lt;br /&gt;
&lt;br /&gt;
In order to achieve this, it was first necessary to determine an appropriate timestep with which to run simulations, and investigate the effect of temperature and pressure on the density of the system. Other aims included seeing how heat capacity varied as a function of temperature for different densities, and calculating the radial distribution function for the three phases from simulations using VMD.    &lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
All simulations of the Lennard-Jones fluid were run using the LAMMPS software, and all quantities used were in reduced units.&lt;br /&gt;
&lt;br /&gt;
=== Part 1: Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
A simulation box consisting of 10 x 10 x 10 unit cells of a simple cubic lattice with an atomic density of 0.8 was defined. The atomic mass was set to 1.0 and the Lennard-Jones pairwise interaction cutoff distance was set to 3.0. The pairwise forcefield coefficients ε (potential well depth) and σ (zero-potential distance) were both set to 1.0. Five simulations were run for differing timestep values (0.0010, 0.0025, 0.0075, 0.0100 and 0.0150).&lt;br /&gt;
&lt;br /&gt;
=== Part 2: Equations of State in the NpT Ensemble ===&lt;br /&gt;
The simulation box was increased to consist of 15 x 15 x 15 unit cells of the same simple cubic lattice defined in part 1. A total of ten simulations were run in the NpT ensemble, varying temperature (2.0, 4.0, 6.0, 8.0 and 10.0) at two different densities (1.8 and 2.8) using the timestep value of 0.0025 determined in Part 1.&lt;br /&gt;
&lt;br /&gt;
=== Part 3: Calculation of Heat Capacity ===&lt;br /&gt;
The simulation box from Part 2 was used, with the density altered to take the values 0.2 and 0.8. Five simulations were run for each, with varying values of temperature (2.0, 2.2, 2.4, 2.6 and 2.8). A copy of the script written for this simulation can be found by clicking the image below:&lt;br /&gt;
[[File:gm1110_LS_M_3_1.png|centre|thumb|Copy of Script]]&lt;br /&gt;
&lt;br /&gt;
=== Part 4: Radial Distribution Functions ===&lt;br /&gt;
The simulation boxes used previously were altered to take a timestep of 0.002 and a L-J cutoff distance of 3.2, after which the solid, liquid and vapour phases were defined as having (density, temperature) values of (1.2, 1.2), (0.8, 1.2) and (0.05, 1.1) respectively. In particular, the solid phase was defined as having a face-centred cubic lattice, instead of the simple cubic lattice used for the liquid and vapour phases. VMD was used to analyse the trajectories for the three phases, with the distance between points in the generated RDF set to 0.05.&lt;br /&gt;
&lt;br /&gt;
=== Part 5: Diffusion Coefficient ===&lt;br /&gt;
The results from Part 4 were used to graph the mean squared displacement as a function of time, after which the gradient of the linear portion of the graph was extracted and used to calculate the diffusion coefficient from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_M_5_1.png|centre|150px]]&lt;br /&gt;
&lt;br /&gt;
The procedure was then repeated using 1 million atoms.&lt;br /&gt;
&lt;br /&gt;
==Results and Discussion==&lt;br /&gt;
&lt;br /&gt;
=== Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
Simulations were run using the five different timesteps 0.0010, 0.0025, 0.0075, 0.0100 and 0.0150, and a plot of the results can be seen below (Figure 1).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_1_1.png|centre|thumb|Figure 1. A plot of total energy (reduced units) against time comparing simulations run using five different timestep values]]&lt;br /&gt;
&lt;br /&gt;
It was observed that the simulation run with a timestep of 0.0150 did not equilibrate. This was thought to have potentially been due to the timestep being too large, and therefore the simulation was missing too much detail to accurately simulate the fluid. The simulations run for timesteps of 0.0100 and 0.0075 did equilibrate (supporting the previous hypothesis that the 0.0150 timestep was too large), but converged at the wrong energy (approximately -3.181 and -3.183 respectively), indicating that the timesteps were still not quite small enough.&lt;br /&gt;
&lt;br /&gt;
The final two simulations run at timesteps of 0.0025 and 0.0010 both equilibrated to the same, correct energy (approximately -3.184), indicating that both would be suitable for use in further simulations. It is preferable, however, to maximise the timestep when running simulations as a smaller timestep requires more data points, and is therefore more “expensive” and takes longer to run for no real added value. Hence it was decided that a timestep of 0.0025 would be suitable for running further simulations.    &lt;br /&gt;
&lt;br /&gt;
=== Equations of State in the NpT Ensemble ===&lt;br /&gt;
Although specific values for temperature and pressure are specified for the simulations, in reality, the temperature and pressure of a system fluctuates over time and may therefore deviate away from the inputted values. Hence, the simulation calculates the pressure of the system at the end of every timestep, and adjusts the size of the simulation box such that the pressure once again corresponds to the specified value. Pressure controlled simulations are thus in the NpT ensemble and so volume (and therefore density) is not constant.&lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the resulting densities were plotted against temperature, along with values predicted by the ideal gas law and can be seen below (Figure 2).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_2_1.png|centre|thumb|Figure 2. Plot showing density as a function of temperature at pressures of 1.8 and 2.8 (all in reduced units), with error bars, and a plot of the densities predicted by the ideal gas law]]&lt;br /&gt;
&lt;br /&gt;
Clearly, the simulated densities are lower than those predicted by the ideal gas law, and the discrepancy increases with increasing pressure. This is due to the fact that the ideal gas law assumes perfectly elastic collisions between point particles, but in reality, intermolecular repulsive forces cause the simulated densities to be lower. In addition, an increase in pressure causes the molecules to be pushed closer together and increases both the number of collisions as well as the repulsive forces, leading to a greater deviation from ideality.    &lt;br /&gt;
&lt;br /&gt;
=== Calculation of Heat Capacity ===&lt;br /&gt;
Switching to the NVT ensemble, the heat capacity of the system can be determined by considering the magnitude of fluctuations in the system’s energy from its average equilibrium state from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_1.png|centre|250px]]            &lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the average heat capacities were plotted as a function of temperature (Figure 3).        &lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_2.png|centre|thumb|Figure 3. Plot of average heat capacity against temperature for densities of 0.8 and 0.2]]Heat capacity is a measure of the amount of energy required to increase the temperature of a substance. It is clear that the heat capacity is lower, and therefore easier to heat, for lower density systems as the particles are more spaced apart. This means that they are able to gain thermal energy more easily as they have more room for increased vibrations without an increase of repulsive forces or collisions compared to a higher density system. It was also noted that the heat capacity decreased with increasing temperature. This is due to the fact that at higher temperatures, the gap between energy levels decreases as the particles occupy higher energy states, thus making it easier for the particles to be promoted to higher energy levels.&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Functions ===&lt;br /&gt;
Radial distribution functions (g(r)) were calculated for the solid, liquid and vapour phases (see Figure 4) to check that the simulations were correctly reproducing the structural features of each phase. RDFs are essentially probability distribution functions for the likelihood of finding a particle at a given distance r away from a reference particle, and also gives information on the coordination sphere of the reference particle. The integral of the RDF (Figure 5) is also useful as it gives information on the number of atoms found at a distance r.&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_1.png|centre|thumb|Figure 4. Radial distribution function against displacement from a reference atom]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_4_2.png|centre|thumb|Figure 5. Integral of the radial distribution function against displacement]]&lt;br /&gt;
&lt;br /&gt;
All three phases have&lt;br /&gt;
g(r) ~ 0 for small r, indicating a density of zero as there exists a minimum&lt;br /&gt;
distance at which atoms can approach each other. Also, g(r) tends to 1 for all&lt;br /&gt;
phases as r increases, as the local density becomes equivalent to the mean&lt;br /&gt;
density of the system as a whole.&lt;br /&gt;
&lt;br /&gt;
The graph for the&lt;br /&gt;
vapour phase shows a single peak at approximately r = 1, and &lt;br /&gt;
&lt;br /&gt;
For solid phase, first&lt;br /&gt;
peak at r = 1 corresponds to the central atom itself, second peak at&lt;br /&gt;
approximately r = 1.5 corresponds to the atoms in the centre of the faces (6&lt;br /&gt;
atoms in total), and the third peak at approximately r = 1.9 corresponds to the&lt;br /&gt;
atoms on the corners of the cube (8 in total). Hence the third peak is larger&lt;br /&gt;
than the second as there are more atoms on the corners so greater probability&lt;br /&gt;
of finding atom at that distance. &lt;br /&gt;
&lt;br /&gt;
For all phases, peaks&lt;br /&gt;
diminish as r increases, as the further away from the central atom you get, the&lt;br /&gt;
closer to local density becomes equivalent to the mean density (ie g(r) = 1).&lt;br /&gt;
&lt;br /&gt;
Occurrence of peaks at&lt;br /&gt;
long range indicates a high degree of ordering; particularly sharp peak in&lt;br /&gt;
crystalline materials where atoms are strongly confined in their positions. (&amp;lt;nowiki&amp;gt;http://www.compsoc.man.ac.uk/~lucky/Democritus/Theory/rdf.html&amp;lt;/nowiki&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Discuss the&lt;br /&gt;
differences between the three rdfs and what this tells you about the structure&lt;br /&gt;
of the system in each phase. In the solid case, illustrate which lattice sites&lt;br /&gt;
the first three peaks correspond to (remember: fcc for solid, not sc). What is&lt;br /&gt;
its lattice spacing? What is the coordination number for each of the first&lt;br /&gt;
three peaks?&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
==Tasks==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Introduction to Molecular Dynamics Simulations&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 1. For a default timestep value 0.1, estimate the positions of the maxima in the ERROR column as a function of time.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_1_1.png|centre|thumb|Figure X. Plot showing the positions of the error maxima as a function of time, with a best fit line]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 2. (Experiment with different values of the timestep.) What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using a timestep of 0.1990 meant that the total energy did not change by more than 1% over the course of the simulation (Figure X).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_2_1.png|centre|thumb|Figure X. Plot showing the total energy during the simulation using a timestep of 0.1990]]&lt;br /&gt;
&lt;br /&gt;
The simulations are being run in isolated systems which requires total energy conservation, so large fluctuations in the energy would lead to inaccurate results. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 3. For a single Lennard-Jones interaction, find the separation, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;, and work out the well depth. Evaluate the integrals when σ = ε = 1.0.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i) The Lennard-Jones interaction is given by:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_1.png|200px]]&lt;br /&gt;
&lt;br /&gt;
Since r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; when ɸ = 0,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(ii) The force is given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_3.png|250px]]&lt;br /&gt;
&lt;br /&gt;
So at the separation r&amp;lt;sub&amp;gt;0 &amp;lt;/sub&amp;gt;= σ,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_4.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iii) The equilibrium separation r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs at the point at which all forces vanish, ie. when F = 0, so&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_5.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iv) And the well depth is therefore given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_6.png|270px]]&lt;br /&gt;
&lt;br /&gt;
(v)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_7.png|370px]]&lt;br /&gt;
&lt;br /&gt;
(vi)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_8.png|400px]]&lt;br /&gt;
&lt;br /&gt;
(vii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_9.png|370px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4. Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10,000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_1.png|550px]]&lt;br /&gt;
&lt;br /&gt;
For 10,000 water molecules,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_3.png|230px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 5. Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After the timestep, the atom would be at position (0.5 + 0.7, 0.5 + 0.6, 0.5 + 0.2) = (1.2, 1.1, 0.7). Applying the boundary conditions, this is equivalent to the position (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 6. The Lennard-Jones parameters for argon are sigma = 0.34nm, ε/k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt; = 120K. If the LJ cutoff is r&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 1.5 in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_1.png|140px]]&lt;br /&gt;
&lt;br /&gt;
(ii) It was previously determined in Task 1 that the well depth is - ε, so in real units,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_4.png|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(iii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_3.png|130px]]&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Equilibration&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 7. Why do you think giving atoms random starting coordinates causes problems in simulations?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If two atoms are generated too close to one another, then they would experience a large repulsive force, and would disrupt the behaviour of the surrounding atoms, causing the simulation to become inaccurate. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 8. Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_1.png|380px]]&lt;br /&gt;
&lt;br /&gt;
(ii) For a face-centred cubic lattice, note that the unit cell contains four atoms, as opposed to one atom with a simple cubic lattice. Then&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_4.png|460px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 9. Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is 1 atom contained within each unit cell. However for face-centred cubic lattices, each unit cell contains 4 atoms so four times as many atoms are created than with the simple lattice (ie. 4000 atoms).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 10. Given that we are specifying x&amp;lt;sub&amp;gt;i &amp;lt;/sub&amp;gt;(0) and v&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; (0), which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We will be using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 11. In the code section &amp;quot;Specify Timestep&amp;quot;, the second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write &amp;quot;timestep 0.001 // run 100000&amp;quot;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Defining the variable timestep allows us to reference the variable multiple times throughout the simulation if required, whilst preventing errors and making it easier to alter the code if we want to run the simulation for different timestep values. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 12. Make plots of energy, temperature, and pressure, against time for the 0.001 timestep experiment. Does the simulation reach equilibrium? How long does this take? Make a single plot of energy vs time for all of the timesteps. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice and why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_12_1.png|centre|thumb|Figure X. Plot of energy against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_2.png|centre|thumb|Figure X. Plot of temperature against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_3.png|centre|thumb|Figure X. Plot of pressure against time for the 0.001 timestep experiment]]&lt;br /&gt;
&lt;br /&gt;
The 0.001 timestep experiment reaches equilibrium very quickly, within approximately 0.2s. &lt;br /&gt;
&lt;br /&gt;
A single plot of energy vs time for all of the timesteps can be found in &amp;quot;Results &amp;amp; Discussion: Investigation into Simulation Timestep in the NVE Ensemble Figure 1&amp;quot;, along with a detailed analysis, but in brief: the largest acceptable timestep is 0.0025, and a particularly bad choice would be 0.015 as it does not reach equilibrium.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Running Simulations under Specific Conditions&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 13. We need to choose gamma so that the temperature is correct T=fancy T if we multiply every velocity by γ. Solve the following two equations to determine gamma:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_2.png|center|200px]]&lt;br /&gt;
&lt;br /&gt;
Starting from the 2&amp;lt;sup&amp;gt;nd&amp;lt;/sup&amp;gt; equation,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_1.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 14: (Use the manual to find out the importance of the three numbers 100 1000 100000.) 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 (&amp;quot;run 100000&amp;quot;), how much time will you simulate? (DOUBLE CHECK THIS PART WITH OLLIE!)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Firstly, averages are taken for blocks of 100 values at a time to form the first set of averaged values (where av&amp;lt;sub&amp;gt;100,n&amp;lt;/sub&amp;gt; is the average value for the n&amp;lt;sup&amp;gt;th&amp;lt;/sup&amp;gt; block of 100 values). These values are then themselves averaged in blocks of 1000 values to form a second set of averaged values (av&amp;lt;sub&amp;gt;100,1&amp;lt;/sub&amp;gt; + av&amp;lt;sub&amp;gt;100,2&amp;lt;/sub&amp;gt; + ... + av&amp;lt;sub&amp;gt;100,1000&amp;lt;/sub&amp;gt;)/1000 = av&amp;lt;sub&amp;gt;1000,1&amp;lt;/sub&amp;gt;. Finally, these values are averaged once more in blocks of 100000 values.&lt;br /&gt;
&lt;br /&gt;
The amount of time simulated can be found by multiplying the number of steps by the value of the timestep (eg. 100,000 steps of a 0.001 timestep simulates 100 seconds).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 15: Plot density as a function of temperature for both of the pressures that you simulated. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figure 2 in &amp;quot;Results and Discussion: Equations of State in the NpT Ensemble&amp;quot; for the plot and subsequent discussion.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Heat Capacity Calculation&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 16: (Run simulations at densities of 0.2, 0.8 and temperatures of 2.0, 2.2, 2.4, 2.6, 2.8.) Plots C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;/V as a function of temperature, where V is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Structural Properties and the Radial Distribution Function&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 17: Plot the RDFs for the three systems (liquid/solid/vapour) on the same axes. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Dynamical Properties and the Diffusion Coefficient&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 18: Make a plot for each of your simulations (solid/liquid/vapour), showing the mean squared displacement (&amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate D in each case. (Be careful with units!) Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 19: Evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (show working). On the same graph, with x range 0 to 500, plot C(tau) with omega = 1/2pi and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. Why is the harmonic oscillator VACF very different to the Lennard Jones solid and liquid? (Attach a copy of your plot)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_3.png|700px]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_2.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 20: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gm1110_LS_R_D_4_2.png&amp;diff=665472</id>
		<title>File:Gm1110 LS R D 4 2.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gm1110_LS_R_D_4_2.png&amp;diff=665472"/>
		<updated>2018-02-14T11:29:43Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gm1110_LS_R_D_4_1.png&amp;diff=665470</id>
		<title>File:Gm1110 LS R D 4 1.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gm1110_LS_R_D_4_1.png&amp;diff=665470"/>
		<updated>2018-02-14T11:28:40Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665469</id>
		<title>Rep:Gm1110LiquidSim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Gm1110LiquidSim&amp;diff=665469"/>
		<updated>2018-02-14T11:28:20Z</updated>

		<summary type="html">&lt;p&gt;Gm1110: /* Calculation of Heat Capacity */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
The main aim of the experiment was to determine the diffusion coefficient for the solid, liquid and vapour phases of a Lennard-Jones fluid using both the mean squared displacement method and velocity autocorrelation function method.&lt;br /&gt;
&lt;br /&gt;
In order to achieve this, it was first necessary to determine an appropriate timestep with which to run simulations, and investigate the effect of temperature and pressure on the density of the system. Other aims included seeing how heat capacity varied as a function of temperature for different densities, and calculating the radial distribution function for the three phases from simulations using VMD.    &lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
All simulations of the Lennard-Jones fluid were run using the LAMMPS software, and all quantities used were in reduced units.&lt;br /&gt;
&lt;br /&gt;
=== Part 1: Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
A simulation box consisting of 10 x 10 x 10 unit cells of a simple cubic lattice with an atomic density of 0.8 was defined. The atomic mass was set to 1.0 and the Lennard-Jones pairwise interaction cutoff distance was set to 3.0. The pairwise forcefield coefficients ε (potential well depth) and σ (zero-potential distance) were both set to 1.0. Five simulations were run for differing timestep values (0.0010, 0.0025, 0.0075, 0.0100 and 0.0150).&lt;br /&gt;
&lt;br /&gt;
=== Part 2: Equations of State in the NpT Ensemble ===&lt;br /&gt;
The simulation box was increased to consist of 15 x 15 x 15 unit cells of the same simple cubic lattice defined in part 1. A total of ten simulations were run in the NpT ensemble, varying temperature (2.0, 4.0, 6.0, 8.0 and 10.0) at two different densities (1.8 and 2.8) using the timestep value of 0.0025 determined in Part 1.&lt;br /&gt;
&lt;br /&gt;
=== Part 3: Calculation of Heat Capacity ===&lt;br /&gt;
The simulation box from Part 2 was used, with the density altered to take the values 0.2 and 0.8. Five simulations were run for each, with varying values of temperature (2.0, 2.2, 2.4, 2.6 and 2.8). A copy of the script written for this simulation can be found by clicking the image below:&lt;br /&gt;
[[File:gm1110_LS_M_3_1.png|centre|thumb|Copy of Script]]&lt;br /&gt;
&lt;br /&gt;
=== Part 4: Radial Distribution Functions ===&lt;br /&gt;
The simulation boxes used previously were altered to take a timestep of 0.002 and a L-J cutoff distance of 3.2, after which the solid, liquid and vapour phases were defined as having (density, temperature) values of (1.2, 1.2), (0.8, 1.2) and (0.05, 1.1) respectively. In particular, the solid phase was defined as having a face-centred cubic lattice, instead of the simple cubic lattice used for the liquid and vapour phases. VMD was used to analyse the trajectories for the three phases, with the distance between points in the generated RDF set to 0.05.&lt;br /&gt;
&lt;br /&gt;
=== Part 5: Diffusion Coefficient ===&lt;br /&gt;
The results from Part 4 were used to graph the mean squared displacement as a function of time, after which the gradient of the linear portion of the graph was extracted and used to calculate the diffusion coefficient from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_M_5_1.png|centre|150px]]&lt;br /&gt;
&lt;br /&gt;
The procedure was then repeated using 1 million atoms.&lt;br /&gt;
&lt;br /&gt;
==Results and Discussion==&lt;br /&gt;
&lt;br /&gt;
=== Investigation into Simulation Timestep in the NVE Ensemble ===&lt;br /&gt;
Simulations were run using the five different timesteps 0.0010, 0.0025, 0.0075, 0.0100 and 0.0150, and a plot of the results can be seen below (Figure 1).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_1_1.png|centre|thumb|Figure 1. A plot of total energy (reduced units) against time comparing simulations run using five different timestep values]]&lt;br /&gt;
&lt;br /&gt;
It was observed that the simulation run with a timestep of 0.0150 did not equilibrate. This was thought to have potentially been due to the timestep being too large, and therefore the simulation was missing too much detail to accurately simulate the fluid. The simulations run for timesteps of 0.0100 and 0.0075 did equilibrate (supporting the previous hypothesis that the 0.0150 timestep was too large), but converged at the wrong energy (approximately -3.181 and -3.183 respectively), indicating that the timesteps were still not quite small enough.&lt;br /&gt;
&lt;br /&gt;
The final two simulations run at timesteps of 0.0025 and 0.0010 both equilibrated to the same, correct energy (approximately -3.184), indicating that both would be suitable for use in further simulations. It is preferable, however, to maximise the timestep when running simulations as a smaller timestep requires more data points, and is therefore more “expensive” and takes longer to run for no real added value. Hence it was decided that a timestep of 0.0025 would be suitable for running further simulations.    &lt;br /&gt;
&lt;br /&gt;
=== Equations of State in the NpT Ensemble ===&lt;br /&gt;
Although specific values for temperature and pressure are specified for the simulations, in reality, the temperature and pressure of a system fluctuates over time and may therefore deviate away from the inputted values. Hence, the simulation calculates the pressure of the system at the end of every timestep, and adjusts the size of the simulation box such that the pressure once again corresponds to the specified value. Pressure controlled simulations are thus in the NpT ensemble and so volume (and therefore density) is not constant.&lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the resulting densities were plotted against temperature, along with values predicted by the ideal gas law and can be seen below (Figure 2).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_2_1.png|centre|thumb|Figure 2. Plot showing density as a function of temperature at pressures of 1.8 and 2.8 (all in reduced units), with error bars, and a plot of the densities predicted by the ideal gas law]]&lt;br /&gt;
&lt;br /&gt;
Clearly, the simulated densities are lower than those predicted by the ideal gas law, and the discrepancy increases with increasing pressure. This is due to the fact that the ideal gas law assumes perfectly elastic collisions between point particles, but in reality, intermolecular repulsive forces cause the simulated densities to be lower. In addition, an increase in pressure causes the molecules to be pushed closer together and increases both the number of collisions as well as the repulsive forces, leading to a greater deviation from ideality.    &lt;br /&gt;
&lt;br /&gt;
=== Calculation of Heat Capacity ===&lt;br /&gt;
Switching to the NVT ensemble, the heat capacity of the system can be determined by considering the magnitude of fluctuations in the system’s energy from its average equilibrium state from the equation:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_1.png|centre|250px]]            &lt;br /&gt;
&lt;br /&gt;
A total of ten simulations were run, and the average heat capacities were plotted as a function of temperature (Figure 3).        &lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_R_D_3_2.png|centre|thumb|Figure 3. Plot of average heat capacity against temperature for densities of 0.8 and 0.2]]Heat capacity is a measure of the amount of energy required to increase the temperature of a substance. It is clear that the heat capacity is lower, and therefore easier to heat, for lower density systems as the particles are more spaced apart. This means that they are able to gain thermal energy more easily as they have more room for increased vibrations without an increase of repulsive forces or collisions compared to a higher density system. It was also noted that the heat capacity decreased with increasing temperature. This is due to the fact that at higher temperatures, the gap between energy levels decreases as the particles occupy higher energy states, thus making it easier for the particles to be promoted to higher energy levels.&lt;br /&gt;
&lt;br /&gt;
=== Radial Distribution Functions ===&lt;br /&gt;
Radial distribution functions (g(r)) were calculated for the solid, liquid and vapour phases (see Figure 4) to check that the simulations were correctly reproducing the structural features of each phase. RDFs are essentially probability distribution functions for the likelihood of finding a particle at a given distance r away from a reference particle, and also gives information on the coordination sphere of the reference particle. The integral of the RDF (Figure 5) is also useful as it gives information on the number of atoms found at a distance r.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;INSERT&lt;br /&gt;
GRAPH G(R)&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All three phases have&lt;br /&gt;
g(r) ~ 0 for small r, indicating a density of zero as there exists a minimum&lt;br /&gt;
distance at which atoms can approach each other. Also, g(r) tends to 1 for all&lt;br /&gt;
phases as r increases, as the local density becomes equivalent to the mean&lt;br /&gt;
density of the system as a whole.&lt;br /&gt;
&lt;br /&gt;
The graph for the&lt;br /&gt;
vapour phase shows a single peak at approximately r = 1, and &lt;br /&gt;
&lt;br /&gt;
For solid phase, first&lt;br /&gt;
peak at r = 1 corresponds to the central atom itself, second peak at&lt;br /&gt;
approximately r = 1.5 corresponds to the atoms in the centre of the faces (6&lt;br /&gt;
atoms in total), and the third peak at approximately r = 1.9 corresponds to the&lt;br /&gt;
atoms on the corners of the cube (8 in total). Hence the third peak is larger&lt;br /&gt;
than the second as there are more atoms on the corners so greater probability&lt;br /&gt;
of finding atom at that distance. &lt;br /&gt;
&lt;br /&gt;
For all phases, peaks&lt;br /&gt;
diminish as r increases, as the further away from the central atom you get, the&lt;br /&gt;
closer to local density becomes equivalent to the mean density (ie g(r) = 1).&lt;br /&gt;
&lt;br /&gt;
Occurrence of peaks at&lt;br /&gt;
long range indicates a high degree of ordering; particularly sharp peak in&lt;br /&gt;
crystalline materials where atoms are strongly confined in their positions. (&amp;lt;nowiki&amp;gt;http://www.compsoc.man.ac.uk/~lucky/Democritus/Theory/rdf.html&amp;lt;/nowiki&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Discuss the&lt;br /&gt;
differences between the three rdfs and what this tells you about the structure&lt;br /&gt;
of the system in each phase. In the solid case, illustrate which lattice sites&lt;br /&gt;
the first three peaks correspond to (remember: fcc for solid, not sc). What is&lt;br /&gt;
its lattice spacing? What is the coordination number for each of the first&lt;br /&gt;
three peaks?&lt;br /&gt;
&lt;br /&gt;
=== Diffusion Coefficient ===&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
==Tasks==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Introduction to Molecular Dynamics Simulations&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 1. For a default timestep value 0.1, estimate the positions of the maxima in the ERROR column as a function of time.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_1_1.png|centre|thumb|Figure X. Plot showing the positions of the error maxima as a function of time, with a best fit line]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 2. (Experiment with different values of the timestep.) What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using a timestep of 0.1990 meant that the total energy did not change by more than 1% over the course of the simulation (Figure X).&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_2_1.png|centre|thumb|Figure X. Plot showing the total energy during the simulation using a timestep of 0.1990]]&lt;br /&gt;
&lt;br /&gt;
The simulations are being run in isolated systems which requires total energy conservation, so large fluctuations in the energy would lead to inaccurate results. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 3. For a single Lennard-Jones interaction, find the separation, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;, and work out the well depth. Evaluate the integrals when σ = ε = 1.0.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i) The Lennard-Jones interaction is given by:&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_1.png|200px]]&lt;br /&gt;
&lt;br /&gt;
Since r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; when ɸ = 0,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(ii) The force is given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_3.png|250px]]&lt;br /&gt;
&lt;br /&gt;
So at the separation r&amp;lt;sub&amp;gt;0 &amp;lt;/sub&amp;gt;= σ,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_4.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iii) The equilibrium separation r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs at the point at which all forces vanish, ie. when F = 0, so&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_5.png|200px]]&lt;br /&gt;
&lt;br /&gt;
(iv) And the well depth is therefore given by&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_6.png|270px]]&lt;br /&gt;
&lt;br /&gt;
(v)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_7.png|370px]]&lt;br /&gt;
&lt;br /&gt;
(vi)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_8.png|400px]]&lt;br /&gt;
&lt;br /&gt;
(vii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_3_9.png|370px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 4. Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10,000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_1.png|550px]]&lt;br /&gt;
&lt;br /&gt;
For 10,000 water molecules,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_4_3.png|230px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 5. Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After the timestep, the atom would be at position (0.5 + 0.7, 0.5 + 0.6, 0.5 + 0.2) = (1.2, 1.1, 0.7). Applying the boundary conditions, this is equivalent to the position (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 6. The Lennard-Jones parameters for argon are sigma = 0.34nm, ε/k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt; = 120K. If the LJ cutoff is r&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T&amp;lt;sup&amp;gt;*&amp;lt;/sup&amp;gt; = 1.5 in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_1.png|140px]]&lt;br /&gt;
&lt;br /&gt;
(ii) It was previously determined in Task 1 that the well depth is - ε, so in real units,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_4.png|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(iii)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_6_3.png|130px]]&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Equilibration&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 7. Why do you think giving atoms random starting coordinates causes problems in simulations?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If two atoms are generated too close to one another, then they would experience a large repulsive force, and would disrupt the behaviour of the surrounding atoms, causing the simulation to become inaccurate. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 8. Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(i)&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_1.png|380px]]&lt;br /&gt;
&lt;br /&gt;
(ii) For a face-centred cubic lattice, note that the unit cell contains four atoms, as opposed to one atom with a simple cubic lattice. Then&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_8_4.png|460px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 9. Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice, there is 1 atom contained within each unit cell. However for face-centred cubic lattices, each unit cell contains 4 atoms so four times as many atoms are created than with the simple lattice (ie. 4000 atoms).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 10. Given that we are specifying x&amp;lt;sub&amp;gt;i &amp;lt;/sub&amp;gt;(0) and v&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; (0), which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We will be using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 11. In the code section &amp;quot;Specify Timestep&amp;quot;, the second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write &amp;quot;timestep 0.001 // run 100000&amp;quot;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Defining the variable timestep allows us to reference the variable multiple times throughout the simulation if required, whilst preventing errors and making it easier to alter the code if we want to run the simulation for different timestep values. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 12. Make plots of energy, temperature, and pressure, against time for the 0.001 timestep experiment. Does the simulation reach equilibrium? How long does this take? Make a single plot of energy vs time for all of the timesteps. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice and why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_12_1.png|centre|thumb|Figure X. Plot of energy against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_2.png|centre|thumb|Figure X. Plot of temperature against time for the 0.001 timestep experiment]]&lt;br /&gt;
[[File:gm1110_LS_Task_12_3.png|centre|thumb|Figure X. Plot of pressure against time for the 0.001 timestep experiment]]&lt;br /&gt;
&lt;br /&gt;
The 0.001 timestep experiment reaches equilibrium very quickly, within approximately 0.2s. &lt;br /&gt;
&lt;br /&gt;
A single plot of energy vs time for all of the timesteps can be found in &amp;quot;Results &amp;amp; Discussion: Investigation into Simulation Timestep in the NVE Ensemble Figure 1&amp;quot;, along with a detailed analysis, but in brief: the largest acceptable timestep is 0.0025, and a particularly bad choice would be 0.015 as it does not reach equilibrium.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Running Simulations under Specific Conditions&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 13. We need to choose gamma so that the temperature is correct T=fancy T if we multiply every velocity by γ. Solve the following two equations to determine gamma:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_2.png|center|200px]]&lt;br /&gt;
&lt;br /&gt;
Starting from the 2&amp;lt;sup&amp;gt;nd&amp;lt;/sup&amp;gt; equation,&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_13_1.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 14: (Use the manual to find out the importance of the three numbers 100 1000 100000.) 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 (&amp;quot;run 100000&amp;quot;), how much time will you simulate? (DOUBLE CHECK THIS PART WITH OLLIE!)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Firstly, averages are taken for blocks of 100 values at a time to form the first set of averaged values (where av&amp;lt;sub&amp;gt;100,n&amp;lt;/sub&amp;gt; is the average value for the n&amp;lt;sup&amp;gt;th&amp;lt;/sup&amp;gt; block of 100 values). These values are then themselves averaged in blocks of 1000 values to form a second set of averaged values (av&amp;lt;sub&amp;gt;100,1&amp;lt;/sub&amp;gt; + av&amp;lt;sub&amp;gt;100,2&amp;lt;/sub&amp;gt; + ... + av&amp;lt;sub&amp;gt;100,1000&amp;lt;/sub&amp;gt;)/1000 = av&amp;lt;sub&amp;gt;1000,1&amp;lt;/sub&amp;gt;. Finally, these values are averaged once more in blocks of 100000 values.&lt;br /&gt;
&lt;br /&gt;
The amount of time simulated can be found by multiplying the number of steps by the value of the timestep (eg. 100,000 steps of a 0.001 timestep simulates 100 seconds).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Task 15: Plot density as a function of temperature for both of the pressures that you simulated. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See Figure 2 in &amp;quot;Results and Discussion: Equations of State in the NpT Ensemble&amp;quot; for the plot and subsequent discussion.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Heat Capacity Calculation&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 16: (Run simulations at densities of 0.2, 0.8 and temperatures of 2.0, 2.2, 2.4, 2.6, 2.8.) Plots C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;/V as a function of temperature, where V is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Structural Properties and the Radial Distribution Function&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 17: Plot the RDFs for the three systems (liquid/solid/vapour) on the same axes. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;u&amp;gt;Dynamical Properties and the Diffusion Coefficient&amp;lt;/u&amp;gt; ===&lt;br /&gt;
&#039;&#039;&#039;Task 18: Make a plot for each of your simulations (solid/liquid/vapour), showing the mean squared displacement (&amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate D in each case. (Be careful with units!) Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 19: Evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (show working). On the same graph, with x range 0 to 500, plot C(tau) with omega = 1/2pi and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. Why is the harmonic oscillator VACF very different to the Lennard Jones solid and liquid? (Attach a copy of your plot)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_3.png|700px]]&lt;br /&gt;
&lt;br /&gt;
[[File:gm1110_LS_Task_19_2.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(Extension) Task 20: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Gm1110</name></author>
	</entry>
</feed>