<?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=Jwf13</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=Jwf13"/>
	<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/wiki/Special:Contributions/Jwf13"/>
	<updated>2026-04-19T13:53:26Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=User:JFU1608&amp;diff=543653</id>
		<title>User:JFU1608</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=User:JFU1608&amp;diff=543653"/>
		<updated>2016-02-26T11:18:59Z</updated>

		<summary type="html">&lt;p&gt;Jwf13: /* Task 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Part 1: Running first simulation==&lt;br /&gt;
&lt;br /&gt;
-no tasks-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Part 2: Introduction to molecular dynamics simulation==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time  t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by  (the values of  ,  , and   are worked out for you in the sheet).&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL: Position at time t (classical solution)&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Position.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
ERROR: Absolute difference between ANALYTICAL and Velocity-verlet solution&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Error.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
ENERGY: Total E of oscillator for velocity-verlet solution&lt;br /&gt;
Total Energy is given by the summation of both kinetic energy: 1/2 mv2 and potential energy 1/2kx2.&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Energy.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data. &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Time!! Maximum Error&lt;br /&gt;
|-&lt;br /&gt;
| 1.9|| 7.58E-04&lt;br /&gt;
|-&lt;br /&gt;
| 5.00|| 2.00E-03&lt;br /&gt;
|-&lt;br /&gt;
| 8.00|| 3.30E-03&lt;br /&gt;
|-&lt;br /&gt;
| 11.10|| 4.60E-03&lt;br /&gt;
|-&lt;br /&gt;
| 14.20|| 5.91E-03&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
[[File:2.2_Max_Error.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph shows a linear relationship between the maximum errors of position with time, characterised by its extrapolation formula y = 0.0004x – 0.00005.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;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?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Previously for timestep 0.1, the percentage change was 0.248%. By varying the timestep, we are able to deduce the corresponding percentage changes, shown in Table X. As timestep increases, the minima total energy value decreases gradually, leading to a larger percentage change in total energy. In order for total energy not to go over 1%, the timestep must not be larger than 0.2. It is important to monitor the total energy of a physical system while modelling its behaviour numerically. This is because the Law of Conservation of Energy is observed, where total energy stays constant. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Timestep!! Energy Maxima!! Energy Minima!! Change in Energy&lt;br /&gt;
|-&lt;br /&gt;
| 0.05|| 0.5||0.4997||0.06%&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;0.1||&#039;&#039;&#039;0.5&#039;&#039;&#039;||&#039;&#039;&#039;0.4988&#039;&#039;&#039;||&#039;&#039;&#039;0.24%&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0.15||0.5||0.4972||0.56%&lt;br /&gt;
|-&lt;br /&gt;
| 0.2||0.5||0.4950||1.00%&lt;br /&gt;
|-&lt;br /&gt;
| 0.25|| 0.5||0.4922||1.56%&lt;br /&gt;
|-&lt;br /&gt;
| 0.3|| 0.5||0.4888||2.24%&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Row highlighted in bold is the simulation done from previous tasks.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;For a single Lennard-Jones interaction, [[File:8c44e3156b2bf003c09fa62fbaed5cb0.png]], find the separation, [[File:2.4_E2.png]], at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, [[File:2.4_E3.png]], and work out the well depth ([[File:2.4_E4.png]]). Evaluate the integrals [[File:2.4_E5.png]], [[File:2.4_E6.png]], and [[File:2.4_E7.png]] when [[File:2.4_E8.png]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the potential energy is zero, separation r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; can be found:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
At this separation, the force can be calculated with [[File:2.4_F_Eq.png|100px]], where using the definition of U from equation 10 &amp;lt;ref name=&amp;quot;equation 10&amp;quot; /&amp;gt; produces:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs where F&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; = 0, so:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans3.png]]&lt;br /&gt;
&lt;br /&gt;
Well depth, &lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans4.PNG]]&lt;br /&gt;
&lt;br /&gt;
When σ=ϵ=1.0,&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans5.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&amp;lt;b&amp;gt;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At standard conditions, there are 3.35 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt; water molecules in 1 mL of water.&lt;br /&gt;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;; Volume = 1 mL = 1 cm&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;; Mr = 18; N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 6.022 x 10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2.5_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
For 10000 water molecules, the calculated volume is 2.99 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; mL:&lt;br /&gt;
&lt;br /&gt;
[[File:2.5_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&amp;lt;b&amp;gt;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, &#039;&#039;after the periodic boundary conditions have been applied?&#039;&#039;.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sum of (0.5, 0.5, 0.5) and (0.7, 0.6, 0.2) gives (1.2,1.1,0.7), but this assumes periodic boundary conditions not applied. If applied, number of atoms inside box always constant as one leaves, simultaneously another enters. Hence deduct (1.2,1.1,0.7) by value of 1 in the x and y coordinates since they exceed the value of 1, to give the (0.2,0.1,0.3) position.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&amp;lt;b&amp;gt;The Lennard-Jones parameters for argon are [[File:1.7_E1.png]]. If the LJ cutoff is [[File:1.7_E2.png]], 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 [[File:4.1_E1.png]] in real units?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2.7_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
==Part 3: Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together? &lt;br /&gt;
If molecules are put extremely close to each other then they might overlap each other, having unfavourable repulsion interactions. &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates in simulations, there is a possibility that the simulation puts 2 atoms such that they overlap one another, which is not possible in real terms. As two atoms get closer together, their potential energy increases exponentially, causing a discrepancy in the calculated values. This is avoided when the atoms are placed at lattice points.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given previously that each length of a unit cell is 1.07722, &lt;br /&gt;
&lt;br /&gt;
[[File:3.2_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
For a fcc lattice of lattice point number density 1.2:&lt;br /&gt;
&lt;br /&gt;
[[File:3.2_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;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? &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the fcc lattice has 4 atoms, where each is 1000 unit cells, a total of 4000 atoms will be created.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;Using the LAMMPS manual, find the purpose of the following commands in the input script: &amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.4_E1.PNG]]&lt;br /&gt;
&lt;br /&gt;
The first line is a mass command where 1 is the atom type, with mass of 1.0. This input script sets all atoms of atom type 1 to have a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
The second line is a pair style command which computes the pairwise interactions of 2 atoms. This command is scripted such that the Lennard-Jones potential is cut off for coulomb interaction beyond distance of 3.0, hence absence of potential energy. Within distance 3.0, there will be a presence of potential energy due to the active Lennard-Jones interaction.&lt;br /&gt;
&lt;br /&gt;
The third line is a pair coeff command, where the * sign in pair coeff command sets coefficients for multiple pairs of atom types. As there is no numeric value, it means all types from 1 to N. In the case used, there are only atoms of 1 type so this command sets the coefficient value to all atoms of type 1. The first 1.0 coefficient value corresponds to the distance at which potential energies, σ of 2 atoms is 0, whereas the second 1.0 coefficient is the well depth.&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&amp;lt;b&amp;gt;Look at the lines below.&amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.5_E1.PNG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;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;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.5_E2.PNG]]&lt;br /&gt;
&lt;br /&gt;
The first code allows the simulation to run over a fixed time with a varied amount of timesteps. Such that the larger the timestep, the lesser steps is used to run the total simulation. Similarly, more steps are used when a small timestep is set for that variation. The timestep difference between each simulation is 0.001. The second code does not allow this to happen as it only runs the simulation for a fixed timestep at 0.001.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&amp;lt;b&amp;gt;Given that we are specifying [[File:3.6_E1.png]] and [[File:3.6_E2.png]], which integration algorithm are we going to use?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As 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) is given, the Velocity-Verlet algorithm should be used.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&amp;lt;b&amp;gt;Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium can be said to be achieved when thermodynamic quantities becomes constant. Hence for the timestep 0.001, the simulation reaches equilibrium since the plots of temperature and pressure versus time equilibrates to a constant value of approximately 1.25K and 1.25atm. From the zoomed in view, we can deduce that equilibration is achieved within 0.05s.&lt;br /&gt;
Equilibrium has also been achieved for other timesteps, except 0.015, where the graph of total energy versus time graph is observed to gradually increase.&lt;br /&gt;
The largest timestep to provide acceptable results is 0.01. Timestep 0.015 is a particularly bad choice because the simulation does not achieve equilibrium as its total energy value is increasing over time, with a large spread of error (larger fluctuation).&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Total_Energy_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Total energy versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Temperature_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Temperature versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Temperature_0.001_zoom.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Temperature versus time for timestep 0.001, zoomed in version&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Pressure_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Pressure versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Total_Energy_all_timestep.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Total Energy versus time for timesteps 0.001, 0.0025, 0.0075, 0.01, 0.015.&lt;br /&gt;
&lt;br /&gt;
==Part 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Choose 5 temperatures (above the critical temperature [[File:4.1_E1.png]]), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen [[File:4.1_E2.png]] points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Temperatures used: 2.0, 2.5, 3.0, 3.5, 4.0&lt;br /&gt;
&lt;br /&gt;
Pressures used: 2.5, 2.8&lt;br /&gt;
&lt;br /&gt;
Timestep used: 0.0025&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;We need to choose [[File:4.2_E1.png]] so that the temperature is correct [[File:4.2_E2.png]] if we multiply every velocity [[File:4.2_E1.png]]. We can write two equations:&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:4.2_E3.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:4.2_E4.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
Solve these to determine [[File:4.2_E1.png]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:4.2_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;Use the manual page 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, how much time will you simulate?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A measurement will be made every &#039;100&#039; units, with &#039;1000&#039; defined to provide the total average of all the &#039;100000&#039; values.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density [[File:4.4_E1.png]]. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated. Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:4.4_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
Density in Ideal Gas Law calculation:&lt;br /&gt;
&lt;br /&gt;
[[File:4.4_Ans2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
At any fixed pressure, the simulated density is lower than the ideal gas law plot. The ideal gas law states that there is negligible interaction between molecules, leading to no repulsive forces. Given this, molecules are more likely to be found next to one another, as compared to the simulation. Where in the case of a simulation, interactions between molecules are present, along with the presence of repulsion forces. This causes the molecules to be found far away from each other. Hence for a given volume, density is higher for an ideal gas (molecules near each other) than for a non-ideal gas (molecules far apart). This discrepancy of ideal gas law and simulation increases with pressure. This is because at high pressures, molecules are forced to be next to each other, increasing repulsion, therefore reducing density.&lt;br /&gt;
&lt;br /&gt;
==Part 5: Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature [[File:5.1_Equation_1.png]] phase space, rather than pressure-temperature phase space. The two densities required at 0.2 and 0.8, and the temperature range is 2.0, 2.2, 2.4, 2.6, 2.8. Plot [[File:5.1_Equation_2.png]] as a function of temperature, where [[File:5.1_Equation_3.png]] 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.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:5.1_Graph.PNG]]&lt;br /&gt;
&lt;br /&gt;
The trend observed in the graph above is not what would normally be expected as Cv/V is supposed to increase with temperature. At higher temperatures, the total internal energy of the system increases, therefore higher heat capacity due to the increased difficulty to increase the temperature per unit. A lower density also leads to a lower heat capacity, lowering the height of the trendline. This is because heat capacity is an extensive property. A larger density would mean more atoms at the given fixed volume, hence driving up the Cv/V value.&lt;br /&gt;
&lt;br /&gt;
Input script for density 0.2 at temperature 2.0 attached: [[File:5.1_(0.2,2.0).in]]&lt;br /&gt;
&lt;br /&gt;
==Part 6: Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate [[File:6.1_Equation_1.png]] and [[File:6.1_Equation_2.png]]. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:6.1_Ans1.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:6.1_Ans2.PNG]]&lt;br /&gt;
&lt;br /&gt;
The number of peaks in the g(r) plot corresponds to the number of neighbouring atoms. As the solid has the highest number of peaks in the g(r) plot, it has the most neighbouring atoms, followed by liquid and finally gas. The distance between neighbouring atoms in a gas can be seen to be approximately a few times bigger than the solid as within a single gas peak, there are multiple solid peaks. The first 3 peaks for the solid corresponds to the 3 nearest atoms to the sampled atom, as per equidistant lattice points on a cube. The coordination number for the first three peaks are 12, 18 and 42.&lt;br /&gt;
&lt;br /&gt;
==Part 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate [[File:7.2_D.png]] in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Graphs of Mean Squared Displacement against Time&lt;br /&gt;
! 1 atom!! 1 million atoms&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Liq.PNG]]|| [[File:7.1_MSD_Liq1m.PNG]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Solid.PNG]]|| [[File:7.1_MSD_Solid1m.PNG]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Vap.PNG]]|| [[File:7.1_MSD_Vap1m.PNG]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Trendline for 1 million liquid and vapour atoms has a larger gradient and intercept than the normal box simulation. This is opposed in the solid, with a lower gradient and intercept for the 1 million atoms. The observations in these trends are as expected.&lt;br /&gt;
&lt;br /&gt;
The value of D can be found using the equation [[File:7.1_DEq.PNG]], where the [[File:7.1_DEq1.PNG]] value can be found via gradient of each plot. By increasing the amount of total atoms, the diffusion coefficient increases for the liquid and gas, except for the solid. This is due to its high density property.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! LIQUID!!1 unit cell!! 1 million atoms&lt;br /&gt;
|-&lt;br /&gt;
| Gradient|| 0.5094 ||0.5236&lt;br /&gt;
|-&lt;br /&gt;
| D ||0.0849||0.0873&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! SOLID!!1 unit cell!! 1 million atoms&lt;br /&gt;
|-&lt;br /&gt;
| Gradient|| 2.00E-04||3.00E-05&lt;br /&gt;
|-&lt;br /&gt;
| D ||3.33E-05||5.00E-06&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! GAS!!1 unit cell!! 1 million atoms&lt;br /&gt;
|-&lt;br /&gt;
| Gradient|| 9.9061||15.249&lt;br /&gt;
|-&lt;br /&gt;
| D ||1.65||2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
[[File:7.3_Equation_1.png]]. &lt;br /&gt;
Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot [[File:7.3_Equation_2.png]] with [[File:7.3_Equation_3.png]] and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:7.2_Ans1.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:7.2_Graph.PNG]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;equation 10&amp;quot;&amp;gt;https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment/Introduction_to_molecular_dynamics_simulation&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:7.1_DEq1.PNG&amp;diff=543636</id>
		<title>File:7.1 DEq1.PNG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:7.1_DEq1.PNG&amp;diff=543636"/>
		<updated>2016-02-26T10:59:24Z</updated>

		<summary type="html">&lt;p&gt;Jwf13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:7.1_DEq.PNG&amp;diff=543635</id>
		<title>File:7.1 DEq.PNG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:7.1_DEq.PNG&amp;diff=543635"/>
		<updated>2016-02-26T10:59:03Z</updated>

		<summary type="html">&lt;p&gt;Jwf13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=User:JFU1608&amp;diff=543630</id>
		<title>User:JFU1608</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=User:JFU1608&amp;diff=543630"/>
		<updated>2016-02-26T10:53:04Z</updated>

		<summary type="html">&lt;p&gt;Jwf13: /* Task 5 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Part 1: Running first simulation==&lt;br /&gt;
&lt;br /&gt;
-no tasks-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Part 2: Introduction to molecular dynamics simulation==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time  t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by  (the values of  ,  , and   are worked out for you in the sheet).&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL: Position at time t (classical solution)&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Position.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
ERROR: Absolute difference between ANALYTICAL and Velocity-verlet solution&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Error.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
ENERGY: Total E of oscillator for velocity-verlet solution&lt;br /&gt;
Total Energy is given by the summation of both kinetic energy: 1/2 mv2 and potential energy 1/2kx2.&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Energy.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data. &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Time!! Maximum Error&lt;br /&gt;
|-&lt;br /&gt;
| 1.9|| 7.58E-04&lt;br /&gt;
|-&lt;br /&gt;
| 5.00|| 2.00E-03&lt;br /&gt;
|-&lt;br /&gt;
| 8.00|| 3.30E-03&lt;br /&gt;
|-&lt;br /&gt;
| 11.10|| 4.60E-03&lt;br /&gt;
|-&lt;br /&gt;
| 14.20|| 5.91E-03&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
[[File:2.2_Max_Error.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph shows a linear relationship between the maximum errors of position with time, characterised by its extrapolation formula y = 0.0004x – 0.00005.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;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?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Previously for timestep 0.1, the percentage change was 0.248%. By varying the timestep, we are able to deduce the corresponding percentage changes, shown in Table X. As timestep increases, the minima total energy value decreases gradually, leading to a larger percentage change in total energy. In order for total energy not to go over 1%, the timestep must not be larger than 0.2. It is important to monitor the total energy of a physical system while modelling its behaviour numerically. This is because the Law of Conservation of Energy is observed, where total energy stays constant. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Timestep!! Energy Maxima!! Energy Minima!! Change in Energy&lt;br /&gt;
|-&lt;br /&gt;
| 0.05|| 0.5||0.4997||0.06%&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;0.1||&#039;&#039;&#039;0.5&#039;&#039;&#039;||&#039;&#039;&#039;0.4988&#039;&#039;&#039;||&#039;&#039;&#039;0.24%&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0.15||0.5||0.4972||0.56%&lt;br /&gt;
|-&lt;br /&gt;
| 0.2||0.5||0.4950||1.00%&lt;br /&gt;
|-&lt;br /&gt;
| 0.25|| 0.5||0.4922||1.56%&lt;br /&gt;
|-&lt;br /&gt;
| 0.3|| 0.5||0.4888||2.24%&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Row highlighted in bold is the simulation done from previous tasks.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;For a single Lennard-Jones interaction, [[File:8c44e3156b2bf003c09fa62fbaed5cb0.png]], find the separation, [[File:2.4_E2.png]], at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, [[File:2.4_E3.png]], and work out the well depth ([[File:2.4_E4.png]]). Evaluate the integrals [[File:2.4_E5.png]], [[File:2.4_E6.png]], and [[File:2.4_E7.png]] when [[File:2.4_E8.png]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the potential energy is zero, separation r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; can be found:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
At this separation, the force can be calculated with [[File:2.4_F_Eq.png|100px]], where using the definition of U from equation 10 &amp;lt;ref name=&amp;quot;equation 10&amp;quot; /&amp;gt; produces:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs where F&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; = 0, so:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans3.png]]&lt;br /&gt;
&lt;br /&gt;
Well depth, &lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans4.PNG]]&lt;br /&gt;
&lt;br /&gt;
When σ=ϵ=1.0,&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans5.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&amp;lt;b&amp;gt;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At standard conditions, there are 3.35 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt; water molecules in 1 mL of water.&lt;br /&gt;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;; Volume = 1 mL = 1 cm&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;; Mr = 18; N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 6.022 x 10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2.5_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
For 10000 water molecules, the calculated volume is 2.99 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; mL:&lt;br /&gt;
&lt;br /&gt;
[[File:2.5_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&amp;lt;b&amp;gt;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, &#039;&#039;after the periodic boundary conditions have been applied?&#039;&#039;.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sum of (0.5, 0.5, 0.5) and (0.7, 0.6, 0.2) gives (1.2,1.1,0.7), but this assumes periodic boundary conditions not applied. If applied, number of atoms inside box always constant as one leaves, simultaneously another enters. Hence deduct (1.2,1.1,0.7) by value of 1 in the x and y coordinates since they exceed the value of 1, to give the (0.2,0.1,0.3) position.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&amp;lt;b&amp;gt;The Lennard-Jones parameters for argon are [[File:1.7_E1.png]]. If the LJ cutoff is [[File:1.7_E2.png]], 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 [[File:4.1_E1.png]] in real units?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2.7_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
==Part 3: Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together? &lt;br /&gt;
If molecules are put extremely close to each other then they might overlap each other, having unfavourable repulsion interactions. &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates in simulations, there is a possibility that the simulation puts 2 atoms such that they overlap one another, which is not possible in real terms. As two atoms get closer together, their potential energy increases exponentially, causing a discrepancy in the calculated values. This is avoided when the atoms are placed at lattice points.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given previously that each length of a unit cell is 1.07722, &lt;br /&gt;
&lt;br /&gt;
[[File:3.2_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
For a fcc lattice of lattice point number density 1.2:&lt;br /&gt;
&lt;br /&gt;
[[File:3.2_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;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? &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the fcc lattice has 4 atoms, where each is 1000 unit cells, a total of 4000 atoms will be created.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;Using the LAMMPS manual, find the purpose of the following commands in the input script: &amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.4_E1.PNG]]&lt;br /&gt;
&lt;br /&gt;
The first line is a mass command where 1 is the atom type, with mass of 1.0. This input script sets all atoms of atom type 1 to have a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
The second line is a pair style command which computes the pairwise interactions of 2 atoms. This command is scripted such that the Lennard-Jones potential is cut off for coulomb interaction beyond distance of 3.0, hence absence of potential energy. Within distance 3.0, there will be a presence of potential energy due to the active Lennard-Jones interaction.&lt;br /&gt;
&lt;br /&gt;
The third line is a pair coeff command, where the * sign in pair coeff command sets coefficients for multiple pairs of atom types. As there is no numeric value, it means all types from 1 to N. In the case used, there are only atoms of 1 type so this command sets the coefficient value to all atoms of type 1. The first 1.0 coefficient value corresponds to the distance at which potential energies, σ of 2 atoms is 0, whereas the second 1.0 coefficient is the well depth.&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&amp;lt;b&amp;gt;Look at the lines below.&amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.5_E1.PNG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;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;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.5_E2.PNG]]&lt;br /&gt;
&lt;br /&gt;
The first code allows the simulation to run over a fixed time with a varied amount of timesteps. Such that the larger the timestep, the lesser steps is used to run the total simulation. Similarly, more steps are used when a small timestep is set for that variation. The timestep difference between each simulation is 0.001. The second code does not allow this to happen as it only runs the simulation for a fixed timestep at 0.001.&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&amp;lt;b&amp;gt;Given that we are specifying [[File:3.6_E1.png]] and [[File:3.6_E2.png]], which integration algorithm are we going to use?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As 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) is given, the Velocity-Verlet algorithm should be used.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&amp;lt;b&amp;gt;Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium can be said to be achieved when thermodynamic quantities becomes constant. Hence for the timestep 0.001, the simulation reaches equilibrium since the plots of temperature and pressure versus time equilibrates to a constant value of approximately 1.25K and 1.25atm. From the zoomed in view, we can deduce that equilibration is achieved within 0.05s.&lt;br /&gt;
Equilibrium has also been achieved for other timesteps, except 0.015, where the graph of total energy versus time graph is observed to gradually increase.&lt;br /&gt;
The largest timestep to provide acceptable results is 0.01. Timestep 0.015 is a particularly bad choice because the simulation does not achieve equilibrium as its total energy value is increasing over time, with a large spread of error (larger fluctuation).&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Total_Energy_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Total energy versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Temperature_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Temperature versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Temperature_0.001_zoom.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Temperature versus time for timestep 0.001, zoomed in version&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Pressure_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Pressure versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Total_Energy_all_timestep.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Total Energy versus time for timesteps 0.001, 0.0025, 0.0075, 0.01, 0.015.&lt;br /&gt;
&lt;br /&gt;
==Part 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Choose 5 temperatures (above the critical temperature [[File:4.1_E1.png]]), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen [[File:4.1_E2.png]] points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Temperatures used: 2.0, 2.5, 3.0, 3.5, 4.0&lt;br /&gt;
&lt;br /&gt;
Pressures used: 2.5, 2.8&lt;br /&gt;
&lt;br /&gt;
Timestep used: 0.0025&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;We need to choose [[File:4.2_E1.png]] so that the temperature is correct [[File:4.2_E2.png]] if we multiply every velocity [[File:4.2_E1.png]]. We can write two equations:&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:4.2_E3.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:4.2_E4.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
Solve these to determine [[File:4.2_E1.png]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:4.2_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;Use the manual page 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, how much time will you simulate?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A measurement will be made every &#039;100&#039; units, with &#039;1000&#039; defined to provide the total average of all the &#039;100000&#039; values.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density [[File:4.4_E1.png]]. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated. Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:4.4_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
Density in Ideal Gas Law calculation:&lt;br /&gt;
&lt;br /&gt;
[[File:4.4_Ans2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
At any fixed pressure, the simulated density is lower than the ideal gas law plot. The ideal gas law states that there is negligible interaction between molecules, leading to no repulsive forces. Given this, molecules are more likely to be found next to one another, as compared to the simulation. Where in the case of a simulation, interactions between molecules are present, along with the presence of repulsion forces. This causes the molecules to be found far away from each other. Hence for a given volume, density is higher for an ideal gas (molecules near each other) than for a non-ideal gas (molecules far apart). This discrepancy of ideal gas law and simulation increases with pressure. This is because at high pressures, molecules are forced to be next to each other, increasing repulsion, therefore reducing density.&lt;br /&gt;
&lt;br /&gt;
==Part 5: Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature [[File:5.1_Equation_1.png]] phase space, rather than pressure-temperature phase space. The two densities required at 0.2 and 0.8, and the temperature range is 2.0, 2.2, 2.4, 2.6, 2.8. Plot [[File:5.1_Equation_2.png]] as a function of temperature, where [[File:5.1_Equation_3.png]] 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.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:5.1_Graph.PNG]]&lt;br /&gt;
&lt;br /&gt;
The trend observed in the graph above is not what would normally be expected as Cv/V is supposed to increase with temperature. At higher temperatures, the total internal energy of the system increases, therefore higher heat capacity due to the increased difficulty to increase the temperature per unit. A lower density also leads to a lower heat capacity, lowering the height of the trendline. This is because heat capacity is an extensive property. A larger density would mean more atoms at the given fixed volume, hence driving up the Cv/V value.&lt;br /&gt;
&lt;br /&gt;
Input script for density 0.2 at temperature 2.0 attached: [[File:5.1_(0.2,2.0).in]]&lt;br /&gt;
&lt;br /&gt;
==Part 6: Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate [[File:6.1_Equation_1.png]] and [[File:6.1_Equation_2.png]]. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:6.1_Ans1.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:6.1_Ans2.PNG]]&lt;br /&gt;
&lt;br /&gt;
The number of peaks in the g(r) plot corresponds to the number of neighbouring atoms. As the solid has the highest number of peaks in the g(r) plot, it has the most neighbouring atoms, followed by liquid and finally gas. The distance between neighbouring atoms in a gas can be seen to be approximately a few times bigger than the solid as within a single gas peak, there are multiple solid peaks. The first 3 peaks for the solid corresponds to the 3 nearest atoms to the sampled atom, as per equidistant lattice points on a cube. The coordination number for the first three peaks are 12, 18 and 42.&lt;br /&gt;
&lt;br /&gt;
==Part 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate [[File:7.2_D.png]] in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Graphs of Mean Squared Displacement against Time&lt;br /&gt;
! 1 atom!! 1 million atoms&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Liq.PNG]]|| [[File:7.1_MSD_Liq1m.PNG]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Solid.PNG]]|| [[File:7.1_MSD_Solid1m.PNG]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Vap.PNG]]|| [[File:7.1_MSD_Vap1m.PNG]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Trendline for 1 million liquid and vapour atoms has a larger gradient and intercept than the normal box simulation. This is opposed in the solid, with a lower gradient and intercept for the 1 million atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
[[File:7.3_Equation_1.png]]. &lt;br /&gt;
Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot [[File:7.3_Equation_2.png]] with [[File:7.3_Equation_3.png]] and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:7.2_Ans1.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:7.2_Graph.PNG]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;equation 10&amp;quot;&amp;gt;https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment/Introduction_to_molecular_dynamics_simulation&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=User:JFU1608&amp;diff=543615</id>
		<title>User:JFU1608</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=User:JFU1608&amp;diff=543615"/>
		<updated>2016-02-26T10:37:18Z</updated>

		<summary type="html">&lt;p&gt;Jwf13: /* Part 7: Dynamical properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Part 1: Running first simulation==&lt;br /&gt;
&lt;br /&gt;
-no tasks-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Part 2: Introduction to molecular dynamics simulation==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time  t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by  (the values of  ,  , and   are worked out for you in the sheet).&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL: Position at time t (classical solution)&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Position.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
ERROR: Absolute difference between ANALYTICAL and Velocity-verlet solution&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Error.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
ENERGY: Total E of oscillator for velocity-verlet solution&lt;br /&gt;
Total Energy is given by the summation of both kinetic energy: 1/2 mv2 and potential energy 1/2kx2.&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Energy.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data. &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Time!! Maximum Error&lt;br /&gt;
|-&lt;br /&gt;
| 1.9|| 7.58E-04&lt;br /&gt;
|-&lt;br /&gt;
| 5.00|| 2.00E-03&lt;br /&gt;
|-&lt;br /&gt;
| 8.00|| 3.30E-03&lt;br /&gt;
|-&lt;br /&gt;
| 11.10|| 4.60E-03&lt;br /&gt;
|-&lt;br /&gt;
| 14.20|| 5.91E-03&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
[[File:2.2_Max_Error.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph shows a linear relationship between the maximum errors of position with time, characterised by its extrapolation formula y = 0.0004x – 0.00005.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;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?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Previously for timestep 0.1, the percentage change was 0.248%. By varying the timestep, we are able to deduce the corresponding percentage changes, shown in Table X. As timestep increases, the minima total energy value decreases gradually, leading to a larger percentage change in total energy. In order for total energy not to go over 1%, the timestep must not be larger than 0.2. It is important to monitor the total energy of a physical system while modelling its behaviour numerically. This is because the Law of Conservation of Energy is observed, where total energy stays constant. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Timestep!! Energy Maxima!! Energy Minima!! Change in Energy&lt;br /&gt;
|-&lt;br /&gt;
| 0.05|| 0.5||0.4997||0.06%&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;0.1||&#039;&#039;&#039;0.5&#039;&#039;&#039;||&#039;&#039;&#039;0.4988&#039;&#039;&#039;||&#039;&#039;&#039;0.24%&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0.15||0.5||0.4972||0.56%&lt;br /&gt;
|-&lt;br /&gt;
| 0.2||0.5||0.4950||1.00%&lt;br /&gt;
|-&lt;br /&gt;
| 0.25|| 0.5||0.4922||1.56%&lt;br /&gt;
|-&lt;br /&gt;
| 0.3|| 0.5||0.4888||2.24%&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Row highlighted in bold is the simulation done from previous tasks.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;For a single Lennard-Jones interaction, [[File:8c44e3156b2bf003c09fa62fbaed5cb0.png]], find the separation, [[File:2.4_E2.png]], at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, [[File:2.4_E3.png]], and work out the well depth ([[File:2.4_E4.png]]). Evaluate the integrals [[File:2.4_E5.png]], [[File:2.4_E6.png]], and [[File:2.4_E7.png]] when [[File:2.4_E8.png]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the potential energy is zero, separation r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; can be found:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
At this separation, the force can be calculated with [[File:2.4_F_Eq.png|100px]], where using the definition of U from equation 10 &amp;lt;ref name=&amp;quot;equation 10&amp;quot; /&amp;gt; produces:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs where F&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; = 0, so:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans3.png]]&lt;br /&gt;
&lt;br /&gt;
Well depth, &lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans4.PNG]]&lt;br /&gt;
&lt;br /&gt;
When σ=ϵ=1.0,&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans5.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&amp;lt;b&amp;gt;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At standard conditions, there are 3.35 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt; water molecules in 1 mL of water.&lt;br /&gt;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;; Volume = 1 mL = 1 cm&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;; Mr = 18; N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 6.022 x 10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2.5_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
For 10000 water molecules, the calculated volume is 2.99 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; mL:&lt;br /&gt;
&lt;br /&gt;
[[File:2.5_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&amp;lt;b&amp;gt;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, &#039;&#039;after the periodic boundary conditions have been applied?&#039;&#039;.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sum of (0.5, 0.5, 0.5) and (0.7, 0.6, 0.2) gives (1.2,1.1,0.7), but this assumes periodic boundary conditions not applied. If applied, number of atoms inside box always constant as one leaves, simultaneously another enters. Hence deduct (1.2,1.1,0.7) by value of 1 in the x and y coordinates since they exceed the value of 1, to give the (0.2,0.1,0.3) position.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&amp;lt;b&amp;gt;The Lennard-Jones parameters for argon are [[File:1.7_E1.png]]. If the LJ cutoff is [[File:1.7_E2.png]], 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 [[File:4.1_E1.png]] in real units?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2.7_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
==Part 3: Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together? &lt;br /&gt;
If molecules are put extremely close to each other then they might overlap each other, having unfavourable repulsion interactions. &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates in simulations, there is a possibility that the simulation puts 2 atoms such that they overlap one another, which is not possible in real terms. As two atoms get closer together, their potential energy increases exponentially, causing a discrepancy in the calculated values. This is avoided when the atoms are placed at lattice points.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given previously that each length of a unit cell is 1.07722, &lt;br /&gt;
&lt;br /&gt;
[[File:3.2_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
For a fcc lattice of lattice point number density 1.2:&lt;br /&gt;
&lt;br /&gt;
[[File:3.2_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;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? &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the fcc lattice has 4 atoms, where each is 1000 unit cells, a total of 4000 atoms will be created.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;Using the LAMMPS manual, find the purpose of the following commands in the input script: &amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.4_E1.PNG]]&lt;br /&gt;
&lt;br /&gt;
The first line is a mass command where 1 is the atom type, with mass of 1.0. This input script sets all atoms of atom type 1 to have a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
The second line is a pair style command which computes the pairwise interactions of 2 atoms. This command is scripted such that the Lennard-Jones potential is cut off for coulomb interaction beyond distance of 3.0, hence absence of potential energy. Within distance 3.0, there will be a presence of potential energy due to the active Lennard-Jones interaction.&lt;br /&gt;
&lt;br /&gt;
The third line is a pair coeff command, where the * sign in pair coeff command sets coefficients for multiple pairs of atom types. As there is no numeric value, it means all types from 1 to N. In the case used, there are only atoms of 1 type so this command sets the coefficient value to all atoms of type 1. The first 1.0 coefficient value corresponds to the distance at which potential energies, σ of 2 atoms is 0, whereas the second 1.0 coefficient is the well depth.&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&amp;lt;b&amp;gt;Look at the lines below.&amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.5_E1.PNG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;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;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.5_E2.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&amp;lt;b&amp;gt;Given that we are specifying [[File:3.6_E1.png]] and [[File:3.6_E2.png]], which integration algorithm are we going to use?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As 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) is given, the Velocity-Verlet algorithm should be used.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&amp;lt;b&amp;gt;Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium can be said to be achieved when thermodynamic quantities becomes constant. Hence for the timestep 0.001, the simulation reaches equilibrium since the plots of temperature and pressure versus time equilibrates to a constant value of approximately 1.25K and 1.25atm. From the zoomed in view, we can deduce that equilibration is achieved within 0.05s.&lt;br /&gt;
Equilibrium has also been achieved for other timesteps, except 0.015, where the graph of total energy versus time graph is observed to gradually increase.&lt;br /&gt;
The largest timestep to provide acceptable results is 0.01. Timestep 0.015 is a particularly bad choice because the simulation does not achieve equilibrium as its total energy value is increasing over time, with a large spread of error (larger fluctuation).&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Total_Energy_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Total energy versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Temperature_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Temperature versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Temperature_0.001_zoom.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Temperature versus time for timestep 0.001, zoomed in version&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Pressure_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Pressure versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Total_Energy_all_timestep.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Total Energy versus time for timesteps 0.001, 0.0025, 0.0075, 0.01, 0.015.&lt;br /&gt;
&lt;br /&gt;
==Part 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Choose 5 temperatures (above the critical temperature [[File:4.1_E1.png]]), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen [[File:4.1_E2.png]] points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Temperatures used: 2.0, 2.5, 3.0, 3.5, 4.0&lt;br /&gt;
&lt;br /&gt;
Pressures used: 2.5, 2.8&lt;br /&gt;
&lt;br /&gt;
Timestep used: 0.0025&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;We need to choose [[File:4.2_E1.png]] so that the temperature is correct [[File:4.2_E2.png]] if we multiply every velocity [[File:4.2_E1.png]]. We can write two equations:&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:4.2_E3.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:4.2_E4.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
Solve these to determine [[File:4.2_E1.png]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:4.2_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;Use the manual page 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, how much time will you simulate?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A measurement will be made every &#039;100&#039; units, with &#039;1000&#039; defined to provide the total average of all the &#039;100000&#039; values.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density [[File:4.4_E1.png]]. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated. Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:4.4_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
Density in Ideal Gas Law calculation:&lt;br /&gt;
&lt;br /&gt;
[[File:4.4_Ans2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
At any fixed pressure, the simulated density is lower than the ideal gas law plot. The ideal gas law states that there is negligible interaction between molecules, leading to no repulsive forces. Given this, molecules are more likely to be found next to one another, as compared to the simulation. Where in the case of a simulation, interactions between molecules are present, along with the presence of repulsion forces. This causes the molecules to be found far away from each other. Hence for a given volume, density is higher for an ideal gas (molecules near each other) than for a non-ideal gas (molecules far apart). This discrepancy of ideal gas law and simulation increases with pressure. This is because at high pressures, molecules are forced to be next to each other, increasing repulsion, therefore reducing density.&lt;br /&gt;
&lt;br /&gt;
==Part 5: Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature [[File:5.1_Equation_1.png]] phase space, rather than pressure-temperature phase space. The two densities required at 0.2 and 0.8, and the temperature range is 2.0, 2.2, 2.4, 2.6, 2.8. Plot [[File:5.1_Equation_2.png]] as a function of temperature, where [[File:5.1_Equation_3.png]] 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.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:5.1_Graph.PNG]]&lt;br /&gt;
&lt;br /&gt;
The trend observed in the graph above is not what would normally be expected as Cv/V is supposed to increase with temperature. At higher temperatures, the total internal energy of the system increases, therefore higher heat capacity due to the increased difficulty to increase the temperature per unit. A lower density also leads to a lower heat capacity, lowering the height of the trendline. This is because heat capacity is an extensive property. A larger density would mean more atoms at the given fixed volume, hence driving up the Cv/V value.&lt;br /&gt;
&lt;br /&gt;
Input script for density 0.2 at temperature 2.0 attached: [[File:5.1_(0.2,2.0).in]]&lt;br /&gt;
&lt;br /&gt;
==Part 6: Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate [[File:6.1_Equation_1.png]] and [[File:6.1_Equation_2.png]]. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:6.1_Ans1.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:6.1_Ans2.PNG]]&lt;br /&gt;
&lt;br /&gt;
The number of peaks in the g(r) plot corresponds to the number of neighbouring atoms. As the solid has the highest number of peaks in the g(r) plot, it has the most neighbouring atoms, followed by liquid and finally gas. The distance between neighbouring atoms in a gas can be seen to be approximately a few times bigger than the solid as within a single gas peak, there are multiple solid peaks. The first 3 peaks for the solid corresponds to the 3 nearest atoms to the sampled atom, as per equidistant lattice points on a cube. The coordination number for the first three peaks are 12, 18 and 42.&lt;br /&gt;
&lt;br /&gt;
==Part 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate [[File:7.2_D.png]] in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Graphs of Mean Squared Displacement against Time&lt;br /&gt;
! 1 atom!! 1 million atoms&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Liq.PNG]]|| [[File:7.1_MSD_Liq1m.PNG]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Solid.PNG]]|| [[File:7.1_MSD_Solid1m.PNG]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Vap.PNG]]|| [[File:7.1_MSD_Vap1m.PNG]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Trendline for 1 million liquid and vapour atoms has a larger gradient and intercept than the normal box simulation. This is opposed in the solid, with a lower gradient and intercept for the 1 million atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
[[File:7.3_Equation_1.png]]. &lt;br /&gt;
Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot [[File:7.3_Equation_2.png]] with [[File:7.3_Equation_3.png]] and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:7.2_Ans1.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:7.2_Graph.PNG]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;equation 10&amp;quot;&amp;gt;https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment/Introduction_to_molecular_dynamics_simulation&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:7.2_Graph.PNG&amp;diff=543614</id>
		<title>File:7.2 Graph.PNG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:7.2_Graph.PNG&amp;diff=543614"/>
		<updated>2016-02-26T10:36:42Z</updated>

		<summary type="html">&lt;p&gt;Jwf13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:7.2_Ans1.PNG&amp;diff=543599</id>
		<title>File:7.2 Ans1.PNG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:7.2_Ans1.PNG&amp;diff=543599"/>
		<updated>2016-02-26T10:16:27Z</updated>

		<summary type="html">&lt;p&gt;Jwf13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=User:JFU1608&amp;diff=543597</id>
		<title>User:JFU1608</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=User:JFU1608&amp;diff=543597"/>
		<updated>2016-02-26T10:14:33Z</updated>

		<summary type="html">&lt;p&gt;Jwf13: /* Part 7: Dynamical properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Part 1: Running first simulation==&lt;br /&gt;
&lt;br /&gt;
-no tasks-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Part 2: Introduction to molecular dynamics simulation==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time  t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by  (the values of  ,  , and   are worked out for you in the sheet).&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL: Position at time t (classical solution)&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Position.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
ERROR: Absolute difference between ANALYTICAL and Velocity-verlet solution&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Error.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
ENERGY: Total E of oscillator for velocity-verlet solution&lt;br /&gt;
Total Energy is given by the summation of both kinetic energy: 1/2 mv2 and potential energy 1/2kx2.&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Energy.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data. &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Time!! Maximum Error&lt;br /&gt;
|-&lt;br /&gt;
| 1.9|| 7.58E-04&lt;br /&gt;
|-&lt;br /&gt;
| 5.00|| 2.00E-03&lt;br /&gt;
|-&lt;br /&gt;
| 8.00|| 3.30E-03&lt;br /&gt;
|-&lt;br /&gt;
| 11.10|| 4.60E-03&lt;br /&gt;
|-&lt;br /&gt;
| 14.20|| 5.91E-03&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
[[File:2.2_Max_Error.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph shows a linear relationship between the maximum errors of position with time, characterised by its extrapolation formula y = 0.0004x – 0.00005.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;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?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Previously for timestep 0.1, the percentage change was 0.248%. By varying the timestep, we are able to deduce the corresponding percentage changes, shown in Table X. As timestep increases, the minima total energy value decreases gradually, leading to a larger percentage change in total energy. In order for total energy not to go over 1%, the timestep must not be larger than 0.2. It is important to monitor the total energy of a physical system while modelling its behaviour numerically. This is because the Law of Conservation of Energy is observed, where total energy stays constant. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Timestep!! Energy Maxima!! Energy Minima!! Change in Energy&lt;br /&gt;
|-&lt;br /&gt;
| 0.05|| 0.5||0.4997||0.06%&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;0.1||&#039;&#039;&#039;0.5&#039;&#039;&#039;||&#039;&#039;&#039;0.4988&#039;&#039;&#039;||&#039;&#039;&#039;0.24%&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0.15||0.5||0.4972||0.56%&lt;br /&gt;
|-&lt;br /&gt;
| 0.2||0.5||0.4950||1.00%&lt;br /&gt;
|-&lt;br /&gt;
| 0.25|| 0.5||0.4922||1.56%&lt;br /&gt;
|-&lt;br /&gt;
| 0.3|| 0.5||0.4888||2.24%&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Row highlighted in bold is the simulation done from previous tasks.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;For a single Lennard-Jones interaction, [[File:8c44e3156b2bf003c09fa62fbaed5cb0.png]], find the separation, [[File:2.4_E2.png]], at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, [[File:2.4_E3.png]], and work out the well depth ([[File:2.4_E4.png]]). Evaluate the integrals [[File:2.4_E5.png]], [[File:2.4_E6.png]], and [[File:2.4_E7.png]] when [[File:2.4_E8.png]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the potential energy is zero, separation r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; can be found:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
At this separation, the force can be calculated with [[File:2.4_F_Eq.png|100px]], where using the definition of U from equation 10 &amp;lt;ref name=&amp;quot;equation 10&amp;quot; /&amp;gt; produces:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs where F&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; = 0, so:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans3.png]]&lt;br /&gt;
&lt;br /&gt;
Well depth, &lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans4.PNG]]&lt;br /&gt;
&lt;br /&gt;
When σ=ϵ=1.0,&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans5.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&amp;lt;b&amp;gt;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At standard conditions, there are 3.35 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt; water molecules in 1 mL of water.&lt;br /&gt;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;; Volume = 1 mL = 1 cm&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;; Mr = 18; N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 6.022 x 10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2.5_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
For 10000 water molecules, the calculated volume is 2.99 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; mL:&lt;br /&gt;
&lt;br /&gt;
[[File:2.5_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&amp;lt;b&amp;gt;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, &#039;&#039;after the periodic boundary conditions have been applied?&#039;&#039;.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sum of (0.5, 0.5, 0.5) and (0.7, 0.6, 0.2) gives (1.2,1.1,0.7), but this assumes periodic boundary conditions not applied. If applied, number of atoms inside box always constant as one leaves, simultaneously another enters. Hence deduct (1.2,1.1,0.7) by value of 1 in the x and y coordinates since they exceed the value of 1, to give the (0.2,0.1,0.3) position.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&amp;lt;b&amp;gt;The Lennard-Jones parameters for argon are [[File:1.7_E1.png]]. If the LJ cutoff is [[File:1.7_E2.png]], 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 [[File:4.1_E1.png]] in real units?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2.7_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
==Part 3: Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together? &lt;br /&gt;
If molecules are put extremely close to each other then they might overlap each other, having unfavourable repulsion interactions. &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates in simulations, there is a possibility that the simulation puts 2 atoms such that they overlap one another, which is not possible in real terms. As two atoms get closer together, their potential energy increases exponentially, causing a discrepancy in the calculated values. This is avoided when the atoms are placed at lattice points.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given previously that each length of a unit cell is 1.07722, &lt;br /&gt;
&lt;br /&gt;
[[File:3.2_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
For a fcc lattice of lattice point number density 1.2:&lt;br /&gt;
&lt;br /&gt;
[[File:3.2_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;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? &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the fcc lattice has 4 atoms, where each is 1000 unit cells, a total of 4000 atoms will be created.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;Using the LAMMPS manual, find the purpose of the following commands in the input script: &amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.4_E1.PNG]]&lt;br /&gt;
&lt;br /&gt;
The first line is a mass command where 1 is the atom type, with mass of 1.0. This input script sets all atoms of atom type 1 to have a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
The second line is a pair style command which computes the pairwise interactions of 2 atoms. This command is scripted such that the Lennard-Jones potential is cut off for coulomb interaction beyond distance of 3.0, hence absence of potential energy. Within distance 3.0, there will be a presence of potential energy due to the active Lennard-Jones interaction.&lt;br /&gt;
&lt;br /&gt;
The third line is a pair coeff command, where the * sign in pair coeff command sets coefficients for multiple pairs of atom types. As there is no numeric value, it means all types from 1 to N. In the case used, there are only atoms of 1 type so this command sets the coefficient value to all atoms of type 1. The first 1.0 coefficient value corresponds to the distance at which potential energies, σ of 2 atoms is 0, whereas the second 1.0 coefficient is the well depth.&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&amp;lt;b&amp;gt;Look at the lines below.&amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.5_E1.PNG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;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;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.5_E2.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&amp;lt;b&amp;gt;Given that we are specifying [[File:3.6_E1.png]] and [[File:3.6_E2.png]], which integration algorithm are we going to use?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As 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) is given, the Velocity-Verlet algorithm should be used.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&amp;lt;b&amp;gt;Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium can be said to be achieved when thermodynamic quantities becomes constant. Hence for the timestep 0.001, the simulation reaches equilibrium since the plots of temperature and pressure versus time equilibrates to a constant value of approximately 1.25K and 1.25atm. From the zoomed in view, we can deduce that equilibration is achieved within 0.05s.&lt;br /&gt;
Equilibrium has also been achieved for other timesteps, except 0.015, where the graph of total energy versus time graph is observed to gradually increase.&lt;br /&gt;
The largest timestep to provide acceptable results is 0.01. Timestep 0.015 is a particularly bad choice because the simulation does not achieve equilibrium as its total energy value is increasing over time, with a large spread of error (larger fluctuation).&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Total_Energy_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Total energy versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Temperature_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Temperature versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Temperature_0.001_zoom.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Temperature versus time for timestep 0.001, zoomed in version&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Pressure_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Pressure versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Total_Energy_all_timestep.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Total Energy versus time for timesteps 0.001, 0.0025, 0.0075, 0.01, 0.015.&lt;br /&gt;
&lt;br /&gt;
==Part 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Choose 5 temperatures (above the critical temperature [[File:4.1_E1.png]]), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen [[File:4.1_E2.png]] points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Temperatures used: 2.0, 2.5, 3.0, 3.5, 4.0&lt;br /&gt;
&lt;br /&gt;
Pressures used: 2.5, 2.8&lt;br /&gt;
&lt;br /&gt;
Timestep used: 0.0025&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;We need to choose [[File:4.2_E1.png]] so that the temperature is correct [[File:4.2_E2.png]] if we multiply every velocity [[File:4.2_E1.png]]. We can write two equations:&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:4.2_E3.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:4.2_E4.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
Solve these to determine [[File:4.2_E1.png]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:4.2_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;Use the manual page 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, how much time will you simulate?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A measurement will be made every &#039;100&#039; units, with &#039;1000&#039; defined to provide the total average of all the &#039;100000&#039; values.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density [[File:4.4_E1.png]]. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated. Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:4.4_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
Density in Ideal Gas Law calculation:&lt;br /&gt;
&lt;br /&gt;
[[File:4.4_Ans2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
At any fixed pressure, the simulated density is lower than the ideal gas law plot. The ideal gas law states that there is negligible interaction between molecules, leading to no repulsive forces. Given this, molecules are more likely to be found next to one another, as compared to the simulation. Where in the case of a simulation, interactions between molecules are present, along with the presence of repulsion forces. This causes the molecules to be found far away from each other. Hence for a given volume, density is higher for an ideal gas (molecules near each other) than for a non-ideal gas (molecules far apart). This discrepancy of ideal gas law and simulation increases with pressure. This is because at high pressures, molecules are forced to be next to each other, increasing repulsion, therefore reducing density.&lt;br /&gt;
&lt;br /&gt;
==Part 5: Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature [[File:5.1_Equation_1.png]] phase space, rather than pressure-temperature phase space. The two densities required at 0.2 and 0.8, and the temperature range is 2.0, 2.2, 2.4, 2.6, 2.8. Plot [[File:5.1_Equation_2.png]] as a function of temperature, where [[File:5.1_Equation_3.png]] 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.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:5.1_Graph.PNG]]&lt;br /&gt;
&lt;br /&gt;
The trend observed in the graph above is not what would normally be expected as Cv/V is supposed to increase with temperature. At higher temperatures, the total internal energy of the system increases, therefore higher heat capacity due to the increased difficulty to increase the temperature per unit. A lower density also leads to a lower heat capacity, lowering the height of the trendline. This is because heat capacity is an extensive property. A larger density would mean more atoms at the given fixed volume, hence driving up the Cv/V value.&lt;br /&gt;
&lt;br /&gt;
Input script for density 0.2 at temperature 2.0 attached: [[File:5.1_(0.2,2.0).in]]&lt;br /&gt;
&lt;br /&gt;
==Part 6: Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate [[File:6.1_Equation_1.png]] and [[File:6.1_Equation_2.png]]. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:6.1_Ans1.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:6.1_Ans2.PNG]]&lt;br /&gt;
&lt;br /&gt;
The number of peaks in the g(r) plot corresponds to the number of neighbouring atoms. As the solid has the highest number of peaks in the g(r) plot, it has the most neighbouring atoms, followed by liquid and finally gas. The distance between neighbouring atoms in a gas can be seen to be approximately a few times bigger than the solid as within a single gas peak, there are multiple solid peaks. The first 3 peaks for the solid corresponds to the 3 nearest atoms to the sampled atom, as per equidistant lattice points on a cube. The coordination number for the first three peaks are 12, 18 and 42.&lt;br /&gt;
&lt;br /&gt;
==Part 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate [[File:7.2_D.png]] in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Graphs of Mean Squared Displacement against Time&lt;br /&gt;
! 1 atom!! 1 million atoms&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Liq.PNG]]|| [[File:7.1_MSD_Liq1m.PNG]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Solid.PNG]]|| [[File:7.1_MSD_Solid1m.PNG]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Vap.PNG]]|| [[File:7.1_MSD_Vap1m.PNG]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Trendline for 1 million liquid and vapour atoms has a larger gradient and intercept than the normal box simulation. This is opposed in the solid, with a lower gradient and intercept for the 1 million atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
[[File:7.3_Equation_1.png]]. &lt;br /&gt;
Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot [[File:7.3_Equation_2.png]] with [[File:7.3_Equation_3.png]] and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;equation 10&amp;quot;&amp;gt;https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment/Introduction_to_molecular_dynamics_simulation&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=User:JFU1608&amp;diff=543580</id>
		<title>User:JFU1608</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=User:JFU1608&amp;diff=543580"/>
		<updated>2016-02-26T09:53:04Z</updated>

		<summary type="html">&lt;p&gt;Jwf13: /* Part 7: Dynamical properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Part 1: Running first simulation==&lt;br /&gt;
&lt;br /&gt;
-no tasks-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Part 2: Introduction to molecular dynamics simulation==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time  t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by  (the values of  ,  , and   are worked out for you in the sheet).&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL: Position at time t (classical solution)&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Position.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
ERROR: Absolute difference between ANALYTICAL and Velocity-verlet solution&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Error.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
ENERGY: Total E of oscillator for velocity-verlet solution&lt;br /&gt;
Total Energy is given by the summation of both kinetic energy: 1/2 mv2 and potential energy 1/2kx2.&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Energy.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data. &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Time!! Maximum Error&lt;br /&gt;
|-&lt;br /&gt;
| 1.9|| 7.58E-04&lt;br /&gt;
|-&lt;br /&gt;
| 5.00|| 2.00E-03&lt;br /&gt;
|-&lt;br /&gt;
| 8.00|| 3.30E-03&lt;br /&gt;
|-&lt;br /&gt;
| 11.10|| 4.60E-03&lt;br /&gt;
|-&lt;br /&gt;
| 14.20|| 5.91E-03&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
[[File:2.2_Max_Error.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph shows a linear relationship between the maximum errors of position with time, characterised by its extrapolation formula y = 0.0004x – 0.00005.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;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?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Previously for timestep 0.1, the percentage change was 0.248%. By varying the timestep, we are able to deduce the corresponding percentage changes, shown in Table X. As timestep increases, the minima total energy value decreases gradually, leading to a larger percentage change in total energy. In order for total energy not to go over 1%, the timestep must not be larger than 0.2. It is important to monitor the total energy of a physical system while modelling its behaviour numerically. This is because the Law of Conservation of Energy is observed, where total energy stays constant. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Timestep!! Energy Maxima!! Energy Minima!! Change in Energy&lt;br /&gt;
|-&lt;br /&gt;
| 0.05|| 0.5||0.4997||0.06%&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;0.1||&#039;&#039;&#039;0.5&#039;&#039;&#039;||&#039;&#039;&#039;0.4988&#039;&#039;&#039;||&#039;&#039;&#039;0.24%&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0.15||0.5||0.4972||0.56%&lt;br /&gt;
|-&lt;br /&gt;
| 0.2||0.5||0.4950||1.00%&lt;br /&gt;
|-&lt;br /&gt;
| 0.25|| 0.5||0.4922||1.56%&lt;br /&gt;
|-&lt;br /&gt;
| 0.3|| 0.5||0.4888||2.24%&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Row highlighted in bold is the simulation done from previous tasks.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;For a single Lennard-Jones interaction, [[File:8c44e3156b2bf003c09fa62fbaed5cb0.png]], find the separation, [[File:2.4_E2.png]], at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, [[File:2.4_E3.png]], and work out the well depth ([[File:2.4_E4.png]]). Evaluate the integrals [[File:2.4_E5.png]], [[File:2.4_E6.png]], and [[File:2.4_E7.png]] when [[File:2.4_E8.png]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the potential energy is zero, separation r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; can be found:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
At this separation, the force can be calculated with [[File:2.4_F_Eq.png|100px]], where using the definition of U from equation 10 &amp;lt;ref name=&amp;quot;equation 10&amp;quot; /&amp;gt; produces:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs where F&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; = 0, so:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans3.png]]&lt;br /&gt;
&lt;br /&gt;
Well depth, &lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans4.PNG]]&lt;br /&gt;
&lt;br /&gt;
When σ=ϵ=1.0,&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans5.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&amp;lt;b&amp;gt;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At standard conditions, there are 3.35 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt; water molecules in 1 mL of water.&lt;br /&gt;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;; Volume = 1 mL = 1 cm&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;; Mr = 18; N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 6.022 x 10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2.5_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
For 10000 water molecules, the calculated volume is 2.99 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; mL:&lt;br /&gt;
&lt;br /&gt;
[[File:2.5_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&amp;lt;b&amp;gt;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, &#039;&#039;after the periodic boundary conditions have been applied?&#039;&#039;.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sum of (0.5, 0.5, 0.5) and (0.7, 0.6, 0.2) gives (1.2,1.1,0.7), but this assumes periodic boundary conditions not applied. If applied, number of atoms inside box always constant as one leaves, simultaneously another enters. Hence deduct (1.2,1.1,0.7) by value of 1 in the x and y coordinates since they exceed the value of 1, to give the (0.2,0.1,0.3) position.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&amp;lt;b&amp;gt;The Lennard-Jones parameters for argon are [[File:1.7_E1.png]]. If the LJ cutoff is [[File:1.7_E2.png]], 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 [[File:4.1_E1.png]] in real units?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2.7_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
==Part 3: Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together? &lt;br /&gt;
If molecules are put extremely close to each other then they might overlap each other, having unfavourable repulsion interactions. &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates in simulations, there is a possibility that the simulation puts 2 atoms such that they overlap one another, which is not possible in real terms. As two atoms get closer together, their potential energy increases exponentially, causing a discrepancy in the calculated values. This is avoided when the atoms are placed at lattice points.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given previously that each length of a unit cell is 1.07722, &lt;br /&gt;
&lt;br /&gt;
[[File:3.2_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
For a fcc lattice of lattice point number density 1.2:&lt;br /&gt;
&lt;br /&gt;
[[File:3.2_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;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? &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the fcc lattice has 4 atoms, where each is 1000 unit cells, a total of 4000 atoms will be created.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;Using the LAMMPS manual, find the purpose of the following commands in the input script: &amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.4_E1.PNG]]&lt;br /&gt;
&lt;br /&gt;
The first line is a mass command where 1 is the atom type, with mass of 1.0. This input script sets all atoms of atom type 1 to have a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
The second line is a pair style command which computes the pairwise interactions of 2 atoms. This command is scripted such that the Lennard-Jones potential is cut off for coulomb interaction beyond distance of 3.0, hence absence of potential energy. Within distance 3.0, there will be a presence of potential energy due to the active Lennard-Jones interaction.&lt;br /&gt;
&lt;br /&gt;
The third line is a pair coeff command, where the * sign in pair coeff command sets coefficients for multiple pairs of atom types. As there is no numeric value, it means all types from 1 to N. In the case used, there are only atoms of 1 type so this command sets the coefficient value to all atoms of type 1. The first 1.0 coefficient value corresponds to the distance at which potential energies, σ of 2 atoms is 0, whereas the second 1.0 coefficient is the well depth.&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&amp;lt;b&amp;gt;Look at the lines below.&amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.5_E1.PNG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;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;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.5_E2.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&amp;lt;b&amp;gt;Given that we are specifying [[File:3.6_E1.png]] and [[File:3.6_E2.png]], which integration algorithm are we going to use?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As 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) is given, the Velocity-Verlet algorithm should be used.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&amp;lt;b&amp;gt;Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium can be said to be achieved when thermodynamic quantities becomes constant. Hence for the timestep 0.001, the simulation reaches equilibrium since the plots of temperature and pressure versus time equilibrates to a constant value of approximately 1.25K and 1.25atm. From the zoomed in view, we can deduce that equilibration is achieved within 0.05s.&lt;br /&gt;
Equilibrium has also been achieved for other timesteps, except 0.015, where the graph of total energy versus time graph is observed to gradually increase.&lt;br /&gt;
The largest timestep to provide acceptable results is 0.01. Timestep 0.015 is a particularly bad choice because the simulation does not achieve equilibrium as its total energy value is increasing over time, with a large spread of error (larger fluctuation).&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Total_Energy_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Total energy versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Temperature_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Temperature versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Temperature_0.001_zoom.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Temperature versus time for timestep 0.001, zoomed in version&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Pressure_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Pressure versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Total_Energy_all_timestep.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Total Energy versus time for timesteps 0.001, 0.0025, 0.0075, 0.01, 0.015.&lt;br /&gt;
&lt;br /&gt;
==Part 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Choose 5 temperatures (above the critical temperature [[File:4.1_E1.png]]), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen [[File:4.1_E2.png]] points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Temperatures used: 2.0, 2.5, 3.0, 3.5, 4.0&lt;br /&gt;
&lt;br /&gt;
Pressures used: 2.5, 2.8&lt;br /&gt;
&lt;br /&gt;
Timestep used: 0.0025&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;We need to choose [[File:4.2_E1.png]] so that the temperature is correct [[File:4.2_E2.png]] if we multiply every velocity [[File:4.2_E1.png]]. We can write two equations:&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:4.2_E3.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:4.2_E4.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
Solve these to determine [[File:4.2_E1.png]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:4.2_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;Use the manual page 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, how much time will you simulate?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A measurement will be made every &#039;100&#039; units, with &#039;1000&#039; defined to provide the total average of all the &#039;100000&#039; values.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density [[File:4.4_E1.png]]. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated. Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:4.4_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
Density in Ideal Gas Law calculation:&lt;br /&gt;
&lt;br /&gt;
[[File:4.4_Ans2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
At any fixed pressure, the simulated density is lower than the ideal gas law plot. The ideal gas law states that there is negligible interaction between molecules, leading to no repulsive forces. Given this, molecules are more likely to be found next to one another, as compared to the simulation. Where in the case of a simulation, interactions between molecules are present, along with the presence of repulsion forces. This causes the molecules to be found far away from each other. Hence for a given volume, density is higher for an ideal gas (molecules near each other) than for a non-ideal gas (molecules far apart). This discrepancy of ideal gas law and simulation increases with pressure. This is because at high pressures, molecules are forced to be next to each other, increasing repulsion, therefore reducing density.&lt;br /&gt;
&lt;br /&gt;
==Part 5: Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature [[File:5.1_Equation_1.png]] phase space, rather than pressure-temperature phase space. The two densities required at 0.2 and 0.8, and the temperature range is 2.0, 2.2, 2.4, 2.6, 2.8. Plot [[File:5.1_Equation_2.png]] as a function of temperature, where [[File:5.1_Equation_3.png]] 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.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:5.1_Graph.PNG]]&lt;br /&gt;
&lt;br /&gt;
The trend observed in the graph above is not what would normally be expected as Cv/V is supposed to increase with temperature. At higher temperatures, the total internal energy of the system increases, therefore higher heat capacity due to the increased difficulty to increase the temperature per unit. A lower density also leads to a lower heat capacity, lowering the height of the trendline. This is because heat capacity is an extensive property. A larger density would mean more atoms at the given fixed volume, hence driving up the Cv/V value.&lt;br /&gt;
&lt;br /&gt;
Input script for density 0.2 at temperature 2.0 attached: [[File:5.1_(0.2,2.0).in]]&lt;br /&gt;
&lt;br /&gt;
==Part 6: Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate [[File:6.1_Equation_1.png]] and [[File:6.1_Equation_2.png]]. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:6.1_Ans1.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:6.1_Ans2.PNG]]&lt;br /&gt;
&lt;br /&gt;
The number of peaks in the g(r) plot corresponds to the number of neighbouring atoms. As the solid has the highest number of peaks in the g(r) plot, it has the most neighbouring atoms, followed by liquid and finally gas. The distance between neighbouring atoms in a gas can be seen to be approximately a few times bigger than the solid as within a single gas peak, there are multiple solid peaks. The first 3 peaks for the solid corresponds to the 3 nearest atoms to the sampled atom, as per equidistant lattice points on a cube. The coordination number for the first three peaks are 12, 18 and 42.&lt;br /&gt;
&lt;br /&gt;
==Part 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;Make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate [[File:7.2_D.png]] in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Graphs of Mean Squared Displacement against Time&lt;br /&gt;
! 1 atom!! 1 million atoms&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Liq.PNG]]|| [[File:7.1_MSD_Liq1m.PNG]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Solid.PNG]]|| [[File:7.1_MSD_Solid1m.PNG]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Vap.PNG]]|| [[File:7.1_MSD_Vap1m.PNG]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Trendline for 1 million liquid and vapour atoms has a larger gradient and intercept than the normal box simulation. This is opposed in the solid, with a lower gradient and intercept for the 1 million atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
[[File:7.3_Equation_1.png]]. &lt;br /&gt;
Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot [[File:7.3_Equation_2.png]] with [[File:7.3_Equation_3.png]] and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;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 [[File:7.2_D.png]] 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?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;equation 10&amp;quot;&amp;gt;https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment/Introduction_to_molecular_dynamics_simulation&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=User:JFU1608&amp;diff=543579</id>
		<title>User:JFU1608</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=User:JFU1608&amp;diff=543579"/>
		<updated>2016-02-26T09:52:42Z</updated>

		<summary type="html">&lt;p&gt;Jwf13: /* Task 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Part 1: Running first simulation==&lt;br /&gt;
&lt;br /&gt;
-no tasks-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Part 2: Introduction to molecular dynamics simulation==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time  t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by  (the values of  ,  , and   are worked out for you in the sheet).&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL: Position at time t (classical solution)&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Position.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
ERROR: Absolute difference between ANALYTICAL and Velocity-verlet solution&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Error.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
ENERGY: Total E of oscillator for velocity-verlet solution&lt;br /&gt;
Total Energy is given by the summation of both kinetic energy: 1/2 mv2 and potential energy 1/2kx2.&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Energy.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data. &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Time!! Maximum Error&lt;br /&gt;
|-&lt;br /&gt;
| 1.9|| 7.58E-04&lt;br /&gt;
|-&lt;br /&gt;
| 5.00|| 2.00E-03&lt;br /&gt;
|-&lt;br /&gt;
| 8.00|| 3.30E-03&lt;br /&gt;
|-&lt;br /&gt;
| 11.10|| 4.60E-03&lt;br /&gt;
|-&lt;br /&gt;
| 14.20|| 5.91E-03&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
[[File:2.2_Max_Error.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph shows a linear relationship between the maximum errors of position with time, characterised by its extrapolation formula y = 0.0004x – 0.00005.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;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?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Previously for timestep 0.1, the percentage change was 0.248%. By varying the timestep, we are able to deduce the corresponding percentage changes, shown in Table X. As timestep increases, the minima total energy value decreases gradually, leading to a larger percentage change in total energy. In order for total energy not to go over 1%, the timestep must not be larger than 0.2. It is important to monitor the total energy of a physical system while modelling its behaviour numerically. This is because the Law of Conservation of Energy is observed, where total energy stays constant. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Timestep!! Energy Maxima!! Energy Minima!! Change in Energy&lt;br /&gt;
|-&lt;br /&gt;
| 0.05|| 0.5||0.4997||0.06%&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;0.1||&#039;&#039;&#039;0.5&#039;&#039;&#039;||&#039;&#039;&#039;0.4988&#039;&#039;&#039;||&#039;&#039;&#039;0.24%&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0.15||0.5||0.4972||0.56%&lt;br /&gt;
|-&lt;br /&gt;
| 0.2||0.5||0.4950||1.00%&lt;br /&gt;
|-&lt;br /&gt;
| 0.25|| 0.5||0.4922||1.56%&lt;br /&gt;
|-&lt;br /&gt;
| 0.3|| 0.5||0.4888||2.24%&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Row highlighted in bold is the simulation done from previous tasks.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;For a single Lennard-Jones interaction, [[File:8c44e3156b2bf003c09fa62fbaed5cb0.png]], find the separation, [[File:2.4_E2.png]], at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, [[File:2.4_E3.png]], and work out the well depth ([[File:2.4_E4.png]]). Evaluate the integrals [[File:2.4_E5.png]], [[File:2.4_E6.png]], and [[File:2.4_E7.png]] when [[File:2.4_E8.png]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the potential energy is zero, separation r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; can be found:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
At this separation, the force can be calculated with [[File:2.4_F_Eq.png|100px]], where using the definition of U from equation 10 &amp;lt;ref name=&amp;quot;equation 10&amp;quot; /&amp;gt; produces:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs where F&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; = 0, so:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans3.png]]&lt;br /&gt;
&lt;br /&gt;
Well depth, &lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans4.PNG]]&lt;br /&gt;
&lt;br /&gt;
When σ=ϵ=1.0,&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans5.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&amp;lt;b&amp;gt;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At standard conditions, there are 3.35 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt; water molecules in 1 mL of water.&lt;br /&gt;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;; Volume = 1 mL = 1 cm&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;; Mr = 18; N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 6.022 x 10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2.5_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
For 10000 water molecules, the calculated volume is 2.99 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; mL:&lt;br /&gt;
&lt;br /&gt;
[[File:2.5_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&amp;lt;b&amp;gt;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, &#039;&#039;after the periodic boundary conditions have been applied?&#039;&#039;.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sum of (0.5, 0.5, 0.5) and (0.7, 0.6, 0.2) gives (1.2,1.1,0.7), but this assumes periodic boundary conditions not applied. If applied, number of atoms inside box always constant as one leaves, simultaneously another enters. Hence deduct (1.2,1.1,0.7) by value of 1 in the x and y coordinates since they exceed the value of 1, to give the (0.2,0.1,0.3) position.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&amp;lt;b&amp;gt;The Lennard-Jones parameters for argon are [[File:1.7_E1.png]]. If the LJ cutoff is [[File:1.7_E2.png]], 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 [[File:4.1_E1.png]] in real units?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2.7_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
==Part 3: Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together? &lt;br /&gt;
If molecules are put extremely close to each other then they might overlap each other, having unfavourable repulsion interactions. &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates in simulations, there is a possibility that the simulation puts 2 atoms such that they overlap one another, which is not possible in real terms. As two atoms get closer together, their potential energy increases exponentially, causing a discrepancy in the calculated values. This is avoided when the atoms are placed at lattice points.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given previously that each length of a unit cell is 1.07722, &lt;br /&gt;
&lt;br /&gt;
[[File:3.2_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
For a fcc lattice of lattice point number density 1.2:&lt;br /&gt;
&lt;br /&gt;
[[File:3.2_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;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? &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the fcc lattice has 4 atoms, where each is 1000 unit cells, a total of 4000 atoms will be created.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;Using the LAMMPS manual, find the purpose of the following commands in the input script: &amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.4_E1.PNG]]&lt;br /&gt;
&lt;br /&gt;
The first line is a mass command where 1 is the atom type, with mass of 1.0. This input script sets all atoms of atom type 1 to have a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
The second line is a pair style command which computes the pairwise interactions of 2 atoms. This command is scripted such that the Lennard-Jones potential is cut off for coulomb interaction beyond distance of 3.0, hence absence of potential energy. Within distance 3.0, there will be a presence of potential energy due to the active Lennard-Jones interaction.&lt;br /&gt;
&lt;br /&gt;
The third line is a pair coeff command, where the * sign in pair coeff command sets coefficients for multiple pairs of atom types. As there is no numeric value, it means all types from 1 to N. In the case used, there are only atoms of 1 type so this command sets the coefficient value to all atoms of type 1. The first 1.0 coefficient value corresponds to the distance at which potential energies, σ of 2 atoms is 0, whereas the second 1.0 coefficient is the well depth.&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&amp;lt;b&amp;gt;Look at the lines below.&amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.5_E1.PNG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;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;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.5_E2.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&amp;lt;b&amp;gt;Given that we are specifying [[File:3.6_E1.png]] and [[File:3.6_E2.png]], which integration algorithm are we going to use?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As 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) is given, the Velocity-Verlet algorithm should be used.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&amp;lt;b&amp;gt;Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium can be said to be achieved when thermodynamic quantities becomes constant. Hence for the timestep 0.001, the simulation reaches equilibrium since the plots of temperature and pressure versus time equilibrates to a constant value of approximately 1.25K and 1.25atm. From the zoomed in view, we can deduce that equilibration is achieved within 0.05s.&lt;br /&gt;
Equilibrium has also been achieved for other timesteps, except 0.015, where the graph of total energy versus time graph is observed to gradually increase.&lt;br /&gt;
The largest timestep to provide acceptable results is 0.01. Timestep 0.015 is a particularly bad choice because the simulation does not achieve equilibrium as its total energy value is increasing over time, with a large spread of error (larger fluctuation).&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Total_Energy_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Total energy versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Temperature_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Temperature versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Temperature_0.001_zoom.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Temperature versus time for timestep 0.001, zoomed in version&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Pressure_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Pressure versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Total_Energy_all_timestep.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Total Energy versus time for timesteps 0.001, 0.0025, 0.0075, 0.01, 0.015.&lt;br /&gt;
&lt;br /&gt;
==Part 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Choose 5 temperatures (above the critical temperature [[File:4.1_E1.png]]), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen [[File:4.1_E2.png]] points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Temperatures used: 2.0, 2.5, 3.0, 3.5, 4.0&lt;br /&gt;
&lt;br /&gt;
Pressures used: 2.5, 2.8&lt;br /&gt;
&lt;br /&gt;
Timestep used: 0.0025&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;We need to choose [[File:4.2_E1.png]] so that the temperature is correct [[File:4.2_E2.png]] if we multiply every velocity [[File:4.2_E1.png]]. We can write two equations:&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:4.2_E3.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:4.2_E4.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
Solve these to determine [[File:4.2_E1.png]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:4.2_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;Use the manual page 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, how much time will you simulate?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A measurement will be made every &#039;100&#039; units, with &#039;1000&#039; defined to provide the total average of all the &#039;100000&#039; values.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density [[File:4.4_E1.png]]. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated. Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:4.4_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
Density in Ideal Gas Law calculation:&lt;br /&gt;
&lt;br /&gt;
[[File:4.4_Ans2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
At any fixed pressure, the simulated density is lower than the ideal gas law plot. The ideal gas law states that there is negligible interaction between molecules, leading to no repulsive forces. Given this, molecules are more likely to be found next to one another, as compared to the simulation. Where in the case of a simulation, interactions between molecules are present, along with the presence of repulsion forces. This causes the molecules to be found far away from each other. Hence for a given volume, density is higher for an ideal gas (molecules near each other) than for a non-ideal gas (molecules far apart). This discrepancy of ideal gas law and simulation increases with pressure. This is because at high pressures, molecules are forced to be next to each other, increasing repulsion, therefore reducing density.&lt;br /&gt;
&lt;br /&gt;
==Part 5: Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature [[File:5.1_Equation_1.png]] phase space, rather than pressure-temperature phase space. The two densities required at 0.2 and 0.8, and the temperature range is 2.0, 2.2, 2.4, 2.6, 2.8. Plot [[File:5.1_Equation_2.png]] as a function of temperature, where [[File:5.1_Equation_3.png]] 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.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:5.1_Graph.PNG]]&lt;br /&gt;
&lt;br /&gt;
The trend observed in the graph above is not what would normally be expected as Cv/V is supposed to increase with temperature. At higher temperatures, the total internal energy of the system increases, therefore higher heat capacity due to the increased difficulty to increase the temperature per unit. A lower density also leads to a lower heat capacity, lowering the height of the trendline. This is because heat capacity is an extensive property. A larger density would mean more atoms at the given fixed volume, hence driving up the Cv/V value.&lt;br /&gt;
&lt;br /&gt;
Input script for density 0.2 at temperature 2.0 attached: [[File:5.1_(0.2,2.0).in]]&lt;br /&gt;
&lt;br /&gt;
==Part 6: Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate [[File:6.1_Equation_1.png]] and [[File:6.1_Equation_2.png]]. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:6.1_Ans1.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:6.1_Ans2.PNG]]&lt;br /&gt;
&lt;br /&gt;
The number of peaks in the g(r) plot corresponds to the number of neighbouring atoms. As the solid has the highest number of peaks in the g(r) plot, it has the most neighbouring atoms, followed by liquid and finally gas. The distance between neighbouring atoms in a gas can be seen to be approximately a few times bigger than the solid as within a single gas peak, there are multiple solid peaks. The first 3 peaks for the solid corresponds to the 3 nearest atoms to the sampled atom, as per equidistant lattice points on a cube. The coordination number for the first three peaks are 12, 18 and 42.&lt;br /&gt;
&lt;br /&gt;
==Part 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Graphs of Mean Squared Displacement against Time&lt;br /&gt;
! 1 atom!! 1 million atoms&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Liq.PNG]]|| [[File:7.1_MSD_Liq1m.PNG]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Solid.PNG]]|| [[File:7.1_MSD_Solid1m.PNG]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Vap.PNG]]|| [[File:7.1_MSD_Vap1m.PNG]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Trendline for 1 million liquid and vapour atoms has a larger gradient and intercept than the normal box simulation. This is opposed in the solid, with a lower gradient and intercept for the 1 million atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;Make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate [[File:7.2_D.png]] in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
[[File:7.3_Equation_1.png]]. &lt;br /&gt;
Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot [[File:7.3_Equation_2.png]] with [[File:7.3_Equation_3.png]] and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;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 [[File:7.2_D.png]] 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?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;equation 10&amp;quot;&amp;gt;https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment/Introduction_to_molecular_dynamics_simulation&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=User:JFU1608&amp;diff=543578</id>
		<title>User:JFU1608</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=User:JFU1608&amp;diff=543578"/>
		<updated>2016-02-26T09:51:41Z</updated>

		<summary type="html">&lt;p&gt;Jwf13: /* Task 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Part 1: Running first simulation==&lt;br /&gt;
&lt;br /&gt;
-no tasks-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Part 2: Introduction to molecular dynamics simulation==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time  t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by  (the values of  ,  , and   are worked out for you in the sheet).&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL: Position at time t (classical solution)&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Position.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
ERROR: Absolute difference between ANALYTICAL and Velocity-verlet solution&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Error.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
ENERGY: Total E of oscillator for velocity-verlet solution&lt;br /&gt;
Total Energy is given by the summation of both kinetic energy: 1/2 mv2 and potential energy 1/2kx2.&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Energy.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data. &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Time!! Maximum Error&lt;br /&gt;
|-&lt;br /&gt;
| 1.9|| 7.58E-04&lt;br /&gt;
|-&lt;br /&gt;
| 5.00|| 2.00E-03&lt;br /&gt;
|-&lt;br /&gt;
| 8.00|| 3.30E-03&lt;br /&gt;
|-&lt;br /&gt;
| 11.10|| 4.60E-03&lt;br /&gt;
|-&lt;br /&gt;
| 14.20|| 5.91E-03&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
[[File:2.2_Max_Error.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph shows a linear relationship between the maximum errors of position with time, characterised by its extrapolation formula y = 0.0004x – 0.00005.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;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?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Previously for timestep 0.1, the percentage change was 0.248%. By varying the timestep, we are able to deduce the corresponding percentage changes, shown in Table X. As timestep increases, the minima total energy value decreases gradually, leading to a larger percentage change in total energy. In order for total energy not to go over 1%, the timestep must not be larger than 0.2. It is important to monitor the total energy of a physical system while modelling its behaviour numerically. This is because the Law of Conservation of Energy is observed, where total energy stays constant. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Timestep!! Energy Maxima!! Energy Minima!! Change in Energy&lt;br /&gt;
|-&lt;br /&gt;
| 0.05|| 0.5||0.4997||0.06%&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;0.1||&#039;&#039;&#039;0.5&#039;&#039;&#039;||&#039;&#039;&#039;0.4988&#039;&#039;&#039;||&#039;&#039;&#039;0.24%&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0.15||0.5||0.4972||0.56%&lt;br /&gt;
|-&lt;br /&gt;
| 0.2||0.5||0.4950||1.00%&lt;br /&gt;
|-&lt;br /&gt;
| 0.25|| 0.5||0.4922||1.56%&lt;br /&gt;
|-&lt;br /&gt;
| 0.3|| 0.5||0.4888||2.24%&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Row highlighted in bold is the simulation done from previous tasks.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;For a single Lennard-Jones interaction, [[File:8c44e3156b2bf003c09fa62fbaed5cb0.png]], find the separation, [[File:2.4_E2.png]], at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, [[File:2.4_E3.png]], and work out the well depth ([[File:2.4_E4.png]]). Evaluate the integrals [[File:2.4_E5.png]], [[File:2.4_E6.png]], and [[File:2.4_E7.png]] when [[File:2.4_E8.png]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the potential energy is zero, separation r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; can be found:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
At this separation, the force can be calculated with [[File:2.4_F_Eq.png|100px]], where using the definition of U from equation 10 &amp;lt;ref name=&amp;quot;equation 10&amp;quot; /&amp;gt; produces:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs where F&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; = 0, so:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans3.png]]&lt;br /&gt;
&lt;br /&gt;
Well depth, &lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans4.PNG]]&lt;br /&gt;
&lt;br /&gt;
When σ=ϵ=1.0,&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans5.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&amp;lt;b&amp;gt;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At standard conditions, there are 3.35 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt; water molecules in 1 mL of water.&lt;br /&gt;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;; Volume = 1 mL = 1 cm&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;; Mr = 18; N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 6.022 x 10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2.5_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
For 10000 water molecules, the calculated volume is 2.99 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; mL:&lt;br /&gt;
&lt;br /&gt;
[[File:2.5_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&amp;lt;b&amp;gt;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, &#039;&#039;after the periodic boundary conditions have been applied?&#039;&#039;.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sum of (0.5, 0.5, 0.5) and (0.7, 0.6, 0.2) gives (1.2,1.1,0.7), but this assumes periodic boundary conditions not applied. If applied, number of atoms inside box always constant as one leaves, simultaneously another enters. Hence deduct (1.2,1.1,0.7) by value of 1 in the x and y coordinates since they exceed the value of 1, to give the (0.2,0.1,0.3) position.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&amp;lt;b&amp;gt;The Lennard-Jones parameters for argon are [[File:1.7_E1.png]]. If the LJ cutoff is [[File:1.7_E2.png]], 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 [[File:4.1_E1.png]] in real units?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2.7_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
==Part 3: Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together? &lt;br /&gt;
If molecules are put extremely close to each other then they might overlap each other, having unfavourable repulsion interactions. &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates in simulations, there is a possibility that the simulation puts 2 atoms such that they overlap one another, which is not possible in real terms. As two atoms get closer together, their potential energy increases exponentially, causing a discrepancy in the calculated values. This is avoided when the atoms are placed at lattice points.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given previously that each length of a unit cell is 1.07722, &lt;br /&gt;
&lt;br /&gt;
[[File:3.2_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
For a fcc lattice of lattice point number density 1.2:&lt;br /&gt;
&lt;br /&gt;
[[File:3.2_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;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? &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the fcc lattice has 4 atoms, where each is 1000 unit cells, a total of 4000 atoms will be created.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;Using the LAMMPS manual, find the purpose of the following commands in the input script: &amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.4_E1.PNG]]&lt;br /&gt;
&lt;br /&gt;
The first line is a mass command where 1 is the atom type, with mass of 1.0. This input script sets all atoms of atom type 1 to have a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
The second line is a pair style command which computes the pairwise interactions of 2 atoms. This command is scripted such that the Lennard-Jones potential is cut off for coulomb interaction beyond distance of 3.0, hence absence of potential energy. Within distance 3.0, there will be a presence of potential energy due to the active Lennard-Jones interaction.&lt;br /&gt;
&lt;br /&gt;
The third line is a pair coeff command, where the * sign in pair coeff command sets coefficients for multiple pairs of atom types. As there is no numeric value, it means all types from 1 to N. In the case used, there are only atoms of 1 type so this command sets the coefficient value to all atoms of type 1. The first 1.0 coefficient value corresponds to the distance at which potential energies, σ of 2 atoms is 0, whereas the second 1.0 coefficient is the well depth.&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&amp;lt;b&amp;gt;Look at the lines below.&amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.5_E1.PNG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;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;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.5_E2.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&amp;lt;b&amp;gt;Given that we are specifying [[File:3.6_E1.png]] and [[File:3.6_E2.png]], which integration algorithm are we going to use?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As 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) is given, the Velocity-Verlet algorithm should be used.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&amp;lt;b&amp;gt;Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium can be said to be achieved when thermodynamic quantities becomes constant. Hence for the timestep 0.001, the simulation reaches equilibrium since the plots of temperature and pressure versus time equilibrates to a constant value of approximately 1.25K and 1.25atm. From the zoomed in view, we can deduce that equilibration is achieved within 0.05s.&lt;br /&gt;
Equilibrium has also been achieved for other timesteps, except 0.015, where the graph of total energy versus time graph is observed to gradually increase.&lt;br /&gt;
The largest timestep to provide acceptable results is 0.01. Timestep 0.015 is a particularly bad choice because the simulation does not achieve equilibrium as its total energy value is increasing over time, with a large spread of error (larger fluctuation).&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Total_Energy_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Total energy versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Temperature_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Temperature versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Temperature_0.001_zoom.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Temperature versus time for timestep 0.001, zoomed in version&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Pressure_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Pressure versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Total_Energy_all_timestep.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Total Energy versus time for timesteps 0.001, 0.0025, 0.0075, 0.01, 0.015.&lt;br /&gt;
&lt;br /&gt;
==Part 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Choose 5 temperatures (above the critical temperature [[File:4.1_E1.png]]), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen [[File:4.1_E2.png]] points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Temperatures used: 2.0, 2.5, 3.0, 3.5, 4.0&lt;br /&gt;
&lt;br /&gt;
Pressures used: 2.5, 2.8&lt;br /&gt;
&lt;br /&gt;
Timestep used: 0.0025&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;We need to choose [[File:4.2_E1.png]] so that the temperature is correct [[File:4.2_E2.png]] if we multiply every velocity [[File:4.2_E1.png]]. We can write two equations:&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:4.2_E3.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:4.2_E4.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
Solve these to determine [[File:4.2_E1.png]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:4.2_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;Use the manual page 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, how much time will you simulate?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A measurement will be made every &#039;100&#039; units, with &#039;1000&#039; defined to provide the total average of all the &#039;100000&#039; values.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density [[File:4.4_E1.png]]. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated. Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:4.4_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
Density in Ideal Gas Law calculation:&lt;br /&gt;
&lt;br /&gt;
[[File:4.4_Ans2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
At any fixed pressure, the simulated density is lower than the ideal gas law plot. The ideal gas law states that there is negligible interaction between molecules, leading to no repulsive forces. Given this, molecules are more likely to be found next to one another, as compared to the simulation. Where in the case of a simulation, interactions between molecules are present, along with the presence of repulsion forces. This causes the molecules to be found far away from each other. Hence for a given volume, density is higher for an ideal gas (molecules near each other) than for a non-ideal gas (molecules far apart). This discrepancy of ideal gas law and simulation increases with pressure. This is because at high pressures, molecules are forced to be next to each other, increasing repulsion, therefore reducing density.&lt;br /&gt;
&lt;br /&gt;
==Part 5: Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature [[File:5.1_Equation_1.png]] phase space, rather than pressure-temperature phase space. The two densities required at 0.2 and 0.8, and the temperature range is 2.0, 2.2, 2.4, 2.6, 2.8. Plot [[File:5.1_Equation_2.png]] as a function of temperature, where [[File:5.1_Equation_3.png]] 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.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:5.1_Graph.PNG]]&lt;br /&gt;
&lt;br /&gt;
The trend observed in the graph above is not what would normally be expected as Cv/V is supposed to increase with temperature. At higher temperatures, the total internal energy of the system increases, therefore higher heat capacity due to the increased difficulty to increase the temperature per unit. A lower density also leads to a lower heat capacity, lowering the height of the trendline. This is because heat capacity is an extensive property. A larger density would mean more atoms at the given fixed volume, hence driving up the Cv/V value.&lt;br /&gt;
&lt;br /&gt;
Input script for density 0.2 at temperature 2.0 attached: [[File:5.1_(0.2,2.0).in]]&lt;br /&gt;
&lt;br /&gt;
==Part 6: Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate [[File:6.1_Equation_1.png]] and [[File:6.1_Equation_2.png]]. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:6.1_Ans1.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:6.1_Ans2.PNG]]&lt;br /&gt;
&lt;br /&gt;
The number of peaks in the g(r) plot corresponds to the number of neighbouring atoms. As the solid has the highest number of peaks in the g(r) plot, it has the most neighbouring atoms, followed by liquid and finally gas. The distance between neighbouring atoms in a gas can be seen to be approximately a few times bigger than the solid as within a single gas peak, there are multiple solid peaks. The first 3 peaks for the solid corresponds to the 3 nearest atoms to the sampled atom, as per equidistant lattice points on a cube. The coordination number for the first three peaks are 12, 18 and 42.&lt;br /&gt;
&lt;br /&gt;
==Part 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Graphs of Mean Squared Displacement against Time&lt;br /&gt;
! 1 atom!! 1 million atoms&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Liq.PNG]]|| [[File:7.1_MSD_Liq1m.PNG]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Solid.PNG]]|| [[File:7.1_MSD_Solid1m.PNG]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Vap.PNG]]|| [[File:7.1_MSD_Vap1m.PNG]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Trendline for 1 million liquid atoms has a larger gradient and intercept than the normal box simulation. This is opposed in the solid, with a lower gradient and intercept for the 1 million atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;Make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate [[File:7.2_D.png]] in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
[[File:7.3_Equation_1.png]]. &lt;br /&gt;
Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot [[File:7.3_Equation_2.png]] with [[File:7.3_Equation_3.png]] and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;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 [[File:7.2_D.png]] 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?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;equation 10&amp;quot;&amp;gt;https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment/Introduction_to_molecular_dynamics_simulation&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:7.1_MSD_Vap.PNG&amp;diff=543577</id>
		<title>File:7.1 MSD Vap.PNG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:7.1_MSD_Vap.PNG&amp;diff=543577"/>
		<updated>2016-02-26T09:51:21Z</updated>

		<summary type="html">&lt;p&gt;Jwf13: Jwf13 uploaded a new version of File:7.1 MSD Vap.PNG&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:7.1_MSD_Solid1m.PNG&amp;diff=543572</id>
		<title>File:7.1 MSD Solid1m.PNG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:7.1_MSD_Solid1m.PNG&amp;diff=543572"/>
		<updated>2016-02-26T09:47:01Z</updated>

		<summary type="html">&lt;p&gt;Jwf13: Jwf13 uploaded a new version of File:7.1 MSD Solid1m.PNG&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=User:JFU1608&amp;diff=543552</id>
		<title>User:JFU1608</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=User:JFU1608&amp;diff=543552"/>
		<updated>2016-02-26T09:41:38Z</updated>

		<summary type="html">&lt;p&gt;Jwf13: /* Part 7: Dynamical properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Part 1: Running first simulation==&lt;br /&gt;
&lt;br /&gt;
-no tasks-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Part 2: Introduction to molecular dynamics simulation==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time  t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by  (the values of  ,  , and   are worked out for you in the sheet).&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL: Position at time t (classical solution)&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Position.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
ERROR: Absolute difference between ANALYTICAL and Velocity-verlet solution&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Error.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
ENERGY: Total E of oscillator for velocity-verlet solution&lt;br /&gt;
Total Energy is given by the summation of both kinetic energy: 1/2 mv2 and potential energy 1/2kx2.&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Energy.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data. &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Time!! Maximum Error&lt;br /&gt;
|-&lt;br /&gt;
| 1.9|| 7.58E-04&lt;br /&gt;
|-&lt;br /&gt;
| 5.00|| 2.00E-03&lt;br /&gt;
|-&lt;br /&gt;
| 8.00|| 3.30E-03&lt;br /&gt;
|-&lt;br /&gt;
| 11.10|| 4.60E-03&lt;br /&gt;
|-&lt;br /&gt;
| 14.20|| 5.91E-03&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
[[File:2.2_Max_Error.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph shows a linear relationship between the maximum errors of position with time, characterised by its extrapolation formula y = 0.0004x – 0.00005.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;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?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Previously for timestep 0.1, the percentage change was 0.248%. By varying the timestep, we are able to deduce the corresponding percentage changes, shown in Table X. As timestep increases, the minima total energy value decreases gradually, leading to a larger percentage change in total energy. In order for total energy not to go over 1%, the timestep must not be larger than 0.2. It is important to monitor the total energy of a physical system while modelling its behaviour numerically. This is because the Law of Conservation of Energy is observed, where total energy stays constant. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Timestep!! Energy Maxima!! Energy Minima!! Change in Energy&lt;br /&gt;
|-&lt;br /&gt;
| 0.05|| 0.5||0.4997||0.06%&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;0.1||&#039;&#039;&#039;0.5&#039;&#039;&#039;||&#039;&#039;&#039;0.4988&#039;&#039;&#039;||&#039;&#039;&#039;0.24%&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0.15||0.5||0.4972||0.56%&lt;br /&gt;
|-&lt;br /&gt;
| 0.2||0.5||0.4950||1.00%&lt;br /&gt;
|-&lt;br /&gt;
| 0.25|| 0.5||0.4922||1.56%&lt;br /&gt;
|-&lt;br /&gt;
| 0.3|| 0.5||0.4888||2.24%&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Row highlighted in bold is the simulation done from previous tasks.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;For a single Lennard-Jones interaction, [[File:8c44e3156b2bf003c09fa62fbaed5cb0.png]], find the separation, [[File:2.4_E2.png]], at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, [[File:2.4_E3.png]], and work out the well depth ([[File:2.4_E4.png]]). Evaluate the integrals [[File:2.4_E5.png]], [[File:2.4_E6.png]], and [[File:2.4_E7.png]] when [[File:2.4_E8.png]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the potential energy is zero, separation r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; can be found:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
At this separation, the force can be calculated with [[File:2.4_F_Eq.png|100px]], where using the definition of U from equation 10 &amp;lt;ref name=&amp;quot;equation 10&amp;quot; /&amp;gt; produces:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs where F&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; = 0, so:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans3.png]]&lt;br /&gt;
&lt;br /&gt;
Well depth, &lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans4.PNG]]&lt;br /&gt;
&lt;br /&gt;
When σ=ϵ=1.0,&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans5.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&amp;lt;b&amp;gt;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At standard conditions, there are 3.35 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt; water molecules in 1 mL of water.&lt;br /&gt;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;; Volume = 1 mL = 1 cm&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;; Mr = 18; N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 6.022 x 10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2.5_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
For 10000 water molecules, the calculated volume is 2.99 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; mL:&lt;br /&gt;
&lt;br /&gt;
[[File:2.5_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&amp;lt;b&amp;gt;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, &#039;&#039;after the periodic boundary conditions have been applied?&#039;&#039;.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sum of (0.5, 0.5, 0.5) and (0.7, 0.6, 0.2) gives (1.2,1.1,0.7), but this assumes periodic boundary conditions not applied. If applied, number of atoms inside box always constant as one leaves, simultaneously another enters. Hence deduct (1.2,1.1,0.7) by value of 1 in the x and y coordinates since they exceed the value of 1, to give the (0.2,0.1,0.3) position.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&amp;lt;b&amp;gt;The Lennard-Jones parameters for argon are [[File:1.7_E1.png]]. If the LJ cutoff is [[File:1.7_E2.png]], 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 [[File:4.1_E1.png]] in real units?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2.7_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
==Part 3: Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together? &lt;br /&gt;
If molecules are put extremely close to each other then they might overlap each other, having unfavourable repulsion interactions. &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates in simulations, there is a possibility that the simulation puts 2 atoms such that they overlap one another, which is not possible in real terms. As two atoms get closer together, their potential energy increases exponentially, causing a discrepancy in the calculated values. This is avoided when the atoms are placed at lattice points.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given previously that each length of a unit cell is 1.07722, &lt;br /&gt;
&lt;br /&gt;
[[File:3.2_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
For a fcc lattice of lattice point number density 1.2:&lt;br /&gt;
&lt;br /&gt;
[[File:3.2_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;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? &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the fcc lattice has 4 atoms, where each is 1000 unit cells, a total of 4000 atoms will be created.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;Using the LAMMPS manual, find the purpose of the following commands in the input script: &amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.4_E1.PNG]]&lt;br /&gt;
&lt;br /&gt;
The first line is a mass command where 1 is the atom type, with mass of 1.0. This input script sets all atoms of atom type 1 to have a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
The second line is a pair style command which computes the pairwise interactions of 2 atoms. This command is scripted such that the Lennard-Jones potential is cut off for coulomb interaction beyond distance of 3.0, hence absence of potential energy. Within distance 3.0, there will be a presence of potential energy due to the active Lennard-Jones interaction.&lt;br /&gt;
&lt;br /&gt;
The third line is a pair coeff command, where the * sign in pair coeff command sets coefficients for multiple pairs of atom types. As there is no numeric value, it means all types from 1 to N. In the case used, there are only atoms of 1 type so this command sets the coefficient value to all atoms of type 1. The first 1.0 coefficient value corresponds to the distance at which potential energies, σ of 2 atoms is 0, whereas the second 1.0 coefficient is the well depth.&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&amp;lt;b&amp;gt;Look at the lines below.&amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.5_E1.PNG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;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;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.5_E2.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&amp;lt;b&amp;gt;Given that we are specifying [[File:3.6_E1.png]] and [[File:3.6_E2.png]], which integration algorithm are we going to use?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As 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) is given, the Velocity-Verlet algorithm should be used.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&amp;lt;b&amp;gt;Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium can be said to be achieved when thermodynamic quantities becomes constant. Hence for the timestep 0.001, the simulation reaches equilibrium since the plots of temperature and pressure versus time equilibrates to a constant value of approximately 1.25K and 1.25atm. From the zoomed in view, we can deduce that equilibration is achieved within 0.05s.&lt;br /&gt;
Equilibrium has also been achieved for other timesteps, except 0.015, where the graph of total energy versus time graph is observed to gradually increase.&lt;br /&gt;
The largest timestep to provide acceptable results is 0.01. Timestep 0.015 is a particularly bad choice because the simulation does not achieve equilibrium as its total energy value is increasing over time, with a large spread of error (larger fluctuation).&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Total_Energy_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Total energy versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Temperature_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Temperature versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Temperature_0.001_zoom.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Temperature versus time for timestep 0.001, zoomed in version&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Pressure_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Pressure versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Total_Energy_all_timestep.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Total Energy versus time for timesteps 0.001, 0.0025, 0.0075, 0.01, 0.015.&lt;br /&gt;
&lt;br /&gt;
==Part 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Choose 5 temperatures (above the critical temperature [[File:4.1_E1.png]]), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen [[File:4.1_E2.png]] points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Temperatures used: 2.0, 2.5, 3.0, 3.5, 4.0&lt;br /&gt;
&lt;br /&gt;
Pressures used: 2.5, 2.8&lt;br /&gt;
&lt;br /&gt;
Timestep used: 0.0025&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;We need to choose [[File:4.2_E1.png]] so that the temperature is correct [[File:4.2_E2.png]] if we multiply every velocity [[File:4.2_E1.png]]. We can write two equations:&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:4.2_E3.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:4.2_E4.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
Solve these to determine [[File:4.2_E1.png]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:4.2_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;Use the manual page 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, how much time will you simulate?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A measurement will be made every &#039;100&#039; units, with &#039;1000&#039; defined to provide the total average of all the &#039;100000&#039; values.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density [[File:4.4_E1.png]]. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated. Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:4.4_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
Density in Ideal Gas Law calculation:&lt;br /&gt;
&lt;br /&gt;
[[File:4.4_Ans2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
At any fixed pressure, the simulated density is lower than the ideal gas law plot. The ideal gas law states that there is negligible interaction between molecules, leading to no repulsive forces. Given this, molecules are more likely to be found next to one another, as compared to the simulation. Where in the case of a simulation, interactions between molecules are present, along with the presence of repulsion forces. This causes the molecules to be found far away from each other. Hence for a given volume, density is higher for an ideal gas (molecules near each other) than for a non-ideal gas (molecules far apart). This discrepancy of ideal gas law and simulation increases with pressure. This is because at high pressures, molecules are forced to be next to each other, increasing repulsion, therefore reducing density.&lt;br /&gt;
&lt;br /&gt;
==Part 5: Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature [[File:5.1_Equation_1.png]] phase space, rather than pressure-temperature phase space. The two densities required at 0.2 and 0.8, and the temperature range is 2.0, 2.2, 2.4, 2.6, 2.8. Plot [[File:5.1_Equation_2.png]] as a function of temperature, where [[File:5.1_Equation_3.png]] 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.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:5.1_Graph.PNG]]&lt;br /&gt;
&lt;br /&gt;
The trend observed in the graph above is not what would normally be expected as Cv/V is supposed to increase with temperature. At higher temperatures, the total internal energy of the system increases, therefore higher heat capacity due to the increased difficulty to increase the temperature per unit. A lower density also leads to a lower heat capacity, lowering the height of the trendline. This is because heat capacity is an extensive property. A larger density would mean more atoms at the given fixed volume, hence driving up the Cv/V value.&lt;br /&gt;
&lt;br /&gt;
Input script for density 0.2 at temperature 2.0 attached: [[File:5.1_(0.2,2.0).in]]&lt;br /&gt;
&lt;br /&gt;
==Part 6: Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate [[File:6.1_Equation_1.png]] and [[File:6.1_Equation_2.png]]. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:6.1_Ans1.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:6.1_Ans2.PNG]]&lt;br /&gt;
&lt;br /&gt;
The number of peaks in the g(r) plot corresponds to the number of neighbouring atoms. As the solid has the highest number of peaks in the g(r) plot, it has the most neighbouring atoms, followed by liquid and finally gas. The distance between neighbouring atoms in a gas can be seen to be approximately a few times bigger than the solid as within a single gas peak, there are multiple solid peaks. The first 3 peaks for the solid corresponds to the 3 nearest atoms to the sampled atom, as per equidistant lattice points on a cube. The coordination number for the first three peaks are 12, 18 and 42.&lt;br /&gt;
&lt;br /&gt;
==Part 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Graphs of Mean Squared Displacement against Time&lt;br /&gt;
! 1 atom!! 1 million atoms&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Liq.PNG]]|| [[File:7.1_MSD_Liq1m.PNG]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Solid.PNG]]|| [[File:7.1_MSD_Solid1m.PNG]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Vap.PNG]]|| [[File:7.1_MSD_Vap1m.PNG]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;Make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate [[File:7.2_D.png]] in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
[[File:7.3_Equation_1.png]]. &lt;br /&gt;
Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot [[File:7.3_Equation_2.png]] with [[File:7.3_Equation_3.png]] and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;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 [[File:7.2_D.png]] 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?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;equation 10&amp;quot;&amp;gt;https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment/Introduction_to_molecular_dynamics_simulation&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:7.1_MSD_Liq1m.PNG&amp;diff=543550</id>
		<title>File:7.1 MSD Liq1m.PNG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:7.1_MSD_Liq1m.PNG&amp;diff=543550"/>
		<updated>2016-02-26T09:41:25Z</updated>

		<summary type="html">&lt;p&gt;Jwf13: Jwf13 uploaded a new version of File:7.1 MSD Liq1m.PNG&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=User:JFU1608&amp;diff=543535</id>
		<title>User:JFU1608</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=User:JFU1608&amp;diff=543535"/>
		<updated>2016-02-26T09:35:40Z</updated>

		<summary type="html">&lt;p&gt;Jwf13: /* Task 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Part 1: Running first simulation==&lt;br /&gt;
&lt;br /&gt;
-no tasks-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Part 2: Introduction to molecular dynamics simulation==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time  t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by  (the values of  ,  , and   are worked out for you in the sheet).&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL: Position at time t (classical solution)&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Position.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
ERROR: Absolute difference between ANALYTICAL and Velocity-verlet solution&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Error.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
ENERGY: Total E of oscillator for velocity-verlet solution&lt;br /&gt;
Total Energy is given by the summation of both kinetic energy: 1/2 mv2 and potential energy 1/2kx2.&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Energy.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data. &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Time!! Maximum Error&lt;br /&gt;
|-&lt;br /&gt;
| 1.9|| 7.58E-04&lt;br /&gt;
|-&lt;br /&gt;
| 5.00|| 2.00E-03&lt;br /&gt;
|-&lt;br /&gt;
| 8.00|| 3.30E-03&lt;br /&gt;
|-&lt;br /&gt;
| 11.10|| 4.60E-03&lt;br /&gt;
|-&lt;br /&gt;
| 14.20|| 5.91E-03&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
[[File:2.2_Max_Error.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph shows a linear relationship between the maximum errors of position with time, characterised by its extrapolation formula y = 0.0004x – 0.00005.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;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?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Previously for timestep 0.1, the percentage change was 0.248%. By varying the timestep, we are able to deduce the corresponding percentage changes, shown in Table X. As timestep increases, the minima total energy value decreases gradually, leading to a larger percentage change in total energy. In order for total energy not to go over 1%, the timestep must not be larger than 0.2. It is important to monitor the total energy of a physical system while modelling its behaviour numerically. This is because the Law of Conservation of Energy is observed, where total energy stays constant. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Timestep!! Energy Maxima!! Energy Minima!! Change in Energy&lt;br /&gt;
|-&lt;br /&gt;
| 0.05|| 0.5||0.4997||0.06%&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;0.1||&#039;&#039;&#039;0.5&#039;&#039;&#039;||&#039;&#039;&#039;0.4988&#039;&#039;&#039;||&#039;&#039;&#039;0.24%&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0.15||0.5||0.4972||0.56%&lt;br /&gt;
|-&lt;br /&gt;
| 0.2||0.5||0.4950||1.00%&lt;br /&gt;
|-&lt;br /&gt;
| 0.25|| 0.5||0.4922||1.56%&lt;br /&gt;
|-&lt;br /&gt;
| 0.3|| 0.5||0.4888||2.24%&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Row highlighted in bold is the simulation done from previous tasks.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;For a single Lennard-Jones interaction, [[File:8c44e3156b2bf003c09fa62fbaed5cb0.png]], find the separation, [[File:2.4_E2.png]], at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, [[File:2.4_E3.png]], and work out the well depth ([[File:2.4_E4.png]]). Evaluate the integrals [[File:2.4_E5.png]], [[File:2.4_E6.png]], and [[File:2.4_E7.png]] when [[File:2.4_E8.png]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the potential energy is zero, separation r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; can be found:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
At this separation, the force can be calculated with [[File:2.4_F_Eq.png|100px]], where using the definition of U from equation 10 &amp;lt;ref name=&amp;quot;equation 10&amp;quot; /&amp;gt; produces:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs where F&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; = 0, so:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans3.png]]&lt;br /&gt;
&lt;br /&gt;
Well depth, &lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans4.PNG]]&lt;br /&gt;
&lt;br /&gt;
When σ=ϵ=1.0,&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans5.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&amp;lt;b&amp;gt;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At standard conditions, there are 3.35 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt; water molecules in 1 mL of water.&lt;br /&gt;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;; Volume = 1 mL = 1 cm&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;; Mr = 18; N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 6.022 x 10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2.5_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
For 10000 water molecules, the calculated volume is 2.99 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; mL:&lt;br /&gt;
&lt;br /&gt;
[[File:2.5_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&amp;lt;b&amp;gt;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, &#039;&#039;after the periodic boundary conditions have been applied?&#039;&#039;.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sum of (0.5, 0.5, 0.5) and (0.7, 0.6, 0.2) gives (1.2,1.1,0.7), but this assumes periodic boundary conditions not applied. If applied, number of atoms inside box always constant as one leaves, simultaneously another enters. Hence deduct (1.2,1.1,0.7) by value of 1 in the x and y coordinates since they exceed the value of 1, to give the (0.2,0.1,0.3) position.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&amp;lt;b&amp;gt;The Lennard-Jones parameters for argon are [[File:1.7_E1.png]]. If the LJ cutoff is [[File:1.7_E2.png]], 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 [[File:4.1_E1.png]] in real units?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2.7_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
==Part 3: Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together? &lt;br /&gt;
If molecules are put extremely close to each other then they might overlap each other, having unfavourable repulsion interactions. &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates in simulations, there is a possibility that the simulation puts 2 atoms such that they overlap one another, which is not possible in real terms. As two atoms get closer together, their potential energy increases exponentially, causing a discrepancy in the calculated values. This is avoided when the atoms are placed at lattice points.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given previously that each length of a unit cell is 1.07722, &lt;br /&gt;
&lt;br /&gt;
[[File:3.2_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
For a fcc lattice of lattice point number density 1.2:&lt;br /&gt;
&lt;br /&gt;
[[File:3.2_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;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? &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the fcc lattice has 4 atoms, where each is 1000 unit cells, a total of 4000 atoms will be created.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;Using the LAMMPS manual, find the purpose of the following commands in the input script: &amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.4_E1.PNG]]&lt;br /&gt;
&lt;br /&gt;
The first line is a mass command where 1 is the atom type, with mass of 1.0. This input script sets all atoms of atom type 1 to have a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
The second line is a pair style command which computes the pairwise interactions of 2 atoms. This command is scripted such that the Lennard-Jones potential is cut off for coulomb interaction beyond distance of 3.0, hence absence of potential energy. Within distance 3.0, there will be a presence of potential energy due to the active Lennard-Jones interaction.&lt;br /&gt;
&lt;br /&gt;
The third line is a pair coeff command, where the * sign in pair coeff command sets coefficients for multiple pairs of atom types. As there is no numeric value, it means all types from 1 to N. In the case used, there are only atoms of 1 type so this command sets the coefficient value to all atoms of type 1. The first 1.0 coefficient value corresponds to the distance at which potential energies, σ of 2 atoms is 0, whereas the second 1.0 coefficient is the well depth.&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&amp;lt;b&amp;gt;Look at the lines below.&amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.5_E1.PNG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;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;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.5_E2.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&amp;lt;b&amp;gt;Given that we are specifying [[File:3.6_E1.png]] and [[File:3.6_E2.png]], which integration algorithm are we going to use?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As 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) is given, the Velocity-Verlet algorithm should be used.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&amp;lt;b&amp;gt;Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium can be said to be achieved when thermodynamic quantities becomes constant. Hence for the timestep 0.001, the simulation reaches equilibrium since the plots of temperature and pressure versus time equilibrates to a constant value of approximately 1.25K and 1.25atm. From the zoomed in view, we can deduce that equilibration is achieved within 0.05s.&lt;br /&gt;
Equilibrium has also been achieved for other timesteps, except 0.015, where the graph of total energy versus time graph is observed to gradually increase.&lt;br /&gt;
The largest timestep to provide acceptable results is 0.01. Timestep 0.015 is a particularly bad choice because the simulation does not achieve equilibrium as its total energy value is increasing over time, with a large spread of error (larger fluctuation).&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Total_Energy_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Total energy versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Temperature_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Temperature versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Temperature_0.001_zoom.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Temperature versus time for timestep 0.001, zoomed in version&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Pressure_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Pressure versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Total_Energy_all_timestep.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Total Energy versus time for timesteps 0.001, 0.0025, 0.0075, 0.01, 0.015.&lt;br /&gt;
&lt;br /&gt;
==Part 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Choose 5 temperatures (above the critical temperature [[File:4.1_E1.png]]), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen [[File:4.1_E2.png]] points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Temperatures used: 2.0, 2.5, 3.0, 3.5, 4.0&lt;br /&gt;
&lt;br /&gt;
Pressures used: 2.5, 2.8&lt;br /&gt;
&lt;br /&gt;
Timestep used: 0.0025&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;We need to choose [[File:4.2_E1.png]] so that the temperature is correct [[File:4.2_E2.png]] if we multiply every velocity [[File:4.2_E1.png]]. We can write two equations:&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:4.2_E3.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:4.2_E4.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
Solve these to determine [[File:4.2_E1.png]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:4.2_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;Use the manual page 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, how much time will you simulate?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A measurement will be made every &#039;100&#039; units, with &#039;1000&#039; defined to provide the total average of all the &#039;100000&#039; values.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density [[File:4.4_E1.png]]. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated. Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:4.4_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
Density in Ideal Gas Law calculation:&lt;br /&gt;
&lt;br /&gt;
[[File:4.4_Ans2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
At any fixed pressure, the simulated density is lower than the ideal gas law plot. The ideal gas law states that there is negligible interaction between molecules, leading to no repulsive forces. Given this, molecules are more likely to be found next to one another, as compared to the simulation. Where in the case of a simulation, interactions between molecules are present, along with the presence of repulsion forces. This causes the molecules to be found far away from each other. Hence for a given volume, density is higher for an ideal gas (molecules near each other) than for a non-ideal gas (molecules far apart). This discrepancy of ideal gas law and simulation increases with pressure. This is because at high pressures, molecules are forced to be next to each other, increasing repulsion, therefore reducing density.&lt;br /&gt;
&lt;br /&gt;
==Part 5: Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature [[File:5.1_Equation_1.png]] phase space, rather than pressure-temperature phase space. The two densities required at 0.2 and 0.8, and the temperature range is 2.0, 2.2, 2.4, 2.6, 2.8. Plot [[File:5.1_Equation_2.png]] as a function of temperature, where [[File:5.1_Equation_3.png]] 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.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:5.1_Graph.PNG]]&lt;br /&gt;
&lt;br /&gt;
The trend observed in the graph above is not what would normally be expected as Cv/V is supposed to increase with temperature. At higher temperatures, the total internal energy of the system increases, therefore higher heat capacity due to the increased difficulty to increase the temperature per unit. A lower density also leads to a lower heat capacity, lowering the height of the trendline. This is because heat capacity is an extensive property. A larger density would mean more atoms at the given fixed volume, hence driving up the Cv/V value.&lt;br /&gt;
&lt;br /&gt;
Input script for density 0.2 at temperature 2.0 attached: [[File:5.1_(0.2,2.0).in]]&lt;br /&gt;
&lt;br /&gt;
==Part 6: Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate [[File:6.1_Equation_1.png]] and [[File:6.1_Equation_2.png]]. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:6.1_Ans1.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:6.1_Ans2.PNG]]&lt;br /&gt;
&lt;br /&gt;
The number of peaks in the g(r) plot corresponds to the number of neighbouring atoms. As the solid has the highest number of peaks in the g(r) plot, it has the most neighbouring atoms, followed by liquid and finally gas. The distance between neighbouring atoms in a gas can be seen to be approximately a few times bigger than the solid as within a single gas peak, there are multiple solid peaks. The first 3 peaks for the solid corresponds to the 3 nearest atoms to the sampled atom, as per equidistant lattice points on a cube. The coordination number for the first three peaks are 12, 18 and 42.&lt;br /&gt;
&lt;br /&gt;
==Part 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ caption&lt;br /&gt;
! heading !! heading&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Liq.PNG]]|| [[File:7.1_MSD_Liq1m.PNG]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Solid.PNG]]|| [[File:7.1_MSD_Solid1m.PNG]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Vap.PNG]]|| [[File:7.1_MSD_Vap1m.PNG]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;Make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate [[File:7.2_D.png]] in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
[[File:7.3_Equation_1.png]]. &lt;br /&gt;
Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot [[File:7.3_Equation_2.png]] with [[File:7.3_Equation_3.png]] and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;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 [[File:7.2_D.png]] 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?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;equation 10&amp;quot;&amp;gt;https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment/Introduction_to_molecular_dynamics_simulation&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:5.1_Graph.PNG&amp;diff=543513</id>
		<title>File:5.1 Graph.PNG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:5.1_Graph.PNG&amp;diff=543513"/>
		<updated>2016-02-26T09:19:57Z</updated>

		<summary type="html">&lt;p&gt;Jwf13: Jwf13 uploaded a new version of File:5.1 Graph.PNG&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:5.1_Graph.PNG&amp;diff=543507</id>
		<title>File:5.1 Graph.PNG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:5.1_Graph.PNG&amp;diff=543507"/>
		<updated>2016-02-26T09:17:20Z</updated>

		<summary type="html">&lt;p&gt;Jwf13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=User:JFU1608&amp;diff=543399</id>
		<title>User:JFU1608</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=User:JFU1608&amp;diff=543399"/>
		<updated>2016-02-26T03:53:31Z</updated>

		<summary type="html">&lt;p&gt;Jwf13: /* Task 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Part 1: Running first simulation==&lt;br /&gt;
&lt;br /&gt;
-no tasks-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Part 2: Introduction to molecular dynamics simulation==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time  t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by  (the values of  ,  , and   are worked out for you in the sheet).&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL: Position at time t (classical solution)&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Position.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
ERROR: Absolute difference between ANALYTICAL and Velocity-verlet solution&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Error.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
ENERGY: Total E of oscillator for velocity-verlet solution&lt;br /&gt;
Total Energy is given by the summation of both kinetic energy: 1/2 mv2 and potential energy 1/2kx2.&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Energy.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data. &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Time!! Maximum Error&lt;br /&gt;
|-&lt;br /&gt;
| 1.9|| 7.58E-04&lt;br /&gt;
|-&lt;br /&gt;
| 5.00|| 2.00E-03&lt;br /&gt;
|-&lt;br /&gt;
| 8.00|| 3.30E-03&lt;br /&gt;
|-&lt;br /&gt;
| 11.10|| 4.60E-03&lt;br /&gt;
|-&lt;br /&gt;
| 14.20|| 5.91E-03&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
[[File:2.2_Max_Error.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph shows a linear relationship between the maximum errors of position with time, characterised by its extrapolation formula y = 0.0004x – 0.00005.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;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?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Previously for timestep 0.1, the percentage change was 0.248%. By varying the timestep, we are able to deduce the corresponding percentage changes, shown in Table X. As timestep increases, the minima total energy value decreases gradually, leading to a larger percentage change in total energy. In order for total energy not to go over 1%, the timestep must not be larger than 0.2. It is important to monitor the total energy of a physical system while modelling its behaviour numerically. This is because the Law of Conservation of Energy is observed, where total energy stays constant. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Timestep!! Energy Maxima!! Energy Minima!! Change in Energy&lt;br /&gt;
|-&lt;br /&gt;
| 0.05|| 0.5||0.4997||0.06%&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;0.1||&#039;&#039;&#039;0.5&#039;&#039;&#039;||&#039;&#039;&#039;0.4988&#039;&#039;&#039;||&#039;&#039;&#039;0.24%&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0.15||0.5||0.4972||0.56%&lt;br /&gt;
|-&lt;br /&gt;
| 0.2||0.5||0.4950||1.00%&lt;br /&gt;
|-&lt;br /&gt;
| 0.25|| 0.5||0.4922||1.56%&lt;br /&gt;
|-&lt;br /&gt;
| 0.3|| 0.5||0.4888||2.24%&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Row highlighted in bold is the simulation done from previous tasks.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;For a single Lennard-Jones interaction, [[File:8c44e3156b2bf003c09fa62fbaed5cb0.png]], find the separation, [[File:2.4_E2.png]], at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, [[File:2.4_E3.png]], and work out the well depth ([[File:2.4_E4.png]]). Evaluate the integrals [[File:2.4_E5.png]], [[File:2.4_E6.png]], and [[File:2.4_E7.png]] when [[File:2.4_E8.png]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the potential energy is zero, separation r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; can be found:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
At this separation, the force can be calculated with [[File:2.4_F_Eq.png|100px]], where using the definition of U from equation 10 &amp;lt;ref name=&amp;quot;equation 10&amp;quot; /&amp;gt; produces:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs where F&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; = 0, so:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans3.png]]&lt;br /&gt;
&lt;br /&gt;
Well depth, &lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans4.PNG]]&lt;br /&gt;
&lt;br /&gt;
When σ=ϵ=1.0,&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans5.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&amp;lt;b&amp;gt;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At standard conditions, there are 3.35 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt; water molecules in 1 mL of water.&lt;br /&gt;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;; Volume = 1 mL = 1 cm&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;; Mr = 18; N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 6.022 x 10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2.5_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
For 10000 water molecules, the calculated volume is 2.99 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; mL:&lt;br /&gt;
&lt;br /&gt;
[[File:2.5_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&amp;lt;b&amp;gt;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, &#039;&#039;after the periodic boundary conditions have been applied?&#039;&#039;.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sum of (0.5, 0.5, 0.5) and (0.7, 0.6, 0.2) gives (1.2,1.1,0.7), but this assumes periodic boundary conditions not applied. If applied, number of atoms inside box always constant as one leaves, simultaneously another enters. Hence deduct (1.2,1.1,0.7) by value of 1 in the x and y coordinates since they exceed the value of 1, to give the (0.2,0.1,0.3) position.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&amp;lt;b&amp;gt;The Lennard-Jones parameters for argon are [[File:1.7_E1.png]]. If the LJ cutoff is [[File:1.7_E2.png]], 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 [[File:4.1_E1.png]] in real units?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2.7_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
==Part 3: Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together? &lt;br /&gt;
If molecules are put extremely close to each other then they might overlap each other, having unfavourable repulsion interactions. &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates in simulations, there is a possibility that the simulation puts 2 atoms such that they overlap one another, which is not possible in real terms. As two atoms get closer together, their potential energy increases exponentially, causing a discrepancy in the calculated values. This is avoided when the atoms are placed at lattice points.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given previously that each length of a unit cell is 1.07722, &lt;br /&gt;
&lt;br /&gt;
[[File:3.2_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
For a fcc lattice of lattice point number density 1.2:&lt;br /&gt;
&lt;br /&gt;
[[File:3.2_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;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? &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the fcc lattice has 4 atoms, where each is 1000 unit cells, a total of 4000 atoms will be created.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;Using the LAMMPS manual, find the purpose of the following commands in the input script: &amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.4_E1.PNG]]&lt;br /&gt;
&lt;br /&gt;
The first line is a mass command where 1 is the atom type, with mass of 1.0. This input script sets all atoms of atom type 1 to have a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
The second line is a pair style command which computes the pairwise interactions of 2 atoms. This command is scripted such that the Lennard-Jones potential is cut off for coulomb interaction beyond distance of 3.0, hence absence of potential energy. Within distance 3.0, there will be a presence of potential energy due to the active Lennard-Jones interaction.&lt;br /&gt;
&lt;br /&gt;
The third line is a pair coeff command, where the * sign in pair coeff command sets coefficients for multiple pairs of atom types. As there is no numeric value, it means all types from 1 to N. In the case used, there are only atoms of 1 type so this command sets the coefficient value to all atoms of type 1. The first 1.0 coefficient value corresponds to the distance at which potential energies, σ of 2 atoms is 0, whereas the second 1.0 coefficient is the well depth.&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&amp;lt;b&amp;gt;Look at the lines below.&amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.5_E1.PNG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;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;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.5_E2.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&amp;lt;b&amp;gt;Given that we are specifying [[File:3.6_E1.png]] and [[File:3.6_E2.png]], which integration algorithm are we going to use?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As 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) is given, the Velocity-Verlet algorithm should be used.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&amp;lt;b&amp;gt;Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium can be said to be achieved when thermodynamic quantities becomes constant. Hence for the timestep 0.001, the simulation reaches equilibrium since the plots of temperature and pressure versus time equilibrates to a constant value of approximately 1.25K and 1.25atm. From the zoomed in view, we can deduce that equilibration is achieved within 0.05s.&lt;br /&gt;
Equilibrium has also been achieved for other timesteps, except 0.015, where the graph of total energy versus time graph is observed to gradually increase.&lt;br /&gt;
The largest timestep to provide acceptable results is 0.01. Timestep 0.015 is a particularly bad choice because the simulation does not achieve equilibrium as its total energy value is increasing over time, with a large spread of error (larger fluctuation).&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Total_Energy_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Total energy versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Temperature_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Temperature versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Temperature_0.001_zoom.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Temperature versus time for timestep 0.001, zoomed in version&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Pressure_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Pressure versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Total_Energy_all_timestep.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Total Energy versus time for timesteps 0.001, 0.0025, 0.0075, 0.01, 0.015.&lt;br /&gt;
&lt;br /&gt;
==Part 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Choose 5 temperatures (above the critical temperature [[File:4.1_E1.png]]), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen [[File:4.1_E2.png]] points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Temperatures used: 2.0, 2.5, 3.0, 3.5, 4.0&lt;br /&gt;
&lt;br /&gt;
Pressures used: 2.5, 2.8&lt;br /&gt;
&lt;br /&gt;
Timestep used: 0.0025&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;We need to choose [[File:4.2_E1.png]] so that the temperature is correct [[File:4.2_E2.png]] if we multiply every velocity [[File:4.2_E1.png]]. We can write two equations:&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:4.2_E3.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:4.2_E4.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
Solve these to determine [[File:4.2_E1.png]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:4.2_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;Use the manual page 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, how much time will you simulate?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A measurement will be made every &#039;100&#039; units, with &#039;1000&#039; defined to provide the total average of all the &#039;100000&#039; values.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density [[File:4.4_E1.png]]. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated. Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:4.4_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
Density in Ideal Gas Law calculation:&lt;br /&gt;
&lt;br /&gt;
[[File:4.4_Ans2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
At any fixed pressure, the simulated density is lower than the ideal gas law plot. The ideal gas law states that there is negligible interaction between molecules, leading to no repulsive forces. Given this, molecules are more likely to be found next to one another, as compared to the simulation. Where in the case of a simulation, interactions between molecules are present, along with the presence of repulsion forces. This causes the molecules to be found far away from each other. Hence for a given volume, density is higher for an ideal gas (molecules near each other) than for a non-ideal gas (molecules far apart). This discrepancy of ideal gas law and simulation increases with pressure. This is because at high pressures, molecules are forced to be next to each other, increasing repulsion, therefore reducing density.&lt;br /&gt;
&lt;br /&gt;
==Part 5: Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature [[File:5.1_Equation_1.png]] phase space, rather than pressure-temperature phase space. The two densities required at 0.2 and 0.8, and the temperature range is 2.0, 2.2, 2.4, 2.6, 2.8. Plot [[File:5.1_Equation_2.png]] as a function of temperature, where [[File:5.1_Equation_3.png]] 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.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Input script for density 0.2 at temperature 2.0 attached: [[File:5.1_(0.2,2.0).in]]&lt;br /&gt;
&lt;br /&gt;
==Part 6: Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate [[File:6.1_Equation_1.png]] and [[File:6.1_Equation_2.png]]. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:6.1_Ans1.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:6.1_Ans2.PNG]]&lt;br /&gt;
&lt;br /&gt;
The number of peaks in the g(r) plot corresponds to the number of neighbouring atoms. As the solid has the highest number of peaks in the g(r) plot, it has the most neighbouring atoms, followed by liquid and finally gas. The distance between neighbouring atoms in a gas can be seen to be approximately a few times bigger than the solid as within a single gas peak, there are multiple solid peaks. The first 3 peaks for the solid corresponds to the 3 nearest atoms to the sampled atom, as per equidistant lattice points on a cube. The coordination number for the first three peaks are 12, 18 and 42.&lt;br /&gt;
&lt;br /&gt;
==Part 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ caption&lt;br /&gt;
! heading !! heading&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Liq.PNG]]|| [[File:7.1_MSD_Liq1m.PNG]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Solid.PNG]]|| [[File:7.1_MSD_Solid1m.PNG]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Vap.PNG]]|| [[File:7.1_MSD_Vap1m.PNG]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;Make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate [[File:7.2_D.png]] in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
[[File:7.3_Equation_1.png]]. &lt;br /&gt;
Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot [[File:7.3_Equation_2.png]] with [[File:7.3_Equation_3.png]] and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;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 [[File:7.2_D.png]] 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?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;equation 10&amp;quot;&amp;gt;https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment/Introduction_to_molecular_dynamics_simulation&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=User:JFU1608&amp;diff=543396</id>
		<title>User:JFU1608</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=User:JFU1608&amp;diff=543396"/>
		<updated>2016-02-26T03:34:48Z</updated>

		<summary type="html">&lt;p&gt;Jwf13: /* Task 4 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Part 1: Running first simulation==&lt;br /&gt;
&lt;br /&gt;
-no tasks-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Part 2: Introduction to molecular dynamics simulation==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time  t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by  (the values of  ,  , and   are worked out for you in the sheet).&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL: Position at time t (classical solution)&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Position.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
ERROR: Absolute difference between ANALYTICAL and Velocity-verlet solution&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Error.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
ENERGY: Total E of oscillator for velocity-verlet solution&lt;br /&gt;
Total Energy is given by the summation of both kinetic energy: 1/2 mv2 and potential energy 1/2kx2.&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Energy.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data. &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Time!! Maximum Error&lt;br /&gt;
|-&lt;br /&gt;
| 1.9|| 7.58E-04&lt;br /&gt;
|-&lt;br /&gt;
| 5.00|| 2.00E-03&lt;br /&gt;
|-&lt;br /&gt;
| 8.00|| 3.30E-03&lt;br /&gt;
|-&lt;br /&gt;
| 11.10|| 4.60E-03&lt;br /&gt;
|-&lt;br /&gt;
| 14.20|| 5.91E-03&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
[[File:2.2_Max_Error.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph shows a linear relationship between the maximum errors of position with time, characterised by its extrapolation formula y = 0.0004x – 0.00005.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;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?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Previously for timestep 0.1, the percentage change was 0.248%. By varying the timestep, we are able to deduce the corresponding percentage changes, shown in Table X. As timestep increases, the minima total energy value decreases gradually, leading to a larger percentage change in total energy. In order for total energy not to go over 1%, the timestep must not be larger than 0.2. It is important to monitor the total energy of a physical system while modelling its behaviour numerically. This is because the Law of Conservation of Energy is observed, where total energy stays constant. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Timestep!! Energy Maxima!! Energy Minima!! Change in Energy&lt;br /&gt;
|-&lt;br /&gt;
| 0.05|| 0.5||0.4997||0.06%&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;0.1||&#039;&#039;&#039;0.5&#039;&#039;&#039;||&#039;&#039;&#039;0.4988&#039;&#039;&#039;||&#039;&#039;&#039;0.24%&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0.15||0.5||0.4972||0.56%&lt;br /&gt;
|-&lt;br /&gt;
| 0.2||0.5||0.4950||1.00%&lt;br /&gt;
|-&lt;br /&gt;
| 0.25|| 0.5||0.4922||1.56%&lt;br /&gt;
|-&lt;br /&gt;
| 0.3|| 0.5||0.4888||2.24%&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Row highlighted in bold is the simulation done from previous tasks.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;For a single Lennard-Jones interaction, [[File:8c44e3156b2bf003c09fa62fbaed5cb0.png]], find the separation, [[File:2.4_E2.png]], at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, [[File:2.4_E3.png]], and work out the well depth ([[File:2.4_E4.png]]). Evaluate the integrals [[File:2.4_E5.png]], [[File:2.4_E6.png]], and [[File:2.4_E7.png]] when [[File:2.4_E8.png]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the potential energy is zero, separation r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; can be found:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
At this separation, the force can be calculated with [[File:2.4_F_Eq.png|100px]], where using the definition of U from equation 10 &amp;lt;ref name=&amp;quot;equation 10&amp;quot; /&amp;gt; produces:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs where F&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; = 0, so:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans3.png]]&lt;br /&gt;
&lt;br /&gt;
Well depth, &lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans4.PNG]]&lt;br /&gt;
&lt;br /&gt;
When σ=ϵ=1.0,&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans5.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&amp;lt;b&amp;gt;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At standard conditions, there are 3.35 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt; water molecules in 1 mL of water.&lt;br /&gt;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;; Volume = 1 mL = 1 cm&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;; Mr = 18; N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 6.022 x 10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2.5_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
For 10000 water molecules, the calculated volume is 2.99 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; mL:&lt;br /&gt;
&lt;br /&gt;
[[File:2.5_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&amp;lt;b&amp;gt;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, &#039;&#039;after the periodic boundary conditions have been applied?&#039;&#039;.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sum of (0.5, 0.5, 0.5) and (0.7, 0.6, 0.2) gives (1.2,1.1,0.7), but this assumes periodic boundary conditions not applied. If applied, number of atoms inside box always constant as one leaves, simultaneously another enters. Hence deduct (1.2,1.1,0.7) by value of 1 in the x and y coordinates since they exceed the value of 1, to give the (0.2,0.1,0.3) position.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&amp;lt;b&amp;gt;The Lennard-Jones parameters for argon are [[File:1.7_E1.png]]. If the LJ cutoff is [[File:1.7_E2.png]], 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 [[File:4.1_E1.png]] in real units?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2.7_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
==Part 3: Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together? &lt;br /&gt;
If molecules are put extremely close to each other then they might overlap each other, having unfavourable repulsion interactions. &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates in simulations, there is a possibility that the simulation puts 2 atoms such that they overlap one another, which is not possible in real terms. As two atoms get closer together, their potential energy increases exponentially, causing a discrepancy in the calculated values. This is avoided when the atoms are placed at lattice points.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given previously that each length of a unit cell is 1.07722, &lt;br /&gt;
&lt;br /&gt;
[[File:3.2_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
For a fcc lattice of lattice point number density 1.2:&lt;br /&gt;
&lt;br /&gt;
[[File:3.2_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;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? &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the fcc lattice has 4 atoms, where each is 1000 unit cells, a total of 4000 atoms will be created.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;Using the LAMMPS manual, find the purpose of the following commands in the input script: &amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.4_E1.PNG]]&lt;br /&gt;
&lt;br /&gt;
The first line is a mass command where 1 is the atom type, with mass of 1.0. This input script sets all atoms of atom type 1 to have a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
The second line is a pair style command which computes the pairwise interactions of 2 atoms. This command is scripted such that the Lennard-Jones potential is cut off for coulomb interaction beyond distance of 3.0, hence absence of potential energy. Within distance 3.0, there will be a presence of potential energy due to the active Lennard-Jones interaction.&lt;br /&gt;
&lt;br /&gt;
The third line is a pair coeff command, where the * sign in pair coeff command sets coefficients for multiple pairs of atom types. As there is no numeric value, it means all types from 1 to N. In the case used, there are only atoms of 1 type so this command sets the coefficient value to all atoms of type 1. The first 1.0 coefficient value corresponds to the distance at which potential energies, σ of 2 atoms is 0, whereas the second 1.0 coefficient is the well depth.&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&amp;lt;b&amp;gt;Look at the lines below.&amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.5_E1.PNG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;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;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.5_E2.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&amp;lt;b&amp;gt;Given that we are specifying [[File:3.6_E1.png]] and [[File:3.6_E2.png]], which integration algorithm are we going to use?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As 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) is given, the Velocity-Verlet algorithm should be used.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&amp;lt;b&amp;gt;Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium can be said to be achieved when thermodynamic quantities becomes constant. Hence for the timestep 0.001, the simulation reaches equilibrium since the plots of temperature and pressure versus time equilibrates to a constant value of approximately 1.25K and 1.25atm. From the zoomed in view, we can deduce that equilibration is achieved within 0.05s.&lt;br /&gt;
Equilibrium has also been achieved for other timesteps, except 0.015, where the graph of total energy versus time graph is observed to gradually increase.&lt;br /&gt;
The largest timestep to provide acceptable results is 0.01. Timestep 0.015 is a particularly bad choice because the simulation does not achieve equilibrium as its total energy value is increasing over time, with a large spread of error (larger fluctuation).&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Total_Energy_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Total energy versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Temperature_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Temperature versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Temperature_0.001_zoom.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Temperature versus time for timestep 0.001, zoomed in version&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Pressure_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Pressure versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Total_Energy_all_timestep.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Total Energy versus time for timesteps 0.001, 0.0025, 0.0075, 0.01, 0.015.&lt;br /&gt;
&lt;br /&gt;
==Part 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Choose 5 temperatures (above the critical temperature [[File:4.1_E1.png]]), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen [[File:4.1_E2.png]] points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Temperatures used: 2.0, 2.5, 3.0, 3.5, 4.0&lt;br /&gt;
&lt;br /&gt;
Pressures used: 2.5, 2.8&lt;br /&gt;
&lt;br /&gt;
Timestep used: 0.0025&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;We need to choose [[File:4.2_E1.png]] so that the temperature is correct [[File:4.2_E2.png]] if we multiply every velocity [[File:4.2_E1.png]]. We can write two equations:&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:4.2_E3.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:4.2_E4.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
Solve these to determine [[File:4.2_E1.png]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:4.2_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;Use the manual page 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, how much time will you simulate?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A measurement will be made every &#039;100&#039; units, with &#039;1000&#039; defined to provide the total average of all the &#039;100000&#039; values.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density [[File:4.4_E1.png]]. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated. Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:4.4_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
Density in Ideal Gas Law calculation:&lt;br /&gt;
&lt;br /&gt;
[[File:4.4_Ans2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
At any fixed pressure, the simulated density is lower than the ideal gas law plot. The ideal gas law states that there is negligible interaction between molecules, leading to no repulsive forces. Given this, molecules are more likely to be found next to one another, as compared to the simulation. Where in the case of a simulation, interactions between molecules are present, along with the presence of repulsion forces. This causes the molecules to be found far away from each other. Hence for a given volume, density is higher for an ideal gas (molecules near each other) than for a non-ideal gas (molecules far apart). This discrepancy of ideal gas law and simulation increases with pressure. This is because at high pressures, molecules are forced to be next to each other, increasing repulsion, therefore reducing density.&lt;br /&gt;
&lt;br /&gt;
==Part 5: Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature [[File:5.1_Equation_1.png]] phase space, rather than pressure-temperature phase space. The two densities required at 0.2 and 0.8, and the temperature range is 2.0, 2.2, 2.4, 2.6, 2.8. Plot [[File:5.1_Equation_2.png]] as a function of temperature, where [[File:5.1_Equation_3.png]] 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.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Input script for density 0.2 at temperature 2.0 attached: [[File:5.1_(0.2,2.0).in]]&lt;br /&gt;
&lt;br /&gt;
==Part 6: Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate [[File:6.1_Equation_1.png]] and [[File:6.1_Equation_2.png]]. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:6.1_Ans1.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:6.1_Ans2.PNG]]&lt;br /&gt;
&lt;br /&gt;
==Part 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ caption&lt;br /&gt;
! heading !! heading&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Liq.PNG]]|| [[File:7.1_MSD_Liq1m.PNG]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Solid.PNG]]|| [[File:7.1_MSD_Solid1m.PNG]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Vap.PNG]]|| [[File:7.1_MSD_Vap1m.PNG]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;Make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate [[File:7.2_D.png]] in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
[[File:7.3_Equation_1.png]]. &lt;br /&gt;
Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot [[File:7.3_Equation_2.png]] with [[File:7.3_Equation_3.png]] and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;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 [[File:7.2_D.png]] 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?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;equation 10&amp;quot;&amp;gt;https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment/Introduction_to_molecular_dynamics_simulation&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=User:JFU1608&amp;diff=543394</id>
		<title>User:JFU1608</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=User:JFU1608&amp;diff=543394"/>
		<updated>2016-02-26T03:19:58Z</updated>

		<summary type="html">&lt;p&gt;Jwf13: /* Task 3 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Part 1: Running first simulation==&lt;br /&gt;
&lt;br /&gt;
-no tasks-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Part 2: Introduction to molecular dynamics simulation==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time  t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by  (the values of  ,  , and   are worked out for you in the sheet).&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL: Position at time t (classical solution)&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Position.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
ERROR: Absolute difference between ANALYTICAL and Velocity-verlet solution&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Error.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
ENERGY: Total E of oscillator for velocity-verlet solution&lt;br /&gt;
Total Energy is given by the summation of both kinetic energy: 1/2 mv2 and potential energy 1/2kx2.&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Energy.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data. &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Time!! Maximum Error&lt;br /&gt;
|-&lt;br /&gt;
| 1.9|| 7.58E-04&lt;br /&gt;
|-&lt;br /&gt;
| 5.00|| 2.00E-03&lt;br /&gt;
|-&lt;br /&gt;
| 8.00|| 3.30E-03&lt;br /&gt;
|-&lt;br /&gt;
| 11.10|| 4.60E-03&lt;br /&gt;
|-&lt;br /&gt;
| 14.20|| 5.91E-03&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
[[File:2.2_Max_Error.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph shows a linear relationship between the maximum errors of position with time, characterised by its extrapolation formula y = 0.0004x – 0.00005.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;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?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Previously for timestep 0.1, the percentage change was 0.248%. By varying the timestep, we are able to deduce the corresponding percentage changes, shown in Table X. As timestep increases, the minima total energy value decreases gradually, leading to a larger percentage change in total energy. In order for total energy not to go over 1%, the timestep must not be larger than 0.2. It is important to monitor the total energy of a physical system while modelling its behaviour numerically. This is because the Law of Conservation of Energy is observed, where total energy stays constant. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Timestep!! Energy Maxima!! Energy Minima!! Change in Energy&lt;br /&gt;
|-&lt;br /&gt;
| 0.05|| 0.5||0.4997||0.06%&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;0.1||&#039;&#039;&#039;0.5&#039;&#039;&#039;||&#039;&#039;&#039;0.4988&#039;&#039;&#039;||&#039;&#039;&#039;0.24%&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0.15||0.5||0.4972||0.56%&lt;br /&gt;
|-&lt;br /&gt;
| 0.2||0.5||0.4950||1.00%&lt;br /&gt;
|-&lt;br /&gt;
| 0.25|| 0.5||0.4922||1.56%&lt;br /&gt;
|-&lt;br /&gt;
| 0.3|| 0.5||0.4888||2.24%&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Row highlighted in bold is the simulation done from previous tasks.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;For a single Lennard-Jones interaction, [[File:8c44e3156b2bf003c09fa62fbaed5cb0.png]], find the separation, [[File:2.4_E2.png]], at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, [[File:2.4_E3.png]], and work out the well depth ([[File:2.4_E4.png]]). Evaluate the integrals [[File:2.4_E5.png]], [[File:2.4_E6.png]], and [[File:2.4_E7.png]] when [[File:2.4_E8.png]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the potential energy is zero, separation r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; can be found:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
At this separation, the force can be calculated with [[File:2.4_F_Eq.png|100px]], where using the definition of U from equation 10 &amp;lt;ref name=&amp;quot;equation 10&amp;quot; /&amp;gt; produces:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs where F&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; = 0, so:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans3.png]]&lt;br /&gt;
&lt;br /&gt;
Well depth, &lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans4.PNG]]&lt;br /&gt;
&lt;br /&gt;
When σ=ϵ=1.0,&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans5.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&amp;lt;b&amp;gt;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At standard conditions, there are 3.35 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt; water molecules in 1 mL of water.&lt;br /&gt;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;; Volume = 1 mL = 1 cm&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;; Mr = 18; N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 6.022 x 10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2.5_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
For 10000 water molecules, the calculated volume is 2.99 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; mL:&lt;br /&gt;
&lt;br /&gt;
[[File:2.5_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&amp;lt;b&amp;gt;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, &#039;&#039;after the periodic boundary conditions have been applied?&#039;&#039;.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sum of (0.5, 0.5, 0.5) and (0.7, 0.6, 0.2) gives (1.2,1.1,0.7), but this assumes periodic boundary conditions not applied. If applied, number of atoms inside box always constant as one leaves, simultaneously another enters. Hence deduct (1.2,1.1,0.7) by value of 1 in the x and y coordinates since they exceed the value of 1, to give the (0.2,0.1,0.3) position.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&amp;lt;b&amp;gt;The Lennard-Jones parameters for argon are [[File:1.7_E1.png]]. If the LJ cutoff is [[File:1.7_E2.png]], 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 [[File:4.1_E1.png]] in real units?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2.7_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
==Part 3: Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together? &lt;br /&gt;
If molecules are put extremely close to each other then they might overlap each other, having unfavourable repulsion interactions. &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates in simulations, there is a possibility that the simulation puts 2 atoms such that they overlap one another, which is not possible in real terms. As two atoms get closer together, their potential energy increases exponentially, causing a discrepancy in the calculated values. This is avoided when the atoms are placed at lattice points.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given previously that each length of a unit cell is 1.07722, &lt;br /&gt;
&lt;br /&gt;
[[File:3.2_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
For a fcc lattice of lattice point number density 1.2:&lt;br /&gt;
&lt;br /&gt;
[[File:3.2_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;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? &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the fcc lattice has 4 atoms, where each is 1000 unit cells, a total of 4000 atoms will be created.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;Using the LAMMPS manual, find the purpose of the following commands in the input script: &amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.4_E1.PNG]]&lt;br /&gt;
&lt;br /&gt;
The first line is a mass command where 1 is the atom type, with mass of 1.0. This input script sets all atoms of atom type 1 to have a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
The second line is a pair style command which computes the pairwise interactions of 2 atoms. This command is scripted such that the Lennard-Jones potential is cut off for coulomb interaction beyond distance of 3.0, hence absence of potential energy. Within distance 3.0, there will be a presence of potential energy due to the active Lennard-Jones interaction.&lt;br /&gt;
&lt;br /&gt;
The third line is a pair coeff command, where the * sign in pair coeff command sets coefficients for multiple pairs of atom types. As there is no numeric value, it means all types from 1 to N. In the case used, there are only atoms of 1 type so this command sets the coefficient value to all atoms of type 1. The first 1.0 coefficient value corresponds to the distance at which potential energies, σ of 2 atoms is 0, whereas the second 1.0 coefficient is the well depth.&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&amp;lt;b&amp;gt;Look at the lines below.&amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.5_E1.PNG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;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;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.5_E2.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&amp;lt;b&amp;gt;Given that we are specifying [[File:3.6_E1.png]] and [[File:3.6_E2.png]], which integration algorithm are we going to use?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As 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) is given, the Velocity-Verlet algorithm should be used.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&amp;lt;b&amp;gt;Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium can be said to be achieved when thermodynamic quantities becomes constant. Hence for the timestep 0.001, the simulation reaches equilibrium since the plots of temperature and pressure versus time equilibrates to a constant value of approximately 1.25K and 1.25atm. From the zoomed in view, we can deduce that equilibration is achieved within 0.05s.&lt;br /&gt;
Equilibrium has also been achieved for other timesteps, except 0.015, where the graph of total energy versus time graph is observed to gradually increase.&lt;br /&gt;
The largest timestep to provide acceptable results is 0.01. Timestep 0.015 is a particularly bad choice because the simulation does not achieve equilibrium as its total energy value is increasing over time, with a large spread of error (larger fluctuation).&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Total_Energy_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Total energy versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Temperature_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Temperature versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Temperature_0.001_zoom.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Temperature versus time for timestep 0.001, zoomed in version&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Pressure_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Pressure versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Total_Energy_all_timestep.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Total Energy versus time for timesteps 0.001, 0.0025, 0.0075, 0.01, 0.015.&lt;br /&gt;
&lt;br /&gt;
==Part 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Choose 5 temperatures (above the critical temperature [[File:4.1_E1.png]]), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen [[File:4.1_E2.png]] points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Temperatures used: 2.0, 2.5, 3.0, 3.5, 4.0&lt;br /&gt;
&lt;br /&gt;
Pressures used: 2.5, 2.8&lt;br /&gt;
&lt;br /&gt;
Timestep used: 0.0025&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;We need to choose [[File:4.2_E1.png]] so that the temperature is correct [[File:4.2_E2.png]] if we multiply every velocity [[File:4.2_E1.png]]. We can write two equations:&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:4.2_E3.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:4.2_E4.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
Solve these to determine [[File:4.2_E1.png]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:4.2_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;Use the manual page 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, how much time will you simulate?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A measurement will be made every &#039;100&#039; units, with &#039;1000&#039; defined to provide the total average of all the &#039;100000&#039; values.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density [[File:4.4_E1.png]]. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated. Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:4.4_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
Density in Ideal Gas Law calculation:&lt;br /&gt;
&lt;br /&gt;
[[File:4.4_Ans2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the ideal gas law plot. ?????&lt;br /&gt;
&lt;br /&gt;
==Part 5: Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature [[File:5.1_Equation_1.png]] phase space, rather than pressure-temperature phase space. The two densities required at 0.2 and 0.8, and the temperature range is 2.0, 2.2, 2.4, 2.6, 2.8. Plot [[File:5.1_Equation_2.png]] as a function of temperature, where [[File:5.1_Equation_3.png]] 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.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Input script for density 0.2 at temperature 2.0 attached: [[File:5.1_(0.2,2.0).in]]&lt;br /&gt;
&lt;br /&gt;
==Part 6: Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate [[File:6.1_Equation_1.png]] and [[File:6.1_Equation_2.png]]. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:6.1_Ans1.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:6.1_Ans2.PNG]]&lt;br /&gt;
&lt;br /&gt;
==Part 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ caption&lt;br /&gt;
! heading !! heading&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Liq.PNG]]|| [[File:7.1_MSD_Liq1m.PNG]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Solid.PNG]]|| [[File:7.1_MSD_Solid1m.PNG]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Vap.PNG]]|| [[File:7.1_MSD_Vap1m.PNG]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;Make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate [[File:7.2_D.png]] in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
[[File:7.3_Equation_1.png]]. &lt;br /&gt;
Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot [[File:7.3_Equation_2.png]] with [[File:7.3_Equation_3.png]] and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;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 [[File:7.2_D.png]] 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?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;equation 10&amp;quot;&amp;gt;https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment/Introduction_to_molecular_dynamics_simulation&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=User:JFU1608&amp;diff=543391</id>
		<title>User:JFU1608</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=User:JFU1608&amp;diff=543391"/>
		<updated>2016-02-26T03:15:17Z</updated>

		<summary type="html">&lt;p&gt;Jwf13: /* Task 5 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Part 1: Running first simulation==&lt;br /&gt;
&lt;br /&gt;
-no tasks-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Part 2: Introduction to molecular dynamics simulation==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time  t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by  (the values of  ,  , and   are worked out for you in the sheet).&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL: Position at time t (classical solution)&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Position.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
ERROR: Absolute difference between ANALYTICAL and Velocity-verlet solution&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Error.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
ENERGY: Total E of oscillator for velocity-verlet solution&lt;br /&gt;
Total Energy is given by the summation of both kinetic energy: 1/2 mv2 and potential energy 1/2kx2.&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Energy.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data. &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Time!! Maximum Error&lt;br /&gt;
|-&lt;br /&gt;
| 1.9|| 7.58E-04&lt;br /&gt;
|-&lt;br /&gt;
| 5.00|| 2.00E-03&lt;br /&gt;
|-&lt;br /&gt;
| 8.00|| 3.30E-03&lt;br /&gt;
|-&lt;br /&gt;
| 11.10|| 4.60E-03&lt;br /&gt;
|-&lt;br /&gt;
| 14.20|| 5.91E-03&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
[[File:2.2_Max_Error.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph shows a linear relationship between the maximum errors of position with time, characterised by its extrapolation formula y = 0.0004x – 0.00005.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;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?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Previously for timestep 0.1, the percentage change was 0.248%. By varying the timestep, we are able to deduce the corresponding percentage changes, shown in Table X. As timestep increases, the minima total energy value decreases gradually, leading to a larger percentage change in total energy. In order for total energy not to go over 1%, the timestep must not be larger than 0.2. It is important to monitor the total energy of a physical system while modelling its behaviour numerically. This is because the Law of Conservation of Energy is observed, where total energy stays constant. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Timestep!! Energy Maxima!! Energy Minima!! Change in Energy&lt;br /&gt;
|-&lt;br /&gt;
| 0.05|| 0.5||0.4997||0.06%&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;0.1||&#039;&#039;&#039;0.5&#039;&#039;&#039;||&#039;&#039;&#039;0.4988&#039;&#039;&#039;||&#039;&#039;&#039;0.24%&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0.15||0.5||0.4972||0.56%&lt;br /&gt;
|-&lt;br /&gt;
| 0.2||0.5||0.4950||1.00%&lt;br /&gt;
|-&lt;br /&gt;
| 0.25|| 0.5||0.4922||1.56%&lt;br /&gt;
|-&lt;br /&gt;
| 0.3|| 0.5||0.4888||2.24%&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Row highlighted in bold is the simulation done from previous tasks.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;For a single Lennard-Jones interaction, [[File:8c44e3156b2bf003c09fa62fbaed5cb0.png]], find the separation, [[File:2.4_E2.png]], at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, [[File:2.4_E3.png]], and work out the well depth ([[File:2.4_E4.png]]). Evaluate the integrals [[File:2.4_E5.png]], [[File:2.4_E6.png]], and [[File:2.4_E7.png]] when [[File:2.4_E8.png]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the potential energy is zero, separation r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; can be found:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
At this separation, the force can be calculated with [[File:2.4_F_Eq.png|100px]], where using the definition of U from equation 10 &amp;lt;ref name=&amp;quot;equation 10&amp;quot; /&amp;gt; produces:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs where F&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; = 0, so:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans3.png]]&lt;br /&gt;
&lt;br /&gt;
Well depth, &lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans4.PNG]]&lt;br /&gt;
&lt;br /&gt;
When σ=ϵ=1.0,&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans5.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&amp;lt;b&amp;gt;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At standard conditions, there are 3.35 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt; water molecules in 1 mL of water.&lt;br /&gt;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;; Volume = 1 mL = 1 cm&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;; Mr = 18; N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 6.022 x 10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2.5_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
For 10000 water molecules, the calculated volume is 2.99 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; mL:&lt;br /&gt;
&lt;br /&gt;
[[File:2.5_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&amp;lt;b&amp;gt;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, &#039;&#039;after the periodic boundary conditions have been applied?&#039;&#039;.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sum of (0.5, 0.5, 0.5) and (0.7, 0.6, 0.2) gives (1.2,1.1,0.7), but this assumes periodic boundary conditions not applied. If applied, number of atoms inside box always constant as one leaves, simultaneously another enters. Hence deduct (1.2,1.1,0.7) by value of 1 in the x and y coordinates since they exceed the value of 1, to give the (0.2,0.1,0.3) position.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&amp;lt;b&amp;gt;The Lennard-Jones parameters for argon are [[File:1.7_E1.png]]. If the LJ cutoff is [[File:1.7_E2.png]], 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 [[File:4.1_E1.png]] in real units?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2.7_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
==Part 3: Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together? &lt;br /&gt;
If molecules are put extremely close to each other then they might overlap each other, having unfavourable repulsion interactions. &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates in simulations, there is a possibility that the simulation puts 2 atoms such that they overlap one another, which is not possible in real terms. As two atoms get closer together, their potential energy increases exponentially, causing a discrepancy in the calculated values. This is avoided when the atoms are placed at lattice points.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given previously that each length of a unit cell is 1.07722, &lt;br /&gt;
&lt;br /&gt;
[[File:3.2_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
For a fcc lattice of lattice point number density 1.2:&lt;br /&gt;
&lt;br /&gt;
[[File:3.2_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;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? &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the fcc lattice has 4 atoms, where each is 1000 unit cells, a total of 4000 atoms will be created.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;Using the LAMMPS manual, find the purpose of the following commands in the input script: &amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.4_E1.PNG]]&lt;br /&gt;
&lt;br /&gt;
The first line is a mass command where 1 is the atom type, with mass of 1.0. This input script sets all atoms of atom type 1 to have a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
The second line is a pair style command which computes the pairwise interactions of 2 atoms. This command is scripted such that the Lennard-Jones potential is cut off for coulomb interaction beyond distance of 3.0, hence absence of potential energy. Within distance 3.0, there will be a presence of potential energy due to the active Lennard-Jones interaction.&lt;br /&gt;
&lt;br /&gt;
The third line is a pair coeff command, where the * sign in pair coeff command sets coefficients for multiple pairs of atom types. As there is no numeric value, it means all types from 1 to N. In the case used, there are only atoms of 1 type so this command sets the coefficient value to all atoms of type 1. The first 1.0 coefficient value corresponds to the distance at which potential energies, σ of 2 atoms is 0, whereas the second 1.0 coefficient is the well depth.&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&amp;lt;b&amp;gt;Look at the lines below.&amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.5_E1.PNG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;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;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.5_E2.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&amp;lt;b&amp;gt;Given that we are specifying [[File:3.6_E1.png]] and [[File:3.6_E2.png]], which integration algorithm are we going to use?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As 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) is given, the Velocity-Verlet algorithm should be used.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&amp;lt;b&amp;gt;Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium can be said to be achieved when thermodynamic quantities becomes constant. Hence for the timestep 0.001, the simulation reaches equilibrium since the plots of temperature and pressure versus time equilibrates to a constant value of approximately 1.25K and 1.25atm. From the zoomed in view, we can deduce that equilibration is achieved within 0.05s.&lt;br /&gt;
Equilibrium has also been achieved for other timesteps, except 0.015, where the graph of total energy versus time graph is observed to gradually increase.&lt;br /&gt;
The largest timestep to provide acceptable results is 0.01. Timestep 0.015 is a particularly bad choice because the simulation does not achieve equilibrium as its total energy value is increasing over time, with a large spread of error (larger fluctuation).&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Total_Energy_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Total energy versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Temperature_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Temperature versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Temperature_0.001_zoom.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Temperature versus time for timestep 0.001, zoomed in version&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Pressure_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Pressure versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Total_Energy_all_timestep.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Total Energy versus time for timesteps 0.001, 0.0025, 0.0075, 0.01, 0.015.&lt;br /&gt;
&lt;br /&gt;
==Part 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Choose 5 temperatures (above the critical temperature [[File:4.1_E1.png]]), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen [[File:4.1_E2.png]] points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Temperatures used: 2.0, 2.5, 3.0, 3.5, 4.0&lt;br /&gt;
&lt;br /&gt;
Pressures used: 2.5, 2.8&lt;br /&gt;
&lt;br /&gt;
Timestep used: 0.0025&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;We need to choose [[File:4.2_E1.png]] so that the temperature is correct [[File:4.2_E2.png]] if we multiply every velocity [[File:4.2_E1.png]]. We can write two equations:&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:4.2_E3.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:4.2_E4.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
Solve these to determine [[File:4.2_E1.png]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:4.2_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;Use the manual page 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, how much time will you simulate?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density [[File:4.4_E1.png]]. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated. Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:4.4_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
Density in Ideal Gas Law calculation:&lt;br /&gt;
&lt;br /&gt;
[[File:4.4_Ans2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the ideal gas law plot. ?????&lt;br /&gt;
&lt;br /&gt;
==Part 5: Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature [[File:5.1_Equation_1.png]] phase space, rather than pressure-temperature phase space. The two densities required at 0.2 and 0.8, and the temperature range is 2.0, 2.2, 2.4, 2.6, 2.8. Plot [[File:5.1_Equation_2.png]] as a function of temperature, where [[File:5.1_Equation_3.png]] 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.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Input script for density 0.2 at temperature 2.0 attached: [[File:5.1_(0.2,2.0).in]]&lt;br /&gt;
&lt;br /&gt;
==Part 6: Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate [[File:6.1_Equation_1.png]] and [[File:6.1_Equation_2.png]]. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:6.1_Ans1.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:6.1_Ans2.PNG]]&lt;br /&gt;
&lt;br /&gt;
==Part 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ caption&lt;br /&gt;
! heading !! heading&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Liq.PNG]]|| [[File:7.1_MSD_Liq1m.PNG]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Solid.PNG]]|| [[File:7.1_MSD_Solid1m.PNG]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Vap.PNG]]|| [[File:7.1_MSD_Vap1m.PNG]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;Make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate [[File:7.2_D.png]] in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
[[File:7.3_Equation_1.png]]. &lt;br /&gt;
Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot [[File:7.3_Equation_2.png]] with [[File:7.3_Equation_3.png]] and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;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 [[File:7.2_D.png]] 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?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;equation 10&amp;quot;&amp;gt;https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment/Introduction_to_molecular_dynamics_simulation&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=User:JFU1608&amp;diff=543390</id>
		<title>User:JFU1608</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=User:JFU1608&amp;diff=543390"/>
		<updated>2016-02-26T03:03:12Z</updated>

		<summary type="html">&lt;p&gt;Jwf13: /* Task 3 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Part 1: Running first simulation==&lt;br /&gt;
&lt;br /&gt;
-no tasks-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Part 2: Introduction to molecular dynamics simulation==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time  t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by  (the values of  ,  , and   are worked out for you in the sheet).&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL: Position at time t (classical solution)&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Position.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
ERROR: Absolute difference between ANALYTICAL and Velocity-verlet solution&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Error.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
ENERGY: Total E of oscillator for velocity-verlet solution&lt;br /&gt;
Total Energy is given by the summation of both kinetic energy: 1/2 mv2 and potential energy 1/2kx2.&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Energy.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data. &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Time!! Maximum Error&lt;br /&gt;
|-&lt;br /&gt;
| 1.9|| 7.58E-04&lt;br /&gt;
|-&lt;br /&gt;
| 5.00|| 2.00E-03&lt;br /&gt;
|-&lt;br /&gt;
| 8.00|| 3.30E-03&lt;br /&gt;
|-&lt;br /&gt;
| 11.10|| 4.60E-03&lt;br /&gt;
|-&lt;br /&gt;
| 14.20|| 5.91E-03&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
[[File:2.2_Max_Error.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph shows a linear relationship between the maximum errors of position with time, characterised by its extrapolation formula y = 0.0004x – 0.00005.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;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?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Previously for timestep 0.1, the percentage change was 0.248%. By varying the timestep, we are able to deduce the corresponding percentage changes, shown in Table X. As timestep increases, the minima total energy value decreases gradually, leading to a larger percentage change in total energy. In order for total energy not to go over 1%, the timestep must not be larger than 0.2. It is important to monitor the total energy of a physical system while modelling its behaviour numerically. This is because the Law of Conservation of Energy is observed, where total energy stays constant. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Timestep!! Energy Maxima!! Energy Minima!! Change in Energy&lt;br /&gt;
|-&lt;br /&gt;
| 0.05|| 0.5||0.4997||0.06%&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;0.1||&#039;&#039;&#039;0.5&#039;&#039;&#039;||&#039;&#039;&#039;0.4988&#039;&#039;&#039;||&#039;&#039;&#039;0.24%&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0.15||0.5||0.4972||0.56%&lt;br /&gt;
|-&lt;br /&gt;
| 0.2||0.5||0.4950||1.00%&lt;br /&gt;
|-&lt;br /&gt;
| 0.25|| 0.5||0.4922||1.56%&lt;br /&gt;
|-&lt;br /&gt;
| 0.3|| 0.5||0.4888||2.24%&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Row highlighted in bold is the simulation done from previous tasks.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;For a single Lennard-Jones interaction, [[File:8c44e3156b2bf003c09fa62fbaed5cb0.png]], find the separation, [[File:2.4_E2.png]], at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, [[File:2.4_E3.png]], and work out the well depth ([[File:2.4_E4.png]]). Evaluate the integrals [[File:2.4_E5.png]], [[File:2.4_E6.png]], and [[File:2.4_E7.png]] when [[File:2.4_E8.png]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the potential energy is zero, separation r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; can be found:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
At this separation, the force can be calculated with [[File:2.4_F_Eq.png|100px]], where using the definition of U from equation 10 &amp;lt;ref name=&amp;quot;equation 10&amp;quot; /&amp;gt; produces:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs where F&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; = 0, so:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans3.png]]&lt;br /&gt;
&lt;br /&gt;
Well depth, &lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans4.PNG]]&lt;br /&gt;
&lt;br /&gt;
When σ=ϵ=1.0,&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans5.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&amp;lt;b&amp;gt;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At standard conditions, there are 3.35 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt; water molecules in 1 mL of water.&lt;br /&gt;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;; Volume = 1 mL = 1 cm&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;; Mr = 18; N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 6.022 x 10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2.5_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
For 10000 water molecules, the calculated volume is 2.99 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; mL:&lt;br /&gt;
&lt;br /&gt;
[[File:2.5_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&amp;lt;b&amp;gt;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, &#039;&#039;after the periodic boundary conditions have been applied?&#039;&#039;.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sum of (0.5, 0.5, 0.5) and (0.7, 0.6, 0.2) gives (1.2,1.1,0.7), but this assumes periodic boundary conditions not applied. If applied, number of atoms inside box always constant as one leaves, simultaneously another enters. Hence deduct (1.2,1.1,0.7) by value of 1 in the x and y coordinates since they exceed the value of 1, to give the (0.2,0.1,0.3) position.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&amp;lt;b&amp;gt;The Lennard-Jones parameters for argon are [[File:1.7_E1.png]]. If the LJ cutoff is [[File:1.7_E2.png]], 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 [[File:4.1_E1.png]] in real units?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2.7_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
==Part 3: Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together? &lt;br /&gt;
If molecules are put extremely close to each other then they might overlap each other, having unfavourable repulsion interactions. &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates in simulations, there is a possibility that the simulation puts 2 atoms such that they overlap one another, which is not possible in real terms. As two atoms get closer together, their potential energy increases exponentially, causing a discrepancy in the calculated values. This is avoided when the atoms are placed at lattice points.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given previously that each length of a unit cell is 1.07722, &lt;br /&gt;
&lt;br /&gt;
[[File:3.2_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
For a fcc lattice of lattice point number density 1.2:&lt;br /&gt;
&lt;br /&gt;
[[File:3.2_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;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? &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the fcc lattice has 4 atoms, where each is 1000 unit cells, a total of 4000 atoms will be created.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;Using the LAMMPS manual, find the purpose of the following commands in the input script: &amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.4_E1.PNG]]&lt;br /&gt;
&lt;br /&gt;
The first line is a mass command where 1 is the atom type, with mass of 1.0. This input script sets all atoms of atom type 1 to have a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
The second line is a pair style command which computes the pairwise interactions of 2 atoms. This command is scripted such that the Lennard-Jones potential is cut off for coulomb interaction beyond distance of 3.0, hence absence of potential energy. Within distance 3.0, there will be a presence of potential energy due to the active Lennard-Jones interaction.&lt;br /&gt;
&lt;br /&gt;
The third line is a pair coeff command, where the * sign in pair coeff command sets coefficients for multiple pairs of atom types. As there is no numeric value, it means all types from 1 to N. In the case used, there are only atoms of 1 type so this command sets the coefficient value to all atoms of type 1. The first 1.0 coefficient value corresponds to the distance at which potential energies, σ of 2 atoms is 0, whereas the second 1.0 coefficient is the well depth.&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&amp;lt;b&amp;gt;Look at the lines below.&amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.5_E1.PNG]]&lt;br /&gt;
&amp;lt;b&amp;gt;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;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.5_E2.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&amp;lt;b&amp;gt;Given that we are specifying [[File:3.6_E1.png]] and [[File:3.6_E2.png]], which integration algorithm are we going to use?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As 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) is given, the Velocity-Verlet algorithm should be used.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&amp;lt;b&amp;gt;Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium can be said to be achieved when thermodynamic quantities becomes constant. Hence for the timestep 0.001, the simulation reaches equilibrium since the plots of temperature and pressure versus time equilibrates to a constant value of approximately 1.25K and 1.25atm. From the zoomed in view, we can deduce that equilibration is achieved within 0.05s.&lt;br /&gt;
Equilibrium has also been achieved for other timesteps, except 0.015, where the graph of total energy versus time graph is observed to gradually increase.&lt;br /&gt;
The largest timestep to provide acceptable results is 0.01. Timestep 0.015 is a particularly bad choice because the simulation does not achieve equilibrium as its total energy value is increasing over time, with a large spread of error (larger fluctuation).&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Total_Energy_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Total energy versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Temperature_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Temperature versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Temperature_0.001_zoom.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Temperature versus time for timestep 0.001, zoomed in version&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Pressure_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Pressure versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Total_Energy_all_timestep.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Total Energy versus time for timesteps 0.001, 0.0025, 0.0075, 0.01, 0.015.&lt;br /&gt;
&lt;br /&gt;
==Part 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Choose 5 temperatures (above the critical temperature [[File:4.1_E1.png]]), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen [[File:4.1_E2.png]] points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Temperatures used: 2.0, 2.5, 3.0, 3.5, 4.0&lt;br /&gt;
&lt;br /&gt;
Pressures used: 2.5, 2.8&lt;br /&gt;
&lt;br /&gt;
Timestep used: 0.0025&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;We need to choose [[File:4.2_E1.png]] so that the temperature is correct [[File:4.2_E2.png]] if we multiply every velocity [[File:4.2_E1.png]]. We can write two equations:&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:4.2_E3.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:4.2_E4.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
Solve these to determine [[File:4.2_E1.png]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:4.2_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;Use the manual page 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, how much time will you simulate?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density [[File:4.4_E1.png]]. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated. Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:4.4_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
Density in Ideal Gas Law calculation:&lt;br /&gt;
&lt;br /&gt;
[[File:4.4_Ans2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the ideal gas law plot. ?????&lt;br /&gt;
&lt;br /&gt;
==Part 5: Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature [[File:5.1_Equation_1.png]] phase space, rather than pressure-temperature phase space. The two densities required at 0.2 and 0.8, and the temperature range is 2.0, 2.2, 2.4, 2.6, 2.8. Plot [[File:5.1_Equation_2.png]] as a function of temperature, where [[File:5.1_Equation_3.png]] 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.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Input script for density 0.2 at temperature 2.0 attached: [[File:5.1_(0.2,2.0).in]]&lt;br /&gt;
&lt;br /&gt;
==Part 6: Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate [[File:6.1_Equation_1.png]] and [[File:6.1_Equation_2.png]]. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:6.1_Ans1.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:6.1_Ans2.PNG]]&lt;br /&gt;
&lt;br /&gt;
==Part 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ caption&lt;br /&gt;
! heading !! heading&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Liq.PNG]]|| [[File:7.1_MSD_Liq1m.PNG]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Solid.PNG]]|| [[File:7.1_MSD_Solid1m.PNG]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Vap.PNG]]|| [[File:7.1_MSD_Vap1m.PNG]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;Make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate [[File:7.2_D.png]] in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
[[File:7.3_Equation_1.png]]. &lt;br /&gt;
Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot [[File:7.3_Equation_2.png]] with [[File:7.3_Equation_3.png]] and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;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 [[File:7.2_D.png]] 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?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;equation 10&amp;quot;&amp;gt;https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment/Introduction_to_molecular_dynamics_simulation&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=User:JFU1608&amp;diff=543388</id>
		<title>User:JFU1608</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=User:JFU1608&amp;diff=543388"/>
		<updated>2016-02-26T03:01:02Z</updated>

		<summary type="html">&lt;p&gt;Jwf13: /* Task 2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Part 1: Running first simulation==&lt;br /&gt;
&lt;br /&gt;
-no tasks-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Part 2: Introduction to molecular dynamics simulation==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time  t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by  (the values of  ,  , and   are worked out for you in the sheet).&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL: Position at time t (classical solution)&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Position.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
ERROR: Absolute difference between ANALYTICAL and Velocity-verlet solution&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Error.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
ENERGY: Total E of oscillator for velocity-verlet solution&lt;br /&gt;
Total Energy is given by the summation of both kinetic energy: 1/2 mv2 and potential energy 1/2kx2.&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Energy.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data. &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Time!! Maximum Error&lt;br /&gt;
|-&lt;br /&gt;
| 1.9|| 7.58E-04&lt;br /&gt;
|-&lt;br /&gt;
| 5.00|| 2.00E-03&lt;br /&gt;
|-&lt;br /&gt;
| 8.00|| 3.30E-03&lt;br /&gt;
|-&lt;br /&gt;
| 11.10|| 4.60E-03&lt;br /&gt;
|-&lt;br /&gt;
| 14.20|| 5.91E-03&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
[[File:2.2_Max_Error.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph shows a linear relationship between the maximum errors of position with time, characterised by its extrapolation formula y = 0.0004x – 0.00005.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;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?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Previously for timestep 0.1, the percentage change was 0.248%. By varying the timestep, we are able to deduce the corresponding percentage changes, shown in Table X. As timestep increases, the minima total energy value decreases gradually, leading to a larger percentage change in total energy. In order for total energy not to go over 1%, the timestep must not be larger than 0.2. It is important to monitor the total energy of a physical system while modelling its behaviour numerically. This is because the Law of Conservation of Energy is observed, where total energy stays constant. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Timestep!! Energy Maxima!! Energy Minima!! Change in Energy&lt;br /&gt;
|-&lt;br /&gt;
| 0.05|| 0.5||0.4997||0.06%&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;0.1||&#039;&#039;&#039;0.5&#039;&#039;&#039;||&#039;&#039;&#039;0.4988&#039;&#039;&#039;||&#039;&#039;&#039;0.24%&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0.15||0.5||0.4972||0.56%&lt;br /&gt;
|-&lt;br /&gt;
| 0.2||0.5||0.4950||1.00%&lt;br /&gt;
|-&lt;br /&gt;
| 0.25|| 0.5||0.4922||1.56%&lt;br /&gt;
|-&lt;br /&gt;
| 0.3|| 0.5||0.4888||2.24%&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Row highlighted in bold is the simulation done from previous tasks.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;For a single Lennard-Jones interaction, [[File:8c44e3156b2bf003c09fa62fbaed5cb0.png]], find the separation, [[File:2.4_E2.png]], at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, [[File:2.4_E3.png]], and work out the well depth ([[File:2.4_E4.png]]). Evaluate the integrals [[File:2.4_E5.png]], [[File:2.4_E6.png]], and [[File:2.4_E7.png]] when [[File:2.4_E8.png]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the potential energy is zero, separation r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; can be found:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
At this separation, the force can be calculated with [[File:2.4_F_Eq.png|100px]], where using the definition of U from equation 10 &amp;lt;ref name=&amp;quot;equation 10&amp;quot; /&amp;gt; produces:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs where F&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; = 0, so:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans3.png]]&lt;br /&gt;
&lt;br /&gt;
Well depth, &lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans4.PNG]]&lt;br /&gt;
&lt;br /&gt;
When σ=ϵ=1.0,&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans5.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&amp;lt;b&amp;gt;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At standard conditions, there are 3.35 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt; water molecules in 1 mL of water.&lt;br /&gt;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;; Volume = 1 mL = 1 cm&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;; Mr = 18; N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 6.022 x 10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2.5_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
For 10000 water molecules, the calculated volume is 2.99 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; mL:&lt;br /&gt;
&lt;br /&gt;
[[File:2.5_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&amp;lt;b&amp;gt;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, &#039;&#039;after the periodic boundary conditions have been applied?&#039;&#039;.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sum of (0.5, 0.5, 0.5) and (0.7, 0.6, 0.2) gives (1.2,1.1,0.7), but this assumes periodic boundary conditions not applied. If applied, number of atoms inside box always constant as one leaves, simultaneously another enters. Hence deduct (1.2,1.1,0.7) by value of 1 in the x and y coordinates since they exceed the value of 1, to give the (0.2,0.1,0.3) position.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&amp;lt;b&amp;gt;The Lennard-Jones parameters for argon are [[File:1.7_E1.png]]. If the LJ cutoff is [[File:1.7_E2.png]], 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 [[File:4.1_E1.png]] in real units?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2.7_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
==Part 3: Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together? &lt;br /&gt;
If molecules are put extremely close to each other then they might overlap each other, having unfavourable repulsion interactions. &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates in simulations, there is a possibility that the simulation puts 2 atoms such that they overlap one another, which is not possible in real terms. As two atoms get closer together, their potential energy increases exponentially, causing a discrepancy in the calculated values. This is avoided when the atoms are placed at lattice points.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given previously that each length of a unit cell is 1.07722, &lt;br /&gt;
&lt;br /&gt;
[[File:3.2_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
For a fcc lattice of lattice point number density 1.2:&lt;br /&gt;
&lt;br /&gt;
[[File:3.2_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;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? &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Still 1000 atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;Using the LAMMPS manual, find the purpose of the following commands in the input script: &amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.4_E1.PNG]]&lt;br /&gt;
&lt;br /&gt;
The first line is a mass command where 1 is the atom type, with mass of 1.0. This input script sets all atoms of atom type 1 to have a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
The second line is a pair style command which computes the pairwise interactions of 2 atoms. This command is scripted such that the Lennard-Jones potential is cut off for coulomb interaction beyond distance of 3.0, hence absence of potential energy. Within distance 3.0, there will be a presence of potential energy due to the active Lennard-Jones interaction.&lt;br /&gt;
&lt;br /&gt;
The third line is a pair coeff command, where the * sign in pair coeff command sets coefficients for multiple pairs of atom types. As there is no numeric value, it means all types from 1 to N. In the case used, there are only atoms of 1 type so this command sets the coefficient value to all atoms of type 1. The first 1.0 coefficient value corresponds to the distance at which potential energies, σ of 2 atoms is 0, whereas the second 1.0 coefficient is the well depth.&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&amp;lt;b&amp;gt;Look at the lines below.&amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.5_E1.PNG]]&lt;br /&gt;
&amp;lt;b&amp;gt;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;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.5_E2.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&amp;lt;b&amp;gt;Given that we are specifying [[File:3.6_E1.png]] and [[File:3.6_E2.png]], which integration algorithm are we going to use?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As 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) is given, the Velocity-Verlet algorithm should be used.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&amp;lt;b&amp;gt;Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium can be said to be achieved when thermodynamic quantities becomes constant. Hence for the timestep 0.001, the simulation reaches equilibrium since the plots of temperature and pressure versus time equilibrates to a constant value of approximately 1.25K and 1.25atm. From the zoomed in view, we can deduce that equilibration is achieved within 0.05s.&lt;br /&gt;
Equilibrium has also been achieved for other timesteps, except 0.015, where the graph of total energy versus time graph is observed to gradually increase.&lt;br /&gt;
The largest timestep to provide acceptable results is 0.01. Timestep 0.015 is a particularly bad choice because the simulation does not achieve equilibrium as its total energy value is increasing over time, with a large spread of error (larger fluctuation).&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Total_Energy_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Total energy versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Temperature_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Temperature versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Temperature_0.001_zoom.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Temperature versus time for timestep 0.001, zoomed in version&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Pressure_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Pressure versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Total_Energy_all_timestep.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Total Energy versus time for timesteps 0.001, 0.0025, 0.0075, 0.01, 0.015.&lt;br /&gt;
&lt;br /&gt;
==Part 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Choose 5 temperatures (above the critical temperature [[File:4.1_E1.png]]), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen [[File:4.1_E2.png]] points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Temperatures used: 2.0, 2.5, 3.0, 3.5, 4.0&lt;br /&gt;
&lt;br /&gt;
Pressures used: 2.5, 2.8&lt;br /&gt;
&lt;br /&gt;
Timestep used: 0.0025&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;We need to choose [[File:4.2_E1.png]] so that the temperature is correct [[File:4.2_E2.png]] if we multiply every velocity [[File:4.2_E1.png]]. We can write two equations:&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:4.2_E3.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:4.2_E4.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
Solve these to determine [[File:4.2_E1.png]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:4.2_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;Use the manual page 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, how much time will you simulate?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density [[File:4.4_E1.png]]. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated. Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:4.4_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
Density in Ideal Gas Law calculation:&lt;br /&gt;
&lt;br /&gt;
[[File:4.4_Ans2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the ideal gas law plot. ?????&lt;br /&gt;
&lt;br /&gt;
==Part 5: Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature [[File:5.1_Equation_1.png]] phase space, rather than pressure-temperature phase space. The two densities required at 0.2 and 0.8, and the temperature range is 2.0, 2.2, 2.4, 2.6, 2.8. Plot [[File:5.1_Equation_2.png]] as a function of temperature, where [[File:5.1_Equation_3.png]] 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.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Input script for density 0.2 at temperature 2.0 attached: [[File:5.1_(0.2,2.0).in]]&lt;br /&gt;
&lt;br /&gt;
==Part 6: Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate [[File:6.1_Equation_1.png]] and [[File:6.1_Equation_2.png]]. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:6.1_Ans1.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:6.1_Ans2.PNG]]&lt;br /&gt;
&lt;br /&gt;
==Part 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ caption&lt;br /&gt;
! heading !! heading&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Liq.PNG]]|| [[File:7.1_MSD_Liq1m.PNG]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Solid.PNG]]|| [[File:7.1_MSD_Solid1m.PNG]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Vap.PNG]]|| [[File:7.1_MSD_Vap1m.PNG]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;Make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate [[File:7.2_D.png]] in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
[[File:7.3_Equation_1.png]]. &lt;br /&gt;
Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot [[File:7.3_Equation_2.png]] with [[File:7.3_Equation_3.png]] and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;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 [[File:7.2_D.png]] 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?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;equation 10&amp;quot;&amp;gt;https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment/Introduction_to_molecular_dynamics_simulation&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:3.2_Ans2.png&amp;diff=543387</id>
		<title>File:3.2 Ans2.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:3.2_Ans2.png&amp;diff=543387"/>
		<updated>2016-02-26T03:00:46Z</updated>

		<summary type="html">&lt;p&gt;Jwf13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:3.2_Ans1.png&amp;diff=543385</id>
		<title>File:3.2 Ans1.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:3.2_Ans1.png&amp;diff=543385"/>
		<updated>2016-02-26T03:00:17Z</updated>

		<summary type="html">&lt;p&gt;Jwf13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=User:JFU1608&amp;diff=543380</id>
		<title>User:JFU1608</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=User:JFU1608&amp;diff=543380"/>
		<updated>2016-02-26T02:45:48Z</updated>

		<summary type="html">&lt;p&gt;Jwf13: /* Task 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Part 1: Running first simulation==&lt;br /&gt;
&lt;br /&gt;
-no tasks-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Part 2: Introduction to molecular dynamics simulation==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time  t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by  (the values of  ,  , and   are worked out for you in the sheet).&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL: Position at time t (classical solution)&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Position.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
ERROR: Absolute difference between ANALYTICAL and Velocity-verlet solution&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Error.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
ENERGY: Total E of oscillator for velocity-verlet solution&lt;br /&gt;
Total Energy is given by the summation of both kinetic energy: 1/2 mv2 and potential energy 1/2kx2.&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Energy.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data. &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Time!! Maximum Error&lt;br /&gt;
|-&lt;br /&gt;
| 1.9|| 7.58E-04&lt;br /&gt;
|-&lt;br /&gt;
| 5.00|| 2.00E-03&lt;br /&gt;
|-&lt;br /&gt;
| 8.00|| 3.30E-03&lt;br /&gt;
|-&lt;br /&gt;
| 11.10|| 4.60E-03&lt;br /&gt;
|-&lt;br /&gt;
| 14.20|| 5.91E-03&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
[[File:2.2_Max_Error.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph shows a linear relationship between the maximum errors of position with time, characterised by its extrapolation formula y = 0.0004x – 0.00005.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;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?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Previously for timestep 0.1, the percentage change was 0.248%. By varying the timestep, we are able to deduce the corresponding percentage changes, shown in Table X. As timestep increases, the minima total energy value decreases gradually, leading to a larger percentage change in total energy. In order for total energy not to go over 1%, the timestep must not be larger than 0.2. It is important to monitor the total energy of a physical system while modelling its behaviour numerically. This is because the Law of Conservation of Energy is observed, where total energy stays constant. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Timestep!! Energy Maxima!! Energy Minima!! Change in Energy&lt;br /&gt;
|-&lt;br /&gt;
| 0.05|| 0.5||0.4997||0.06%&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;0.1||&#039;&#039;&#039;0.5&#039;&#039;&#039;||&#039;&#039;&#039;0.4988&#039;&#039;&#039;||&#039;&#039;&#039;0.24%&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0.15||0.5||0.4972||0.56%&lt;br /&gt;
|-&lt;br /&gt;
| 0.2||0.5||0.4950||1.00%&lt;br /&gt;
|-&lt;br /&gt;
| 0.25|| 0.5||0.4922||1.56%&lt;br /&gt;
|-&lt;br /&gt;
| 0.3|| 0.5||0.4888||2.24%&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Row highlighted in bold is the simulation done from previous tasks.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;For a single Lennard-Jones interaction, [[File:8c44e3156b2bf003c09fa62fbaed5cb0.png]], find the separation, [[File:2.4_E2.png]], at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, [[File:2.4_E3.png]], and work out the well depth ([[File:2.4_E4.png]]). Evaluate the integrals [[File:2.4_E5.png]], [[File:2.4_E6.png]], and [[File:2.4_E7.png]] when [[File:2.4_E8.png]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the potential energy is zero, separation r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; can be found:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
At this separation, the force can be calculated with [[File:2.4_F_Eq.png|100px]], where using the definition of U from equation 10 &amp;lt;ref name=&amp;quot;equation 10&amp;quot; /&amp;gt; produces:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs where F&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; = 0, so:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans3.png]]&lt;br /&gt;
&lt;br /&gt;
Well depth, &lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans4.PNG]]&lt;br /&gt;
&lt;br /&gt;
When σ=ϵ=1.0,&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans5.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&amp;lt;b&amp;gt;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At standard conditions, there are 3.35 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt; water molecules in 1 mL of water.&lt;br /&gt;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;; Volume = 1 mL = 1 cm&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;; Mr = 18; N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 6.022 x 10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2.5_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
For 10000 water molecules, the calculated volume is 2.99 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; mL:&lt;br /&gt;
&lt;br /&gt;
[[File:2.5_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&amp;lt;b&amp;gt;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, &#039;&#039;after the periodic boundary conditions have been applied?&#039;&#039;.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sum of (0.5, 0.5, 0.5) and (0.7, 0.6, 0.2) gives (1.2,1.1,0.7), but this assumes periodic boundary conditions not applied. If applied, number of atoms inside box always constant as one leaves, simultaneously another enters. Hence deduct (1.2,1.1,0.7) by value of 1 in the x and y coordinates since they exceed the value of 1, to give the (0.2,0.1,0.3) position.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&amp;lt;b&amp;gt;The Lennard-Jones parameters for argon are [[File:1.7_E1.png]]. If the LJ cutoff is [[File:1.7_E2.png]], 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 [[File:4.1_E1.png]] in real units?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2.7_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
==Part 3: Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together? &lt;br /&gt;
If molecules are put extremely close to each other then they might overlap each other, having unfavourable repulsion interactions. &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates in simulations, there is a possibility that the simulation puts 2 atoms such that they overlap one another, which is not possible in real terms. As two atoms get closer together, their potential energy increases exponentially, causing a discrepancy in the calculated values. This is avoided when the atoms are placed at lattice points.&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
0.941036.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;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? &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Still 1000 atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;Using the LAMMPS manual, find the purpose of the following commands in the input script: &amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.4_E1.PNG]]&lt;br /&gt;
&lt;br /&gt;
The first line is a mass command where 1 is the atom type, with mass of 1.0. This input script sets all atoms of atom type 1 to have a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
The second line is a pair style command which computes the pairwise interactions of 2 atoms. This command is scripted such that the Lennard-Jones potential is cut off for coulomb interaction beyond distance of 3.0, hence absence of potential energy. Within distance 3.0, there will be a presence of potential energy due to the active Lennard-Jones interaction.&lt;br /&gt;
&lt;br /&gt;
The third line is a pair coeff command, where the * sign in pair coeff command sets coefficients for multiple pairs of atom types. As there is no numeric value, it means all types from 1 to N. In the case used, there are only atoms of 1 type so this command sets the coefficient value to all atoms of type 1. The first 1.0 coefficient value corresponds to the distance at which potential energies, σ of 2 atoms is 0, whereas the second 1.0 coefficient is the well depth.&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&amp;lt;b&amp;gt;Look at the lines below.&amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.5_E1.PNG]]&lt;br /&gt;
&amp;lt;b&amp;gt;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;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.5_E2.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&amp;lt;b&amp;gt;Given that we are specifying [[File:3.6_E1.png]] and [[File:3.6_E2.png]], which integration algorithm are we going to use?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As 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) is given, the Velocity-Verlet algorithm should be used.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&amp;lt;b&amp;gt;Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium can be said to be achieved when thermodynamic quantities becomes constant. Hence for the timestep 0.001, the simulation reaches equilibrium since the plots of temperature and pressure versus time equilibrates to a constant value of approximately 1.25K and 1.25atm. From the zoomed in view, we can deduce that equilibration is achieved within 0.05s.&lt;br /&gt;
Equilibrium has also been achieved for other timesteps, except 0.015, where the graph of total energy versus time graph is observed to gradually increase.&lt;br /&gt;
The largest timestep to provide acceptable results is 0.01. Timestep 0.015 is a particularly bad choice because the simulation does not achieve equilibrium as its total energy value is increasing over time, with a large spread of error (larger fluctuation).&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Total_Energy_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Total energy versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Temperature_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Temperature versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Temperature_0.001_zoom.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Temperature versus time for timestep 0.001, zoomed in version&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Pressure_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Pressure versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Total_Energy_all_timestep.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Total Energy versus time for timesteps 0.001, 0.0025, 0.0075, 0.01, 0.015.&lt;br /&gt;
&lt;br /&gt;
==Part 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Choose 5 temperatures (above the critical temperature [[File:4.1_E1.png]]), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen [[File:4.1_E2.png]] points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Temperatures used: 2.0, 2.5, 3.0, 3.5, 4.0&lt;br /&gt;
&lt;br /&gt;
Pressures used: 2.5, 2.8&lt;br /&gt;
&lt;br /&gt;
Timestep used: 0.0025&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;We need to choose [[File:4.2_E1.png]] so that the temperature is correct [[File:4.2_E2.png]] if we multiply every velocity [[File:4.2_E1.png]]. We can write two equations:&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:4.2_E3.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:4.2_E4.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
Solve these to determine [[File:4.2_E1.png]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:4.2_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;Use the manual page 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, how much time will you simulate?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density [[File:4.4_E1.png]]. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated. Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:4.4_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
Density in Ideal Gas Law calculation:&lt;br /&gt;
&lt;br /&gt;
[[File:4.4_Ans2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the ideal gas law plot. ?????&lt;br /&gt;
&lt;br /&gt;
==Part 5: Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature [[File:5.1_Equation_1.png]] phase space, rather than pressure-temperature phase space. The two densities required at 0.2 and 0.8, and the temperature range is 2.0, 2.2, 2.4, 2.6, 2.8. Plot [[File:5.1_Equation_2.png]] as a function of temperature, where [[File:5.1_Equation_3.png]] 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.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Input script for density 0.2 at temperature 2.0 attached: [[File:5.1_(0.2,2.0).in]]&lt;br /&gt;
&lt;br /&gt;
==Part 6: Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate [[File:6.1_Equation_1.png]] and [[File:6.1_Equation_2.png]]. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:6.1_Ans1.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:6.1_Ans2.PNG]]&lt;br /&gt;
&lt;br /&gt;
==Part 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ caption&lt;br /&gt;
! heading !! heading&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Liq.PNG]]|| [[File:7.1_MSD_Liq1m.PNG]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Solid.PNG]]|| [[File:7.1_MSD_Solid1m.PNG]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Vap.PNG]]|| [[File:7.1_MSD_Vap1m.PNG]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;Make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate [[File:7.2_D.png]] in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
[[File:7.3_Equation_1.png]]. &lt;br /&gt;
Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot [[File:7.3_Equation_2.png]] with [[File:7.3_Equation_3.png]] and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;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 [[File:7.2_D.png]] 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?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;equation 10&amp;quot;&amp;gt;https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment/Introduction_to_molecular_dynamics_simulation&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:5.1_(0.2,2.0).in&amp;diff=541636</id>
		<title>File:5.1 (0.2,2.0).in</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:5.1_(0.2,2.0).in&amp;diff=541636"/>
		<updated>2016-02-25T14:20:57Z</updated>

		<summary type="html">&lt;p&gt;Jwf13: Jwf13 uploaded a new version of File:5.1 (0.2,2.0).in&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:5.1_(0.2,2.0).txt&amp;diff=541629</id>
		<title>File:5.1 (0.2,2.0).txt</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:5.1_(0.2,2.0).txt&amp;diff=541629"/>
		<updated>2016-02-25T14:20:26Z</updated>

		<summary type="html">&lt;p&gt;Jwf13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=User:JFU1608&amp;diff=541426</id>
		<title>User:JFU1608</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=User:JFU1608&amp;diff=541426"/>
		<updated>2016-02-25T13:15:36Z</updated>

		<summary type="html">&lt;p&gt;Jwf13: /* Task 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Part 1: Running first simulation==&lt;br /&gt;
&lt;br /&gt;
-no tasks-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Part 2: Introduction to molecular dynamics simulation==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time  t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by  (the values of  ,  , and   are worked out for you in the sheet).&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL: Position at time t (classical solution)&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Position.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
ERROR: Absolute difference between ANALYTICAL and Velocity-verlet solution&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Error.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
ENERGY: Total E of oscillator for velocity-verlet solution&lt;br /&gt;
Total Energy is given by the summation of both kinetic energy: 1/2 mv2 and potential energy 1/2kx2.&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Energy.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data. &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Time!! Maximum Error&lt;br /&gt;
|-&lt;br /&gt;
| 1.9|| 7.58E-04&lt;br /&gt;
|-&lt;br /&gt;
| 5.00|| 2.00E-03&lt;br /&gt;
|-&lt;br /&gt;
| 8.00|| 3.30E-03&lt;br /&gt;
|-&lt;br /&gt;
| 11.10|| 4.60E-03&lt;br /&gt;
|-&lt;br /&gt;
| 14.20|| 5.91E-03&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
[[File:2.2_Max_Error.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph shows a linear relationship between the maximum errors of position with time, characterised by its extrapolation formula y = 0.0004x – 0.00005.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;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?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Previously for timestep 0.1, the percentage change was 0.248%. By varying the timestep, we are able to deduce the corresponding percentage changes, shown in Table X. As timestep increases, the minima total energy value decreases gradually, leading to a larger percentage change in total energy. In order for total energy not to go over 1%, the timestep must not be larger than 0.2. It is important to monitor the total energy of a physical system while modelling its behaviour numerically. This is because the Law of Conservation of Energy is observed, where total energy stays constant. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Timestep!! Energy Maxima!! Energy Minima!! Change in Energy&lt;br /&gt;
|-&lt;br /&gt;
| 0.05|| 0.5||0.4997||0.06%&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;0.1||&#039;&#039;&#039;0.5&#039;&#039;&#039;||&#039;&#039;&#039;0.4988&#039;&#039;&#039;||&#039;&#039;&#039;0.24%&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0.15||0.5||0.4972||0.56%&lt;br /&gt;
|-&lt;br /&gt;
| 0.2||0.5||0.4950||1.00%&lt;br /&gt;
|-&lt;br /&gt;
| 0.25|| 0.5||0.4922||1.56%&lt;br /&gt;
|-&lt;br /&gt;
| 0.3|| 0.5||0.4888||2.24%&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Row highlighted in bold is the simulation done from previous tasks.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;For a single Lennard-Jones interaction, [[File:8c44e3156b2bf003c09fa62fbaed5cb0.png]], find the separation, [[File:2.4_E2.png]], at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, [[File:2.4_E3.png]], and work out the well depth ([[File:2.4_E4.png]]). Evaluate the integrals [[File:2.4_E5.png]], [[File:2.4_E6.png]], and [[File:2.4_E7.png]] when [[File:2.4_E8.png]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the potential energy is zero, separation r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; can be found:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
At this separation, the force can be calculated with [[File:2.4_F_Eq.png|100px]], where using the definition of U from equation 10 &amp;lt;ref name=&amp;quot;equation 10&amp;quot; /&amp;gt; produces:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs where F&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; = 0, so:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans3.png]]&lt;br /&gt;
&lt;br /&gt;
Well depth, &lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans4.PNG]]&lt;br /&gt;
&lt;br /&gt;
When σ=ϵ=1.0,&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans5.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&amp;lt;b&amp;gt;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At standard conditions, there are 3.35 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt; water molecules in 1 mL of water.&lt;br /&gt;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;; Volume = 1 mL = 1 cm&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;; Mr = 18; N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 6.022 x 10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2.5_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
For 10000 water molecules, the calculated volume is 2.99 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; mL:&lt;br /&gt;
&lt;br /&gt;
[[File:2.5_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&amp;lt;b&amp;gt;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, &#039;&#039;after the periodic boundary conditions have been applied?&#039;&#039;.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sum of (0.5, 0.5, 0.5) and (0.7, 0.6, 0.2) gives (1.2,1.1,0.7), but this assumes periodic boundary conditions not applied. If applied, number of atoms inside box always constant as one leaves, simultaneously another enters. Hence deduct (1.2,1.1,0.7) by value of 1 in the x and y coordinates since they exceed the value of 1, to give the (0.2,0.1,0.3) position.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&amp;lt;b&amp;gt;The Lennard-Jones parameters for argon are [[File:1.7_E1.png]]. If the LJ cutoff is [[File:1.7_E2.png]], 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 [[File:4.1_E1.png]] in real units?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2.7_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
==Part 3: Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together? &lt;br /&gt;
If molecules are put extremely close to each other then they might overlap each other, having unfavourable repulsion interactions. &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
0.941036.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;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? &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Still 1000 atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;Using the LAMMPS manual, find the purpose of the following commands in the input script: &amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.4_E1.PNG]]&lt;br /&gt;
&lt;br /&gt;
The first line is a mass command where 1 is the atom type, with mass of 1.0. This input script sets all atoms of atom type 1 to have a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
The second line is a pair style command which computes the pairwise interactions of 2 atoms. This command is scripted such that the Lennard-Jones potential is cut off for coulomb interaction beyond distance of 3.0, hence absence of potential energy. Within distance 3.0, there will be a presence of potential energy due to the active Lennard-Jones interaction.&lt;br /&gt;
&lt;br /&gt;
The third line is a pair coeff command, where the * sign in pair coeff command sets coefficients for multiple pairs of atom types. As there is no numeric value, it means all types from 1 to N. In the case used, there are only atoms of 1 type so this command sets the coefficient value to all atoms of type 1. The first 1.0 coefficient value corresponds to the distance at which potential energies, σ of 2 atoms is 0, whereas the second 1.0 coefficient is the well depth.&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&amp;lt;b&amp;gt;Look at the lines below.&amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.5_E1.PNG]]&lt;br /&gt;
&amp;lt;b&amp;gt;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;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.5_E2.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&amp;lt;b&amp;gt;Given that we are specifying [[File:3.6_E1.png]] and [[File:3.6_E2.png]], which integration algorithm are we going to use?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As 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) is given, the Velocity-Verlet algorithm should be used.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&amp;lt;b&amp;gt;Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium can be said to be achieved when thermodynamic quantities becomes constant. Hence for the timestep 0.001, the simulation reaches equilibrium since the plots of temperature and pressure versus time equilibrates to a constant value of approximately 1.25K and 1.25atm. From the zoomed in view, we can deduce that equilibration is achieved within 0.05s.&lt;br /&gt;
Equilibrium has also been achieved for other timesteps, except 0.015, where the graph of total energy versus time graph is observed to gradually increase.&lt;br /&gt;
The largest timestep to provide acceptable results is 0.01. Timestep 0.015 is a particularly bad choice because the simulation does not achieve equilibrium as its total energy value is increasing over time, with a large spread of error (larger fluctuation).&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Total_Energy_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Total energy versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Temperature_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Temperature versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Temperature_0.001_zoom.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Temperature versus time for timestep 0.001, zoomed in version&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Pressure_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Pressure versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Total_Energy_all_timestep.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Total Energy versus time for timesteps 0.001, 0.0025, 0.0075, 0.01, 0.015.&lt;br /&gt;
&lt;br /&gt;
==Part 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Choose 5 temperatures (above the critical temperature [[File:4.1_E1.png]]), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen [[File:4.1_E2.png]] points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Temperatures used: 2.0, 2.5, 3.0, 3.5, 4.0&lt;br /&gt;
&lt;br /&gt;
Pressures used: 2.5, 2.8&lt;br /&gt;
&lt;br /&gt;
Timestep used: 0.0025&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;We need to choose [[File:4.2_E1.png]] so that the temperature is correct [[File:4.2_E2.png]] if we multiply every velocity [[File:4.2_E1.png]]. We can write two equations:&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:4.2_E3.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:4.2_E4.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
Solve these to determine [[File:4.2_E1.png]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:4.2_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;Use the manual page 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, how much time will you simulate?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density [[File:4.4_E1.png]]. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated. Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:4.4_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
Density in Ideal Gas Law calculation:&lt;br /&gt;
&lt;br /&gt;
[[File:4.4_Ans2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the ideal gas law plot. ?????&lt;br /&gt;
&lt;br /&gt;
==Part 5: Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature [[File:5.1_Equation_1.png]] phase space, rather than pressure-temperature phase space. The two densities required at 0.2 and 0.8, and the temperature range is 2.0, 2.2, 2.4, 2.6, 2.8. Plot [[File:5.1_Equation_2.png]] as a function of temperature, where [[File:5.1_Equation_3.png]] 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.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Input script for density 0.2 at temperature 2.0 attached: [[File:5.1_(0.2,2.0).in]]&lt;br /&gt;
&lt;br /&gt;
==Part 6: Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate [[File:6.1_Equation_1.png]] and [[File:6.1_Equation_2.png]]. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:6.1_Ans1.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:6.1_Ans2.PNG]]&lt;br /&gt;
&lt;br /&gt;
==Part 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ caption&lt;br /&gt;
! heading !! heading&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Liq.PNG]]|| [[File:7.1_MSD_Liq1m.PNG]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Solid.PNG]]|| [[File:7.1_MSD_Solid1m.PNG]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:7.1_MSD_Vap.PNG]]|| [[File:7.1_MSD_Vap1m.PNG]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;Make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate [[File:7.2_D.png]] in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
[[File:7.3_Equation_1.png]]. &lt;br /&gt;
Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot [[File:7.3_Equation_2.png]] with [[File:7.3_Equation_3.png]] and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;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 [[File:7.2_D.png]] 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?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;equation 10&amp;quot;&amp;gt;https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment/Introduction_to_molecular_dynamics_simulation&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:7.1_MSD_Vap1m.PNG&amp;diff=541425</id>
		<title>File:7.1 MSD Vap1m.PNG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:7.1_MSD_Vap1m.PNG&amp;diff=541425"/>
		<updated>2016-02-25T13:14:05Z</updated>

		<summary type="html">&lt;p&gt;Jwf13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:7.1_MSD_Vap.PNG&amp;diff=541424</id>
		<title>File:7.1 MSD Vap.PNG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:7.1_MSD_Vap.PNG&amp;diff=541424"/>
		<updated>2016-02-25T13:13:53Z</updated>

		<summary type="html">&lt;p&gt;Jwf13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:7.1_MSD_Solid.PNG&amp;diff=541423</id>
		<title>File:7.1 MSD Solid.PNG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:7.1_MSD_Solid.PNG&amp;diff=541423"/>
		<updated>2016-02-25T13:13:38Z</updated>

		<summary type="html">&lt;p&gt;Jwf13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:7.1_MSD_Solid1m.PNG&amp;diff=541422</id>
		<title>File:7.1 MSD Solid1m.PNG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:7.1_MSD_Solid1m.PNG&amp;diff=541422"/>
		<updated>2016-02-25T13:13:25Z</updated>

		<summary type="html">&lt;p&gt;Jwf13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:7.1_MSD_Liq1m.PNG&amp;diff=541421</id>
		<title>File:7.1 MSD Liq1m.PNG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:7.1_MSD_Liq1m.PNG&amp;diff=541421"/>
		<updated>2016-02-25T13:13:11Z</updated>

		<summary type="html">&lt;p&gt;Jwf13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:7.1_MSD_Liq.PNG&amp;diff=541420</id>
		<title>File:7.1 MSD Liq.PNG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:7.1_MSD_Liq.PNG&amp;diff=541420"/>
		<updated>2016-02-25T13:12:42Z</updated>

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

		<summary type="html">&lt;p&gt;Jwf13: /* Task 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Part 1: Running first simulation==&lt;br /&gt;
&lt;br /&gt;
-no tasks-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Part 2: Introduction to molecular dynamics simulation==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time  t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by  (the values of  ,  , and   are worked out for you in the sheet).&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL: Position at time t (classical solution)&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Position.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
ERROR: Absolute difference between ANALYTICAL and Velocity-verlet solution&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Error.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
ENERGY: Total E of oscillator for velocity-verlet solution&lt;br /&gt;
Total Energy is given by the summation of both kinetic energy: 1/2 mv2 and potential energy 1/2kx2.&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Energy.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data. &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Time!! Maximum Error&lt;br /&gt;
|-&lt;br /&gt;
| 1.9|| 7.58E-04&lt;br /&gt;
|-&lt;br /&gt;
| 5.00|| 2.00E-03&lt;br /&gt;
|-&lt;br /&gt;
| 8.00|| 3.30E-03&lt;br /&gt;
|-&lt;br /&gt;
| 11.10|| 4.60E-03&lt;br /&gt;
|-&lt;br /&gt;
| 14.20|| 5.91E-03&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
[[File:2.2_Max_Error.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph shows a linear relationship between the maximum errors of position with time, characterised by its extrapolation formula y = 0.0004x – 0.00005.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;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?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Previously for timestep 0.1, the percentage change was 0.248%. By varying the timestep, we are able to deduce the corresponding percentage changes, shown in Table X. As timestep increases, the minima total energy value decreases gradually, leading to a larger percentage change in total energy. In order for total energy not to go over 1%, the timestep must not be larger than 0.2. It is important to monitor the total energy of a physical system while modelling its behaviour numerically. This is because the Law of Conservation of Energy is observed, where total energy stays constant. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Timestep!! Energy Maxima!! Energy Minima!! Change in Energy&lt;br /&gt;
|-&lt;br /&gt;
| 0.05|| 0.5||0.4997||0.06%&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;0.1||&#039;&#039;&#039;0.5&#039;&#039;&#039;||&#039;&#039;&#039;0.4988&#039;&#039;&#039;||&#039;&#039;&#039;0.24%&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0.15||0.5||0.4972||0.56%&lt;br /&gt;
|-&lt;br /&gt;
| 0.2||0.5||0.4950||1.00%&lt;br /&gt;
|-&lt;br /&gt;
| 0.25|| 0.5||0.4922||1.56%&lt;br /&gt;
|-&lt;br /&gt;
| 0.3|| 0.5||0.4888||2.24%&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Row highlighted in bold is the simulation done from previous tasks.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;For a single Lennard-Jones interaction, [[File:8c44e3156b2bf003c09fa62fbaed5cb0.png]], find the separation, [[File:2.4_E2.png]], at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, [[File:2.4_E3.png]], and work out the well depth ([[File:2.4_E4.png]]). Evaluate the integrals [[File:2.4_E5.png]], [[File:2.4_E6.png]], and [[File:2.4_E7.png]] when [[File:2.4_E8.png]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the potential energy is zero, separation r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; can be found:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
At this separation, the force can be calculated with [[File:2.4_F_Eq.png|100px]], where using the definition of U from equation 10 &amp;lt;ref name=&amp;quot;equation 10&amp;quot; /&amp;gt; produces:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs where F&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; = 0, so:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans3.png]]&lt;br /&gt;
&lt;br /&gt;
Well depth, &lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans4.PNG]]&lt;br /&gt;
&lt;br /&gt;
When σ=ϵ=1.0,&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans5.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&amp;lt;b&amp;gt;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At standard conditions, there are 3.35 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt; water molecules in 1 mL of water.&lt;br /&gt;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;; Volume = 1 mL = 1 cm&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;; Mr = 18; N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 6.022 x 10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2.5_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
For 10000 water molecules, the calculated volume is 2.99 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; mL:&lt;br /&gt;
&lt;br /&gt;
[[File:2.5_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&amp;lt;b&amp;gt;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, &#039;&#039;after the periodic boundary conditions have been applied?&#039;&#039;.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sum of (0.5, 0.5, 0.5) and (0.7, 0.6, 0.2) gives (1.2,1.1,0.7), but this assumes periodic boundary conditions not applied. If applied, number of atoms inside box always constant as one leaves, simultaneously another enters. Hence deduct (1.2,1.1,0.7) by value of 1 in the x and y coordinates since they exceed the value of 1, to give the (0.2,0.1,0.3) position.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&amp;lt;b&amp;gt;The Lennard-Jones parameters for argon are [[File:1.7_E1.png]]. If the LJ cutoff is [[File:1.7_E2.png]], 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 [[File:4.1_E1.png]] in real units?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2.7_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
==Part 3: Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together? &lt;br /&gt;
If molecules are put extremely close to each other then they might overlap each other, having unfavourable repulsion interactions. &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
0.941036.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;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? &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Still 1000 atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;Using the LAMMPS manual, find the purpose of the following commands in the input script: &amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.4_E1.PNG]]&lt;br /&gt;
&lt;br /&gt;
The first line is a mass command where 1 is the atom type, with mass of 1.0. This input script sets all atoms of atom type 1 to have a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
The second line is a pair style command which computes the pairwise interactions of 2 atoms. This command is scripted such that the Lennard-Jones potential is cut off for coulomb interaction beyond distance of 3.0, hence absence of potential energy. Within distance 3.0, there will be a presence of potential energy due to the active Lennard-Jones interaction.&lt;br /&gt;
&lt;br /&gt;
The third line is a pair coeff command, where the * sign in pair coeff command sets coefficients for multiple pairs of atom types. As there is no numeric value, it means all types from 1 to N. In the case used, there are only atoms of 1 type so this command sets the coefficient value to all atoms of type 1. The first 1.0 coefficient value corresponds to the distance at which potential energies, σ of 2 atoms is 0, whereas the second 1.0 coefficient is the well depth.&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&amp;lt;b&amp;gt;Look at the lines below.&amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.5_E1.PNG]]&lt;br /&gt;
&amp;lt;b&amp;gt;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;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.5_E2.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&amp;lt;b&amp;gt;Given that we are specifying [[File:3.6_E1.png]] and [[File:3.6_E2.png]], which integration algorithm are we going to use?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As 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) is given, the Velocity-Verlet algorithm should be used.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&amp;lt;b&amp;gt;Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium can be said to be achieved when thermodynamic quantities becomes constant. Hence for the timestep 0.001, the simulation reaches equilibrium since the plots of temperature and pressure versus time equilibrates to a constant value of approximately 1.25K and 1.25atm. From the zoomed in view, we can deduce that equilibration is achieved within 0.05s.&lt;br /&gt;
Equilibrium has also been achieved for other timesteps, except 0.015, where the graph of total energy versus time graph is observed to gradually increase.&lt;br /&gt;
The largest timestep to provide acceptable results is 0.01. Timestep 0.015 is a particularly bad choice because the simulation does not achieve equilibrium as its total energy value is increasing over time, with a large spread of error (larger fluctuation).&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Total_Energy_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Total energy versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Temperature_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Temperature versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Temperature_0.001_zoom.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Temperature versus time for timestep 0.001, zoomed in version&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Pressure_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Pressure versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Total_Energy_all_timestep.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Total Energy versus time for timesteps 0.001, 0.0025, 0.0075, 0.01, 0.015.&lt;br /&gt;
&lt;br /&gt;
==Part 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Choose 5 temperatures (above the critical temperature [[File:4.1_E1.png]]), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen [[File:4.1_E2.png]] points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Temperatures used: 2.0, 2.5, 3.0, 3.5, 4.0&lt;br /&gt;
&lt;br /&gt;
Pressures used: 2.5, 2.8&lt;br /&gt;
&lt;br /&gt;
Timestep used: 0.0025&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;We need to choose [[File:4.2_E1.png]] so that the temperature is correct [[File:4.2_E2.png]] if we multiply every velocity [[File:4.2_E1.png]]. We can write two equations:&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:4.2_E3.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:4.2_E4.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
Solve these to determine [[File:4.2_E1.png]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:4.2_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;Use the manual page 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, how much time will you simulate?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density [[File:4.4_E1.png]]. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated. Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:4.4_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
Density in Ideal Gas Law calculation:&lt;br /&gt;
&lt;br /&gt;
[[File:4.4_Ans2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the ideal gas law plot. ?????&lt;br /&gt;
&lt;br /&gt;
==Part 5: Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature [[File:5.1_Equation_1.png]] phase space, rather than pressure-temperature phase space. The two densities required at 0.2 and 0.8, and the temperature range is 2.0, 2.2, 2.4, 2.6, 2.8. Plot [[File:5.1_Equation_2.png]] as a function of temperature, where [[File:5.1_Equation_3.png]] 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.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Input script for density 0.2 at temperature 2.0 attached: [[File:5.1_(0.2,2.0).in]]&lt;br /&gt;
&lt;br /&gt;
==Part 6: Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate [[File:6.1_Equation_1.png]] and [[File:6.1_Equation_2.png]]. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:6.1_Ans1.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:6.1_Ans2.PNG]]&lt;br /&gt;
&lt;br /&gt;
==Part 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;Make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate [[File:7.2_D.png]] in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
[[File:7.3_Equation_1.png]]. &lt;br /&gt;
Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot [[File:7.3_Equation_2.png]] with [[File:7.3_Equation_3.png]] and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;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 [[File:7.2_D.png]] 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?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;equation 10&amp;quot;&amp;gt;https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment/Introduction_to_molecular_dynamics_simulation&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=User:JFU1608&amp;diff=541336</id>
		<title>User:JFU1608</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=User:JFU1608&amp;diff=541336"/>
		<updated>2016-02-25T12:00:38Z</updated>

		<summary type="html">&lt;p&gt;Jwf13: /* Task 7 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Part 1: Running first simulation==&lt;br /&gt;
&lt;br /&gt;
-no tasks-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Part 2: Introduction to molecular dynamics simulation==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time  t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by  (the values of  ,  , and   are worked out for you in the sheet).&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL: Position at time t (classical solution)&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Position.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
ERROR: Absolute difference between ANALYTICAL and Velocity-verlet solution&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Error.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
ENERGY: Total E of oscillator for velocity-verlet solution&lt;br /&gt;
Total Energy is given by the summation of both kinetic energy: 1/2 mv2 and potential energy 1/2kx2.&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Energy.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data. &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Time!! Maximum Error&lt;br /&gt;
|-&lt;br /&gt;
| 1.9|| 7.58E-04&lt;br /&gt;
|-&lt;br /&gt;
| 5.00|| 2.00E-03&lt;br /&gt;
|-&lt;br /&gt;
| 8.00|| 3.30E-03&lt;br /&gt;
|-&lt;br /&gt;
| 11.10|| 4.60E-03&lt;br /&gt;
|-&lt;br /&gt;
| 14.20|| 5.91E-03&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
[[File:2.2_Max_Error.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph shows a linear relationship between the maximum errors of position with time, characterised by its extrapolation formula y = 0.0004x – 0.00005.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;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?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Previously for timestep 0.1, the percentage change was 0.248%. By varying the timestep, we are able to deduce the corresponding percentage changes, shown in Table X. As timestep increases, the minima total energy value decreases gradually, leading to a larger percentage change in total energy. In order for total energy not to go over 1%, the timestep must not be larger than 0.2. It is important to monitor the total energy of a physical system while modelling its behaviour numerically. This is because the Law of Conservation of Energy is observed, where total energy stays constant. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Timestep!! Energy Maxima!! Energy Minima!! Change in Energy&lt;br /&gt;
|-&lt;br /&gt;
| 0.05|| 0.5||0.4997||0.06%&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;0.1||&#039;&#039;&#039;0.5&#039;&#039;&#039;||&#039;&#039;&#039;0.4988&#039;&#039;&#039;||&#039;&#039;&#039;0.24%&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0.15||0.5||0.4972||0.56%&lt;br /&gt;
|-&lt;br /&gt;
| 0.2||0.5||0.4950||1.00%&lt;br /&gt;
|-&lt;br /&gt;
| 0.25|| 0.5||0.4922||1.56%&lt;br /&gt;
|-&lt;br /&gt;
| 0.3|| 0.5||0.4888||2.24%&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Row highlighted in bold is the simulation done from previous tasks.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;For a single Lennard-Jones interaction, [[File:8c44e3156b2bf003c09fa62fbaed5cb0.png]], find the separation, [[File:2.4_E2.png]], at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, [[File:2.4_E3.png]], and work out the well depth ([[File:2.4_E4.png]]). Evaluate the integrals [[File:2.4_E5.png]], [[File:2.4_E6.png]], and [[File:2.4_E7.png]] when [[File:2.4_E8.png]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the potential energy is zero, separation r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; can be found:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
At this separation, the force can be calculated with [[File:2.4_F_Eq.png|100px]], where using the definition of U from equation 10 &amp;lt;ref name=&amp;quot;equation 10&amp;quot; /&amp;gt; produces:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs where F&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; = 0, so:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans3.png]]&lt;br /&gt;
&lt;br /&gt;
Well depth, &lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans4.PNG]]&lt;br /&gt;
&lt;br /&gt;
When σ=ϵ=1.0,&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans5.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&amp;lt;b&amp;gt;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At standard conditions, there are 3.35 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt; water molecules in 1 mL of water.&lt;br /&gt;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;; Volume = 1 mL = 1 cm&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;; Mr = 18; N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 6.022 x 10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2.5_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
For 10000 water molecules, the calculated volume is 2.99 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; mL:&lt;br /&gt;
&lt;br /&gt;
[[File:2.5_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&amp;lt;b&amp;gt;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, &#039;&#039;after the periodic boundary conditions have been applied?&#039;&#039;.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sum of (0.5, 0.5, 0.5) and (0.7, 0.6, 0.2) gives (1.2,1.1,0.7), but this assumes periodic boundary conditions not applied. If applied, number of atoms inside box always constant as one leaves, simultaneously another enters. Hence deduct (1.2,1.1,0.7) by value of 1 in the x and y coordinates since they exceed the value of 1, to give the (0.2,0.1,0.3) position.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&amp;lt;b&amp;gt;The Lennard-Jones parameters for argon are [[File:1.7_E1.png]]. If the LJ cutoff is [[File:1.7_E2.png]], 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 [[File:4.1_E1.png]] in real units?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2.7_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
==Part 3: Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together? &lt;br /&gt;
If molecules are put extremely close to each other then they might overlap each other, having unfavourable repulsion interactions. &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
0.941036.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;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? &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Still 1000 atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;Using the LAMMPS manual, find the purpose of the following commands in the input script: &amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.4_E1.PNG]]&lt;br /&gt;
&lt;br /&gt;
The first line is a mass command where 1 is the atom type, with mass of 1.0. This input script sets all atoms of atom type 1 to have a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
The second line is a pair style command which computes the pairwise interactions of 2 atoms. This command is scripted such that the Lennard-Jones potential is cut off for coulomb interaction beyond distance of 3.0, hence absence of potential energy. Within distance 3.0, there will be a presence of potential energy due to the active Lennard-Jones interaction.&lt;br /&gt;
&lt;br /&gt;
The third line is a pair coeff command, where the * sign in pair coeff command sets coefficients for multiple pairs of atom types. As there is no numeric value, it means all types from 1 to N. In the case used, there are only atoms of 1 type so this command sets the coefficient value to all atoms of type 1. The first 1.0 coefficient value corresponds to the distance at which potential energies, σ of 2 atoms is 0, whereas the second 1.0 coefficient is the well depth.&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&amp;lt;b&amp;gt;Look at the lines below.&amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.5_E1.PNG]]&lt;br /&gt;
&amp;lt;b&amp;gt;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;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.5_E2.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&amp;lt;b&amp;gt;Given that we are specifying [[File:3.6_E1.png]] and [[File:3.6_E2.png]], which integration algorithm are we going to use?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As 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) is given, the Velocity-Verlet algorithm should be used.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&amp;lt;b&amp;gt;Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium can be said to be achieved when thermodynamic quantities becomes constant. Hence for the timestep 0.001, the simulation reaches equilibrium since the plots of temperature and pressure versus time equilibrates to a constant value of approximately 1.25K and 1.25atm. From the zoomed in view, we can deduce that equilibration is achieved within 0.05s.&lt;br /&gt;
Equilibrium has also been achieved for other timesteps, except 0.015, where the graph of total energy versus time graph is observed to gradually increase.&lt;br /&gt;
The largest timestep to provide acceptable results is 0.01. Timestep 0.015 is a particularly bad choice because the simulation does not achieve equilibrium as its total energy value is increasing over time, with a large spread of error (larger fluctuation).&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Total_Energy_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Total energy versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Temperature_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Temperature versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Temperature_0.001_zoom.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Temperature versus time for timestep 0.001, zoomed in version&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Pressure_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Pressure versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Total_Energy_all_timestep.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Total Energy versus time for timesteps 0.001, 0.0025, 0.0075, 0.01, 0.015.&lt;br /&gt;
&lt;br /&gt;
==Part 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Choose 5 temperatures (above the critical temperature [[File:4.1_E1.png]]), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen [[File:4.1_E2.png]] points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5 temperatures above critical temp 1.5: 2.0, 2.5, 3.0, 3.5, 4.0&lt;br /&gt;
&lt;br /&gt;
2 pressures: 2.5, 2.8&lt;br /&gt;
&lt;br /&gt;
Timestep used: 0.001&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;We need to choose [[File:4.2_E1.png]] so that the temperature is correct [[File:4.2_E2.png]] if we multiply every velocity [[File:4.2_E1.png]]. We can write two equations:&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:4.2_E3.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:4.2_E4.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
Solve these to determine [[File:4.2_E1.png]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:4.2_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;Use the manual page 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, how much time will you simulate?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density [[File:4.4_E1.png]]. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated. Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:4.4_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
Density in Ideal Gas Law calculation:&lt;br /&gt;
&lt;br /&gt;
[[File:4.4_Ans2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the ideal gas law plot. ?????&lt;br /&gt;
&lt;br /&gt;
==Part 5: Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature [[File:5.1_Equation_1.png]] phase space, rather than pressure-temperature phase space. The two densities required at 0.2 and 0.8, and the temperature range is 2.0, 2.2, 2.4, 2.6, 2.8. Plot [[File:5.1_Equation_2.png]] as a function of temperature, where [[File:5.1_Equation_3.png]] 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.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Input script for density 0.2 at temperature 2.0 attached: [[File:5.1_(0.2,2.0).in]]&lt;br /&gt;
&lt;br /&gt;
==Part 6: Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate [[File:6.1_Equation_1.png]] and [[File:6.1_Equation_2.png]]. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:6.1_Ans1.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:6.1_Ans2.PNG]]&lt;br /&gt;
&lt;br /&gt;
==Part 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;Make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate [[File:7.2_D.png]] in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
[[File:7.3_Equation_1.png]]. &lt;br /&gt;
Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot [[File:7.3_Equation_2.png]] with [[File:7.3_Equation_3.png]] and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;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 [[File:7.2_D.png]] 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?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;equation 10&amp;quot;&amp;gt;https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment/Introduction_to_molecular_dynamics_simulation&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=User:JFU1608&amp;diff=541334</id>
		<title>User:JFU1608</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=User:JFU1608&amp;diff=541334"/>
		<updated>2016-02-25T12:00:02Z</updated>

		<summary type="html">&lt;p&gt;Jwf13: /* Task 6 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Part 1: Running first simulation==&lt;br /&gt;
&lt;br /&gt;
-no tasks-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Part 2: Introduction to molecular dynamics simulation==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time  t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by  (the values of  ,  , and   are worked out for you in the sheet).&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL: Position at time t (classical solution)&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Position.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
ERROR: Absolute difference between ANALYTICAL and Velocity-verlet solution&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Error.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
ENERGY: Total E of oscillator for velocity-verlet solution&lt;br /&gt;
Total Energy is given by the summation of both kinetic energy: 1/2 mv2 and potential energy 1/2kx2.&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Energy.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data. &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Time!! Maximum Error&lt;br /&gt;
|-&lt;br /&gt;
| 1.9|| 7.58E-04&lt;br /&gt;
|-&lt;br /&gt;
| 5.00|| 2.00E-03&lt;br /&gt;
|-&lt;br /&gt;
| 8.00|| 3.30E-03&lt;br /&gt;
|-&lt;br /&gt;
| 11.10|| 4.60E-03&lt;br /&gt;
|-&lt;br /&gt;
| 14.20|| 5.91E-03&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
[[File:2.2_Max_Error.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph shows a linear relationship between the maximum errors of position with time, characterised by its extrapolation formula y = 0.0004x – 0.00005.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;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?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Previously for timestep 0.1, the percentage change was 0.248%. By varying the timestep, we are able to deduce the corresponding percentage changes, shown in Table X. As timestep increases, the minima total energy value decreases gradually, leading to a larger percentage change in total energy. In order for total energy not to go over 1%, the timestep must not be larger than 0.2. It is important to monitor the total energy of a physical system while modelling its behaviour numerically. This is because the Law of Conservation of Energy is observed, where total energy stays constant. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Timestep!! Energy Maxima!! Energy Minima!! Change in Energy&lt;br /&gt;
|-&lt;br /&gt;
| 0.05|| 0.5||0.4997||0.06%&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;0.1||&#039;&#039;&#039;0.5&#039;&#039;&#039;||&#039;&#039;&#039;0.4988&#039;&#039;&#039;||&#039;&#039;&#039;0.24%&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0.15||0.5||0.4972||0.56%&lt;br /&gt;
|-&lt;br /&gt;
| 0.2||0.5||0.4950||1.00%&lt;br /&gt;
|-&lt;br /&gt;
| 0.25|| 0.5||0.4922||1.56%&lt;br /&gt;
|-&lt;br /&gt;
| 0.3|| 0.5||0.4888||2.24%&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Row highlighted in bold is the simulation done from previous tasks.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;For a single Lennard-Jones interaction, [[File:8c44e3156b2bf003c09fa62fbaed5cb0.png]], find the separation, [[File:2.4_E2.png]], at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, [[File:2.4_E3.png]], and work out the well depth ([[File:2.4_E4.png]]). Evaluate the integrals [[File:2.4_E5.png]], [[File:2.4_E6.png]], and [[File:2.4_E7.png]] when [[File:2.4_E8.png]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the potential energy is zero, separation r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; can be found:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
At this separation, the force can be calculated with [[File:2.4_F_Eq.png|100px]], where using the definition of U from equation 10 &amp;lt;ref name=&amp;quot;equation 10&amp;quot; /&amp;gt; produces:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs where F&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; = 0, so:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans3.png]]&lt;br /&gt;
&lt;br /&gt;
Well depth, &lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans4.PNG]]&lt;br /&gt;
&lt;br /&gt;
When σ=ϵ=1.0,&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans5.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&amp;lt;b&amp;gt;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At standard conditions, there are 3.35 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt; water molecules in 1 mL of water.&lt;br /&gt;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;; Volume = 1 mL = 1 cm&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;; Mr = 18; N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 6.022 x 10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2.5_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
For 10000 water molecules, the calculated volume is 2.99 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; mL:&lt;br /&gt;
&lt;br /&gt;
[[File:2.5_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&amp;lt;b&amp;gt;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, &#039;&#039;after the periodic boundary conditions have been applied?&#039;&#039;.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sum of (0.5, 0.5, 0.5) and (0.7, 0.6, 0.2) gives (1.2,1.1,0.7), but this assumes periodic boundary conditions not applied. If applied, number of atoms inside box always constant as one leaves, simultaneously another enters. Hence deduct (1.2,1.1,0.7) by value of 1 in the x and y coordinates since they exceed the value of 1, to give the (0.2,0.1,0.3) position.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&amp;lt;b&amp;gt;The Lennard-Jones parameters for argon are [[File:1.7_E1.png]]. If the LJ cutoff is [[File:1.7_E2.png]], 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 [[File:4.1_E1.png]] in real units?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2.7_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
==Part 3: Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together? &lt;br /&gt;
If molecules are put extremely close to each other then they might overlap each other, having unfavourable repulsion interactions. &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
0.941036.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;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? &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Still 1000 atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;Using the LAMMPS manual, find the purpose of the following commands in the input script: &amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.4_E1.PNG]]&lt;br /&gt;
&lt;br /&gt;
The first line is a mass command where 1 is the atom type, with mass of 1.0. This input script sets all atoms of atom type 1 to have a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
The second line is a pair style command which computes the pairwise interactions of 2 atoms. This command is scripted such that the Lennard-Jones potential is cut off for coulomb interaction beyond distance of 3.0, hence absence of potential energy. Within distance 3.0, there will be a presence of potential energy due to the active Lennard-Jones interaction.&lt;br /&gt;
&lt;br /&gt;
The third line is a pair coeff command, where the * sign in pair coeff command sets coefficients for multiple pairs of atom types. As there is no numeric value, it means all types from 1 to N. In the case used, there are only atoms of 1 type so this command sets the coefficient value to all atoms of type 1. The first 1.0 coefficient value corresponds to the distance at which potential energies, σ of 2 atoms is 0, whereas the second 1.0 coefficient is the well depth.&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&amp;lt;b&amp;gt;Look at the lines below.&amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.5_E1.PNG]]&lt;br /&gt;
&amp;lt;b&amp;gt;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;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.5_E2.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&amp;lt;b&amp;gt;Given that we are specifying [[File:3.6_E1.png]] and [[File:3.6_E2.png]], which integration algorithm are we going to use?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As 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) is given, the Velocity-Verlet algorithm should be used.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&amp;lt;b&amp;gt;Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium can be said to be achieved when thermodynamic quantities becomes constant. Hence for the timestep 0.001, the simulation reaches equilibrium since the plots of temperature and pressure versus time equilibrates to a constant value of approximately 1.25K and 1.25atm. From the zoomed in view (Graph ___), we can deduce that equilibration is achieved within 0.05s.&lt;br /&gt;
Equilibrium has also been achieved for other timesteps, except 0.015, where the graph of total energy versus time graph is observed to gradually increase.&lt;br /&gt;
The largest timestep to provide acceptable results is 0.01. Timestep 0.015 is a particularly bad choice because the simulation does not achieve equilibrium as its total energy value is increasing over time, with a large spread of error (larger fluctuation).&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Total_Energy_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Total energy versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Temperature_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Temperature versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Temperature_0.001_zoom.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Temperature versus time for timestep 0.001, zoomed in version&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Pressure_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Pressure versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Total_Energy_all_timestep.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Total Energy versus time for timesteps 0.001, 0.0025, 0.0075, 0.01, 0.015.&lt;br /&gt;
&lt;br /&gt;
==Part 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Choose 5 temperatures (above the critical temperature [[File:4.1_E1.png]]), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen [[File:4.1_E2.png]] points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5 temperatures above critical temp 1.5: 2.0, 2.5, 3.0, 3.5, 4.0&lt;br /&gt;
&lt;br /&gt;
2 pressures: 2.5, 2.8&lt;br /&gt;
&lt;br /&gt;
Timestep used: 0.001&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;We need to choose [[File:4.2_E1.png]] so that the temperature is correct [[File:4.2_E2.png]] if we multiply every velocity [[File:4.2_E1.png]]. We can write two equations:&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:4.2_E3.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:4.2_E4.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
Solve these to determine [[File:4.2_E1.png]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:4.2_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;Use the manual page 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, how much time will you simulate?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density [[File:4.4_E1.png]]. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated. Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:4.4_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
Density in Ideal Gas Law calculation:&lt;br /&gt;
&lt;br /&gt;
[[File:4.4_Ans2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the ideal gas law plot. ?????&lt;br /&gt;
&lt;br /&gt;
==Part 5: Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature [[File:5.1_Equation_1.png]] phase space, rather than pressure-temperature phase space. The two densities required at 0.2 and 0.8, and the temperature range is 2.0, 2.2, 2.4, 2.6, 2.8. Plot [[File:5.1_Equation_2.png]] as a function of temperature, where [[File:5.1_Equation_3.png]] 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.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Input script for density 0.2 at temperature 2.0 attached: [[File:5.1_(0.2,2.0).in]]&lt;br /&gt;
&lt;br /&gt;
==Part 6: Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate [[File:6.1_Equation_1.png]] and [[File:6.1_Equation_2.png]]. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:6.1_Ans1.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:6.1_Ans2.PNG]]&lt;br /&gt;
&lt;br /&gt;
==Part 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;Make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate [[File:7.2_D.png]] in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
[[File:7.3_Equation_1.png]]. &lt;br /&gt;
Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot [[File:7.3_Equation_2.png]] with [[File:7.3_Equation_3.png]] and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;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 [[File:7.2_D.png]] 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?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;equation 10&amp;quot;&amp;gt;https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment/Introduction_to_molecular_dynamics_simulation&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=User:JFU1608&amp;diff=541333</id>
		<title>User:JFU1608</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=User:JFU1608&amp;diff=541333"/>
		<updated>2016-02-25T11:59:41Z</updated>

		<summary type="html">&lt;p&gt;Jwf13: /* Task 6 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Part 1: Running first simulation==&lt;br /&gt;
&lt;br /&gt;
-no tasks-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Part 2: Introduction to molecular dynamics simulation==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time  t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by  (the values of  ,  , and   are worked out for you in the sheet).&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL: Position at time t (classical solution)&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Position.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
ERROR: Absolute difference between ANALYTICAL and Velocity-verlet solution&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Error.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
ENERGY: Total E of oscillator for velocity-verlet solution&lt;br /&gt;
Total Energy is given by the summation of both kinetic energy: 1/2 mv2 and potential energy 1/2kx2.&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Energy.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data. &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Time!! Maximum Error&lt;br /&gt;
|-&lt;br /&gt;
| 1.9|| 7.58E-04&lt;br /&gt;
|-&lt;br /&gt;
| 5.00|| 2.00E-03&lt;br /&gt;
|-&lt;br /&gt;
| 8.00|| 3.30E-03&lt;br /&gt;
|-&lt;br /&gt;
| 11.10|| 4.60E-03&lt;br /&gt;
|-&lt;br /&gt;
| 14.20|| 5.91E-03&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
[[File:2.2_Max_Error.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph shows a linear relationship between the maximum errors of position with time, characterised by its extrapolation formula y = 0.0004x – 0.00005.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;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?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Previously for timestep 0.1, the percentage change was 0.248%. By varying the timestep, we are able to deduce the corresponding percentage changes, shown in Table X. As timestep increases, the minima total energy value decreases gradually, leading to a larger percentage change in total energy. In order for total energy not to go over 1%, the timestep must not be larger than 0.2. It is important to monitor the total energy of a physical system while modelling its behaviour numerically. This is because the Law of Conservation of Energy is observed, where total energy stays constant. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Timestep!! Energy Maxima!! Energy Minima!! Change in Energy&lt;br /&gt;
|-&lt;br /&gt;
| 0.05|| 0.5||0.4997||0.06%&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;0.1||&#039;&#039;&#039;0.5&#039;&#039;&#039;||&#039;&#039;&#039;0.4988&#039;&#039;&#039;||&#039;&#039;&#039;0.24%&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0.15||0.5||0.4972||0.56%&lt;br /&gt;
|-&lt;br /&gt;
| 0.2||0.5||0.4950||1.00%&lt;br /&gt;
|-&lt;br /&gt;
| 0.25|| 0.5||0.4922||1.56%&lt;br /&gt;
|-&lt;br /&gt;
| 0.3|| 0.5||0.4888||2.24%&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Row highlighted in bold is the simulation done from previous tasks.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;For a single Lennard-Jones interaction, [[File:8c44e3156b2bf003c09fa62fbaed5cb0.png]], find the separation, [[File:2.4_E2.png]], at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, [[File:2.4_E3.png]], and work out the well depth ([[File:2.4_E4.png]]). Evaluate the integrals [[File:2.4_E5.png]], [[File:2.4_E6.png]], and [[File:2.4_E7.png]] when [[File:2.4_E8.png]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the potential energy is zero, separation r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; can be found:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
At this separation, the force can be calculated with [[File:2.4_F_Eq.png|100px]], where using the definition of U from equation 10 &amp;lt;ref name=&amp;quot;equation 10&amp;quot; /&amp;gt; produces:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs where F&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; = 0, so:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans3.png]]&lt;br /&gt;
&lt;br /&gt;
Well depth, &lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans4.PNG]]&lt;br /&gt;
&lt;br /&gt;
When σ=ϵ=1.0,&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans5.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&amp;lt;b&amp;gt;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At standard conditions, there are 3.35 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt; water molecules in 1 mL of water.&lt;br /&gt;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;; Volume = 1 mL = 1 cm&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;; Mr = 18; N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 6.022 x 10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2.5_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
For 10000 water molecules, the calculated volume is 2.99 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; mL:&lt;br /&gt;
&lt;br /&gt;
[[File:2.5_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&amp;lt;b&amp;gt;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, &#039;&#039;after the periodic boundary conditions have been applied?&#039;&#039;.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sum of (0.5, 0.5, 0.5) and (0.7, 0.6, 0.2) gives (1.2,1.1,0.7), but this assumes periodic boundary conditions not applied. If applied, number of atoms inside box always constant as one leaves, simultaneously another enters. Hence deduct (1.2,1.1,0.7) by value of 1 in the x and y coordinates since they exceed the value of 1, to give the (0.2,0.1,0.3) position.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&amp;lt;b&amp;gt;The Lennard-Jones parameters for argon are [[File:1.7_E1.png]]. If the LJ cutoff is [[File:1.7_E2.png]], 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 [[File:4.1_E1.png]] in real units?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2.7_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
==Part 3: Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together? &lt;br /&gt;
If molecules are put extremely close to each other then they might overlap each other, having unfavourable repulsion interactions. &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
0.941036.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;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? &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Still 1000 atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;Using the LAMMPS manual, find the purpose of the following commands in the input script: &amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.4_E1.PNG]]&lt;br /&gt;
&lt;br /&gt;
The first line is a mass command where 1 is the atom type, with mass of 1.0. This input script sets all atoms of atom type 1 to have a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
The second line is a pair style command which computes the pairwise interactions of 2 atoms. This command is scripted such that the Lennard-Jones potential is cut off for coulomb interaction beyond distance of 3.0, hence absence of potential energy. Within distance 3.0, there will be a presence of potential energy due to the active Lennard-Jones interaction.&lt;br /&gt;
&lt;br /&gt;
The third line is a pair coeff command, where the * sign in pair coeff command sets coefficients for multiple pairs of atom types. As there is no numeric value, it means all types from 1 to N. In the case used, there are only atoms of 1 type so this command sets the coefficient value to all atoms of type 1. The first 1.0 coefficient value corresponds to the distance at which potential energies, σ of 2 atoms is 0, whereas the second 1.0 coefficient is the well depth.&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&amp;lt;b&amp;gt;Look at the lines below.&amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.5_E1.PNG]]&lt;br /&gt;
&amp;lt;b&amp;gt;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;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.5_E2.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&amp;lt;b&amp;gt;Given that we are specifying [[File:3.6_E1.png]] and [[File:3.6_E2.png]], which integration algorithm are we going to use?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As 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) is given, the Velocity-Verlet equation should be used.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&amp;lt;b&amp;gt;Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium can be said to be achieved when thermodynamic quantities becomes constant. Hence for the timestep 0.001, the simulation reaches equilibrium since the plots of temperature and pressure versus time equilibrates to a constant value of approximately 1.25K and 1.25atm. From the zoomed in view (Graph ___), we can deduce that equilibration is achieved within 0.05s.&lt;br /&gt;
Equilibrium has also been achieved for other timesteps, except 0.015, where the graph of total energy versus time graph is observed to gradually increase.&lt;br /&gt;
The largest timestep to provide acceptable results is 0.01. Timestep 0.015 is a particularly bad choice because the simulation does not achieve equilibrium as its total energy value is increasing over time, with a large spread of error (larger fluctuation).&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Total_Energy_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Total energy versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Temperature_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Temperature versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Temperature_0.001_zoom.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Temperature versus time for timestep 0.001, zoomed in version&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Pressure_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Pressure versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Total_Energy_all_timestep.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Total Energy versus time for timesteps 0.001, 0.0025, 0.0075, 0.01, 0.015.&lt;br /&gt;
&lt;br /&gt;
==Part 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Choose 5 temperatures (above the critical temperature [[File:4.1_E1.png]]), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen [[File:4.1_E2.png]] points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5 temperatures above critical temp 1.5: 2.0, 2.5, 3.0, 3.5, 4.0&lt;br /&gt;
&lt;br /&gt;
2 pressures: 2.5, 2.8&lt;br /&gt;
&lt;br /&gt;
Timestep used: 0.001&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;We need to choose [[File:4.2_E1.png]] so that the temperature is correct [[File:4.2_E2.png]] if we multiply every velocity [[File:4.2_E1.png]]. We can write two equations:&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:4.2_E3.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:4.2_E4.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
Solve these to determine [[File:4.2_E1.png]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:4.2_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;Use the manual page 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, how much time will you simulate?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density [[File:4.4_E1.png]]. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated. Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:4.4_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
Density in Ideal Gas Law calculation:&lt;br /&gt;
&lt;br /&gt;
[[File:4.4_Ans2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the ideal gas law plot. ?????&lt;br /&gt;
&lt;br /&gt;
==Part 5: Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature [[File:5.1_Equation_1.png]] phase space, rather than pressure-temperature phase space. The two densities required at 0.2 and 0.8, and the temperature range is 2.0, 2.2, 2.4, 2.6, 2.8. Plot [[File:5.1_Equation_2.png]] as a function of temperature, where [[File:5.1_Equation_3.png]] 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.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Input script for density 0.2 at temperature 2.0 attached: [[File:5.1_(0.2,2.0).in]]&lt;br /&gt;
&lt;br /&gt;
==Part 6: Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate [[File:6.1_Equation_1.png]] and [[File:6.1_Equation_2.png]]. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:6.1_Ans1.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:6.1_Ans2.PNG]]&lt;br /&gt;
&lt;br /&gt;
==Part 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;Make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate [[File:7.2_D.png]] in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
[[File:7.3_Equation_1.png]]. &lt;br /&gt;
Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot [[File:7.3_Equation_2.png]] with [[File:7.3_Equation_3.png]] and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;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 [[File:7.2_D.png]] 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?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;equation 10&amp;quot;&amp;gt;https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment/Introduction_to_molecular_dynamics_simulation&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=User:JFU1608&amp;diff=541331</id>
		<title>User:JFU1608</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=User:JFU1608&amp;diff=541331"/>
		<updated>2016-02-25T11:55:35Z</updated>

		<summary type="html">&lt;p&gt;Jwf13: /* Task 4 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Part 1: Running first simulation==&lt;br /&gt;
&lt;br /&gt;
-no tasks-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Part 2: Introduction to molecular dynamics simulation==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time  t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by  (the values of  ,  , and   are worked out for you in the sheet).&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL: Position at time t (classical solution)&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Position.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
ERROR: Absolute difference between ANALYTICAL and Velocity-verlet solution&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Error.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
ENERGY: Total E of oscillator for velocity-verlet solution&lt;br /&gt;
Total Energy is given by the summation of both kinetic energy: 1/2 mv2 and potential energy 1/2kx2.&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Energy.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data. &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Time!! Maximum Error&lt;br /&gt;
|-&lt;br /&gt;
| 1.9|| 7.58E-04&lt;br /&gt;
|-&lt;br /&gt;
| 5.00|| 2.00E-03&lt;br /&gt;
|-&lt;br /&gt;
| 8.00|| 3.30E-03&lt;br /&gt;
|-&lt;br /&gt;
| 11.10|| 4.60E-03&lt;br /&gt;
|-&lt;br /&gt;
| 14.20|| 5.91E-03&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
[[File:2.2_Max_Error.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph shows a linear relationship between the maximum errors of position with time, characterised by its extrapolation formula y = 0.0004x – 0.00005.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;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?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Previously for timestep 0.1, the percentage change was 0.248%. By varying the timestep, we are able to deduce the corresponding percentage changes, shown in Table X. As timestep increases, the minima total energy value decreases gradually, leading to a larger percentage change in total energy. In order for total energy not to go over 1%, the timestep must not be larger than 0.2. It is important to monitor the total energy of a physical system while modelling its behaviour numerically. This is because the Law of Conservation of Energy is observed, where total energy stays constant. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Timestep!! Energy Maxima!! Energy Minima!! Change in Energy&lt;br /&gt;
|-&lt;br /&gt;
| 0.05|| 0.5||0.4997||0.06%&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;0.1||&#039;&#039;&#039;0.5&#039;&#039;&#039;||&#039;&#039;&#039;0.4988&#039;&#039;&#039;||&#039;&#039;&#039;0.24%&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0.15||0.5||0.4972||0.56%&lt;br /&gt;
|-&lt;br /&gt;
| 0.2||0.5||0.4950||1.00%&lt;br /&gt;
|-&lt;br /&gt;
| 0.25|| 0.5||0.4922||1.56%&lt;br /&gt;
|-&lt;br /&gt;
| 0.3|| 0.5||0.4888||2.24%&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Row highlighted in bold is the simulation done from previous tasks.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;For a single Lennard-Jones interaction, [[File:8c44e3156b2bf003c09fa62fbaed5cb0.png]], find the separation, [[File:2.4_E2.png]], at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, [[File:2.4_E3.png]], and work out the well depth ([[File:2.4_E4.png]]). Evaluate the integrals [[File:2.4_E5.png]], [[File:2.4_E6.png]], and [[File:2.4_E7.png]] when [[File:2.4_E8.png]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the potential energy is zero, separation r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; can be found:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
At this separation, the force can be calculated with [[File:2.4_F_Eq.png|100px]], where using the definition of U from equation 10 &amp;lt;ref name=&amp;quot;equation 10&amp;quot; /&amp;gt; produces:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs where F&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; = 0, so:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans3.png]]&lt;br /&gt;
&lt;br /&gt;
Well depth, &lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans4.PNG]]&lt;br /&gt;
&lt;br /&gt;
When σ=ϵ=1.0,&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans5.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&amp;lt;b&amp;gt;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At standard conditions, there are 3.35 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt; water molecules in 1 mL of water.&lt;br /&gt;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;; Volume = 1 mL = 1 cm&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;; Mr = 18; N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 6.022 x 10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2.5_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
For 10000 water molecules, the calculated volume is 2.99 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; mL:&lt;br /&gt;
&lt;br /&gt;
[[File:2.5_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&amp;lt;b&amp;gt;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, &#039;&#039;after the periodic boundary conditions have been applied?&#039;&#039;.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sum of (0.5, 0.5, 0.5) and (0.7, 0.6, 0.2) gives (1.2,1.1,0.7), but this assumes periodic boundary conditions not applied. If applied, number of atoms inside box always constant as one leaves, simultaneously another enters. Hence deduct (1.2,1.1,0.7) by value of 1 in the x and y coordinates since they exceed the value of 1, to give the (0.2,0.1,0.3) position.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&amp;lt;b&amp;gt;The Lennard-Jones parameters for argon are [[File:1.7_E1.png]]. If the LJ cutoff is [[File:1.7_E2.png]], 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 [[File:4.1_E1.png]] in real units?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2.7_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
==Part 3: Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together? &lt;br /&gt;
If molecules are put extremely close to each other then they might overlap each other, having unfavourable repulsion interactions. &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
0.941036.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;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? &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Still 1000 atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;Using the LAMMPS manual, find the purpose of the following commands in the input script: &amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.4_E1.PNG]]&lt;br /&gt;
&lt;br /&gt;
The first line is a mass command where 1 is the atom type, with mass of 1.0. This input script sets all atoms of atom type 1 to have a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
The second line is a pair style command which computes the pairwise interactions of 2 atoms. This command is scripted such that the Lennard-Jones potential is cut off for coulomb interaction beyond distance of 3.0, hence absence of potential energy. Within distance 3.0, there will be a presence of potential energy due to the active Lennard-Jones interaction.&lt;br /&gt;
&lt;br /&gt;
The third line is a pair coeff command, where the * sign in pair coeff command sets coefficients for multiple pairs of atom types. As there is no numeric value, it means all types from 1 to N. In the case used, there are only atoms of 1 type so this command sets the coefficient value to all atoms of type 1. The first 1.0 coefficient value corresponds to the distance at which potential energies, σ of 2 atoms is 0, whereas the second 1.0 coefficient is the well depth.&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&amp;lt;b&amp;gt;Look at the lines below.&amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.5_E1.PNG]]&lt;br /&gt;
&amp;lt;b&amp;gt;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;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.5_E2.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&amp;lt;b&amp;gt;Given that we are specifying [[File:3.6_E1.png]] and [[File:3.6_E2.png]], which integration algorithm are we going to use?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&amp;lt;b&amp;gt;Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium can be said to be achieved when thermodynamic quantities becomes constant. Hence for the timestep 0.001, the simulation reaches equilibrium since the plots of temperature and pressure versus time equilibrates to a constant value of approximately 1.25K and 1.25atm. From the zoomed in view (Graph ___), we can deduce that equilibration is achieved within 0.05s.&lt;br /&gt;
Equilibrium has also been achieved for other timesteps, except 0.015, where the graph of total energy versus time graph is observed to gradually increase.&lt;br /&gt;
The largest timestep to provide acceptable results is 0.01. Timestep 0.015 is a particularly bad choice because the simulation does not achieve equilibrium as its total energy value is increasing over time, with a large spread of error (larger fluctuation).&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Total_Energy_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Total energy versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Temperature_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Temperature versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Temperature_0.001_zoom.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Temperature versus time for timestep 0.001, zoomed in version&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Pressure_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Pressure versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Total_Energy_all_timestep.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Total Energy versus time for timesteps 0.001, 0.0025, 0.0075, 0.01, 0.015.&lt;br /&gt;
&lt;br /&gt;
==Part 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Choose 5 temperatures (above the critical temperature [[File:4.1_E1.png]]), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen [[File:4.1_E2.png]] points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5 temperatures above critical temp 1.5: 2.0, 2.5, 3.0, 3.5, 4.0&lt;br /&gt;
&lt;br /&gt;
2 pressures: 2.5, 2.8&lt;br /&gt;
&lt;br /&gt;
Timestep used: 0.001&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;We need to choose [[File:4.2_E1.png]] so that the temperature is correct [[File:4.2_E2.png]] if we multiply every velocity [[File:4.2_E1.png]]. We can write two equations:&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:4.2_E3.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:4.2_E4.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
Solve these to determine [[File:4.2_E1.png]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:4.2_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;Use the manual page 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, how much time will you simulate?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density [[File:4.4_E1.png]]. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated. Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:4.4_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
Density in Ideal Gas Law calculation:&lt;br /&gt;
&lt;br /&gt;
[[File:4.4_Ans2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the ideal gas law plot. ?????&lt;br /&gt;
&lt;br /&gt;
==Part 5: Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature [[File:5.1_Equation_1.png]] phase space, rather than pressure-temperature phase space. The two densities required at 0.2 and 0.8, and the temperature range is 2.0, 2.2, 2.4, 2.6, 2.8. Plot [[File:5.1_Equation_2.png]] as a function of temperature, where [[File:5.1_Equation_3.png]] 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.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Input script for density 0.2 at temperature 2.0 attached: [[File:5.1_(0.2,2.0).in]]&lt;br /&gt;
&lt;br /&gt;
==Part 6: Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate [[File:6.1_Equation_1.png]] and [[File:6.1_Equation_2.png]]. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:6.1_Ans1.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:6.1_Ans2.PNG]]&lt;br /&gt;
&lt;br /&gt;
==Part 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;Make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate [[File:7.2_D.png]] in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
[[File:7.3_Equation_1.png]]. &lt;br /&gt;
Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot [[File:7.3_Equation_2.png]] with [[File:7.3_Equation_3.png]] and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;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 [[File:7.2_D.png]] 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?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;equation 10&amp;quot;&amp;gt;https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment/Introduction_to_molecular_dynamics_simulation&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:2.4_Ans5.PNG&amp;diff=541329</id>
		<title>File:2.4 Ans5.PNG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:2.4_Ans5.PNG&amp;diff=541329"/>
		<updated>2016-02-25T11:55:11Z</updated>

		<summary type="html">&lt;p&gt;Jwf13: Jwf13 uploaded a new version of File:2.4 Ans5.PNG&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:2.4_Ans5.PNG&amp;diff=541324</id>
		<title>File:2.4 Ans5.PNG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:2.4_Ans5.PNG&amp;diff=541324"/>
		<updated>2016-02-25T11:54:03Z</updated>

		<summary type="html">&lt;p&gt;Jwf13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:2.4_Ans4.PNG&amp;diff=541321</id>
		<title>File:2.4 Ans4.PNG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:2.4_Ans4.PNG&amp;diff=541321"/>
		<updated>2016-02-25T11:53:17Z</updated>

		<summary type="html">&lt;p&gt;Jwf13: Jwf13 uploaded a new version of File:2.4 Ans4.PNG&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:2.4_Ans4.PNG&amp;diff=541319</id>
		<title>File:2.4 Ans4.PNG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:2.4_Ans4.PNG&amp;diff=541319"/>
		<updated>2016-02-25T11:51:55Z</updated>

		<summary type="html">&lt;p&gt;Jwf13: Jwf13 uploaded a new version of File:2.4 Ans4.PNG&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:2.4_Ans4.PNG&amp;diff=541317</id>
		<title>File:2.4 Ans4.PNG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:2.4_Ans4.PNG&amp;diff=541317"/>
		<updated>2016-02-25T11:49:57Z</updated>

		<summary type="html">&lt;p&gt;Jwf13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:2.1_Energy.PNG&amp;diff=541282</id>
		<title>File:2.1 Energy.PNG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:2.1_Energy.PNG&amp;diff=541282"/>
		<updated>2016-02-25T11:05:49Z</updated>

		<summary type="html">&lt;p&gt;Jwf13: Jwf13 uploaded a new version of File:2.1 Energy.PNG&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=User:JFU1608&amp;diff=541165</id>
		<title>User:JFU1608</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=User:JFU1608&amp;diff=541165"/>
		<updated>2016-02-24T22:14:53Z</updated>

		<summary type="html">&lt;p&gt;Jwf13: /* Task 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Part 1: Running first simulation==&lt;br /&gt;
&lt;br /&gt;
-no tasks-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Part 2: Introduction to molecular dynamics simulation==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time  t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by  (the values of  ,  , and   are worked out for you in the sheet).&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL: Position at time t (classical solution)&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Position.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
ERROR: Absolute difference between ANALYTICAL and Velocity-verlet solution&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Error.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
ENERGY: Total E of oscillator for velocity-verlet solution&lt;br /&gt;
Total Energy is given by the summation of both kinetic energy: 1/2 mv2 and potential energy 1/2kx2.&lt;br /&gt;
&lt;br /&gt;
[[File:2.1_Energy.PNG|750px]]&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data. &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Time!! Maximum Error&lt;br /&gt;
|-&lt;br /&gt;
| 1.9|| 7.58E-04&lt;br /&gt;
|-&lt;br /&gt;
| 5.00|| 2.00E-03&lt;br /&gt;
|-&lt;br /&gt;
| 8.00|| 3.30E-03&lt;br /&gt;
|-&lt;br /&gt;
| 11.10|| 4.60E-03&lt;br /&gt;
|-&lt;br /&gt;
| 14.20|| 5.91E-03&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
[[File:2.2_Max_Error.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph shows a linear relationship between the maximum errors of position with time, characterised by its extrapolation formula y = 0.0004x – 0.00005.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;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?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Previously for timestep 0.1, the percentage change was 0.248%. By varying the timestep, we are able to deduce the corresponding percentage changes, shown in Table X. As timestep increases, the minima total energy value decreases gradually, leading to a larger percentage change in total energy. In order for total energy not to go over 1%, the timestep must not be larger than 0.2. It is important to monitor the total energy of a physical system while modelling its behaviour numerically. This is because the Law of Conservation of Energy is observed, where total energy stays constant. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Timestep!! Energy Maxima!! Energy Minima!! Change in Energy&lt;br /&gt;
|-&lt;br /&gt;
| 0.05|| 0.5||0.4997||0.06%&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;0.1||&#039;&#039;&#039;0.5&#039;&#039;&#039;||&#039;&#039;&#039;0.4988&#039;&#039;&#039;||&#039;&#039;&#039;0.24%&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0.15||0.5||0.4972||0.56%&lt;br /&gt;
|-&lt;br /&gt;
| 0.2||0.5||0.4950||1.00%&lt;br /&gt;
|-&lt;br /&gt;
| 0.25|| 0.5||0.4922||1.56%&lt;br /&gt;
|-&lt;br /&gt;
| 0.3|| 0.5||0.4888||2.24%&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Row highlighted in bold is the simulation done from previous tasks.&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;For a single Lennard-Jones interaction, [[File:8c44e3156b2bf003c09fa62fbaed5cb0.png]], find the separation, [[File:2.4_E2.png]], at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, [[File:2.4_E3.png]], and work out the well depth ([[File:2.4_E4.png]]). Evaluate the integrals [[File:2.4_E5.png]], [[File:2.4_E6.png]], and [[File:2.4_E7.png]] when [[File:2.4_E8.png]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the potential energy is zero, separation r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; can be found:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
At this separation, the force can be calculated with [[File:2.4_F_Eq.png|100px]], where using the definition of U from equation 10 &amp;lt;ref name=&amp;quot;equation 10&amp;quot; /&amp;gt; produces:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; occurs where F&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; = 0, so:&lt;br /&gt;
&lt;br /&gt;
[[File:2.4_Ans3.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&amp;lt;b&amp;gt;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At standard conditions, there are 3.35 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt; water molecules in 1 mL of water.&lt;br /&gt;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;; Volume = 1 mL = 1 cm&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;; Mr = 18; N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 6.022 x 10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2.5_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
For 10000 water molecules, the calculated volume is 2.99 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; mL:&lt;br /&gt;
&lt;br /&gt;
[[File:2.5_Ans2.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&amp;lt;b&amp;gt;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, &#039;&#039;after the periodic boundary conditions have been applied?&#039;&#039;.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sum of (0.5, 0.5, 0.5) and (0.7, 0.6, 0.2) gives (1.2,1.1,0.7), but this assumes periodic boundary conditions not applied. If applied, number of atoms inside box always constant as one leaves, simultaneously another enters. Hence deduct (1.2,1.1,0.7) by value of 1 in the x and y coordinates since they exceed the value of 1, to give the (0.2,0.1,0.3) position.&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&amp;lt;b&amp;gt;The Lennard-Jones parameters for argon are [[File:1.7_E1.png]]. If the LJ cutoff is [[File:1.7_E2.png]], 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 [[File:4.1_E1.png]] in real units?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2.7_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
==Part 3: Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together? &lt;br /&gt;
If molecules are put extremely close to each other then they might overlap each other, having unfavourable repulsion interactions. &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
0.941036.&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;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? &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Still 1000 atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;Using the LAMMPS manual, find the purpose of the following commands in the input script: &amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.4_E1.PNG]]&lt;br /&gt;
&lt;br /&gt;
The first line is a mass command where 1 is the atom type, with mass of 1.0. This input script sets all atoms of atom type 1 to have a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
The second line is a pair style command which computes the pairwise interactions of 2 atoms. This command is scripted such that the Lennard-Jones potential is cut off for coulomb interaction beyond distance of 3.0, hence absence of potential energy. Within distance 3.0, there will be a presence of potential energy due to the active Lennard-Jones interaction.&lt;br /&gt;
&lt;br /&gt;
The third line is a pair coeff command, where the * sign in pair coeff command sets coefficients for multiple pairs of atom types. As there is no numeric value, it means all types from 1 to N. In the case used, there are only atoms of 1 type so this command sets the coefficient value to all atoms of type 1. The first 1.0 coefficient value corresponds to the distance at which potential energies, σ of 2 atoms is 0, whereas the second 1.0 coefficient is the well depth.&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&amp;lt;b&amp;gt;Look at the lines below.&amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.5_E1.PNG]]&lt;br /&gt;
&amp;lt;b&amp;gt;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;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:3.5_E2.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&amp;lt;b&amp;gt;Given that we are specifying [[File:3.6_E1.png]] and [[File:3.6_E2.png]], which integration algorithm are we going to use?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&amp;lt;b&amp;gt;Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium can be said to be achieved when thermodynamic quantities becomes constant. Hence for the timestep 0.001, the simulation reaches equilibrium since the plots of temperature and pressure versus time equilibrates to a constant value of approximately 1.25K and 1.25atm. From the zoomed in view (Graph ___), we can deduce that equilibration is achieved within 0.05s.&lt;br /&gt;
Equilibrium has also been achieved for other timesteps, except 0.015, where the graph of total energy versus time graph is observed to gradually increase.&lt;br /&gt;
The largest timestep to provide acceptable results is 0.01. Timestep 0.015 is a particularly bad choice because the simulation does not achieve equilibrium as its total energy value is increasing over time, with a large spread of error (larger fluctuation).&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Total_Energy_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Total energy versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Temperature_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Temperature versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Temperature_0.001_zoom.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Temperature versus time for timestep 0.001, zoomed in version&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Pressure_0.001.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Pressure versus time for timestep 0.001&lt;br /&gt;
&lt;br /&gt;
[[File:3.7_Total_Energy_all_timestep.PNG]]&lt;br /&gt;
&lt;br /&gt;
Graph of Total Energy versus time for timesteps 0.001, 0.0025, 0.0075, 0.01, 0.015.&lt;br /&gt;
&lt;br /&gt;
==Part 4: Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Choose 5 temperatures (above the critical temperature [[File:4.1_E1.png]]), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen [[File:4.1_E2.png]] points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5 temperatures above critical temp 1.5: 2.0, 2.5, 3.0, 3.5, 4.0&lt;br /&gt;
&lt;br /&gt;
2 pressures: 2.5, 2.8&lt;br /&gt;
&lt;br /&gt;
Timestep used: 0.001&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;We need to choose [[File:4.2_E1.png]] so that the temperature is correct [[File:4.2_E2.png]] if we multiply every velocity [[File:4.2_E1.png]]. We can write two equations:&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:4.2_E3.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:4.2_E4.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
Solve these to determine [[File:4.2_E1.png]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:4.2_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;Use the manual page 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, how much time will you simulate?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density [[File:4.4_E1.png]]. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated. Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:4.4_Ans1.png]]&lt;br /&gt;
&lt;br /&gt;
Density in Ideal Gas Law calculation:&lt;br /&gt;
&lt;br /&gt;
[[File:4.4_Ans2.png|200px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the ideal gas law plot. ?????&lt;br /&gt;
&lt;br /&gt;
==Part 5: Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature [[File:5.1_Equation_1.png]] phase space, rather than pressure-temperature phase space. The two densities required at 0.2 and 0.8, and the temperature range is 2.0, 2.2, 2.4, 2.6, 2.8. Plot [[File:5.1_Equation_2.png]] as a function of temperature, where [[File:5.1_Equation_3.png]] 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.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Input script for density 0.2 at temperature 2.0 attached: [[File:5.1_(0.2,2.0).in]]&lt;br /&gt;
&lt;br /&gt;
==Part 6: Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;Perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate [[File:6.1_Equation_1.png]] and [[File:6.1_Equation_2.png]]. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:6.1_Ans1.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:6.1_Ans2.PNG]]&lt;br /&gt;
&lt;br /&gt;
==Part 7: Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&amp;lt;b&amp;gt;In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&amp;lt;b&amp;gt;Make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate [[File:7.2_D.png]] in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&amp;lt;b&amp;gt;In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
[[File:7.3_Equation_1.png]]. &lt;br /&gt;
Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot [[File:7.3_Equation_2.png]] with [[File:7.3_Equation_3.png]] and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&amp;lt;b&amp;gt;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 [[File:7.2_D.png]] 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?&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;equation 10&amp;quot;&amp;gt;https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment/Introduction_to_molecular_dynamics_simulation&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:6.1_Ans2.PNG&amp;diff=541164</id>
		<title>File:6.1 Ans2.PNG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:6.1_Ans2.PNG&amp;diff=541164"/>
		<updated>2016-02-24T22:14:41Z</updated>

		<summary type="html">&lt;p&gt;Jwf13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:6.1_Ans1.PNG&amp;diff=541163</id>
		<title>File:6.1 Ans1.PNG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:6.1_Ans1.PNG&amp;diff=541163"/>
		<updated>2016-02-24T22:14:25Z</updated>

		<summary type="html">&lt;p&gt;Jwf13: Jwf13 uploaded a new version of File:6.1 Ans1.PNG&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jwf13</name></author>
	</entry>
</feed>