<?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=Jmd114</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=Jmd114"/>
	<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/wiki/Special:Contributions/Jmd114"/>
	<updated>2026-05-16T09:01:14Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=590424</id>
		<title>Rep:Mod:Yr3LiquidSimJmsD</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=590424"/>
		<updated>2017-02-24T11:59:13Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: /* 5.1 Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Jack Dawson - Yr3 Comp: Liquid Sim.=&lt;br /&gt;
&lt;br /&gt;
== 1 Theory ==&lt;br /&gt;
&lt;br /&gt;
==== 1.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Compltete the Classical Harmonic Osciallator Spreadsheet&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_HO.xls|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For δt=0.01, estimate the positions of maximum error and fit accordingly.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Max Error Graph.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.1:&#039;&#039;&#039; &#039;&#039;A plot of the error in VV algorithm data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
Figure 1.1 shows how the maximum error increases linearly. This can be rationalised by the fact that each cycle of simulation follows on from the last, so the error of the new cycle is combined to the uncertainty in a previous calculation for an older timestep and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Experiment to find the timestep range to ensure the total energy does not change by more than 1% over the course of the simulation. Why is this important?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In simulations such as this, the physical model is considered an isolated system. We are modeling the changes in velocity and thus kinetic energy changes of induvidual particles/atoms over a total timeframe at constant timesteps. As such, the particles are moving around, interacting, transfering energy between each other. However, unless we are changing variables such as Temperature, Number of particles, Volume (density) etc. during a simulation, the overall energy should remain constant. Therefore it is important to monitor the total energy to ensure our model is fitting with our physical understanding.&lt;br /&gt;
&lt;br /&gt;
From experimentation, it can be seen that to limit this total energy change over a simulation, the time step should really be smaller than 0.3. It can be seen in Figure 1.2 how the peaks and thus total energy begin to fluctuate significantly more for 0.3 and above. &lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_En_err_w_timestep.png|thumb|500px|center|&#039;&#039;&#039;Figure 1.2:&#039;&#039;&#039; &#039;&#039;Energy vs Time: a) δt=0.01, b) δt=0.03, c) δt=0.03&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Maths based upon a single Lennard-Jones interaction&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
[[File:JmsD_Maths_1.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.3:&#039;&#039;&#039; &#039;&#039;Answers to the LJ based maths task&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.5 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the number of water molecules in 1 mL under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;Density of water = 1 g/ml&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Molecular weight of wate = 18 g/mol&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Moles in 1 ml, n = 1/18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Number of molecules = n x N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 1/18 x 6.022x10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;3.35x10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;10000/N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = moles of water, n&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Mass of 10000 water molecules, m = n x 18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;The volume, V = m / 1 g/ml &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;2.99x10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.6 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?.  &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The particle should end up in position (0.2,0.1,0.7) after the application of periodic boundary conditions. &lt;br /&gt;
&lt;br /&gt;
This is because, if the number of particles in the box remains constant, if a particle excit the box on one face, it will return from the opposite. In this case, if the particle starts at (0.5,0.5,0.5) in the cubic box ((0,0,0):(1,1,1)) and moves along the vector (0.7,0.6,0.2), it will reappear from the other face, positioned now at (0.2,0.1,0.7).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.7 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; The LJ parameters for argon are &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; = 0.34 nm, &amp;lt;math&amp;gt;\epsilon\ /\ k_B&amp;lt;/math&amp;gt; = 120 K. If the LJ cutoff is r* = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T*=1.5 in real units?  &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;r = 1.088 x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; m&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;T = 180 K&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; = 0.014 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2 Equilibriation ==&lt;br /&gt;
==== 2.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Why do random starting coords cause problems in simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
If particles are placed randomly, there is chance for multiple particles to be placed in the same positions, or at least close too each other. It two particles are close or overlap, there would be very strong resulting interactions. These large forces would caus the model to deviate from its classical behaviour, and will affect properties from energy, to timestep.&lt;br /&gt;
&lt;br /&gt;
Therefore it is wise to start a liquid or gas simulation as a &#039;melt&#039; from particles on lattice points (which can allow random positioning to some degree), e.g. Simple cubic. This ensures particles will begin a suitable distance away from each other.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Prove that lattice spacing of 1.07722 gives a number density of 0.8&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; If lattice spacing is 1.07722, Volume of one cube = 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; If number density is Number / Volume, and there is one particle per cube, number density = 1 / Volume&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; 1 / 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.79999 &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;If instead FCC, and number density of 1.2, what is the length of the cubic uni cell?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; First calculate Volume of the cell: V = Number / number density &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; The Number of particles in a FCC unit cell are 4, so V = 4 / 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; The cube root of the volume will give side length...&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; (4/1.2)&amp;lt;sup&amp;gt;1/3&amp;lt;/sup&amp;gt; = 1.4938 &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the FCC latice, how many atoms would be created by create_atoms&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Assuming no other parameters  (i.e. the box size [Below]) have changed...&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
There should be 4000 atoms created.&lt;br /&gt;
&lt;br /&gt;
If there are 1000 atoms in a 10x10x10 box for a sc lattice that has one atom per unit cell, a lattice such as FCC that has 4 atoms per unit cell should yield 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find and explain the purpose of:&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;mass&#039;&#039; - Sets the mass for the types of atoms, argument(1) is the type, argument(2) is the mass.&lt;br /&gt;
*&#039;&#039;pair_style&#039;&#039; - Calculates the pair interactions (pair potentials defined as interactions between atoms within a certain distance), argument(1) &amp;quot;lj/cut&amp;quot; means this line refers to the global cutoff for all Lennard-Jones interactions, argument(2) defines the distance.&lt;br /&gt;
*&#039;&#039;pair_coeff&#039;&#039; - Provides the interaction coefficients for the interactions between atoms, arguments(1 &amp;amp; 2) refer to the attoms that interact (* means all types 1-&amp;gt;N), and arguments (3 &amp;amp; 4) are those coefficients.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.5 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Given that we are specifying x&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; and v&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt;, which integration algorithm is to be used?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; The Velocity-Verlet Algorithm &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.6 Task ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The purpose of using &#039;&#039;${timestep}&#039;&#039;, or for any other variable for that matter, is that it allows for that property in the simulation to be changed just once in the input file, as opposed to the file being manually altered on every line that variable is called.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.6 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Plot Energy, Temperature and Pressure vs Time for timestep = 0.001&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_0.001all.png|thumb|600px|center|&#039;&#039;&#039;Figure 2.1:&#039;&#039;&#039; &#039;&#039;The data sets from the δt=0.001 initial simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_IntroEnergy.png|thumb|600px|center|&#039;&#039;&#039;Figure 2.2:&#039;&#039;&#039; &#039;&#039;All initial timestep data, Total Energy vs Time&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_IntroEnergyZoomed.png|thumb|600px|center|&#039;&#039;&#039;Figure 2.3:&#039;&#039;&#039; &#039;&#039;Expansion of Figure 2.2 in region Time(0:35)&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Plot all the inital simulations as Energy vs Time, discus the best timestep to progress with.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep chosen for ongoing calculations was 0.0025. The reason being that it was one of only two that provided data showing convergence within the full simulation time (Energy vs Time graph). Of these two timesteps - 0.0025 and 0.001 - the 0.0025 is the better choice to progres with due to it&#039;s slight advantage in computational efficiency. The larger the time step, the fewer data points collected.&lt;br /&gt;
&lt;br /&gt;
[A note should be made about te 0.15 timestep - This is quite clearly a bad choice because instead of converging it diverged...]&lt;br /&gt;
&lt;br /&gt;
== 3 Simmulations under specific conditions ==&lt;br /&gt;
==== 3.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature, T* = 1.5), and two reasonable pressures in Lennard-Jones units.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run these simulations to plot the &#039;Equations of State&#039; [Below].&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The 10 phase points used inn this task were determined by the 5 temperatures (T): 1.6, 1.8, 2.0, 2.2, 2.4 and the pressures (p) 2.4, 2.8. The timestep (δt) chosen was again 0.0025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Npt_1.6_2.4.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Npt_1.6_2.4.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 3.2 Task ====&lt;br /&gt;
&lt;br /&gt;
The temperature ideally needs to be maintained as close to the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, as possible. This is done by multplying every velocity, by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &#039;target temperature&#039; is as stipulated in the input script&lt;br /&gt;
&lt;br /&gt;
The instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, will fluctuate  due to approximations made in the algorithm. &lt;br /&gt;
*If &amp;lt;math&amp;gt;T &amp;gt; \mathfrak{T}&amp;lt;/math&amp;gt;, the E&amp;lt;sub&amp;gt;K&amp;lt;/sub&amp;gt; is too high and thus &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be less than 1.&lt;br /&gt;
*If, by contrast, &amp;lt;math&amp;gt;T &amp;lt; \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;Equipartition theorem&#039; states that on average, every degree of freedom in a system at equilibrium will have K&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T/2 of energy. This sytem has 3 degrees of freedom and as such:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \mathbf{v}_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expressing in terms of the adjustment to target temperature as described above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma \mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Solve the equations for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find out the importance of the three numbers 100 1000 100000.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* 100 is used as the &#039;&#039;Nevery&#039;&#039; argument - This is the number of timesteps between inputing of values.&lt;br /&gt;
* 1000 is used as the &#039;&#039;Nrepeat&#039;&#039; argument - This is the number of times to use the input values to calculate averages.&lt;br /&gt;
* 100000 is used as the &#039;&#039;Nfreq&#039;&#039; argument - The number of timesteps between calculating averages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 {...VARIABLES...}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How much time will this simulate?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;run 100000&#039;&#039; shows the number of timesteps that will be run in the simulation.&lt;br /&gt;
&lt;br /&gt;
This shows that averages in this simulation are calculated only at the end of the simulations, as &#039;&#039;Nfreq&#039;&#039;= &#039;&#039;N&#039;&#039; (run N ...).&lt;br /&gt;
&lt;br /&gt;
==== 3.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Using the output of the simulations in 3.1, plot density as a unction of temperature, for both pressures - (Incl. Error bars + Ideal Gas). Is the simulated density higher or lower than Ideal? Why? Finaly, does the discrepancy increase or decrease w. pressure?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_NpT1.png|thumb|500px|center|&#039;&#039;&#039;Figure 3.1:&#039;&#039;&#039; &#039;&#039;A plot of Average Density vs Average Temperature for two different pressures&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_NpT_wideal.png|thumb|500px|center|&#039;&#039;&#039;Figure 3.2:&#039;&#039;&#039; &#039;&#039;A plot of Average Density vs Average Temperature for two different pressures and their relation to data with the same parameters calculated by the Ideal Gas Law&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
Theoretical results , based on the ideal gas law, give a higher density than the simulated result. (It can also be added that the discrepancy between the ideal and simulated systems increases with pressure.) It can be reasoned that the results provided by the Ideal Gas Law are higher due to the fact that particle-particle interactions are not consided.This means the repulsion that would be experienced by the particles moving closer to each other are not expressed, as such, particles the distance between particles can decrease without energyetic effects, thus increasing the density.&lt;br /&gt;
&lt;br /&gt;
== 4 Calculation of heat capacities using statistical physics ==&lt;br /&gt;
==== 4.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simulations and plot C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V as a function of temperature. Is this as expected?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Cv_2.0_0.2.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Cv_2.0_0.2.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
For this section, 5 simulations were run for each of the two densities: 0.2, 0.8. These simulations corresponded to each of the respective temperatures: 2.0, 2.2, 2.4, 2.6, 2.8 (in reduced units). The desired results of these simulations were the calculated values of the Heat Capacity at constant volume, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;. The results can be seen in Figure 4.1 as a funtion of the average temperatures.&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Cv graph1.png|thumb|500px|center|&#039;&#039;&#039;Figure 4.1:&#039;&#039;&#039; &#039;&#039;A plot comparing Heat Capacity/Volume vs Average Temperature for two different densities&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
These graphs do indeed follow the trend expected, that is similar to the trend seen in a crystalline solid for example. The Heat Capacity is proportional to 1/T&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; [As seen in the Equations below] and as such a negative trend should be observed. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With reagrds to density, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V increases as the density increases - which is again as expected - because heat capacity is dependant on the amount of material per volume, and thus a denser material (with the same volume) has more mass or moles per unit voulume.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 5 Radial Distribution Functions ==&lt;br /&gt;
==== 5.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; From simulations of the Lennard-Jones system in the three phases, Compute &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; in VMD. Discuss the differences in the 3 RDFs and thus what this means about the structure in each phase.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the solid phase, illustrate which lattics sites the first 3 peaks correspond to. What is the Lattice spacing? What is the Coordination number for each of the first three peaks?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The initial parameters for the simulations, in order to specify the correct phases were:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; Temperature: (For all phases) = 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Densities: (Solid) = 1.50, (Liquid) = 0.85, (Vapour) = 0.01 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Finally, to provide the initial positions of atoms, the simple cubic model was used for Liquid and Vapour, but for Solid FCC was used.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These parameters were calculated by examining the Lennar-Jones phase diagram found in literature. [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 &amp;lt;sup&amp;gt;[2] &amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_g(r).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.1:&#039;&#039;&#039; &#039;&#039;The Radial Distribution Functions of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Int(g(r))dr.png|thumb|500px|center|&#039;&#039;&#039;Figure 5.2:&#039;&#039;&#039; &#039;&#039;The Integrals of the RDFs of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Solid3(g(r)).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.3:&#039;&#039;&#039; &#039;&#039;The RDF of the solid, paying particular attention to the first 3 peaks&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As it can be seen in Figure 5.1, the RDFs are very different for each phase. The area under the curves is the probability of finding another particle at that distance from the particle of reference, thus peaks are distances away from the reference that there is increased probability of encountering another.&lt;br /&gt;
&lt;br /&gt;
For example, the Vapour phase [as shown in blue in Figure 5.1] is largely simple. Whereas, the RDF of the liquid [purple] has a series of fairly ordered peaks of decresing height. This can be explained by the ease of motion of these two phases. Vapour particles are very spread out in space and have a lot more motion than liquids which are held together and inplace by various intermolecular/atomic bonds. Because of this by moving away fro a reference particle in the vapour phase, there is a very low probability of encountaring another particle. Liquids are a lot more ordered than gases and coordination spheres are shown by the fairly smooth peaks as r increases. There is reasonable probability of finsing another particle in the first coordination sphere, but this decreases as you move away further.&lt;br /&gt;
&lt;br /&gt;
Solids, on the other hand, have significantly greater order. The particles are generally held in a rather rigid lattice and their positions can be considered fairly fixed. In Figure 5.1 you can clearly see sharp peaks on the RDF as you move away from the reference, corresponding to neighbouring atoms. These come at regular distance intervals, which are the length of a unit cell away - This RDF in particular representing that of an FCC lattice. The area of these peaks does deacreas with distance somewhat as there is some movement, such as vibrations (especially if the particle&#039;s vibrations about the lattice point are coupled with vibrations of the lattice as a whole), that cause those further out to be proportionaly missalligned from their perfect lattice position.&lt;br /&gt;
&lt;br /&gt;
== 6 Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
==== 6.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simlations for the three phases, to calculate the mean squared displacement and velocity autocorrelation functions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 6.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Measure D from it&#039;s connection to the MSD, for simulations and data for approx. one million atom simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equation for the Diffusion Coefficient, &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
However, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be much more simply estimated by fitting the linear section of a Total MSD vs Timestep graph and dividing by 6.&lt;br /&gt;
This gives the following values for D (in reduced units) for the smaller simulations carried out by myself:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.31x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.33&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 1.55&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.1-6.3]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_my_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.1:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Solid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.2:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Liquid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.3:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Vapour simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
In comparison below are the values for D (in reduced units) for the larger (approx. 1 million atom) data supplied:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.71x10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.75&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 6.28&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.4-6.6]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_mil_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.4:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Solid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_mil_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.5:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Liquid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsDil_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.6:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Vapour MSD data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 7 References ==&lt;br /&gt;
 1.  LAMMPS Manual, http://lammps.sandia.gov/doc/Section_commands.html#lammps-input-script , accessed November 2016&lt;br /&gt;
 2.  JP Hansen, L Verlet, Phys Rev, 184, 1969, http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=590416</id>
		<title>Rep:Mod:Yr3LiquidSimJmsD</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=590416"/>
		<updated>2017-02-24T11:57:20Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: /* 5.1 Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Jack Dawson - Yr3 Comp: Liquid Sim.=&lt;br /&gt;
&lt;br /&gt;
== 1 Theory ==&lt;br /&gt;
&lt;br /&gt;
==== 1.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Compltete the Classical Harmonic Osciallator Spreadsheet&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_HO.xls|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For δt=0.01, estimate the positions of maximum error and fit accordingly.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Max Error Graph.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.1:&#039;&#039;&#039; &#039;&#039;A plot of the error in VV algorithm data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
Figure 1.1 shows how the maximum error increases linearly. This can be rationalised by the fact that each cycle of simulation follows on from the last, so the error of the new cycle is combined to the uncertainty in a previous calculation for an older timestep and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Experiment to find the timestep range to ensure the total energy does not change by more than 1% over the course of the simulation. Why is this important?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In simulations such as this, the physical model is considered an isolated system. We are modeling the changes in velocity and thus kinetic energy changes of induvidual particles/atoms over a total timeframe at constant timesteps. As such, the particles are moving around, interacting, transfering energy between each other. However, unless we are changing variables such as Temperature, Number of particles, Volume (density) etc. during a simulation, the overall energy should remain constant. Therefore it is important to monitor the total energy to ensure our model is fitting with our physical understanding.&lt;br /&gt;
&lt;br /&gt;
From experimentation, it can be seen that to limit this total energy change over a simulation, the time step should really be smaller than 0.3. It can be seen in Figure 1.2 how the peaks and thus total energy begin to fluctuate significantly more for 0.3 and above. &lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_En_err_w_timestep.png|thumb|500px|center|&#039;&#039;&#039;Figure 1.2:&#039;&#039;&#039; &#039;&#039;Energy vs Time: a) δt=0.01, b) δt=0.03, c) δt=0.03&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Maths based upon a single Lennard-Jones interaction&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
[[File:JmsD_Maths_1.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.3:&#039;&#039;&#039; &#039;&#039;Answers to the LJ based maths task&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.5 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the number of water molecules in 1 mL under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;Density of water = 1 g/ml&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Molecular weight of wate = 18 g/mol&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Moles in 1 ml, n = 1/18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Number of molecules = n x N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 1/18 x 6.022x10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;3.35x10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;10000/N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = moles of water, n&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Mass of 10000 water molecules, m = n x 18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;The volume, V = m / 1 g/ml &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;2.99x10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.6 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?.  &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The particle should end up in position (0.2,0.1,0.7) after the application of periodic boundary conditions. &lt;br /&gt;
&lt;br /&gt;
This is because, if the number of particles in the box remains constant, if a particle excit the box on one face, it will return from the opposite. In this case, if the particle starts at (0.5,0.5,0.5) in the cubic box ((0,0,0):(1,1,1)) and moves along the vector (0.7,0.6,0.2), it will reappear from the other face, positioned now at (0.2,0.1,0.7).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.7 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; The LJ parameters for argon are &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; = 0.34 nm, &amp;lt;math&amp;gt;\epsilon\ /\ k_B&amp;lt;/math&amp;gt; = 120 K. If the LJ cutoff is r* = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T*=1.5 in real units?  &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;r = 1.088 x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; m&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;T = 180 K&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; = 0.014 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2 Equilibriation ==&lt;br /&gt;
==== 2.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Why do random starting coords cause problems in simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
If particles are placed randomly, there is chance for multiple particles to be placed in the same positions, or at least close too each other. It two particles are close or overlap, there would be very strong resulting interactions. These large forces would caus the model to deviate from its classical behaviour, and will affect properties from energy, to timestep.&lt;br /&gt;
&lt;br /&gt;
Therefore it is wise to start a liquid or gas simulation as a &#039;melt&#039; from particles on lattice points (which can allow random positioning to some degree), e.g. Simple cubic. This ensures particles will begin a suitable distance away from each other.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Prove that lattice spacing of 1.07722 gives a number density of 0.8&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; If lattice spacing is 1.07722, Volume of one cube = 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; If number density is Number / Volume, and there is one particle per cube, number density = 1 / Volume&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; 1 / 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.79999 &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;If instead FCC, and number density of 1.2, what is the length of the cubic uni cell?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; First calculate Volume of the cell: V = Number / number density &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; The Number of particles in a FCC unit cell are 4, so V = 4 / 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; The cube root of the volume will give side length...&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; (4/1.2)&amp;lt;sup&amp;gt;1/3&amp;lt;/sup&amp;gt; = 1.4938 &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the FCC latice, how many atoms would be created by create_atoms&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Assuming no other parameters  (i.e. the box size [Below]) have changed...&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
There should be 4000 atoms created.&lt;br /&gt;
&lt;br /&gt;
If there are 1000 atoms in a 10x10x10 box for a sc lattice that has one atom per unit cell, a lattice such as FCC that has 4 atoms per unit cell should yield 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find and explain the purpose of:&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;mass&#039;&#039; - Sets the mass for the types of atoms, argument(1) is the type, argument(2) is the mass.&lt;br /&gt;
*&#039;&#039;pair_style&#039;&#039; - Calculates the pair interactions (pair potentials defined as interactions between atoms within a certain distance), argument(1) &amp;quot;lj/cut&amp;quot; means this line refers to the global cutoff for all Lennard-Jones interactions, argument(2) defines the distance.&lt;br /&gt;
*&#039;&#039;pair_coeff&#039;&#039; - Provides the interaction coefficients for the interactions between atoms, arguments(1 &amp;amp; 2) refer to the attoms that interact (* means all types 1-&amp;gt;N), and arguments (3 &amp;amp; 4) are those coefficients.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.5 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Given that we are specifying x&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; and v&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt;, which integration algorithm is to be used?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; The Velocity-Verlet Algorithm &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.6 Task ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The purpose of using &#039;&#039;${timestep}&#039;&#039;, or for any other variable for that matter, is that it allows for that property in the simulation to be changed just once in the input file, as opposed to the file being manually altered on every line that variable is called.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.6 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Plot Energy, Temperature and Pressure vs Time for timestep = 0.001&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_0.001all.png|thumb|600px|center|&#039;&#039;&#039;Figure 2.1:&#039;&#039;&#039; &#039;&#039;The data sets from the δt=0.001 initial simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_IntroEnergy.png|thumb|600px|center|&#039;&#039;&#039;Figure 2.2:&#039;&#039;&#039; &#039;&#039;All initial timestep data, Total Energy vs Time&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_IntroEnergyZoomed.png|thumb|600px|center|&#039;&#039;&#039;Figure 2.3:&#039;&#039;&#039; &#039;&#039;Expansion of Figure 2.2 in region Time(0:35)&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Plot all the inital simulations as Energy vs Time, discus the best timestep to progress with.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep chosen for ongoing calculations was 0.0025. The reason being that it was one of only two that provided data showing convergence within the full simulation time (Energy vs Time graph). Of these two timesteps - 0.0025 and 0.001 - the 0.0025 is the better choice to progres with due to it&#039;s slight advantage in computational efficiency. The larger the time step, the fewer data points collected.&lt;br /&gt;
&lt;br /&gt;
[A note should be made about te 0.15 timestep - This is quite clearly a bad choice because instead of converging it diverged...]&lt;br /&gt;
&lt;br /&gt;
== 3 Simmulations under specific conditions ==&lt;br /&gt;
==== 3.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature, T* = 1.5), and two reasonable pressures in Lennard-Jones units.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run these simulations to plot the &#039;Equations of State&#039; [Below].&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The 10 phase points used inn this task were determined by the 5 temperatures (T): 1.6, 1.8, 2.0, 2.2, 2.4 and the pressures (p) 2.4, 2.8. The timestep (δt) chosen was again 0.0025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Npt_1.6_2.4.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Npt_1.6_2.4.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 3.2 Task ====&lt;br /&gt;
&lt;br /&gt;
The temperature ideally needs to be maintained as close to the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, as possible. This is done by multplying every velocity, by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &#039;target temperature&#039; is as stipulated in the input script&lt;br /&gt;
&lt;br /&gt;
The instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, will fluctuate  due to approximations made in the algorithm. &lt;br /&gt;
*If &amp;lt;math&amp;gt;T &amp;gt; \mathfrak{T}&amp;lt;/math&amp;gt;, the E&amp;lt;sub&amp;gt;K&amp;lt;/sub&amp;gt; is too high and thus &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be less than 1.&lt;br /&gt;
*If, by contrast, &amp;lt;math&amp;gt;T &amp;lt; \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;Equipartition theorem&#039; states that on average, every degree of freedom in a system at equilibrium will have K&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T/2 of energy. This sytem has 3 degrees of freedom and as such:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \mathbf{v}_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expressing in terms of the adjustment to target temperature as described above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma \mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Solve the equations for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find out the importance of the three numbers 100 1000 100000.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* 100 is used as the &#039;&#039;Nevery&#039;&#039; argument - This is the number of timesteps between inputing of values.&lt;br /&gt;
* 1000 is used as the &#039;&#039;Nrepeat&#039;&#039; argument - This is the number of times to use the input values to calculate averages.&lt;br /&gt;
* 100000 is used as the &#039;&#039;Nfreq&#039;&#039; argument - The number of timesteps between calculating averages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 {...VARIABLES...}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How much time will this simulate?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;run 100000&#039;&#039; shows the number of timesteps that will be run in the simulation.&lt;br /&gt;
&lt;br /&gt;
This shows that averages in this simulation are calculated only at the end of the simulations, as &#039;&#039;Nfreq&#039;&#039;= &#039;&#039;N&#039;&#039; (run N ...).&lt;br /&gt;
&lt;br /&gt;
==== 3.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Using the output of the simulations in 3.1, plot density as a unction of temperature, for both pressures - (Incl. Error bars + Ideal Gas). Is the simulated density higher or lower than Ideal? Why? Finaly, does the discrepancy increase or decrease w. pressure?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_NpT1.png|thumb|500px|center|&#039;&#039;&#039;Figure 3.1:&#039;&#039;&#039; &#039;&#039;A plot of Average Density vs Average Temperature for two different pressures&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_NpT_wideal.png|thumb|500px|center|&#039;&#039;&#039;Figure 3.2:&#039;&#039;&#039; &#039;&#039;A plot of Average Density vs Average Temperature for two different pressures and their relation to data with the same parameters calculated by the Ideal Gas Law&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
Theoretical results , based on the ideal gas law, give a higher density than the simulated result. (It can also be added that the discrepancy between the ideal and simulated systems increases with pressure.) It can be reasoned that the results provided by the Ideal Gas Law are higher due to the fact that particle-particle interactions are not consided.This means the repulsion that would be experienced by the particles moving closer to each other are not expressed, as such, particles the distance between particles can decrease without energyetic effects, thus increasing the density.&lt;br /&gt;
&lt;br /&gt;
== 4 Calculation of heat capacities using statistical physics ==&lt;br /&gt;
==== 4.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simulations and plot C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V as a function of temperature. Is this as expected?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Cv_2.0_0.2.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Cv_2.0_0.2.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
For this section, 5 simulations were run for each of the two densities: 0.2, 0.8. These simulations corresponded to each of the respective temperatures: 2.0, 2.2, 2.4, 2.6, 2.8 (in reduced units). The desired results of these simulations were the calculated values of the Heat Capacity at constant volume, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;. The results can be seen in Figure 4.1 as a funtion of the average temperatures.&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Cv graph1.png|thumb|500px|center|&#039;&#039;&#039;Figure 4.1:&#039;&#039;&#039; &#039;&#039;A plot comparing Heat Capacity/Volume vs Average Temperature for two different densities&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
These graphs do indeed follow the trend expected, that is similar to the trend seen in a crystalline solid for example. The Heat Capacity is proportional to 1/T&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; [As seen in the Equations below] and as such a negative trend should be observed. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With reagrds to density, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V increases as the density increases - which is again as expected - because heat capacity is dependant on the amount of material per volume, and thus a denser material (with the same volume) has more mass or moles per unit voulume.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 5 Radial Distribution Functions ==&lt;br /&gt;
==== 5.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; From simulations of the Lennard-Jones system in the three phases, Compute &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; in VMD. Discuss the differences in the 3 RDFs and thus what this means about the structure in each phase.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the solid phase, illustrate which lattics sites the first 3 peaks correspond to. What is the Lattice spacing? What is the Coordination number for each of the first three peaks?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The initial parameters for the simulations, in order to specify the correct phases were:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; Temperature: (For all phases) = 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Densities: (Solid) = 1.50, (Liquid) = 0.85, (Vapour) = 0.01 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Finally, to provide the initial positions of atoms, the simple cubic model was used for Liquid and Vapour, but for Solid FCC was used.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These parameters were calculated by examining the Lennar-Jones phase diagram found in literature. [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 &amp;lt;sup&amp;gt;[2] &amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_g(r).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.1:&#039;&#039;&#039; &#039;&#039;The Radial Distribution Functions of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Int(g(r))dr.png|thumb|500px|center|&#039;&#039;&#039;Figure 5.2:&#039;&#039;&#039; &#039;&#039;The Integrals of the RDFs of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Solid3(g(r)).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.3:&#039;&#039;&#039; &#039;&#039;The RDF of the solid, paying particular attention to the first 3 peaks&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As it can be seen in Figure 5.1, the RDFs are very different for each phase. The area under the curves is the probability of finding another particle at that distance from the particle of reference, thus peaks are distances away from the reference that there is increased probability of encountering another.&lt;br /&gt;
&lt;br /&gt;
For example, the Vapour phase [as shown in blue in Figure 5.1] is largely simple. Whereas, the RDF of the liquid [purple] has a series of fairly ordered peaks of decresing height. This can be explained by the ease of motion of these two phases. Vapour particles are very spread out in space and have a lot more motion than liquids which are held together and inplace by various intermolecular/atomic bonds. Because of this by moving away fro a reference particle in the vapour phase, there is a very low probability of encountaring another particle. Liquids are a lot more ordered than gases and coordination spheres are shown by the fairly smooth peaks as r increases. There is reasonable probability of finsing another particle in the first coordination sphere, but this decreases as you move away further.&lt;br /&gt;
&lt;br /&gt;
Solids, on the other hand, have significantly greater order. The particles are generally held in a rather rigid lattice and their positions can be considered fairly fixed. In Figure 5.1 you can clearly see sharp peaks on the RDF as you move away from the reference, corresponding to neighbouring atoms. These come at regular distance intervals, which are the length of a unit cell away - This RDF in particular representing that of an FCC lattice. The area of these peaks does deacreas with distance somewhat as there is some movement, such as vibrations if the particles coupled with vibrations of the lattice as a whole, that cause those further out to be proportionaly missalligned from their perfect lattice position.&lt;br /&gt;
&lt;br /&gt;
== 6 Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
==== 6.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simlations for the three phases, to calculate the mean squared displacement and velocity autocorrelation functions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 6.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Measure D from it&#039;s connection to the MSD, for simulations and data for approx. one million atom simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equation for the Diffusion Coefficient, &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
However, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be much more simply estimated by fitting the linear section of a Total MSD vs Timestep graph and dividing by 6.&lt;br /&gt;
This gives the following values for D (in reduced units) for the smaller simulations carried out by myself:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.31x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.33&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 1.55&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.1-6.3]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_my_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.1:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Solid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.2:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Liquid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.3:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Vapour simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
In comparison below are the values for D (in reduced units) for the larger (approx. 1 million atom) data supplied:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.71x10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.75&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 6.28&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.4-6.6]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_mil_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.4:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Solid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_mil_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.5:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Liquid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsDil_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.6:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Vapour MSD data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 7 References ==&lt;br /&gt;
 1.  LAMMPS Manual, http://lammps.sandia.gov/doc/Section_commands.html#lammps-input-script , accessed November 2016&lt;br /&gt;
 2.  JP Hansen, L Verlet, Phys Rev, 184, 1969, http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=590409</id>
		<title>Rep:Mod:Yr3LiquidSimJmsD</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=590409"/>
		<updated>2017-02-24T11:55:30Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: /* 5 Radial Distribution Functions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Jack Dawson - Yr3 Comp: Liquid Sim.=&lt;br /&gt;
&lt;br /&gt;
== 1 Theory ==&lt;br /&gt;
&lt;br /&gt;
==== 1.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Compltete the Classical Harmonic Osciallator Spreadsheet&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_HO.xls|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For δt=0.01, estimate the positions of maximum error and fit accordingly.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Max Error Graph.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.1:&#039;&#039;&#039; &#039;&#039;A plot of the error in VV algorithm data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
Figure 1.1 shows how the maximum error increases linearly. This can be rationalised by the fact that each cycle of simulation follows on from the last, so the error of the new cycle is combined to the uncertainty in a previous calculation for an older timestep and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Experiment to find the timestep range to ensure the total energy does not change by more than 1% over the course of the simulation. Why is this important?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In simulations such as this, the physical model is considered an isolated system. We are modeling the changes in velocity and thus kinetic energy changes of induvidual particles/atoms over a total timeframe at constant timesteps. As such, the particles are moving around, interacting, transfering energy between each other. However, unless we are changing variables such as Temperature, Number of particles, Volume (density) etc. during a simulation, the overall energy should remain constant. Therefore it is important to monitor the total energy to ensure our model is fitting with our physical understanding.&lt;br /&gt;
&lt;br /&gt;
From experimentation, it can be seen that to limit this total energy change over a simulation, the time step should really be smaller than 0.3. It can be seen in Figure 1.2 how the peaks and thus total energy begin to fluctuate significantly more for 0.3 and above. &lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_En_err_w_timestep.png|thumb|500px|center|&#039;&#039;&#039;Figure 1.2:&#039;&#039;&#039; &#039;&#039;Energy vs Time: a) δt=0.01, b) δt=0.03, c) δt=0.03&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Maths based upon a single Lennard-Jones interaction&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
[[File:JmsD_Maths_1.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.3:&#039;&#039;&#039; &#039;&#039;Answers to the LJ based maths task&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.5 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the number of water molecules in 1 mL under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;Density of water = 1 g/ml&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Molecular weight of wate = 18 g/mol&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Moles in 1 ml, n = 1/18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Number of molecules = n x N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 1/18 x 6.022x10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;3.35x10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;10000/N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = moles of water, n&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Mass of 10000 water molecules, m = n x 18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;The volume, V = m / 1 g/ml &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;2.99x10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.6 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?.  &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The particle should end up in position (0.2,0.1,0.7) after the application of periodic boundary conditions. &lt;br /&gt;
&lt;br /&gt;
This is because, if the number of particles in the box remains constant, if a particle excit the box on one face, it will return from the opposite. In this case, if the particle starts at (0.5,0.5,0.5) in the cubic box ((0,0,0):(1,1,1)) and moves along the vector (0.7,0.6,0.2), it will reappear from the other face, positioned now at (0.2,0.1,0.7).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.7 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; The LJ parameters for argon are &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; = 0.34 nm, &amp;lt;math&amp;gt;\epsilon\ /\ k_B&amp;lt;/math&amp;gt; = 120 K. If the LJ cutoff is r* = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T*=1.5 in real units?  &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;r = 1.088 x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; m&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;T = 180 K&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; = 0.014 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2 Equilibriation ==&lt;br /&gt;
==== 2.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Why do random starting coords cause problems in simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
If particles are placed randomly, there is chance for multiple particles to be placed in the same positions, or at least close too each other. It two particles are close or overlap, there would be very strong resulting interactions. These large forces would caus the model to deviate from its classical behaviour, and will affect properties from energy, to timestep.&lt;br /&gt;
&lt;br /&gt;
Therefore it is wise to start a liquid or gas simulation as a &#039;melt&#039; from particles on lattice points (which can allow random positioning to some degree), e.g. Simple cubic. This ensures particles will begin a suitable distance away from each other.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Prove that lattice spacing of 1.07722 gives a number density of 0.8&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; If lattice spacing is 1.07722, Volume of one cube = 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; If number density is Number / Volume, and there is one particle per cube, number density = 1 / Volume&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; 1 / 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.79999 &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;If instead FCC, and number density of 1.2, what is the length of the cubic uni cell?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; First calculate Volume of the cell: V = Number / number density &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; The Number of particles in a FCC unit cell are 4, so V = 4 / 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; The cube root of the volume will give side length...&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; (4/1.2)&amp;lt;sup&amp;gt;1/3&amp;lt;/sup&amp;gt; = 1.4938 &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the FCC latice, how many atoms would be created by create_atoms&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Assuming no other parameters  (i.e. the box size [Below]) have changed...&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
There should be 4000 atoms created.&lt;br /&gt;
&lt;br /&gt;
If there are 1000 atoms in a 10x10x10 box for a sc lattice that has one atom per unit cell, a lattice such as FCC that has 4 atoms per unit cell should yield 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find and explain the purpose of:&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;mass&#039;&#039; - Sets the mass for the types of atoms, argument(1) is the type, argument(2) is the mass.&lt;br /&gt;
*&#039;&#039;pair_style&#039;&#039; - Calculates the pair interactions (pair potentials defined as interactions between atoms within a certain distance), argument(1) &amp;quot;lj/cut&amp;quot; means this line refers to the global cutoff for all Lennard-Jones interactions, argument(2) defines the distance.&lt;br /&gt;
*&#039;&#039;pair_coeff&#039;&#039; - Provides the interaction coefficients for the interactions between atoms, arguments(1 &amp;amp; 2) refer to the attoms that interact (* means all types 1-&amp;gt;N), and arguments (3 &amp;amp; 4) are those coefficients.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.5 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Given that we are specifying x&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; and v&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt;, which integration algorithm is to be used?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; The Velocity-Verlet Algorithm &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.6 Task ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The purpose of using &#039;&#039;${timestep}&#039;&#039;, or for any other variable for that matter, is that it allows for that property in the simulation to be changed just once in the input file, as opposed to the file being manually altered on every line that variable is called.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.6 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Plot Energy, Temperature and Pressure vs Time for timestep = 0.001&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_0.001all.png|thumb|600px|center|&#039;&#039;&#039;Figure 2.1:&#039;&#039;&#039; &#039;&#039;The data sets from the δt=0.001 initial simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_IntroEnergy.png|thumb|600px|center|&#039;&#039;&#039;Figure 2.2:&#039;&#039;&#039; &#039;&#039;All initial timestep data, Total Energy vs Time&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_IntroEnergyZoomed.png|thumb|600px|center|&#039;&#039;&#039;Figure 2.3:&#039;&#039;&#039; &#039;&#039;Expansion of Figure 2.2 in region Time(0:35)&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Plot all the inital simulations as Energy vs Time, discus the best timestep to progress with.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep chosen for ongoing calculations was 0.0025. The reason being that it was one of only two that provided data showing convergence within the full simulation time (Energy vs Time graph). Of these two timesteps - 0.0025 and 0.001 - the 0.0025 is the better choice to progres with due to it&#039;s slight advantage in computational efficiency. The larger the time step, the fewer data points collected.&lt;br /&gt;
&lt;br /&gt;
[A note should be made about te 0.15 timestep - This is quite clearly a bad choice because instead of converging it diverged...]&lt;br /&gt;
&lt;br /&gt;
== 3 Simmulations under specific conditions ==&lt;br /&gt;
==== 3.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature, T* = 1.5), and two reasonable pressures in Lennard-Jones units.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run these simulations to plot the &#039;Equations of State&#039; [Below].&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The 10 phase points used inn this task were determined by the 5 temperatures (T): 1.6, 1.8, 2.0, 2.2, 2.4 and the pressures (p) 2.4, 2.8. The timestep (δt) chosen was again 0.0025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Npt_1.6_2.4.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Npt_1.6_2.4.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 3.2 Task ====&lt;br /&gt;
&lt;br /&gt;
The temperature ideally needs to be maintained as close to the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, as possible. This is done by multplying every velocity, by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &#039;target temperature&#039; is as stipulated in the input script&lt;br /&gt;
&lt;br /&gt;
The instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, will fluctuate  due to approximations made in the algorithm. &lt;br /&gt;
*If &amp;lt;math&amp;gt;T &amp;gt; \mathfrak{T}&amp;lt;/math&amp;gt;, the E&amp;lt;sub&amp;gt;K&amp;lt;/sub&amp;gt; is too high and thus &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be less than 1.&lt;br /&gt;
*If, by contrast, &amp;lt;math&amp;gt;T &amp;lt; \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;Equipartition theorem&#039; states that on average, every degree of freedom in a system at equilibrium will have K&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T/2 of energy. This sytem has 3 degrees of freedom and as such:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \mathbf{v}_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expressing in terms of the adjustment to target temperature as described above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma \mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Solve the equations for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find out the importance of the three numbers 100 1000 100000.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* 100 is used as the &#039;&#039;Nevery&#039;&#039; argument - This is the number of timesteps between inputing of values.&lt;br /&gt;
* 1000 is used as the &#039;&#039;Nrepeat&#039;&#039; argument - This is the number of times to use the input values to calculate averages.&lt;br /&gt;
* 100000 is used as the &#039;&#039;Nfreq&#039;&#039; argument - The number of timesteps between calculating averages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 {...VARIABLES...}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How much time will this simulate?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;run 100000&#039;&#039; shows the number of timesteps that will be run in the simulation.&lt;br /&gt;
&lt;br /&gt;
This shows that averages in this simulation are calculated only at the end of the simulations, as &#039;&#039;Nfreq&#039;&#039;= &#039;&#039;N&#039;&#039; (run N ...).&lt;br /&gt;
&lt;br /&gt;
==== 3.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Using the output of the simulations in 3.1, plot density as a unction of temperature, for both pressures - (Incl. Error bars + Ideal Gas). Is the simulated density higher or lower than Ideal? Why? Finaly, does the discrepancy increase or decrease w. pressure?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_NpT1.png|thumb|500px|center|&#039;&#039;&#039;Figure 3.1:&#039;&#039;&#039; &#039;&#039;A plot of Average Density vs Average Temperature for two different pressures&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_NpT_wideal.png|thumb|500px|center|&#039;&#039;&#039;Figure 3.2:&#039;&#039;&#039; &#039;&#039;A plot of Average Density vs Average Temperature for two different pressures and their relation to data with the same parameters calculated by the Ideal Gas Law&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
Theoretical results , based on the ideal gas law, give a higher density than the simulated result. (It can also be added that the discrepancy between the ideal and simulated systems increases with pressure.) It can be reasoned that the results provided by the Ideal Gas Law are higher due to the fact that particle-particle interactions are not consided.This means the repulsion that would be experienced by the particles moving closer to each other are not expressed, as such, particles the distance between particles can decrease without energyetic effects, thus increasing the density.&lt;br /&gt;
&lt;br /&gt;
== 4 Calculation of heat capacities using statistical physics ==&lt;br /&gt;
==== 4.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simulations and plot C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V as a function of temperature. Is this as expected?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Cv_2.0_0.2.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Cv_2.0_0.2.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
For this section, 5 simulations were run for each of the two densities: 0.2, 0.8. These simulations corresponded to each of the respective temperatures: 2.0, 2.2, 2.4, 2.6, 2.8 (in reduced units). The desired results of these simulations were the calculated values of the Heat Capacity at constant volume, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;. The results can be seen in Figure 4.1 as a funtion of the average temperatures.&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Cv graph1.png|thumb|500px|center|&#039;&#039;&#039;Figure 4.1:&#039;&#039;&#039; &#039;&#039;A plot comparing Heat Capacity/Volume vs Average Temperature for two different densities&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
These graphs do indeed follow the trend expected, that is similar to the trend seen in a crystalline solid for example. The Heat Capacity is proportional to 1/T&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; [As seen in the Equations below] and as such a negative trend should be observed. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With reagrds to density, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V increases as the density increases - which is again as expected - because heat capacity is dependant on the amount of material per volume, and thus a denser material (with the same volume) has more mass or moles per unit voulume.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 5 Radial Distribution Functions ==&lt;br /&gt;
==== 5.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; From simulations of the Lennard-Jones system in the three phases, Compute &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; in VMD. Discuss the differences in the 3 RDFs and thus what this means about the structure in each phase.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the solid phase, illustrate which lattics sites the first 3 peaks correspond to. What is the Lattice spacing? What is the Coordination number for each of the first three peaks?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The initial parameters for the simulations, in order to specify the correct phases were:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; Temperature: (For all phases) = 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Densities: (Solid) = 1.50, (Liquid) = 0.85, (Vapour) = 0.01 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Finally, to provide the initial positions of atoms, the simple cubic model was used for Liquid and Vapour, but for Solid FCC was used.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These parameters were calculated by examining the Lennar-Jones phase diagram found in literature. [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 &amp;lt;sup&amp;gt;[2] &amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_g(r).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.1:&#039;&#039;&#039; &#039;&#039;The Radial Distribution Functions of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Int(g(r))dr.png|thumb|500px|center|&#039;&#039;&#039;Figure 5.2:&#039;&#039;&#039; &#039;&#039;The Integrals of the RDFs of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Solid3(g(r)).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.3:&#039;&#039;&#039; &#039;&#039;The RDF of the solid, paying particular attention to the first 3 peaks&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As it can be seen in Figure 5.1, the RDFs are very different for each phase. The area under the curves is the probability of finding another particle at that distance from the particle of reference, thus peaks are distances away from the reference that there is increased probability of encountering another.&lt;br /&gt;
&lt;br /&gt;
For example, the Vapour phase [as shown in blue in Figure 5.1] is largely simple. Whereas, the RDF of the liquid [purple] has a series of fairly ordered peaks of decresing height. This can be explained by the ease of motion of these two phases. Vapour particles are very spread out in space and have a lot more motion than liquids which are held together and inplace by various intermolecular/atomic bonds. Because of this by moving away fro a reference particle in the vapour phase, there is a very low probability of encountaring another particle. Liquids are a lot more ordered than gases and coordination spheres are shown by the fairly smooth peaks as r increases. There is reasonable probability of finsing another particle in the first coordination sphere, but this decreases as you move away further.&lt;br /&gt;
&lt;br /&gt;
Solids, on the other hand, have significantly greater order. The particles are generally held in a rather rigid lattice and their positions can be considered fairly fixed. In Figure 5.1 you can clearly see sharp peaks on the RDF as you move away from the reference, corresponding to neighbouring atoms. These come at regular distance intervals, which are the length of a unit cell away - This RDF in particular representing that of an FCC lattice. The area of these peaks does deacreas&lt;br /&gt;
&lt;br /&gt;
== 6 Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
==== 6.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simlations for the three phases, to calculate the mean squared displacement and velocity autocorrelation functions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 6.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Measure D from it&#039;s connection to the MSD, for simulations and data for approx. one million atom simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equation for the Diffusion Coefficient, &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
However, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be much more simply estimated by fitting the linear section of a Total MSD vs Timestep graph and dividing by 6.&lt;br /&gt;
This gives the following values for D (in reduced units) for the smaller simulations carried out by myself:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.31x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.33&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 1.55&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.1-6.3]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_my_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.1:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Solid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.2:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Liquid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.3:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Vapour simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
In comparison below are the values for D (in reduced units) for the larger (approx. 1 million atom) data supplied:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.71x10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.75&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 6.28&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.4-6.6]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_mil_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.4:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Solid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_mil_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.5:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Liquid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsDil_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.6:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Vapour MSD data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 7 References ==&lt;br /&gt;
 1.  LAMMPS Manual, http://lammps.sandia.gov/doc/Section_commands.html#lammps-input-script , accessed November 2016&lt;br /&gt;
 2.  JP Hansen, L Verlet, Phys Rev, 184, 1969, http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=590369</id>
		<title>Rep:Mod:Yr3LiquidSimJmsD</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=590369"/>
		<updated>2017-02-24T11:48:50Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: /* 5.1 Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Jack Dawson - Yr3 Comp: Liquid Sim.=&lt;br /&gt;
&lt;br /&gt;
== 1 Theory ==&lt;br /&gt;
&lt;br /&gt;
==== 1.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Compltete the Classical Harmonic Osciallator Spreadsheet&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_HO.xls|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For δt=0.01, estimate the positions of maximum error and fit accordingly.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Max Error Graph.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.1:&#039;&#039;&#039; &#039;&#039;A plot of the error in VV algorithm data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
Figure 1.1 shows how the maximum error increases linearly. This can be rationalised by the fact that each cycle of simulation follows on from the last, so the error of the new cycle is combined to the uncertainty in a previous calculation for an older timestep and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Experiment to find the timestep range to ensure the total energy does not change by more than 1% over the course of the simulation. Why is this important?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In simulations such as this, the physical model is considered an isolated system. We are modeling the changes in velocity and thus kinetic energy changes of induvidual particles/atoms over a total timeframe at constant timesteps. As such, the particles are moving around, interacting, transfering energy between each other. However, unless we are changing variables such as Temperature, Number of particles, Volume (density) etc. during a simulation, the overall energy should remain constant. Therefore it is important to monitor the total energy to ensure our model is fitting with our physical understanding.&lt;br /&gt;
&lt;br /&gt;
From experimentation, it can be seen that to limit this total energy change over a simulation, the time step should really be smaller than 0.3. It can be seen in Figure 1.2 how the peaks and thus total energy begin to fluctuate significantly more for 0.3 and above. &lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_En_err_w_timestep.png|thumb|500px|center|&#039;&#039;&#039;Figure 1.2:&#039;&#039;&#039; &#039;&#039;Energy vs Time: a) δt=0.01, b) δt=0.03, c) δt=0.03&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Maths based upon a single Lennard-Jones interaction&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
[[File:JmsD_Maths_1.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.3:&#039;&#039;&#039; &#039;&#039;Answers to the LJ based maths task&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.5 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the number of water molecules in 1 mL under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;Density of water = 1 g/ml&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Molecular weight of wate = 18 g/mol&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Moles in 1 ml, n = 1/18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Number of molecules = n x N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 1/18 x 6.022x10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;3.35x10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;10000/N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = moles of water, n&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Mass of 10000 water molecules, m = n x 18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;The volume, V = m / 1 g/ml &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;2.99x10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.6 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?.  &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The particle should end up in position (0.2,0.1,0.7) after the application of periodic boundary conditions. &lt;br /&gt;
&lt;br /&gt;
This is because, if the number of particles in the box remains constant, if a particle excit the box on one face, it will return from the opposite. In this case, if the particle starts at (0.5,0.5,0.5) in the cubic box ((0,0,0):(1,1,1)) and moves along the vector (0.7,0.6,0.2), it will reappear from the other face, positioned now at (0.2,0.1,0.7).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.7 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; The LJ parameters for argon are &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; = 0.34 nm, &amp;lt;math&amp;gt;\epsilon\ /\ k_B&amp;lt;/math&amp;gt; = 120 K. If the LJ cutoff is r* = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T*=1.5 in real units?  &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;r = 1.088 x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; m&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;T = 180 K&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; = 0.014 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2 Equilibriation ==&lt;br /&gt;
==== 2.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Why do random starting coords cause problems in simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
If particles are placed randomly, there is chance for multiple particles to be placed in the same positions, or at least close too each other. It two particles are close or overlap, there would be very strong resulting interactions. These large forces would caus the model to deviate from its classical behaviour, and will affect properties from energy, to timestep.&lt;br /&gt;
&lt;br /&gt;
Therefore it is wise to start a liquid or gas simulation as a &#039;melt&#039; from particles on lattice points (which can allow random positioning to some degree), e.g. Simple cubic. This ensures particles will begin a suitable distance away from each other.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Prove that lattice spacing of 1.07722 gives a number density of 0.8&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; If lattice spacing is 1.07722, Volume of one cube = 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; If number density is Number / Volume, and there is one particle per cube, number density = 1 / Volume&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; 1 / 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.79999 &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;If instead FCC, and number density of 1.2, what is the length of the cubic uni cell?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; First calculate Volume of the cell: V = Number / number density &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; The Number of particles in a FCC unit cell are 4, so V = 4 / 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; The cube root of the volume will give side length...&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; (4/1.2)&amp;lt;sup&amp;gt;1/3&amp;lt;/sup&amp;gt; = 1.4938 &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the FCC latice, how many atoms would be created by create_atoms&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Assuming no other parameters  (i.e. the box size [Below]) have changed...&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
There should be 4000 atoms created.&lt;br /&gt;
&lt;br /&gt;
If there are 1000 atoms in a 10x10x10 box for a sc lattice that has one atom per unit cell, a lattice such as FCC that has 4 atoms per unit cell should yield 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find and explain the purpose of:&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;mass&#039;&#039; - Sets the mass for the types of atoms, argument(1) is the type, argument(2) is the mass.&lt;br /&gt;
*&#039;&#039;pair_style&#039;&#039; - Calculates the pair interactions (pair potentials defined as interactions between atoms within a certain distance), argument(1) &amp;quot;lj/cut&amp;quot; means this line refers to the global cutoff for all Lennard-Jones interactions, argument(2) defines the distance.&lt;br /&gt;
*&#039;&#039;pair_coeff&#039;&#039; - Provides the interaction coefficients for the interactions between atoms, arguments(1 &amp;amp; 2) refer to the attoms that interact (* means all types 1-&amp;gt;N), and arguments (3 &amp;amp; 4) are those coefficients.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.5 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Given that we are specifying x&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; and v&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt;, which integration algorithm is to be used?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; The Velocity-Verlet Algorithm &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.6 Task ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The purpose of using &#039;&#039;${timestep}&#039;&#039;, or for any other variable for that matter, is that it allows for that property in the simulation to be changed just once in the input file, as opposed to the file being manually altered on every line that variable is called.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.6 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Plot Energy, Temperature and Pressure vs Time for timestep = 0.001&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_0.001all.png|thumb|600px|center|&#039;&#039;&#039;Figure 2.1:&#039;&#039;&#039; &#039;&#039;The data sets from the δt=0.001 initial simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_IntroEnergy.png|thumb|600px|center|&#039;&#039;&#039;Figure 2.2:&#039;&#039;&#039; &#039;&#039;All initial timestep data, Total Energy vs Time&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_IntroEnergyZoomed.png|thumb|600px|center|&#039;&#039;&#039;Figure 2.3:&#039;&#039;&#039; &#039;&#039;Expansion of Figure 2.2 in region Time(0:35)&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Plot all the inital simulations as Energy vs Time, discus the best timestep to progress with.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep chosen for ongoing calculations was 0.0025. The reason being that it was one of only two that provided data showing convergence within the full simulation time (Energy vs Time graph). Of these two timesteps - 0.0025 and 0.001 - the 0.0025 is the better choice to progres with due to it&#039;s slight advantage in computational efficiency. The larger the time step, the fewer data points collected.&lt;br /&gt;
&lt;br /&gt;
[A note should be made about te 0.15 timestep - This is quite clearly a bad choice because instead of converging it diverged...]&lt;br /&gt;
&lt;br /&gt;
== 3 Simmulations under specific conditions ==&lt;br /&gt;
==== 3.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature, T* = 1.5), and two reasonable pressures in Lennard-Jones units.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run these simulations to plot the &#039;Equations of State&#039; [Below].&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The 10 phase points used inn this task were determined by the 5 temperatures (T): 1.6, 1.8, 2.0, 2.2, 2.4 and the pressures (p) 2.4, 2.8. The timestep (δt) chosen was again 0.0025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Npt_1.6_2.4.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Npt_1.6_2.4.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 3.2 Task ====&lt;br /&gt;
&lt;br /&gt;
The temperature ideally needs to be maintained as close to the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, as possible. This is done by multplying every velocity, by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &#039;target temperature&#039; is as stipulated in the input script&lt;br /&gt;
&lt;br /&gt;
The instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, will fluctuate  due to approximations made in the algorithm. &lt;br /&gt;
*If &amp;lt;math&amp;gt;T &amp;gt; \mathfrak{T}&amp;lt;/math&amp;gt;, the E&amp;lt;sub&amp;gt;K&amp;lt;/sub&amp;gt; is too high and thus &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be less than 1.&lt;br /&gt;
*If, by contrast, &amp;lt;math&amp;gt;T &amp;lt; \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;Equipartition theorem&#039; states that on average, every degree of freedom in a system at equilibrium will have K&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T/2 of energy. This sytem has 3 degrees of freedom and as such:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \mathbf{v}_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expressing in terms of the adjustment to target temperature as described above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma \mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Solve the equations for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find out the importance of the three numbers 100 1000 100000.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* 100 is used as the &#039;&#039;Nevery&#039;&#039; argument - This is the number of timesteps between inputing of values.&lt;br /&gt;
* 1000 is used as the &#039;&#039;Nrepeat&#039;&#039; argument - This is the number of times to use the input values to calculate averages.&lt;br /&gt;
* 100000 is used as the &#039;&#039;Nfreq&#039;&#039; argument - The number of timesteps between calculating averages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 {...VARIABLES...}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How much time will this simulate?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;run 100000&#039;&#039; shows the number of timesteps that will be run in the simulation.&lt;br /&gt;
&lt;br /&gt;
This shows that averages in this simulation are calculated only at the end of the simulations, as &#039;&#039;Nfreq&#039;&#039;= &#039;&#039;N&#039;&#039; (run N ...).&lt;br /&gt;
&lt;br /&gt;
==== 3.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Using the output of the simulations in 3.1, plot density as a unction of temperature, for both pressures - (Incl. Error bars + Ideal Gas). Is the simulated density higher or lower than Ideal? Why? Finaly, does the discrepancy increase or decrease w. pressure?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_NpT1.png|thumb|500px|center|&#039;&#039;&#039;Figure 3.1:&#039;&#039;&#039; &#039;&#039;A plot of Average Density vs Average Temperature for two different pressures&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_NpT_wideal.png|thumb|500px|center|&#039;&#039;&#039;Figure 3.2:&#039;&#039;&#039; &#039;&#039;A plot of Average Density vs Average Temperature for two different pressures and their relation to data with the same parameters calculated by the Ideal Gas Law&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
Theoretical results , based on the ideal gas law, give a higher density than the simulated result. (It can also be added that the discrepancy between the ideal and simulated systems increases with pressure.) It can be reasoned that the results provided by the Ideal Gas Law are higher due to the fact that particle-particle interactions are not consided.This means the repulsion that would be experienced by the particles moving closer to each other are not expressed, as such, particles the distance between particles can decrease without energyetic effects, thus increasing the density.&lt;br /&gt;
&lt;br /&gt;
== 4 Calculation of heat capacities using statistical physics ==&lt;br /&gt;
==== 4.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simulations and plot C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V as a function of temperature. Is this as expected?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Cv_2.0_0.2.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Cv_2.0_0.2.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
For this section, 5 simulations were run for each of the two densities: 0.2, 0.8. These simulations corresponded to each of the respective temperatures: 2.0, 2.2, 2.4, 2.6, 2.8 (in reduced units). The desired results of these simulations were the calculated values of the Heat Capacity at constant volume, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;. The results can be seen in Figure 4.1 as a funtion of the average temperatures.&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Cv graph1.png|thumb|500px|center|&#039;&#039;&#039;Figure 4.1:&#039;&#039;&#039; &#039;&#039;A plot comparing Heat Capacity/Volume vs Average Temperature for two different densities&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
These graphs do indeed follow the trend expected, that is similar to the trend seen in a crystalline solid for example. The Heat Capacity is proportional to 1/T&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; [As seen in the Equations below] and as such a negative trend should be observed. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With reagrds to density, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V increases as the density increases - which is again as expected - because heat capacity is dependant on the amount of material per volume, and thus a denser material (with the same volume) has more mass or moles per unit voulume.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 5 Radial Distribution Functions ==&lt;br /&gt;
==== 5.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; From simulations of the Lennard-Jones system in the three phases, Compute &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; in VMD. Discuss the differences in the 3 RDFs and thus what this means about the structure in each phase.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the solid phase, illustrate which lattics sites the first 3 peaks correspond to. What is the Lattice spacing? What is the Coordination number for each of the first three peaks?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The initial parameters for the simulations, in order to specify the correct phases were:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; Temperature: (For all phases) = 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Densities: (Solid) = 1.50, (Liquid) = 0.85, (Vapour) = 0.01 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Finally, to provide the initial positions of atoms, the simple cubic model was used for Liquid and Vapour, but for Solid FCC was used.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These parameters were calculated by examining the Lennar-Jones phase diagram found in literature. [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 &amp;lt;sup&amp;gt;[2] &amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_g(r).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.1:&#039;&#039;&#039; &#039;&#039;The Radial Distribution Functions of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Int(g(r))dr.png|thumb|500px|center|&#039;&#039;&#039;Figure 5.2:&#039;&#039;&#039; &#039;&#039;The Integrals of the RDFs of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Solid3(g(r)).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.3:&#039;&#039;&#039; &#039;&#039;The RDF of the solid, paying particular attention to the first 3 peaks&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As it can be seen in Figure 5.1, the RDFs are very different for each phase. The area under the curves is the probability of finding another particle at that distance from the particle of reference, thus peaks are distances away from a reference particle that there is increased probability of encountering another.&lt;br /&gt;
&lt;br /&gt;
For example, the Vapour phase [as shown in blue in Figure 5.1] is largely simple. Whereas, the RDF of the liquid [purple] has a series of fairly ordered peaks of decresing height. This can be explained by the ease of motion of these two phases. Vapour particles are very spread out in space and have a lot more motion than liquids which are held together and inplace by various intermolecular/atomic bonds. Because of this by moving away fro a reference particle in the vapour phase, there is a very low probability of encountaring another particle. Liquids are a lot more ordered than gases and coordination spheres are shown by the fairly smooth peaks as r increases. There is reasonable probability of finsing another particle in the first coordination sphere, but this decreases as you move away. &lt;br /&gt;
&lt;br /&gt;
The area under the curves is the probability of finding another particle at that distance from the particle of reference. This&lt;br /&gt;
&lt;br /&gt;
== 6 Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
==== 6.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simlations for the three phases, to calculate the mean squared displacement and velocity autocorrelation functions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 6.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Measure D from it&#039;s connection to the MSD, for simulations and data for approx. one million atom simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equation for the Diffusion Coefficient, &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
However, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be much more simply estimated by fitting the linear section of a Total MSD vs Timestep graph and dividing by 6.&lt;br /&gt;
This gives the following values for D (in reduced units) for the smaller simulations carried out by myself:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.31x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.33&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 1.55&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.1-6.3]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_my_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.1:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Solid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.2:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Liquid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.3:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Vapour simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
In comparison below are the values for D (in reduced units) for the larger (approx. 1 million atom) data supplied:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.71x10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.75&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 6.28&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.4-6.6]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_mil_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.4:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Solid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_mil_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.5:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Liquid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsDil_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.6:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Vapour MSD data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 7 References ==&lt;br /&gt;
 1.  LAMMPS Manual, http://lammps.sandia.gov/doc/Section_commands.html#lammps-input-script , accessed November 2016&lt;br /&gt;
 2.  JP Hansen, L Verlet, Phys Rev, 184, 1969, http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=590342</id>
		<title>Rep:Mod:Yr3LiquidSimJmsD</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=590342"/>
		<updated>2017-02-24T11:40:26Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: /* 5.1 Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Jack Dawson - Yr3 Comp: Liquid Sim.=&lt;br /&gt;
&lt;br /&gt;
== 1 Theory ==&lt;br /&gt;
&lt;br /&gt;
==== 1.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Compltete the Classical Harmonic Osciallator Spreadsheet&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_HO.xls|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For δt=0.01, estimate the positions of maximum error and fit accordingly.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Max Error Graph.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.1:&#039;&#039;&#039; &#039;&#039;A plot of the error in VV algorithm data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
Figure 1.1 shows how the maximum error increases linearly. This can be rationalised by the fact that each cycle of simulation follows on from the last, so the error of the new cycle is combined to the uncertainty in a previous calculation for an older timestep and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Experiment to find the timestep range to ensure the total energy does not change by more than 1% over the course of the simulation. Why is this important?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In simulations such as this, the physical model is considered an isolated system. We are modeling the changes in velocity and thus kinetic energy changes of induvidual particles/atoms over a total timeframe at constant timesteps. As such, the particles are moving around, interacting, transfering energy between each other. However, unless we are changing variables such as Temperature, Number of particles, Volume (density) etc. during a simulation, the overall energy should remain constant. Therefore it is important to monitor the total energy to ensure our model is fitting with our physical understanding.&lt;br /&gt;
&lt;br /&gt;
From experimentation, it can be seen that to limit this total energy change over a simulation, the time step should really be smaller than 0.3. It can be seen in Figure 1.2 how the peaks and thus total energy begin to fluctuate significantly more for 0.3 and above. &lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_En_err_w_timestep.png|thumb|500px|center|&#039;&#039;&#039;Figure 1.2:&#039;&#039;&#039; &#039;&#039;Energy vs Time: a) δt=0.01, b) δt=0.03, c) δt=0.03&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Maths based upon a single Lennard-Jones interaction&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
[[File:JmsD_Maths_1.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.3:&#039;&#039;&#039; &#039;&#039;Answers to the LJ based maths task&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.5 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the number of water molecules in 1 mL under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;Density of water = 1 g/ml&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Molecular weight of wate = 18 g/mol&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Moles in 1 ml, n = 1/18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Number of molecules = n x N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 1/18 x 6.022x10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;3.35x10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;10000/N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = moles of water, n&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Mass of 10000 water molecules, m = n x 18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;The volume, V = m / 1 g/ml &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;2.99x10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.6 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?.  &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The particle should end up in position (0.2,0.1,0.7) after the application of periodic boundary conditions. &lt;br /&gt;
&lt;br /&gt;
This is because, if the number of particles in the box remains constant, if a particle excit the box on one face, it will return from the opposite. In this case, if the particle starts at (0.5,0.5,0.5) in the cubic box ((0,0,0):(1,1,1)) and moves along the vector (0.7,0.6,0.2), it will reappear from the other face, positioned now at (0.2,0.1,0.7).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.7 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; The LJ parameters for argon are &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; = 0.34 nm, &amp;lt;math&amp;gt;\epsilon\ /\ k_B&amp;lt;/math&amp;gt; = 120 K. If the LJ cutoff is r* = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T*=1.5 in real units?  &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;r = 1.088 x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; m&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;T = 180 K&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; = 0.014 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2 Equilibriation ==&lt;br /&gt;
==== 2.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Why do random starting coords cause problems in simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
If particles are placed randomly, there is chance for multiple particles to be placed in the same positions, or at least close too each other. It two particles are close or overlap, there would be very strong resulting interactions. These large forces would caus the model to deviate from its classical behaviour, and will affect properties from energy, to timestep.&lt;br /&gt;
&lt;br /&gt;
Therefore it is wise to start a liquid or gas simulation as a &#039;melt&#039; from particles on lattice points (which can allow random positioning to some degree), e.g. Simple cubic. This ensures particles will begin a suitable distance away from each other.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Prove that lattice spacing of 1.07722 gives a number density of 0.8&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; If lattice spacing is 1.07722, Volume of one cube = 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; If number density is Number / Volume, and there is one particle per cube, number density = 1 / Volume&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; 1 / 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.79999 &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;If instead FCC, and number density of 1.2, what is the length of the cubic uni cell?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; First calculate Volume of the cell: V = Number / number density &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; The Number of particles in a FCC unit cell are 4, so V = 4 / 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; The cube root of the volume will give side length...&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; (4/1.2)&amp;lt;sup&amp;gt;1/3&amp;lt;/sup&amp;gt; = 1.4938 &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the FCC latice, how many atoms would be created by create_atoms&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Assuming no other parameters  (i.e. the box size [Below]) have changed...&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
There should be 4000 atoms created.&lt;br /&gt;
&lt;br /&gt;
If there are 1000 atoms in a 10x10x10 box for a sc lattice that has one atom per unit cell, a lattice such as FCC that has 4 atoms per unit cell should yield 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find and explain the purpose of:&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;mass&#039;&#039; - Sets the mass for the types of atoms, argument(1) is the type, argument(2) is the mass.&lt;br /&gt;
*&#039;&#039;pair_style&#039;&#039; - Calculates the pair interactions (pair potentials defined as interactions between atoms within a certain distance), argument(1) &amp;quot;lj/cut&amp;quot; means this line refers to the global cutoff for all Lennard-Jones interactions, argument(2) defines the distance.&lt;br /&gt;
*&#039;&#039;pair_coeff&#039;&#039; - Provides the interaction coefficients for the interactions between atoms, arguments(1 &amp;amp; 2) refer to the attoms that interact (* means all types 1-&amp;gt;N), and arguments (3 &amp;amp; 4) are those coefficients.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.5 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Given that we are specifying x&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; and v&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt;, which integration algorithm is to be used?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; The Velocity-Verlet Algorithm &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.6 Task ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The purpose of using &#039;&#039;${timestep}&#039;&#039;, or for any other variable for that matter, is that it allows for that property in the simulation to be changed just once in the input file, as opposed to the file being manually altered on every line that variable is called.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.6 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Plot Energy, Temperature and Pressure vs Time for timestep = 0.001&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_0.001all.png|thumb|600px|center|&#039;&#039;&#039;Figure 2.1:&#039;&#039;&#039; &#039;&#039;The data sets from the δt=0.001 initial simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_IntroEnergy.png|thumb|600px|center|&#039;&#039;&#039;Figure 2.2:&#039;&#039;&#039; &#039;&#039;All initial timestep data, Total Energy vs Time&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_IntroEnergyZoomed.png|thumb|600px|center|&#039;&#039;&#039;Figure 2.3:&#039;&#039;&#039; &#039;&#039;Expansion of Figure 2.2 in region Time(0:35)&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Plot all the inital simulations as Energy vs Time, discus the best timestep to progress with.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep chosen for ongoing calculations was 0.0025. The reason being that it was one of only two that provided data showing convergence within the full simulation time (Energy vs Time graph). Of these two timesteps - 0.0025 and 0.001 - the 0.0025 is the better choice to progres with due to it&#039;s slight advantage in computational efficiency. The larger the time step, the fewer data points collected.&lt;br /&gt;
&lt;br /&gt;
[A note should be made about te 0.15 timestep - This is quite clearly a bad choice because instead of converging it diverged...]&lt;br /&gt;
&lt;br /&gt;
== 3 Simmulations under specific conditions ==&lt;br /&gt;
==== 3.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature, T* = 1.5), and two reasonable pressures in Lennard-Jones units.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run these simulations to plot the &#039;Equations of State&#039; [Below].&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The 10 phase points used inn this task were determined by the 5 temperatures (T): 1.6, 1.8, 2.0, 2.2, 2.4 and the pressures (p) 2.4, 2.8. The timestep (δt) chosen was again 0.0025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Npt_1.6_2.4.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Npt_1.6_2.4.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 3.2 Task ====&lt;br /&gt;
&lt;br /&gt;
The temperature ideally needs to be maintained as close to the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, as possible. This is done by multplying every velocity, by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &#039;target temperature&#039; is as stipulated in the input script&lt;br /&gt;
&lt;br /&gt;
The instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, will fluctuate  due to approximations made in the algorithm. &lt;br /&gt;
*If &amp;lt;math&amp;gt;T &amp;gt; \mathfrak{T}&amp;lt;/math&amp;gt;, the E&amp;lt;sub&amp;gt;K&amp;lt;/sub&amp;gt; is too high and thus &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be less than 1.&lt;br /&gt;
*If, by contrast, &amp;lt;math&amp;gt;T &amp;lt; \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;Equipartition theorem&#039; states that on average, every degree of freedom in a system at equilibrium will have K&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T/2 of energy. This sytem has 3 degrees of freedom and as such:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \mathbf{v}_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expressing in terms of the adjustment to target temperature as described above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma \mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Solve the equations for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find out the importance of the three numbers 100 1000 100000.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* 100 is used as the &#039;&#039;Nevery&#039;&#039; argument - This is the number of timesteps between inputing of values.&lt;br /&gt;
* 1000 is used as the &#039;&#039;Nrepeat&#039;&#039; argument - This is the number of times to use the input values to calculate averages.&lt;br /&gt;
* 100000 is used as the &#039;&#039;Nfreq&#039;&#039; argument - The number of timesteps between calculating averages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 {...VARIABLES...}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How much time will this simulate?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;run 100000&#039;&#039; shows the number of timesteps that will be run in the simulation.&lt;br /&gt;
&lt;br /&gt;
This shows that averages in this simulation are calculated only at the end of the simulations, as &#039;&#039;Nfreq&#039;&#039;= &#039;&#039;N&#039;&#039; (run N ...).&lt;br /&gt;
&lt;br /&gt;
==== 3.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Using the output of the simulations in 3.1, plot density as a unction of temperature, for both pressures - (Incl. Error bars + Ideal Gas). Is the simulated density higher or lower than Ideal? Why? Finaly, does the discrepancy increase or decrease w. pressure?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_NpT1.png|thumb|500px|center|&#039;&#039;&#039;Figure 3.1:&#039;&#039;&#039; &#039;&#039;A plot of Average Density vs Average Temperature for two different pressures&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_NpT_wideal.png|thumb|500px|center|&#039;&#039;&#039;Figure 3.2:&#039;&#039;&#039; &#039;&#039;A plot of Average Density vs Average Temperature for two different pressures and their relation to data with the same parameters calculated by the Ideal Gas Law&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
Theoretical results , based on the ideal gas law, give a higher density than the simulated result. (It can also be added that the discrepancy between the ideal and simulated systems increases with pressure.) It can be reasoned that the results provided by the Ideal Gas Law are higher due to the fact that particle-particle interactions are not consided.This means the repulsion that would be experienced by the particles moving closer to each other are not expressed, as such, particles the distance between particles can decrease without energyetic effects, thus increasing the density.&lt;br /&gt;
&lt;br /&gt;
== 4 Calculation of heat capacities using statistical physics ==&lt;br /&gt;
==== 4.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simulations and plot C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V as a function of temperature. Is this as expected?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Cv_2.0_0.2.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Cv_2.0_0.2.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
For this section, 5 simulations were run for each of the two densities: 0.2, 0.8. These simulations corresponded to each of the respective temperatures: 2.0, 2.2, 2.4, 2.6, 2.8 (in reduced units). The desired results of these simulations were the calculated values of the Heat Capacity at constant volume, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;. The results can be seen in Figure 4.1 as a funtion of the average temperatures.&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Cv graph1.png|thumb|500px|center|&#039;&#039;&#039;Figure 4.1:&#039;&#039;&#039; &#039;&#039;A plot comparing Heat Capacity/Volume vs Average Temperature for two different densities&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
These graphs do indeed follow the trend expected, that is similar to the trend seen in a crystalline solid for example. The Heat Capacity is proportional to 1/T&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; [As seen in the Equations below] and as such a negative trend should be observed. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With reagrds to density, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V increases as the density increases - which is again as expected - because heat capacity is dependant on the amount of material per volume, and thus a denser material (with the same volume) has more mass or moles per unit voulume.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 5 Radial Distribution Functions ==&lt;br /&gt;
==== 5.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; From simulations of the Lennard-Jones system in the three phases, Compute &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; in VMD. Discuss the differences in the 3 RDFs and thus what this means about the structure in each phase.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the solid phase, illustrate which lattics sites the first 3 peaks correspond to. What is the Lattice spacing? What is the Coordination number for each of the first three peaks?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The initial parameters for the simulations, in order to specify the correct phases were:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; Temperature: (For all phases) = 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Densities: (Solid) = 1.50, (Liquid) = 0.85, (Vapour) = 0.01 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Finally, to provide the initial positions of atoms, the simple cubic model was used for Liquid and Vapour, but for Solid FCC was used.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These parameters were calculated by examining the Lennar-Jones phase diagram found in literature. [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 &amp;lt;sup&amp;gt;[2] &amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_g(r).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.1:&#039;&#039;&#039; &#039;&#039;The Radial Distribution Functions of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Int(g(r))dr.png|thumb|500px|center|&#039;&#039;&#039;Figure 5.2:&#039;&#039;&#039; &#039;&#039;The Integrals of the RDFs of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Solid3(g(r)).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.3:&#039;&#039;&#039; &#039;&#039;The RDF of the solid, paying particular attention to the first 3 peaks&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As it can be seen in Figure 5.1, the RDFs are very different for each phase.&lt;br /&gt;
For example, the Vapour phase [as shown in blue in Figure 5.1] is largely simple. Whereas, the RDF of the liquid [purple] has a series of fairly ordered peaks of decresing height. This can be explained by the ease of motion of these two phases. Vapour particles are very spread out in space and have a lot more motion than liquids which are held together and inplace by various intermolecular/atomic bonds. Because of this  &lt;br /&gt;
&lt;br /&gt;
The area under the curves is the probability of finding another particle at that distance from the particle of reference. This&lt;br /&gt;
&lt;br /&gt;
== 6 Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
==== 6.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simlations for the three phases, to calculate the mean squared displacement and velocity autocorrelation functions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 6.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Measure D from it&#039;s connection to the MSD, for simulations and data for approx. one million atom simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equation for the Diffusion Coefficient, &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
However, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be much more simply estimated by fitting the linear section of a Total MSD vs Timestep graph and dividing by 6.&lt;br /&gt;
This gives the following values for D (in reduced units) for the smaller simulations carried out by myself:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.31x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.33&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 1.55&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.1-6.3]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_my_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.1:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Solid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.2:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Liquid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.3:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Vapour simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
In comparison below are the values for D (in reduced units) for the larger (approx. 1 million atom) data supplied:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.71x10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.75&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 6.28&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.4-6.6]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_mil_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.4:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Solid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_mil_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.5:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Liquid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsDil_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.6:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Vapour MSD data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 7 References ==&lt;br /&gt;
 1.  LAMMPS Manual, http://lammps.sandia.gov/doc/Section_commands.html#lammps-input-script , accessed November 2016&lt;br /&gt;
 2.  JP Hansen, L Verlet, Phys Rev, 184, 1969, http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=590228</id>
		<title>Rep:Mod:Yr3LiquidSimJmsD</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=590228"/>
		<updated>2017-02-24T11:20:10Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: /* 5.1 Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Jack Dawson - Yr3 Comp: Liquid Sim.=&lt;br /&gt;
&lt;br /&gt;
== 1 Theory ==&lt;br /&gt;
&lt;br /&gt;
==== 1.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Compltete the Classical Harmonic Osciallator Spreadsheet&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_HO.xls|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For δt=0.01, estimate the positions of maximum error and fit accordingly.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Max Error Graph.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.1:&#039;&#039;&#039; &#039;&#039;A plot of the error in VV algorithm data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
Figure 1.1 shows how the maximum error increases linearly. This can be rationalised by the fact that each cycle of simulation follows on from the last, so the error of the new cycle is combined to the uncertainty in a previous calculation for an older timestep and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Experiment to find the timestep range to ensure the total energy does not change by more than 1% over the course of the simulation. Why is this important?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In simulations such as this, the physical model is considered an isolated system. We are modeling the changes in velocity and thus kinetic energy changes of induvidual particles/atoms over a total timeframe at constant timesteps. As such, the particles are moving around, interacting, transfering energy between each other. However, unless we are changing variables such as Temperature, Number of particles, Volume (density) etc. during a simulation, the overall energy should remain constant. Therefore it is important to monitor the total energy to ensure our model is fitting with our physical understanding.&lt;br /&gt;
&lt;br /&gt;
From experimentation, it can be seen that to limit this total energy change over a simulation, the time step should really be smaller than 0.3. It can be seen in Figure 1.2 how the peaks and thus total energy begin to fluctuate significantly more for 0.3 and above. &lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_En_err_w_timestep.png|thumb|500px|center|&#039;&#039;&#039;Figure 1.2:&#039;&#039;&#039; &#039;&#039;Energy vs Time: a) δt=0.01, b) δt=0.03, c) δt=0.03&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Maths based upon a single Lennard-Jones interaction&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
[[File:JmsD_Maths_1.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.3:&#039;&#039;&#039; &#039;&#039;Answers to the LJ based maths task&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.5 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the number of water molecules in 1 mL under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;Density of water = 1 g/ml&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Molecular weight of wate = 18 g/mol&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Moles in 1 ml, n = 1/18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Number of molecules = n x N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 1/18 x 6.022x10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;3.35x10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;10000/N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = moles of water, n&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Mass of 10000 water molecules, m = n x 18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;The volume, V = m / 1 g/ml &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;2.99x10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.6 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?.  &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The particle should end up in position (0.2,0.1,0.7) after the application of periodic boundary conditions. &lt;br /&gt;
&lt;br /&gt;
This is because, if the number of particles in the box remains constant, if a particle excit the box on one face, it will return from the opposite. In this case, if the particle starts at (0.5,0.5,0.5) in the cubic box ((0,0,0):(1,1,1)) and moves along the vector (0.7,0.6,0.2), it will reappear from the other face, positioned now at (0.2,0.1,0.7).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.7 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; The LJ parameters for argon are &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; = 0.34 nm, &amp;lt;math&amp;gt;\epsilon\ /\ k_B&amp;lt;/math&amp;gt; = 120 K. If the LJ cutoff is r* = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T*=1.5 in real units?  &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;r = 1.088 x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; m&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;T = 180 K&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; = 0.014 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2 Equilibriation ==&lt;br /&gt;
==== 2.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Why do random starting coords cause problems in simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
If particles are placed randomly, there is chance for multiple particles to be placed in the same positions, or at least close too each other. It two particles are close or overlap, there would be very strong resulting interactions. These large forces would caus the model to deviate from its classical behaviour, and will affect properties from energy, to timestep.&lt;br /&gt;
&lt;br /&gt;
Therefore it is wise to start a liquid or gas simulation as a &#039;melt&#039; from particles on lattice points (which can allow random positioning to some degree), e.g. Simple cubic. This ensures particles will begin a suitable distance away from each other.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Prove that lattice spacing of 1.07722 gives a number density of 0.8&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; If lattice spacing is 1.07722, Volume of one cube = 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; If number density is Number / Volume, and there is one particle per cube, number density = 1 / Volume&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; 1 / 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.79999 &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;If instead FCC, and number density of 1.2, what is the length of the cubic uni cell?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; First calculate Volume of the cell: V = Number / number density &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; The Number of particles in a FCC unit cell are 4, so V = 4 / 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; The cube root of the volume will give side length...&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; (4/1.2)&amp;lt;sup&amp;gt;1/3&amp;lt;/sup&amp;gt; = 1.4938 &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the FCC latice, how many atoms would be created by create_atoms&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Assuming no other parameters  (i.e. the box size [Below]) have changed...&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
There should be 4000 atoms created.&lt;br /&gt;
&lt;br /&gt;
If there are 1000 atoms in a 10x10x10 box for a sc lattice that has one atom per unit cell, a lattice such as FCC that has 4 atoms per unit cell should yield 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find and explain the purpose of:&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;mass&#039;&#039; - Sets the mass for the types of atoms, argument(1) is the type, argument(2) is the mass.&lt;br /&gt;
*&#039;&#039;pair_style&#039;&#039; - Calculates the pair interactions (pair potentials defined as interactions between atoms within a certain distance), argument(1) &amp;quot;lj/cut&amp;quot; means this line refers to the global cutoff for all Lennard-Jones interactions, argument(2) defines the distance.&lt;br /&gt;
*&#039;&#039;pair_coeff&#039;&#039; - Provides the interaction coefficients for the interactions between atoms, arguments(1 &amp;amp; 2) refer to the attoms that interact (* means all types 1-&amp;gt;N), and arguments (3 &amp;amp; 4) are those coefficients.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.5 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Given that we are specifying x&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; and v&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt;, which integration algorithm is to be used?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; The Velocity-Verlet Algorithm &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.6 Task ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The purpose of using &#039;&#039;${timestep}&#039;&#039;, or for any other variable for that matter, is that it allows for that property in the simulation to be changed just once in the input file, as opposed to the file being manually altered on every line that variable is called.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.6 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Plot Energy, Temperature and Pressure vs Time for timestep = 0.001&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_0.001all.png|thumb|600px|center|&#039;&#039;&#039;Figure 2.1:&#039;&#039;&#039; &#039;&#039;The data sets from the δt=0.001 initial simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_IntroEnergy.png|thumb|600px|center|&#039;&#039;&#039;Figure 2.2:&#039;&#039;&#039; &#039;&#039;All initial timestep data, Total Energy vs Time&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_IntroEnergyZoomed.png|thumb|600px|center|&#039;&#039;&#039;Figure 2.3:&#039;&#039;&#039; &#039;&#039;Expansion of Figure 2.2 in region Time(0:35)&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Plot all the inital simulations as Energy vs Time, discus the best timestep to progress with.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep chosen for ongoing calculations was 0.0025. The reason being that it was one of only two that provided data showing convergence within the full simulation time (Energy vs Time graph). Of these two timesteps - 0.0025 and 0.001 - the 0.0025 is the better choice to progres with due to it&#039;s slight advantage in computational efficiency. The larger the time step, the fewer data points collected.&lt;br /&gt;
&lt;br /&gt;
[A note should be made about te 0.15 timestep - This is quite clearly a bad choice because instead of converging it diverged...]&lt;br /&gt;
&lt;br /&gt;
== 3 Simmulations under specific conditions ==&lt;br /&gt;
==== 3.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature, T* = 1.5), and two reasonable pressures in Lennard-Jones units.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run these simulations to plot the &#039;Equations of State&#039; [Below].&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The 10 phase points used inn this task were determined by the 5 temperatures (T): 1.6, 1.8, 2.0, 2.2, 2.4 and the pressures (p) 2.4, 2.8. The timestep (δt) chosen was again 0.0025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Npt_1.6_2.4.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Npt_1.6_2.4.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 3.2 Task ====&lt;br /&gt;
&lt;br /&gt;
The temperature ideally needs to be maintained as close to the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, as possible. This is done by multplying every velocity, by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &#039;target temperature&#039; is as stipulated in the input script&lt;br /&gt;
&lt;br /&gt;
The instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, will fluctuate  due to approximations made in the algorithm. &lt;br /&gt;
*If &amp;lt;math&amp;gt;T &amp;gt; \mathfrak{T}&amp;lt;/math&amp;gt;, the E&amp;lt;sub&amp;gt;K&amp;lt;/sub&amp;gt; is too high and thus &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be less than 1.&lt;br /&gt;
*If, by contrast, &amp;lt;math&amp;gt;T &amp;lt; \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;Equipartition theorem&#039; states that on average, every degree of freedom in a system at equilibrium will have K&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T/2 of energy. This sytem has 3 degrees of freedom and as such:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \mathbf{v}_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expressing in terms of the adjustment to target temperature as described above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma \mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Solve the equations for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find out the importance of the three numbers 100 1000 100000.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* 100 is used as the &#039;&#039;Nevery&#039;&#039; argument - This is the number of timesteps between inputing of values.&lt;br /&gt;
* 1000 is used as the &#039;&#039;Nrepeat&#039;&#039; argument - This is the number of times to use the input values to calculate averages.&lt;br /&gt;
* 100000 is used as the &#039;&#039;Nfreq&#039;&#039; argument - The number of timesteps between calculating averages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 {...VARIABLES...}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How much time will this simulate?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;run 100000&#039;&#039; shows the number of timesteps that will be run in the simulation.&lt;br /&gt;
&lt;br /&gt;
This shows that averages in this simulation are calculated only at the end of the simulations, as &#039;&#039;Nfreq&#039;&#039;= &#039;&#039;N&#039;&#039; (run N ...).&lt;br /&gt;
&lt;br /&gt;
==== 3.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Using the output of the simulations in 3.1, plot density as a unction of temperature, for both pressures - (Incl. Error bars + Ideal Gas). Is the simulated density higher or lower than Ideal? Why? Finaly, does the discrepancy increase or decrease w. pressure?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_NpT1.png|thumb|500px|center|&#039;&#039;&#039;Figure 3.1:&#039;&#039;&#039; &#039;&#039;A plot of Average Density vs Average Temperature for two different pressures&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_NpT_wideal.png|thumb|500px|center|&#039;&#039;&#039;Figure 3.2:&#039;&#039;&#039; &#039;&#039;A plot of Average Density vs Average Temperature for two different pressures and their relation to data with the same parameters calculated by the Ideal Gas Law&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
Theoretical results , based on the ideal gas law, give a higher density than the simulated result. (It can also be added that the discrepancy between the ideal and simulated systems increases with pressure.) It can be reasoned that the results provided by the Ideal Gas Law are higher due to the fact that particle-particle interactions are not consided.This means the repulsion that would be experienced by the particles moving closer to each other are not expressed, as such, particles the distance between particles can decrease without energyetic effects, thus increasing the density.&lt;br /&gt;
&lt;br /&gt;
== 4 Calculation of heat capacities using statistical physics ==&lt;br /&gt;
==== 4.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simulations and plot C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V as a function of temperature. Is this as expected?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Cv_2.0_0.2.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Cv_2.0_0.2.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
For this section, 5 simulations were run for each of the two densities: 0.2, 0.8. These simulations corresponded to each of the respective temperatures: 2.0, 2.2, 2.4, 2.6, 2.8 (in reduced units). The desired results of these simulations were the calculated values of the Heat Capacity at constant volume, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;. The results can be seen in Figure 4.1 as a funtion of the average temperatures.&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Cv graph1.png|thumb|500px|center|&#039;&#039;&#039;Figure 4.1:&#039;&#039;&#039; &#039;&#039;A plot comparing Heat Capacity/Volume vs Average Temperature for two different densities&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
These graphs do indeed follow the trend expected, that is similar to the trend seen in a crystalline solid for example. The Heat Capacity is proportional to 1/T&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; [As seen in the Equations below] and as such a negative trend should be observed. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With reagrds to density, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V increases as the density increases - which is again as expected - because heat capacity is dependant on the amount of material per volume, and thus a denser material (with the same volume) has more mass or moles per unit voulume.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 5 Radial Distribution Functions ==&lt;br /&gt;
==== 5.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; From simulations of the Lennard-Jones system in the three phases, Compute &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; in VMD. Discuss the differences in the 3 RDFs and thus what this means about the structure in each phase.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the solid phase, illustrate which lattics sites the first 3 peaks correspond to. What is the Lattice spacing? What is the Coordination number for each of the first three peaks?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The initial parameters for the simulations, in order to specify the correct phases were:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; Temperature: (For all phases) = 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Densities: (Solid) = 1.50, (Liquid) = 0.85, (Vapour) = 0.01 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Finally, to provide the initial positions of atoms, the simple cubic model was used for Liquid and Vapour, but for Solid FCC was used.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These parameters were calculated by examining the Lennar-Jones phase diagram found in literature. [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 &amp;lt;sup&amp;gt;[2] &amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_g(r).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.1:&#039;&#039;&#039; &#039;&#039;The Radial Distribution Functions of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Int(g(r))dr.png|thumb|500px|center|&#039;&#039;&#039;Figure 5.2:&#039;&#039;&#039; &#039;&#039;The Integrals of the RDFs of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Solid3(g(r)).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.3:&#039;&#039;&#039; &#039;&#039;The RDF of the solid, paying particular attention to the first 3 peaks&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As it can be seen in Figure 5.1, the RDFs are very different for each phase.&lt;br /&gt;
&lt;br /&gt;
== 6 Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
==== 6.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simlations for the three phases, to calculate the mean squared displacement and velocity autocorrelation functions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 6.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Measure D from it&#039;s connection to the MSD, for simulations and data for approx. one million atom simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equation for the Diffusion Coefficient, &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
However, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be much more simply estimated by fitting the linear section of a Total MSD vs Timestep graph and dividing by 6.&lt;br /&gt;
This gives the following values for D (in reduced units) for the smaller simulations carried out by myself:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.31x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.33&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 1.55&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.1-6.3]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_my_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.1:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Solid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.2:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Liquid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.3:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Vapour simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
In comparison below are the values for D (in reduced units) for the larger (approx. 1 million atom) data supplied:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.71x10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.75&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 6.28&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.4-6.6]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_mil_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.4:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Solid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_mil_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.5:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Liquid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsDil_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.6:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Vapour MSD data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 7 References ==&lt;br /&gt;
 1.  LAMMPS Manual, http://lammps.sandia.gov/doc/Section_commands.html#lammps-input-script , accessed November 2016&lt;br /&gt;
 2.  JP Hansen, L Verlet, Phys Rev, 184, 1969, http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=590185</id>
		<title>Rep:Mod:Yr3LiquidSimJmsD</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=590185"/>
		<updated>2017-02-24T11:13:49Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: /* 3.4 Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Jack Dawson - Yr3 Comp: Liquid Sim.=&lt;br /&gt;
&lt;br /&gt;
== 1 Theory ==&lt;br /&gt;
&lt;br /&gt;
==== 1.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Compltete the Classical Harmonic Osciallator Spreadsheet&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_HO.xls|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For δt=0.01, estimate the positions of maximum error and fit accordingly.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Max Error Graph.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.1:&#039;&#039;&#039; &#039;&#039;A plot of the error in VV algorithm data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
Figure 1.1 shows how the maximum error increases linearly. This can be rationalised by the fact that each cycle of simulation follows on from the last, so the error of the new cycle is combined to the uncertainty in a previous calculation for an older timestep and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Experiment to find the timestep range to ensure the total energy does not change by more than 1% over the course of the simulation. Why is this important?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In simulations such as this, the physical model is considered an isolated system. We are modeling the changes in velocity and thus kinetic energy changes of induvidual particles/atoms over a total timeframe at constant timesteps. As such, the particles are moving around, interacting, transfering energy between each other. However, unless we are changing variables such as Temperature, Number of particles, Volume (density) etc. during a simulation, the overall energy should remain constant. Therefore it is important to monitor the total energy to ensure our model is fitting with our physical understanding.&lt;br /&gt;
&lt;br /&gt;
From experimentation, it can be seen that to limit this total energy change over a simulation, the time step should really be smaller than 0.3. It can be seen in Figure 1.2 how the peaks and thus total energy begin to fluctuate significantly more for 0.3 and above. &lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_En_err_w_timestep.png|thumb|500px|center|&#039;&#039;&#039;Figure 1.2:&#039;&#039;&#039; &#039;&#039;Energy vs Time: a) δt=0.01, b) δt=0.03, c) δt=0.03&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Maths based upon a single Lennard-Jones interaction&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
[[File:JmsD_Maths_1.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.3:&#039;&#039;&#039; &#039;&#039;Answers to the LJ based maths task&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.5 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the number of water molecules in 1 mL under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;Density of water = 1 g/ml&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Molecular weight of wate = 18 g/mol&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Moles in 1 ml, n = 1/18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Number of molecules = n x N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 1/18 x 6.022x10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;3.35x10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;10000/N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = moles of water, n&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Mass of 10000 water molecules, m = n x 18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;The volume, V = m / 1 g/ml &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;2.99x10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.6 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?.  &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The particle should end up in position (0.2,0.1,0.7) after the application of periodic boundary conditions. &lt;br /&gt;
&lt;br /&gt;
This is because, if the number of particles in the box remains constant, if a particle excit the box on one face, it will return from the opposite. In this case, if the particle starts at (0.5,0.5,0.5) in the cubic box ((0,0,0):(1,1,1)) and moves along the vector (0.7,0.6,0.2), it will reappear from the other face, positioned now at (0.2,0.1,0.7).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.7 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; The LJ parameters for argon are &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; = 0.34 nm, &amp;lt;math&amp;gt;\epsilon\ /\ k_B&amp;lt;/math&amp;gt; = 120 K. If the LJ cutoff is r* = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T*=1.5 in real units?  &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;r = 1.088 x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; m&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;T = 180 K&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; = 0.014 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2 Equilibriation ==&lt;br /&gt;
==== 2.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Why do random starting coords cause problems in simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
If particles are placed randomly, there is chance for multiple particles to be placed in the same positions, or at least close too each other. It two particles are close or overlap, there would be very strong resulting interactions. These large forces would caus the model to deviate from its classical behaviour, and will affect properties from energy, to timestep.&lt;br /&gt;
&lt;br /&gt;
Therefore it is wise to start a liquid or gas simulation as a &#039;melt&#039; from particles on lattice points (which can allow random positioning to some degree), e.g. Simple cubic. This ensures particles will begin a suitable distance away from each other.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Prove that lattice spacing of 1.07722 gives a number density of 0.8&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; If lattice spacing is 1.07722, Volume of one cube = 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; If number density is Number / Volume, and there is one particle per cube, number density = 1 / Volume&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; 1 / 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.79999 &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;If instead FCC, and number density of 1.2, what is the length of the cubic uni cell?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; First calculate Volume of the cell: V = Number / number density &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; The Number of particles in a FCC unit cell are 4, so V = 4 / 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; The cube root of the volume will give side length...&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; (4/1.2)&amp;lt;sup&amp;gt;1/3&amp;lt;/sup&amp;gt; = 1.4938 &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the FCC latice, how many atoms would be created by create_atoms&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Assuming no other parameters  (i.e. the box size [Below]) have changed...&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
There should be 4000 atoms created.&lt;br /&gt;
&lt;br /&gt;
If there are 1000 atoms in a 10x10x10 box for a sc lattice that has one atom per unit cell, a lattice such as FCC that has 4 atoms per unit cell should yield 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find and explain the purpose of:&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;mass&#039;&#039; - Sets the mass for the types of atoms, argument(1) is the type, argument(2) is the mass.&lt;br /&gt;
*&#039;&#039;pair_style&#039;&#039; - Calculates the pair interactions (pair potentials defined as interactions between atoms within a certain distance), argument(1) &amp;quot;lj/cut&amp;quot; means this line refers to the global cutoff for all Lennard-Jones interactions, argument(2) defines the distance.&lt;br /&gt;
*&#039;&#039;pair_coeff&#039;&#039; - Provides the interaction coefficients for the interactions between atoms, arguments(1 &amp;amp; 2) refer to the attoms that interact (* means all types 1-&amp;gt;N), and arguments (3 &amp;amp; 4) are those coefficients.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.5 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Given that we are specifying x&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; and v&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt;, which integration algorithm is to be used?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; The Velocity-Verlet Algorithm &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.6 Task ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The purpose of using &#039;&#039;${timestep}&#039;&#039;, or for any other variable for that matter, is that it allows for that property in the simulation to be changed just once in the input file, as opposed to the file being manually altered on every line that variable is called.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.6 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Plot Energy, Temperature and Pressure vs Time for timestep = 0.001&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_0.001all.png|thumb|600px|center|&#039;&#039;&#039;Figure 2.1:&#039;&#039;&#039; &#039;&#039;The data sets from the δt=0.001 initial simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_IntroEnergy.png|thumb|600px|center|&#039;&#039;&#039;Figure 2.2:&#039;&#039;&#039; &#039;&#039;All initial timestep data, Total Energy vs Time&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_IntroEnergyZoomed.png|thumb|600px|center|&#039;&#039;&#039;Figure 2.3:&#039;&#039;&#039; &#039;&#039;Expansion of Figure 2.2 in region Time(0:35)&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Plot all the inital simulations as Energy vs Time, discus the best timestep to progress with.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep chosen for ongoing calculations was 0.0025. The reason being that it was one of only two that provided data showing convergence within the full simulation time (Energy vs Time graph). Of these two timesteps - 0.0025 and 0.001 - the 0.0025 is the better choice to progres with due to it&#039;s slight advantage in computational efficiency. The larger the time step, the fewer data points collected.&lt;br /&gt;
&lt;br /&gt;
[A note should be made about te 0.15 timestep - This is quite clearly a bad choice because instead of converging it diverged...]&lt;br /&gt;
&lt;br /&gt;
== 3 Simmulations under specific conditions ==&lt;br /&gt;
==== 3.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature, T* = 1.5), and two reasonable pressures in Lennard-Jones units.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run these simulations to plot the &#039;Equations of State&#039; [Below].&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The 10 phase points used inn this task were determined by the 5 temperatures (T): 1.6, 1.8, 2.0, 2.2, 2.4 and the pressures (p) 2.4, 2.8. The timestep (δt) chosen was again 0.0025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Npt_1.6_2.4.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Npt_1.6_2.4.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 3.2 Task ====&lt;br /&gt;
&lt;br /&gt;
The temperature ideally needs to be maintained as close to the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, as possible. This is done by multplying every velocity, by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &#039;target temperature&#039; is as stipulated in the input script&lt;br /&gt;
&lt;br /&gt;
The instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, will fluctuate  due to approximations made in the algorithm. &lt;br /&gt;
*If &amp;lt;math&amp;gt;T &amp;gt; \mathfrak{T}&amp;lt;/math&amp;gt;, the E&amp;lt;sub&amp;gt;K&amp;lt;/sub&amp;gt; is too high and thus &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be less than 1.&lt;br /&gt;
*If, by contrast, &amp;lt;math&amp;gt;T &amp;lt; \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;Equipartition theorem&#039; states that on average, every degree of freedom in a system at equilibrium will have K&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T/2 of energy. This sytem has 3 degrees of freedom and as such:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \mathbf{v}_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expressing in terms of the adjustment to target temperature as described above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma \mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Solve the equations for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find out the importance of the three numbers 100 1000 100000.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* 100 is used as the &#039;&#039;Nevery&#039;&#039; argument - This is the number of timesteps between inputing of values.&lt;br /&gt;
* 1000 is used as the &#039;&#039;Nrepeat&#039;&#039; argument - This is the number of times to use the input values to calculate averages.&lt;br /&gt;
* 100000 is used as the &#039;&#039;Nfreq&#039;&#039; argument - The number of timesteps between calculating averages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 {...VARIABLES...}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How much time will this simulate?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;run 100000&#039;&#039; shows the number of timesteps that will be run in the simulation.&lt;br /&gt;
&lt;br /&gt;
This shows that averages in this simulation are calculated only at the end of the simulations, as &#039;&#039;Nfreq&#039;&#039;= &#039;&#039;N&#039;&#039; (run N ...).&lt;br /&gt;
&lt;br /&gt;
==== 3.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Using the output of the simulations in 3.1, plot density as a unction of temperature, for both pressures - (Incl. Error bars + Ideal Gas). Is the simulated density higher or lower than Ideal? Why? Finaly, does the discrepancy increase or decrease w. pressure?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_NpT1.png|thumb|500px|center|&#039;&#039;&#039;Figure 3.1:&#039;&#039;&#039; &#039;&#039;A plot of Average Density vs Average Temperature for two different pressures&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_NpT_wideal.png|thumb|500px|center|&#039;&#039;&#039;Figure 3.2:&#039;&#039;&#039; &#039;&#039;A plot of Average Density vs Average Temperature for two different pressures and their relation to data with the same parameters calculated by the Ideal Gas Law&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
Theoretical results , based on the ideal gas law, give a higher density than the simulated result. (It can also be added that the discrepancy between the ideal and simulated systems increases with pressure.) It can be reasoned that the results provided by the Ideal Gas Law are higher due to the fact that particle-particle interactions are not consided.This means the repulsion that would be experienced by the particles moving closer to each other are not expressed, as such, particles the distance between particles can decrease without energyetic effects, thus increasing the density.&lt;br /&gt;
&lt;br /&gt;
== 4 Calculation of heat capacities using statistical physics ==&lt;br /&gt;
==== 4.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simulations and plot C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V as a function of temperature. Is this as expected?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Cv_2.0_0.2.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Cv_2.0_0.2.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
For this section, 5 simulations were run for each of the two densities: 0.2, 0.8. These simulations corresponded to each of the respective temperatures: 2.0, 2.2, 2.4, 2.6, 2.8 (in reduced units). The desired results of these simulations were the calculated values of the Heat Capacity at constant volume, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;. The results can be seen in Figure 4.1 as a funtion of the average temperatures.&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Cv graph1.png|thumb|500px|center|&#039;&#039;&#039;Figure 4.1:&#039;&#039;&#039; &#039;&#039;A plot comparing Heat Capacity/Volume vs Average Temperature for two different densities&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
These graphs do indeed follow the trend expected, that is similar to the trend seen in a crystalline solid for example. The Heat Capacity is proportional to 1/T&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; [As seen in the Equations below] and as such a negative trend should be observed. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With reagrds to density, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V increases as the density increases - which is again as expected - because heat capacity is dependant on the amount of material per volume, and thus a denser material (with the same volume) has more mass or moles per unit voulume.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 5 Radial Distribution Functions ==&lt;br /&gt;
==== 5.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; From simulations of the Lennard-Jones system in the three phases, Compute &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; in VMD. Discuss the differences in the 3 RDFs and thus what this means about the structure in each phase.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the solid phase, illustrate which lattics sites the first 3 peaks correspond to. What is the Lattice spacing? What is the Coordination number for each of the first three peaks?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The initial parameters for the simulations, in order to specify the correct phases were:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; Temperature: (For all phases) = 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Densities: (Solid) = 1.50, (Liquid) = 0.85, (Vapour) = 0.01 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Finally, to provide the initial positions of atoms, the simple cubic model was used for Liquid and Vapour, but for Solid FCC was used.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These parameters were calculated by examining the Lennar-Jones phase diagram found in literature. [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 &amp;lt;sup&amp;gt;[2] &amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_g(r).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.1:&#039;&#039;&#039; &#039;&#039;The Radial Distribution Functions of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Int(g(r))dr.png|thumb|500px|center|&#039;&#039;&#039;Figure 5.2:&#039;&#039;&#039; &#039;&#039;The Integrals of the RDFs of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Solid3(g(r)).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.3:&#039;&#039;&#039; &#039;&#039;The RDF of the solid, paying particular attention to the first 3 peaks&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 6 Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
==== 6.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simlations for the three phases, to calculate the mean squared displacement and velocity autocorrelation functions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 6.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Measure D from it&#039;s connection to the MSD, for simulations and data for approx. one million atom simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equation for the Diffusion Coefficient, &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
However, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be much more simply estimated by fitting the linear section of a Total MSD vs Timestep graph and dividing by 6.&lt;br /&gt;
This gives the following values for D (in reduced units) for the smaller simulations carried out by myself:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.31x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.33&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 1.55&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.1-6.3]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_my_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.1:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Solid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.2:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Liquid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.3:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Vapour simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
In comparison below are the values for D (in reduced units) for the larger (approx. 1 million atom) data supplied:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.71x10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.75&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 6.28&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.4-6.6]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_mil_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.4:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Solid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_mil_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.5:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Liquid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsDil_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.6:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Vapour MSD data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 7 References ==&lt;br /&gt;
 1.  LAMMPS Manual, http://lammps.sandia.gov/doc/Section_commands.html#lammps-input-script , accessed November 2016&lt;br /&gt;
 2.  JP Hansen, L Verlet, Phys Rev, 184, 1969, http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=590095</id>
		<title>Rep:Mod:Yr3LiquidSimJmsD</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=590095"/>
		<updated>2017-02-24T10:56:26Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: /* 3.3 Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Jack Dawson - Yr3 Comp: Liquid Sim.=&lt;br /&gt;
&lt;br /&gt;
== 1 Theory ==&lt;br /&gt;
&lt;br /&gt;
==== 1.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Compltete the Classical Harmonic Osciallator Spreadsheet&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_HO.xls|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For δt=0.01, estimate the positions of maximum error and fit accordingly.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Max Error Graph.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.1:&#039;&#039;&#039; &#039;&#039;A plot of the error in VV algorithm data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
Figure 1.1 shows how the maximum error increases linearly. This can be rationalised by the fact that each cycle of simulation follows on from the last, so the error of the new cycle is combined to the uncertainty in a previous calculation for an older timestep and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Experiment to find the timestep range to ensure the total energy does not change by more than 1% over the course of the simulation. Why is this important?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In simulations such as this, the physical model is considered an isolated system. We are modeling the changes in velocity and thus kinetic energy changes of induvidual particles/atoms over a total timeframe at constant timesteps. As such, the particles are moving around, interacting, transfering energy between each other. However, unless we are changing variables such as Temperature, Number of particles, Volume (density) etc. during a simulation, the overall energy should remain constant. Therefore it is important to monitor the total energy to ensure our model is fitting with our physical understanding.&lt;br /&gt;
&lt;br /&gt;
From experimentation, it can be seen that to limit this total energy change over a simulation, the time step should really be smaller than 0.3. It can be seen in Figure 1.2 how the peaks and thus total energy begin to fluctuate significantly more for 0.3 and above. &lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_En_err_w_timestep.png|thumb|500px|center|&#039;&#039;&#039;Figure 1.2:&#039;&#039;&#039; &#039;&#039;Energy vs Time: a) δt=0.01, b) δt=0.03, c) δt=0.03&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Maths based upon a single Lennard-Jones interaction&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
[[File:JmsD_Maths_1.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.3:&#039;&#039;&#039; &#039;&#039;Answers to the LJ based maths task&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.5 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the number of water molecules in 1 mL under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;Density of water = 1 g/ml&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Molecular weight of wate = 18 g/mol&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Moles in 1 ml, n = 1/18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Number of molecules = n x N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 1/18 x 6.022x10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;3.35x10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;10000/N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = moles of water, n&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Mass of 10000 water molecules, m = n x 18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;The volume, V = m / 1 g/ml &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;2.99x10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.6 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?.  &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The particle should end up in position (0.2,0.1,0.7) after the application of periodic boundary conditions. &lt;br /&gt;
&lt;br /&gt;
This is because, if the number of particles in the box remains constant, if a particle excit the box on one face, it will return from the opposite. In this case, if the particle starts at (0.5,0.5,0.5) in the cubic box ((0,0,0):(1,1,1)) and moves along the vector (0.7,0.6,0.2), it will reappear from the other face, positioned now at (0.2,0.1,0.7).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.7 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; The LJ parameters for argon are &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; = 0.34 nm, &amp;lt;math&amp;gt;\epsilon\ /\ k_B&amp;lt;/math&amp;gt; = 120 K. If the LJ cutoff is r* = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T*=1.5 in real units?  &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;r = 1.088 x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; m&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;T = 180 K&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; = 0.014 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2 Equilibriation ==&lt;br /&gt;
==== 2.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Why do random starting coords cause problems in simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
If particles are placed randomly, there is chance for multiple particles to be placed in the same positions, or at least close too each other. It two particles are close or overlap, there would be very strong resulting interactions. These large forces would caus the model to deviate from its classical behaviour, and will affect properties from energy, to timestep.&lt;br /&gt;
&lt;br /&gt;
Therefore it is wise to start a liquid or gas simulation as a &#039;melt&#039; from particles on lattice points (which can allow random positioning to some degree), e.g. Simple cubic. This ensures particles will begin a suitable distance away from each other.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Prove that lattice spacing of 1.07722 gives a number density of 0.8&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; If lattice spacing is 1.07722, Volume of one cube = 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; If number density is Number / Volume, and there is one particle per cube, number density = 1 / Volume&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; 1 / 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.79999 &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;If instead FCC, and number density of 1.2, what is the length of the cubic uni cell?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; First calculate Volume of the cell: V = Number / number density &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; The Number of particles in a FCC unit cell are 4, so V = 4 / 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; The cube root of the volume will give side length...&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; (4/1.2)&amp;lt;sup&amp;gt;1/3&amp;lt;/sup&amp;gt; = 1.4938 &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the FCC latice, how many atoms would be created by create_atoms&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Assuming no other parameters  (i.e. the box size [Below]) have changed...&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
There should be 4000 atoms created.&lt;br /&gt;
&lt;br /&gt;
If there are 1000 atoms in a 10x10x10 box for a sc lattice that has one atom per unit cell, a lattice such as FCC that has 4 atoms per unit cell should yield 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find and explain the purpose of:&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;mass&#039;&#039; - Sets the mass for the types of atoms, argument(1) is the type, argument(2) is the mass.&lt;br /&gt;
*&#039;&#039;pair_style&#039;&#039; - Calculates the pair interactions (pair potentials defined as interactions between atoms within a certain distance), argument(1) &amp;quot;lj/cut&amp;quot; means this line refers to the global cutoff for all Lennard-Jones interactions, argument(2) defines the distance.&lt;br /&gt;
*&#039;&#039;pair_coeff&#039;&#039; - Provides the interaction coefficients for the interactions between atoms, arguments(1 &amp;amp; 2) refer to the attoms that interact (* means all types 1-&amp;gt;N), and arguments (3 &amp;amp; 4) are those coefficients.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.5 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Given that we are specifying x&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; and v&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt;, which integration algorithm is to be used?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; The Velocity-Verlet Algorithm &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.6 Task ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The purpose of using &#039;&#039;${timestep}&#039;&#039;, or for any other variable for that matter, is that it allows for that property in the simulation to be changed just once in the input file, as opposed to the file being manually altered on every line that variable is called.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.6 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Plot Energy, Temperature and Pressure vs Time for timestep = 0.001&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_0.001all.png|thumb|600px|center|&#039;&#039;&#039;Figure 2.1:&#039;&#039;&#039; &#039;&#039;The data sets from the δt=0.001 initial simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_IntroEnergy.png|thumb|600px|center|&#039;&#039;&#039;Figure 2.2:&#039;&#039;&#039; &#039;&#039;All initial timestep data, Total Energy vs Time&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_IntroEnergyZoomed.png|thumb|600px|center|&#039;&#039;&#039;Figure 2.3:&#039;&#039;&#039; &#039;&#039;Expansion of Figure 2.2 in region Time(0:35)&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Plot all the inital simulations as Energy vs Time, discus the best timestep to progress with.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep chosen for ongoing calculations was 0.0025. The reason being that it was one of only two that provided data showing convergence within the full simulation time (Energy vs Time graph). Of these two timesteps - 0.0025 and 0.001 - the 0.0025 is the better choice to progres with due to it&#039;s slight advantage in computational efficiency. The larger the time step, the fewer data points collected.&lt;br /&gt;
&lt;br /&gt;
[A note should be made about te 0.15 timestep - This is quite clearly a bad choice because instead of converging it diverged...]&lt;br /&gt;
&lt;br /&gt;
== 3 Simmulations under specific conditions ==&lt;br /&gt;
==== 3.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature, T* = 1.5), and two reasonable pressures in Lennard-Jones units.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run these simulations to plot the &#039;Equations of State&#039; [Below].&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The 10 phase points used inn this task were determined by the 5 temperatures (T): 1.6, 1.8, 2.0, 2.2, 2.4 and the pressures (p) 2.4, 2.8. The timestep (δt) chosen was again 0.0025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Npt_1.6_2.4.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Npt_1.6_2.4.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 3.2 Task ====&lt;br /&gt;
&lt;br /&gt;
The temperature ideally needs to be maintained as close to the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, as possible. This is done by multplying every velocity, by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &#039;target temperature&#039; is as stipulated in the input script&lt;br /&gt;
&lt;br /&gt;
The instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, will fluctuate  due to approximations made in the algorithm. &lt;br /&gt;
*If &amp;lt;math&amp;gt;T &amp;gt; \mathfrak{T}&amp;lt;/math&amp;gt;, the E&amp;lt;sub&amp;gt;K&amp;lt;/sub&amp;gt; is too high and thus &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be less than 1.&lt;br /&gt;
*If, by contrast, &amp;lt;math&amp;gt;T &amp;lt; \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;Equipartition theorem&#039; states that on average, every degree of freedom in a system at equilibrium will have K&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T/2 of energy. This sytem has 3 degrees of freedom and as such:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \mathbf{v}_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expressing in terms of the adjustment to target temperature as described above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma \mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Solve the equations for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find out the importance of the three numbers 100 1000 100000.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* 100 is used as the &#039;&#039;Nevery&#039;&#039; argument - This is the number of timesteps between inputing of values.&lt;br /&gt;
* 1000 is used as the &#039;&#039;Nrepeat&#039;&#039; argument - This is the number of times to use the input values to calculate averages.&lt;br /&gt;
* 100000 is used as the &#039;&#039;Nfreq&#039;&#039; argument - The number of timesteps between calculating averages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 {...VARIABLES...}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How much time will this simulate?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;run 100000&#039;&#039; shows the number of timesteps that will be run in the simulation.&lt;br /&gt;
&lt;br /&gt;
This shows that averages in this simulation are calculated only at the end of the simulations, as &#039;&#039;Nfreq&#039;&#039;= &#039;&#039;N&#039;&#039; (run N ...).&lt;br /&gt;
&lt;br /&gt;
==== 3.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Using the output of the simulations in 3.1, plot density as a unction of temperature, for both pressures - (Incl. Error bars + Ideal Gas). Is the simulated density higher or lower than Ideal? Why? Finaly, does the discrepancy increase or decrease w. pressure?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_NpT1.png|thumb|500px|center|&#039;&#039;&#039;Figure 3.1:&#039;&#039;&#039; &#039;&#039;A plot of Average Density vs Average Temperature for two different pressures&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 4 Calculation of heat capacities using statistical physics ==&lt;br /&gt;
==== 4.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simulations and plot C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V as a function of temperature. Is this as expected?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Cv_2.0_0.2.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Cv_2.0_0.2.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
For this section, 5 simulations were run for each of the two densities: 0.2, 0.8. These simulations corresponded to each of the respective temperatures: 2.0, 2.2, 2.4, 2.6, 2.8 (in reduced units). The desired results of these simulations were the calculated values of the Heat Capacity at constant volume, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;. The results can be seen in Figure 4.1 as a funtion of the average temperatures.&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Cv graph1.png|thumb|500px|center|&#039;&#039;&#039;Figure 4.1:&#039;&#039;&#039; &#039;&#039;A plot comparing Heat Capacity/Volume vs Average Temperature for two different densities&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
These graphs do indeed follow the trend expected, that is similar to the trend seen in a crystalline solid for example. The Heat Capacity is proportional to 1/T&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; [As seen in the Equations below] and as such a negative trend should be observed. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With reagrds to density, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V increases as the density increases - which is again as expected - because heat capacity is dependant on the amount of material per volume, and thus a denser material (with the same volume) has more mass or moles per unit voulume.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 5 Radial Distribution Functions ==&lt;br /&gt;
==== 5.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; From simulations of the Lennard-Jones system in the three phases, Compute &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; in VMD. Discuss the differences in the 3 RDFs and thus what this means about the structure in each phase.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the solid phase, illustrate which lattics sites the first 3 peaks correspond to. What is the Lattice spacing? What is the Coordination number for each of the first three peaks?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The initial parameters for the simulations, in order to specify the correct phases were:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; Temperature: (For all phases) = 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Densities: (Solid) = 1.50, (Liquid) = 0.85, (Vapour) = 0.01 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Finally, to provide the initial positions of atoms, the simple cubic model was used for Liquid and Vapour, but for Solid FCC was used.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These parameters were calculated by examining the Lennar-Jones phase diagram found in literature. [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 &amp;lt;sup&amp;gt;[2] &amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_g(r).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.1:&#039;&#039;&#039; &#039;&#039;The Radial Distribution Functions of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Int(g(r))dr.png|thumb|500px|center|&#039;&#039;&#039;Figure 5.2:&#039;&#039;&#039; &#039;&#039;The Integrals of the RDFs of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Solid3(g(r)).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.3:&#039;&#039;&#039; &#039;&#039;The RDF of the solid, paying particular attention to the first 3 peaks&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 6 Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
==== 6.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simlations for the three phases, to calculate the mean squared displacement and velocity autocorrelation functions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 6.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Measure D from it&#039;s connection to the MSD, for simulations and data for approx. one million atom simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equation for the Diffusion Coefficient, &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
However, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be much more simply estimated by fitting the linear section of a Total MSD vs Timestep graph and dividing by 6.&lt;br /&gt;
This gives the following values for D (in reduced units) for the smaller simulations carried out by myself:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.31x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.33&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 1.55&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.1-6.3]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_my_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.1:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Solid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.2:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Liquid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.3:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Vapour simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
In comparison below are the values for D (in reduced units) for the larger (approx. 1 million atom) data supplied:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.71x10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.75&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 6.28&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.4-6.6]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_mil_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.4:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Solid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_mil_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.5:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Liquid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsDil_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.6:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Vapour MSD data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 7 References ==&lt;br /&gt;
 1.  LAMMPS Manual, http://lammps.sandia.gov/doc/Section_commands.html#lammps-input-script , accessed November 2016&lt;br /&gt;
 2.  JP Hansen, L Verlet, Phys Rev, 184, 1969, http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=590042</id>
		<title>Rep:Mod:Yr3LiquidSimJmsD</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=590042"/>
		<updated>2017-02-24T10:44:50Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: /* 2.6 Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Jack Dawson - Yr3 Comp: Liquid Sim.=&lt;br /&gt;
&lt;br /&gt;
== 1 Theory ==&lt;br /&gt;
&lt;br /&gt;
==== 1.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Compltete the Classical Harmonic Osciallator Spreadsheet&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_HO.xls|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For δt=0.01, estimate the positions of maximum error and fit accordingly.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Max Error Graph.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.1:&#039;&#039;&#039; &#039;&#039;A plot of the error in VV algorithm data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
Figure 1.1 shows how the maximum error increases linearly. This can be rationalised by the fact that each cycle of simulation follows on from the last, so the error of the new cycle is combined to the uncertainty in a previous calculation for an older timestep and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Experiment to find the timestep range to ensure the total energy does not change by more than 1% over the course of the simulation. Why is this important?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In simulations such as this, the physical model is considered an isolated system. We are modeling the changes in velocity and thus kinetic energy changes of induvidual particles/atoms over a total timeframe at constant timesteps. As such, the particles are moving around, interacting, transfering energy between each other. However, unless we are changing variables such as Temperature, Number of particles, Volume (density) etc. during a simulation, the overall energy should remain constant. Therefore it is important to monitor the total energy to ensure our model is fitting with our physical understanding.&lt;br /&gt;
&lt;br /&gt;
From experimentation, it can be seen that to limit this total energy change over a simulation, the time step should really be smaller than 0.3. It can be seen in Figure 1.2 how the peaks and thus total energy begin to fluctuate significantly more for 0.3 and above. &lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_En_err_w_timestep.png|thumb|500px|center|&#039;&#039;&#039;Figure 1.2:&#039;&#039;&#039; &#039;&#039;Energy vs Time: a) δt=0.01, b) δt=0.03, c) δt=0.03&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Maths based upon a single Lennard-Jones interaction&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
[[File:JmsD_Maths_1.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.3:&#039;&#039;&#039; &#039;&#039;Answers to the LJ based maths task&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.5 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the number of water molecules in 1 mL under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;Density of water = 1 g/ml&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Molecular weight of wate = 18 g/mol&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Moles in 1 ml, n = 1/18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Number of molecules = n x N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 1/18 x 6.022x10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;3.35x10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;10000/N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = moles of water, n&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Mass of 10000 water molecules, m = n x 18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;The volume, V = m / 1 g/ml &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;2.99x10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.6 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?.  &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The particle should end up in position (0.2,0.1,0.7) after the application of periodic boundary conditions. &lt;br /&gt;
&lt;br /&gt;
This is because, if the number of particles in the box remains constant, if a particle excit the box on one face, it will return from the opposite. In this case, if the particle starts at (0.5,0.5,0.5) in the cubic box ((0,0,0):(1,1,1)) and moves along the vector (0.7,0.6,0.2), it will reappear from the other face, positioned now at (0.2,0.1,0.7).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.7 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; The LJ parameters for argon are &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; = 0.34 nm, &amp;lt;math&amp;gt;\epsilon\ /\ k_B&amp;lt;/math&amp;gt; = 120 K. If the LJ cutoff is r* = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T*=1.5 in real units?  &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;r = 1.088 x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; m&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;T = 180 K&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; = 0.014 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2 Equilibriation ==&lt;br /&gt;
==== 2.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Why do random starting coords cause problems in simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
If particles are placed randomly, there is chance for multiple particles to be placed in the same positions, or at least close too each other. It two particles are close or overlap, there would be very strong resulting interactions. These large forces would caus the model to deviate from its classical behaviour, and will affect properties from energy, to timestep.&lt;br /&gt;
&lt;br /&gt;
Therefore it is wise to start a liquid or gas simulation as a &#039;melt&#039; from particles on lattice points (which can allow random positioning to some degree), e.g. Simple cubic. This ensures particles will begin a suitable distance away from each other.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Prove that lattice spacing of 1.07722 gives a number density of 0.8&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; If lattice spacing is 1.07722, Volume of one cube = 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; If number density is Number / Volume, and there is one particle per cube, number density = 1 / Volume&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; 1 / 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.79999 &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;If instead FCC, and number density of 1.2, what is the length of the cubic uni cell?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; First calculate Volume of the cell: V = Number / number density &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; The Number of particles in a FCC unit cell are 4, so V = 4 / 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; The cube root of the volume will give side length...&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; (4/1.2)&amp;lt;sup&amp;gt;1/3&amp;lt;/sup&amp;gt; = 1.4938 &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the FCC latice, how many atoms would be created by create_atoms&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Assuming no other parameters  (i.e. the box size [Below]) have changed...&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
There should be 4000 atoms created.&lt;br /&gt;
&lt;br /&gt;
If there are 1000 atoms in a 10x10x10 box for a sc lattice that has one atom per unit cell, a lattice such as FCC that has 4 atoms per unit cell should yield 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find and explain the purpose of:&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;mass&#039;&#039; - Sets the mass for the types of atoms, argument(1) is the type, argument(2) is the mass.&lt;br /&gt;
*&#039;&#039;pair_style&#039;&#039; - Calculates the pair interactions (pair potentials defined as interactions between atoms within a certain distance), argument(1) &amp;quot;lj/cut&amp;quot; means this line refers to the global cutoff for all Lennard-Jones interactions, argument(2) defines the distance.&lt;br /&gt;
*&#039;&#039;pair_coeff&#039;&#039; - Provides the interaction coefficients for the interactions between atoms, arguments(1 &amp;amp; 2) refer to the attoms that interact (* means all types 1-&amp;gt;N), and arguments (3 &amp;amp; 4) are those coefficients.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.5 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Given that we are specifying x&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; and v&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt;, which integration algorithm is to be used?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; The Velocity-Verlet Algorithm &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.6 Task ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The purpose of using &#039;&#039;${timestep}&#039;&#039;, or for any other variable for that matter, is that it allows for that property in the simulation to be changed just once in the input file, as opposed to the file being manually altered on every line that variable is called.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.6 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Plot Energy, Temperature and Pressure vs Time for timestep = 0.001&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_0.001all.png|thumb|600px|center|&#039;&#039;&#039;Figure 2.1:&#039;&#039;&#039; &#039;&#039;The data sets from the δt=0.001 initial simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_IntroEnergy.png|thumb|600px|center|&#039;&#039;&#039;Figure 2.2:&#039;&#039;&#039; &#039;&#039;All initial timestep data, Total Energy vs Time&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_IntroEnergyZoomed.png|thumb|600px|center|&#039;&#039;&#039;Figure 2.3:&#039;&#039;&#039; &#039;&#039;Expansion of Figure 2.2 in region Time(0:35)&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Plot all the inital simulations as Energy vs Time, discus the best timestep to progress with.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep chosen for ongoing calculations was 0.0025. The reason being that it was one of only two that provided data showing convergence within the full simulation time (Energy vs Time graph). Of these two timesteps - 0.0025 and 0.001 - the 0.0025 is the better choice to progres with due to it&#039;s slight advantage in computational efficiency. The larger the time step, the fewer data points collected.&lt;br /&gt;
&lt;br /&gt;
[A note should be made about te 0.15 timestep - This is quite clearly a bad choice because instead of converging it diverged...]&lt;br /&gt;
&lt;br /&gt;
== 3 Simmulations under specific conditions ==&lt;br /&gt;
==== 3.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature, T* = 1.5), and two reasonable pressures in Lennard-Jones units.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run these simulations to plot the &#039;Equations of State&#039; [Below].&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The 10 phase points used inn this task were determined by the 5 temperatures (T): 1.6, 1.8, 2.0, 2.2, 2.4 and the pressures (p) 2.4, 2.8. The timestep (δt) chosen was again 0.0025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Npt_1.6_2.4.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Npt_1.6_2.4.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 3.2 Task ====&lt;br /&gt;
&lt;br /&gt;
The temperature ideally needs to be maintained as close to the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, as possible. This is done by multplying every velocity, by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &#039;target temperature&#039; is as stipulated in the input script&lt;br /&gt;
&lt;br /&gt;
The instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, will fluctuate  due to approximations made in the algorithm. &lt;br /&gt;
*If &amp;lt;math&amp;gt;T &amp;gt; \mathfrak{T}&amp;lt;/math&amp;gt;, the E&amp;lt;sub&amp;gt;K&amp;lt;/sub&amp;gt; is too high and thus &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be less than 1.&lt;br /&gt;
*If, by contrast, &amp;lt;math&amp;gt;T &amp;lt; \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;Equipartition theorem&#039; states that on average, every degree of freedom in a system at equilibrium will have K&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T/2 of energy. This sytem has 3 degrees of freedom and as such:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \mathbf{v}_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expressing in terms of the adjustment to target temperature as described above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma \mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Solve the equations for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find out the importance of the three numbers 100 1000 100000.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How often are values sampled for the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How many measurments contribute to the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 {...VARIABLES...}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How much time will this simulate?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Using the output of the simulations in 3.1, plot density as a unction of temperature, for both pressures - (Incl. Error bars + Ideal Gas). Is the simulated density higher or lower than Ideal? Why? Finaly, does the discrepancy increase or decrease w. pressure?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_NpT1.png|thumb|500px|center|&#039;&#039;&#039;Figure 3.1:&#039;&#039;&#039; &#039;&#039;A plot of Average Density vs Average Temperature for two different pressures&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 4 Calculation of heat capacities using statistical physics ==&lt;br /&gt;
==== 4.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simulations and plot C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V as a function of temperature. Is this as expected?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Cv_2.0_0.2.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Cv_2.0_0.2.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
For this section, 5 simulations were run for each of the two densities: 0.2, 0.8. These simulations corresponded to each of the respective temperatures: 2.0, 2.2, 2.4, 2.6, 2.8 (in reduced units). The desired results of these simulations were the calculated values of the Heat Capacity at constant volume, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;. The results can be seen in Figure 4.1 as a funtion of the average temperatures.&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Cv graph1.png|thumb|500px|center|&#039;&#039;&#039;Figure 4.1:&#039;&#039;&#039; &#039;&#039;A plot comparing Heat Capacity/Volume vs Average Temperature for two different densities&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
These graphs do indeed follow the trend expected, that is similar to the trend seen in a crystalline solid for example. The Heat Capacity is proportional to 1/T&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; [As seen in the Equations below] and as such a negative trend should be observed. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With reagrds to density, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V increases as the density increases - which is again as expected - because heat capacity is dependant on the amount of material per volume, and thus a denser material (with the same volume) has more mass or moles per unit voulume.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 5 Radial Distribution Functions ==&lt;br /&gt;
==== 5.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; From simulations of the Lennard-Jones system in the three phases, Compute &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; in VMD. Discuss the differences in the 3 RDFs and thus what this means about the structure in each phase.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the solid phase, illustrate which lattics sites the first 3 peaks correspond to. What is the Lattice spacing? What is the Coordination number for each of the first three peaks?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The initial parameters for the simulations, in order to specify the correct phases were:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; Temperature: (For all phases) = 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Densities: (Solid) = 1.50, (Liquid) = 0.85, (Vapour) = 0.01 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Finally, to provide the initial positions of atoms, the simple cubic model was used for Liquid and Vapour, but for Solid FCC was used.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These parameters were calculated by examining the Lennar-Jones phase diagram found in literature. [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 &amp;lt;sup&amp;gt;[2] &amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_g(r).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.1:&#039;&#039;&#039; &#039;&#039;The Radial Distribution Functions of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Int(g(r))dr.png|thumb|500px|center|&#039;&#039;&#039;Figure 5.2:&#039;&#039;&#039; &#039;&#039;The Integrals of the RDFs of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Solid3(g(r)).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.3:&#039;&#039;&#039; &#039;&#039;The RDF of the solid, paying particular attention to the first 3 peaks&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 6 Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
==== 6.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simlations for the three phases, to calculate the mean squared displacement and velocity autocorrelation functions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 6.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Measure D from it&#039;s connection to the MSD, for simulations and data for approx. one million atom simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equation for the Diffusion Coefficient, &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
However, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be much more simply estimated by fitting the linear section of a Total MSD vs Timestep graph and dividing by 6.&lt;br /&gt;
This gives the following values for D (in reduced units) for the smaller simulations carried out by myself:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.31x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.33&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 1.55&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.1-6.3]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_my_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.1:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Solid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.2:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Liquid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.3:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Vapour simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
In comparison below are the values for D (in reduced units) for the larger (approx. 1 million atom) data supplied:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.71x10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.75&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 6.28&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.4-6.6]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_mil_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.4:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Solid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_mil_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.5:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Liquid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsDil_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.6:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Vapour MSD data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 7 References ==&lt;br /&gt;
 1.  LAMMPS Manual, http://lammps.sandia.gov/doc/Section_commands.html#lammps-input-script , accessed November 2016&lt;br /&gt;
 2.  JP Hansen, L Verlet, Phys Rev, 184, 1969, http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:JmsD_IntroEnergyZoomed.png&amp;diff=590026</id>
		<title>File:JmsD IntroEnergyZoomed.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:JmsD_IntroEnergyZoomed.png&amp;diff=590026"/>
		<updated>2017-02-24T10:43:13Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=590024</id>
		<title>Rep:Mod:Yr3LiquidSimJmsD</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=590024"/>
		<updated>2017-02-24T10:42:45Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: /* 2.6 Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Jack Dawson - Yr3 Comp: Liquid Sim.=&lt;br /&gt;
&lt;br /&gt;
== 1 Theory ==&lt;br /&gt;
&lt;br /&gt;
==== 1.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Compltete the Classical Harmonic Osciallator Spreadsheet&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_HO.xls|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For δt=0.01, estimate the positions of maximum error and fit accordingly.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Max Error Graph.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.1:&#039;&#039;&#039; &#039;&#039;A plot of the error in VV algorithm data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
Figure 1.1 shows how the maximum error increases linearly. This can be rationalised by the fact that each cycle of simulation follows on from the last, so the error of the new cycle is combined to the uncertainty in a previous calculation for an older timestep and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Experiment to find the timestep range to ensure the total energy does not change by more than 1% over the course of the simulation. Why is this important?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In simulations such as this, the physical model is considered an isolated system. We are modeling the changes in velocity and thus kinetic energy changes of induvidual particles/atoms over a total timeframe at constant timesteps. As such, the particles are moving around, interacting, transfering energy between each other. However, unless we are changing variables such as Temperature, Number of particles, Volume (density) etc. during a simulation, the overall energy should remain constant. Therefore it is important to monitor the total energy to ensure our model is fitting with our physical understanding.&lt;br /&gt;
&lt;br /&gt;
From experimentation, it can be seen that to limit this total energy change over a simulation, the time step should really be smaller than 0.3. It can be seen in Figure 1.2 how the peaks and thus total energy begin to fluctuate significantly more for 0.3 and above. &lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_En_err_w_timestep.png|thumb|500px|center|&#039;&#039;&#039;Figure 1.2:&#039;&#039;&#039; &#039;&#039;Energy vs Time: a) δt=0.01, b) δt=0.03, c) δt=0.03&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Maths based upon a single Lennard-Jones interaction&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
[[File:JmsD_Maths_1.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.3:&#039;&#039;&#039; &#039;&#039;Answers to the LJ based maths task&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.5 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the number of water molecules in 1 mL under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;Density of water = 1 g/ml&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Molecular weight of wate = 18 g/mol&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Moles in 1 ml, n = 1/18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Number of molecules = n x N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 1/18 x 6.022x10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;3.35x10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;10000/N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = moles of water, n&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Mass of 10000 water molecules, m = n x 18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;The volume, V = m / 1 g/ml &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;2.99x10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.6 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?.  &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The particle should end up in position (0.2,0.1,0.7) after the application of periodic boundary conditions. &lt;br /&gt;
&lt;br /&gt;
This is because, if the number of particles in the box remains constant, if a particle excit the box on one face, it will return from the opposite. In this case, if the particle starts at (0.5,0.5,0.5) in the cubic box ((0,0,0):(1,1,1)) and moves along the vector (0.7,0.6,0.2), it will reappear from the other face, positioned now at (0.2,0.1,0.7).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.7 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; The LJ parameters for argon are &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; = 0.34 nm, &amp;lt;math&amp;gt;\epsilon\ /\ k_B&amp;lt;/math&amp;gt; = 120 K. If the LJ cutoff is r* = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T*=1.5 in real units?  &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;r = 1.088 x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; m&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;T = 180 K&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; = 0.014 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2 Equilibriation ==&lt;br /&gt;
==== 2.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Why do random starting coords cause problems in simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
If particles are placed randomly, there is chance for multiple particles to be placed in the same positions, or at least close too each other. It two particles are close or overlap, there would be very strong resulting interactions. These large forces would caus the model to deviate from its classical behaviour, and will affect properties from energy, to timestep.&lt;br /&gt;
&lt;br /&gt;
Therefore it is wise to start a liquid or gas simulation as a &#039;melt&#039; from particles on lattice points (which can allow random positioning to some degree), e.g. Simple cubic. This ensures particles will begin a suitable distance away from each other.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Prove that lattice spacing of 1.07722 gives a number density of 0.8&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; If lattice spacing is 1.07722, Volume of one cube = 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; If number density is Number / Volume, and there is one particle per cube, number density = 1 / Volume&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; 1 / 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.79999 &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;If instead FCC, and number density of 1.2, what is the length of the cubic uni cell?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; First calculate Volume of the cell: V = Number / number density &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; The Number of particles in a FCC unit cell are 4, so V = 4 / 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; The cube root of the volume will give side length...&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; (4/1.2)&amp;lt;sup&amp;gt;1/3&amp;lt;/sup&amp;gt; = 1.4938 &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the FCC latice, how many atoms would be created by create_atoms&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Assuming no other parameters  (i.e. the box size [Below]) have changed...&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
There should be 4000 atoms created.&lt;br /&gt;
&lt;br /&gt;
If there are 1000 atoms in a 10x10x10 box for a sc lattice that has one atom per unit cell, a lattice such as FCC that has 4 atoms per unit cell should yield 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find and explain the purpose of:&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;mass&#039;&#039; - Sets the mass for the types of atoms, argument(1) is the type, argument(2) is the mass.&lt;br /&gt;
*&#039;&#039;pair_style&#039;&#039; - Calculates the pair interactions (pair potentials defined as interactions between atoms within a certain distance), argument(1) &amp;quot;lj/cut&amp;quot; means this line refers to the global cutoff for all Lennard-Jones interactions, argument(2) defines the distance.&lt;br /&gt;
*&#039;&#039;pair_coeff&#039;&#039; - Provides the interaction coefficients for the interactions between atoms, arguments(1 &amp;amp; 2) refer to the attoms that interact (* means all types 1-&amp;gt;N), and arguments (3 &amp;amp; 4) are those coefficients.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.5 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Given that we are specifying x&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; and v&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt;, which integration algorithm is to be used?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; The Velocity-Verlet Algorithm &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.6 Task ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The purpose of using &#039;&#039;${timestep}&#039;&#039;, or for any other variable for that matter, is that it allows for that property in the simulation to be changed just once in the input file, as opposed to the file being manually altered on every line that variable is called.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.6 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Plot Energy, Temperature and Pressure vs Time for timestep = 0.001&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_0.001all.png|thumb|600px|center|&#039;&#039;&#039;Figure 2.1:&#039;&#039;&#039; &#039;&#039;The data sets from the δt=0.001 initial simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_IntroEnergy.png|thumb|600px|center|&#039;&#039;&#039;Figure 2.2:&#039;&#039;&#039; &#039;&#039;All initial timestep data, Total Energy vs Time&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_IntroEnergyZoomed.png|thumb|600px|center|&#039;&#039;&#039;Figure 2.3:&#039;&#039;&#039; &#039;&#039;Expansion of Figure 2.2 in region Time(0:35)&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The timestep chosen for ongoing calculations was 0.0025. The reason being that it was one of only two that provided data showing convergence within the full simulation time (Energy vs Time graph). Of these two timesteps - 0.0025 and 0.001 - the 0.0025 is the better choice to progres with due to it&#039;s slight advantage in computational efficiency. The larger the time step, the fewer data points collected.&lt;br /&gt;
&lt;br /&gt;
[A note should be made about te 0.15 timestep - This is quite clearly a bad choice because instead of converging it diverged...]&lt;br /&gt;
&lt;br /&gt;
== 3 Simmulations under specific conditions ==&lt;br /&gt;
==== 3.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature, T* = 1.5), and two reasonable pressures in Lennard-Jones units.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run these simulations to plot the &#039;Equations of State&#039; [Below].&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The 10 phase points used inn this task were determined by the 5 temperatures (T): 1.6, 1.8, 2.0, 2.2, 2.4 and the pressures (p) 2.4, 2.8. The timestep (δt) chosen was again 0.0025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Npt_1.6_2.4.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Npt_1.6_2.4.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 3.2 Task ====&lt;br /&gt;
&lt;br /&gt;
The temperature ideally needs to be maintained as close to the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, as possible. This is done by multplying every velocity, by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &#039;target temperature&#039; is as stipulated in the input script&lt;br /&gt;
&lt;br /&gt;
The instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, will fluctuate  due to approximations made in the algorithm. &lt;br /&gt;
*If &amp;lt;math&amp;gt;T &amp;gt; \mathfrak{T}&amp;lt;/math&amp;gt;, the E&amp;lt;sub&amp;gt;K&amp;lt;/sub&amp;gt; is too high and thus &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be less than 1.&lt;br /&gt;
*If, by contrast, &amp;lt;math&amp;gt;T &amp;lt; \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;Equipartition theorem&#039; states that on average, every degree of freedom in a system at equilibrium will have K&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T/2 of energy. This sytem has 3 degrees of freedom and as such:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \mathbf{v}_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expressing in terms of the adjustment to target temperature as described above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma \mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Solve the equations for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find out the importance of the three numbers 100 1000 100000.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How often are values sampled for the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How many measurments contribute to the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 {...VARIABLES...}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How much time will this simulate?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Using the output of the simulations in 3.1, plot density as a unction of temperature, for both pressures - (Incl. Error bars + Ideal Gas). Is the simulated density higher or lower than Ideal? Why? Finaly, does the discrepancy increase or decrease w. pressure?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_NpT1.png|thumb|500px|center|&#039;&#039;&#039;Figure 3.1:&#039;&#039;&#039; &#039;&#039;A plot of Average Density vs Average Temperature for two different pressures&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 4 Calculation of heat capacities using statistical physics ==&lt;br /&gt;
==== 4.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simulations and plot C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V as a function of temperature. Is this as expected?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Cv_2.0_0.2.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Cv_2.0_0.2.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
For this section, 5 simulations were run for each of the two densities: 0.2, 0.8. These simulations corresponded to each of the respective temperatures: 2.0, 2.2, 2.4, 2.6, 2.8 (in reduced units). The desired results of these simulations were the calculated values of the Heat Capacity at constant volume, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;. The results can be seen in Figure 4.1 as a funtion of the average temperatures.&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Cv graph1.png|thumb|500px|center|&#039;&#039;&#039;Figure 4.1:&#039;&#039;&#039; &#039;&#039;A plot comparing Heat Capacity/Volume vs Average Temperature for two different densities&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
These graphs do indeed follow the trend expected, that is similar to the trend seen in a crystalline solid for example. The Heat Capacity is proportional to 1/T&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; [As seen in the Equations below] and as such a negative trend should be observed. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With reagrds to density, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V increases as the density increases - which is again as expected - because heat capacity is dependant on the amount of material per volume, and thus a denser material (with the same volume) has more mass or moles per unit voulume.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 5 Radial Distribution Functions ==&lt;br /&gt;
==== 5.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; From simulations of the Lennard-Jones system in the three phases, Compute &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; in VMD. Discuss the differences in the 3 RDFs and thus what this means about the structure in each phase.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the solid phase, illustrate which lattics sites the first 3 peaks correspond to. What is the Lattice spacing? What is the Coordination number for each of the first three peaks?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The initial parameters for the simulations, in order to specify the correct phases were:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; Temperature: (For all phases) = 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Densities: (Solid) = 1.50, (Liquid) = 0.85, (Vapour) = 0.01 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Finally, to provide the initial positions of atoms, the simple cubic model was used for Liquid and Vapour, but for Solid FCC was used.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These parameters were calculated by examining the Lennar-Jones phase diagram found in literature. [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 &amp;lt;sup&amp;gt;[2] &amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_g(r).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.1:&#039;&#039;&#039; &#039;&#039;The Radial Distribution Functions of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Int(g(r))dr.png|thumb|500px|center|&#039;&#039;&#039;Figure 5.2:&#039;&#039;&#039; &#039;&#039;The Integrals of the RDFs of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Solid3(g(r)).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.3:&#039;&#039;&#039; &#039;&#039;The RDF of the solid, paying particular attention to the first 3 peaks&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 6 Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
==== 6.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simlations for the three phases, to calculate the mean squared displacement and velocity autocorrelation functions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 6.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Measure D from it&#039;s connection to the MSD, for simulations and data for approx. one million atom simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equation for the Diffusion Coefficient, &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
However, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be much more simply estimated by fitting the linear section of a Total MSD vs Timestep graph and dividing by 6.&lt;br /&gt;
This gives the following values for D (in reduced units) for the smaller simulations carried out by myself:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.31x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.33&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 1.55&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.1-6.3]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_my_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.1:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Solid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.2:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Liquid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.3:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Vapour simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
In comparison below are the values for D (in reduced units) for the larger (approx. 1 million atom) data supplied:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.71x10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.75&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 6.28&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.4-6.6]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_mil_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.4:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Solid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_mil_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.5:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Liquid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsDil_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.6:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Vapour MSD data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 7 References ==&lt;br /&gt;
 1.  LAMMPS Manual, http://lammps.sandia.gov/doc/Section_commands.html#lammps-input-script , accessed November 2016&lt;br /&gt;
 2.  JP Hansen, L Verlet, Phys Rev, 184, 1969, http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589985</id>
		<title>Rep:Mod:Yr3LiquidSimJmsD</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589985"/>
		<updated>2017-02-24T10:37:15Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: /* 2.6 Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Jack Dawson - Yr3 Comp: Liquid Sim.=&lt;br /&gt;
&lt;br /&gt;
== 1 Theory ==&lt;br /&gt;
&lt;br /&gt;
==== 1.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Compltete the Classical Harmonic Osciallator Spreadsheet&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_HO.xls|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For δt=0.01, estimate the positions of maximum error and fit accordingly.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Max Error Graph.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.1:&#039;&#039;&#039; &#039;&#039;A plot of the error in VV algorithm data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
Figure 1.1 shows how the maximum error increases linearly. This can be rationalised by the fact that each cycle of simulation follows on from the last, so the error of the new cycle is combined to the uncertainty in a previous calculation for an older timestep and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Experiment to find the timestep range to ensure the total energy does not change by more than 1% over the course of the simulation. Why is this important?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In simulations such as this, the physical model is considered an isolated system. We are modeling the changes in velocity and thus kinetic energy changes of induvidual particles/atoms over a total timeframe at constant timesteps. As such, the particles are moving around, interacting, transfering energy between each other. However, unless we are changing variables such as Temperature, Number of particles, Volume (density) etc. during a simulation, the overall energy should remain constant. Therefore it is important to monitor the total energy to ensure our model is fitting with our physical understanding.&lt;br /&gt;
&lt;br /&gt;
From experimentation, it can be seen that to limit this total energy change over a simulation, the time step should really be smaller than 0.3. It can be seen in Figure 1.2 how the peaks and thus total energy begin to fluctuate significantly more for 0.3 and above. &lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_En_err_w_timestep.png|thumb|500px|center|&#039;&#039;&#039;Figure 1.2:&#039;&#039;&#039; &#039;&#039;Energy vs Time: a) δt=0.01, b) δt=0.03, c) δt=0.03&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Maths based upon a single Lennard-Jones interaction&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
[[File:JmsD_Maths_1.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.3:&#039;&#039;&#039; &#039;&#039;Answers to the LJ based maths task&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.5 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the number of water molecules in 1 mL under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;Density of water = 1 g/ml&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Molecular weight of wate = 18 g/mol&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Moles in 1 ml, n = 1/18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Number of molecules = n x N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 1/18 x 6.022x10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;3.35x10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;10000/N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = moles of water, n&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Mass of 10000 water molecules, m = n x 18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;The volume, V = m / 1 g/ml &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;2.99x10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.6 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?.  &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The particle should end up in position (0.2,0.1,0.7) after the application of periodic boundary conditions. &lt;br /&gt;
&lt;br /&gt;
This is because, if the number of particles in the box remains constant, if a particle excit the box on one face, it will return from the opposite. In this case, if the particle starts at (0.5,0.5,0.5) in the cubic box ((0,0,0):(1,1,1)) and moves along the vector (0.7,0.6,0.2), it will reappear from the other face, positioned now at (0.2,0.1,0.7).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.7 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; The LJ parameters for argon are &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; = 0.34 nm, &amp;lt;math&amp;gt;\epsilon\ /\ k_B&amp;lt;/math&amp;gt; = 120 K. If the LJ cutoff is r* = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T*=1.5 in real units?  &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;r = 1.088 x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; m&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;T = 180 K&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; = 0.014 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2 Equilibriation ==&lt;br /&gt;
==== 2.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Why do random starting coords cause problems in simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
If particles are placed randomly, there is chance for multiple particles to be placed in the same positions, or at least close too each other. It two particles are close or overlap, there would be very strong resulting interactions. These large forces would caus the model to deviate from its classical behaviour, and will affect properties from energy, to timestep.&lt;br /&gt;
&lt;br /&gt;
Therefore it is wise to start a liquid or gas simulation as a &#039;melt&#039; from particles on lattice points (which can allow random positioning to some degree), e.g. Simple cubic. This ensures particles will begin a suitable distance away from each other.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Prove that lattice spacing of 1.07722 gives a number density of 0.8&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; If lattice spacing is 1.07722, Volume of one cube = 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; If number density is Number / Volume, and there is one particle per cube, number density = 1 / Volume&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; 1 / 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.79999 &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;If instead FCC, and number density of 1.2, what is the length of the cubic uni cell?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; First calculate Volume of the cell: V = Number / number density &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; The Number of particles in a FCC unit cell are 4, so V = 4 / 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; The cube root of the volume will give side length...&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; (4/1.2)&amp;lt;sup&amp;gt;1/3&amp;lt;/sup&amp;gt; = 1.4938 &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the FCC latice, how many atoms would be created by create_atoms&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Assuming no other parameters  (i.e. the box size [Below]) have changed...&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
There should be 4000 atoms created.&lt;br /&gt;
&lt;br /&gt;
If there are 1000 atoms in a 10x10x10 box for a sc lattice that has one atom per unit cell, a lattice such as FCC that has 4 atoms per unit cell should yield 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find and explain the purpose of:&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;mass&#039;&#039; - Sets the mass for the types of atoms, argument(1) is the type, argument(2) is the mass.&lt;br /&gt;
*&#039;&#039;pair_style&#039;&#039; - Calculates the pair interactions (pair potentials defined as interactions between atoms within a certain distance), argument(1) &amp;quot;lj/cut&amp;quot; means this line refers to the global cutoff for all Lennard-Jones interactions, argument(2) defines the distance.&lt;br /&gt;
*&#039;&#039;pair_coeff&#039;&#039; - Provides the interaction coefficients for the interactions between atoms, arguments(1 &amp;amp; 2) refer to the attoms that interact (* means all types 1-&amp;gt;N), and arguments (3 &amp;amp; 4) are those coefficients.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.5 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Given that we are specifying x&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; and v&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt;, which integration algorithm is to be used?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; The Velocity-Verlet Algorithm &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.6 Task ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The purpose of using &#039;&#039;${timestep}&#039;&#039;, or for any other variable for that matter, is that it allows for that property in the simulation to be changed just once in the input file, as opposed to the file being manually altered on every line that variable is called.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.6 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Plot Energy, Temperature and Pressure vs Time for timestep = 0.001&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_0.001all.png|thumb|600px|center|&#039;&#039;&#039;Figure 2.1:&#039;&#039;&#039; &#039;&#039;The data sets from the δt=0.001 initial simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_IntroEnergy.png|thumb|600px|center|&#039;&#039;&#039;Figure 2.2:&#039;&#039;&#039; &#039;&#039;All initial timestep data, Total Energy vs Time&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The timestep chosen for ongoing calculations was 0.0025. The reason being that it was one of only two that provided data showing convergence within the full simulation time (Energy vs Time graph). Of these two timesteps - 0.0025 and 0.001 - the 0.0025 is the better choice to progres with due to it&#039;s slight advantage in computational efficiency. The larger the time step, the fewer data points collected.&lt;br /&gt;
&lt;br /&gt;
[A note should be made about te 0.15 timestep - This is quite clearly a bad choice because instead of converging it diverged...]&lt;br /&gt;
&lt;br /&gt;
== 3 Simmulations under specific conditions ==&lt;br /&gt;
==== 3.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature, T* = 1.5), and two reasonable pressures in Lennard-Jones units.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run these simulations to plot the &#039;Equations of State&#039; [Below].&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The 10 phase points used inn this task were determined by the 5 temperatures (T): 1.6, 1.8, 2.0, 2.2, 2.4 and the pressures (p) 2.4, 2.8. The timestep (δt) chosen was again 0.0025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Npt_1.6_2.4.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Npt_1.6_2.4.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 3.2 Task ====&lt;br /&gt;
&lt;br /&gt;
The temperature ideally needs to be maintained as close to the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, as possible. This is done by multplying every velocity, by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &#039;target temperature&#039; is as stipulated in the input script&lt;br /&gt;
&lt;br /&gt;
The instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, will fluctuate  due to approximations made in the algorithm. &lt;br /&gt;
*If &amp;lt;math&amp;gt;T &amp;gt; \mathfrak{T}&amp;lt;/math&amp;gt;, the E&amp;lt;sub&amp;gt;K&amp;lt;/sub&amp;gt; is too high and thus &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be less than 1.&lt;br /&gt;
*If, by contrast, &amp;lt;math&amp;gt;T &amp;lt; \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;Equipartition theorem&#039; states that on average, every degree of freedom in a system at equilibrium will have K&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T/2 of energy. This sytem has 3 degrees of freedom and as such:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \mathbf{v}_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expressing in terms of the adjustment to target temperature as described above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma \mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Solve the equations for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find out the importance of the three numbers 100 1000 100000.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How often are values sampled for the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How many measurments contribute to the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 {...VARIABLES...}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How much time will this simulate?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Using the output of the simulations in 3.1, plot density as a unction of temperature, for both pressures - (Incl. Error bars + Ideal Gas). Is the simulated density higher or lower than Ideal? Why? Finaly, does the discrepancy increase or decrease w. pressure?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_NpT1.png|thumb|500px|center|&#039;&#039;&#039;Figure 3.1:&#039;&#039;&#039; &#039;&#039;A plot of Average Density vs Average Temperature for two different pressures&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 4 Calculation of heat capacities using statistical physics ==&lt;br /&gt;
==== 4.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simulations and plot C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V as a function of temperature. Is this as expected?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Cv_2.0_0.2.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Cv_2.0_0.2.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
For this section, 5 simulations were run for each of the two densities: 0.2, 0.8. These simulations corresponded to each of the respective temperatures: 2.0, 2.2, 2.4, 2.6, 2.8 (in reduced units). The desired results of these simulations were the calculated values of the Heat Capacity at constant volume, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;. The results can be seen in Figure 4.1 as a funtion of the average temperatures.&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Cv graph1.png|thumb|500px|center|&#039;&#039;&#039;Figure 4.1:&#039;&#039;&#039; &#039;&#039;A plot comparing Heat Capacity/Volume vs Average Temperature for two different densities&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
These graphs do indeed follow the trend expected, that is similar to the trend seen in a crystalline solid for example. The Heat Capacity is proportional to 1/T&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; [As seen in the Equations below] and as such a negative trend should be observed. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With reagrds to density, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V increases as the density increases - which is again as expected - because heat capacity is dependant on the amount of material per volume, and thus a denser material (with the same volume) has more mass or moles per unit voulume.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 5 Radial Distribution Functions ==&lt;br /&gt;
==== 5.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; From simulations of the Lennard-Jones system in the three phases, Compute &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; in VMD. Discuss the differences in the 3 RDFs and thus what this means about the structure in each phase.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the solid phase, illustrate which lattics sites the first 3 peaks correspond to. What is the Lattice spacing? What is the Coordination number for each of the first three peaks?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The initial parameters for the simulations, in order to specify the correct phases were:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; Temperature: (For all phases) = 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Densities: (Solid) = 1.50, (Liquid) = 0.85, (Vapour) = 0.01 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Finally, to provide the initial positions of atoms, the simple cubic model was used for Liquid and Vapour, but for Solid FCC was used.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These parameters were calculated by examining the Lennar-Jones phase diagram found in literature. [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 &amp;lt;sup&amp;gt;[2] &amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_g(r).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.1:&#039;&#039;&#039; &#039;&#039;The Radial Distribution Functions of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Int(g(r))dr.png|thumb|500px|center|&#039;&#039;&#039;Figure 5.2:&#039;&#039;&#039; &#039;&#039;The Integrals of the RDFs of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Solid3(g(r)).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.3:&#039;&#039;&#039; &#039;&#039;The RDF of the solid, paying particular attention to the first 3 peaks&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 6 Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
==== 6.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simlations for the three phases, to calculate the mean squared displacement and velocity autocorrelation functions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 6.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Measure D from it&#039;s connection to the MSD, for simulations and data for approx. one million atom simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equation for the Diffusion Coefficient, &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
However, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be much more simply estimated by fitting the linear section of a Total MSD vs Timestep graph and dividing by 6.&lt;br /&gt;
This gives the following values for D (in reduced units) for the smaller simulations carried out by myself:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.31x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.33&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 1.55&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.1-6.3]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_my_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.1:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Solid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.2:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Liquid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.3:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Vapour simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
In comparison below are the values for D (in reduced units) for the larger (approx. 1 million atom) data supplied:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.71x10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.75&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 6.28&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.4-6.6]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_mil_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.4:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Solid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_mil_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.5:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Liquid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsDil_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.6:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Vapour MSD data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 7 References ==&lt;br /&gt;
 1.  LAMMPS Manual, http://lammps.sandia.gov/doc/Section_commands.html#lammps-input-script , accessed November 2016&lt;br /&gt;
 2.  JP Hansen, L Verlet, Phys Rev, 184, 1969, http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589982</id>
		<title>Rep:Mod:Yr3LiquidSimJmsD</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589982"/>
		<updated>2017-02-24T10:36:54Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: /* 2.6 Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Jack Dawson - Yr3 Comp: Liquid Sim.=&lt;br /&gt;
&lt;br /&gt;
== 1 Theory ==&lt;br /&gt;
&lt;br /&gt;
==== 1.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Compltete the Classical Harmonic Osciallator Spreadsheet&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_HO.xls|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For δt=0.01, estimate the positions of maximum error and fit accordingly.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Max Error Graph.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.1:&#039;&#039;&#039; &#039;&#039;A plot of the error in VV algorithm data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
Figure 1.1 shows how the maximum error increases linearly. This can be rationalised by the fact that each cycle of simulation follows on from the last, so the error of the new cycle is combined to the uncertainty in a previous calculation for an older timestep and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Experiment to find the timestep range to ensure the total energy does not change by more than 1% over the course of the simulation. Why is this important?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In simulations such as this, the physical model is considered an isolated system. We are modeling the changes in velocity and thus kinetic energy changes of induvidual particles/atoms over a total timeframe at constant timesteps. As such, the particles are moving around, interacting, transfering energy between each other. However, unless we are changing variables such as Temperature, Number of particles, Volume (density) etc. during a simulation, the overall energy should remain constant. Therefore it is important to monitor the total energy to ensure our model is fitting with our physical understanding.&lt;br /&gt;
&lt;br /&gt;
From experimentation, it can be seen that to limit this total energy change over a simulation, the time step should really be smaller than 0.3. It can be seen in Figure 1.2 how the peaks and thus total energy begin to fluctuate significantly more for 0.3 and above. &lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_En_err_w_timestep.png|thumb|500px|center|&#039;&#039;&#039;Figure 1.2:&#039;&#039;&#039; &#039;&#039;Energy vs Time: a) δt=0.01, b) δt=0.03, c) δt=0.03&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Maths based upon a single Lennard-Jones interaction&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
[[File:JmsD_Maths_1.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.3:&#039;&#039;&#039; &#039;&#039;Answers to the LJ based maths task&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.5 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the number of water molecules in 1 mL under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;Density of water = 1 g/ml&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Molecular weight of wate = 18 g/mol&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Moles in 1 ml, n = 1/18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Number of molecules = n x N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 1/18 x 6.022x10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;3.35x10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;10000/N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = moles of water, n&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Mass of 10000 water molecules, m = n x 18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;The volume, V = m / 1 g/ml &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;2.99x10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.6 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?.  &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The particle should end up in position (0.2,0.1,0.7) after the application of periodic boundary conditions. &lt;br /&gt;
&lt;br /&gt;
This is because, if the number of particles in the box remains constant, if a particle excit the box on one face, it will return from the opposite. In this case, if the particle starts at (0.5,0.5,0.5) in the cubic box ((0,0,0):(1,1,1)) and moves along the vector (0.7,0.6,0.2), it will reappear from the other face, positioned now at (0.2,0.1,0.7).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.7 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; The LJ parameters for argon are &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; = 0.34 nm, &amp;lt;math&amp;gt;\epsilon\ /\ k_B&amp;lt;/math&amp;gt; = 120 K. If the LJ cutoff is r* = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T*=1.5 in real units?  &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;r = 1.088 x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; m&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;T = 180 K&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; = 0.014 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2 Equilibriation ==&lt;br /&gt;
==== 2.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Why do random starting coords cause problems in simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
If particles are placed randomly, there is chance for multiple particles to be placed in the same positions, or at least close too each other. It two particles are close or overlap, there would be very strong resulting interactions. These large forces would caus the model to deviate from its classical behaviour, and will affect properties from energy, to timestep.&lt;br /&gt;
&lt;br /&gt;
Therefore it is wise to start a liquid or gas simulation as a &#039;melt&#039; from particles on lattice points (which can allow random positioning to some degree), e.g. Simple cubic. This ensures particles will begin a suitable distance away from each other.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Prove that lattice spacing of 1.07722 gives a number density of 0.8&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; If lattice spacing is 1.07722, Volume of one cube = 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; If number density is Number / Volume, and there is one particle per cube, number density = 1 / Volume&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; 1 / 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.79999 &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;If instead FCC, and number density of 1.2, what is the length of the cubic uni cell?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; First calculate Volume of the cell: V = Number / number density &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; The Number of particles in a FCC unit cell are 4, so V = 4 / 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; The cube root of the volume will give side length...&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; (4/1.2)&amp;lt;sup&amp;gt;1/3&amp;lt;/sup&amp;gt; = 1.4938 &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the FCC latice, how many atoms would be created by create_atoms&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Assuming no other parameters  (i.e. the box size [Below]) have changed...&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
There should be 4000 atoms created.&lt;br /&gt;
&lt;br /&gt;
If there are 1000 atoms in a 10x10x10 box for a sc lattice that has one atom per unit cell, a lattice such as FCC that has 4 atoms per unit cell should yield 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find and explain the purpose of:&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;mass&#039;&#039; - Sets the mass for the types of atoms, argument(1) is the type, argument(2) is the mass.&lt;br /&gt;
*&#039;&#039;pair_style&#039;&#039; - Calculates the pair interactions (pair potentials defined as interactions between atoms within a certain distance), argument(1) &amp;quot;lj/cut&amp;quot; means this line refers to the global cutoff for all Lennard-Jones interactions, argument(2) defines the distance.&lt;br /&gt;
*&#039;&#039;pair_coeff&#039;&#039; - Provides the interaction coefficients for the interactions between atoms, arguments(1 &amp;amp; 2) refer to the attoms that interact (* means all types 1-&amp;gt;N), and arguments (3 &amp;amp; 4) are those coefficients.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.5 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Given that we are specifying x&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; and v&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt;, which integration algorithm is to be used?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; The Velocity-Verlet Algorithm &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.6 Task ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The purpose of using &#039;&#039;${timestep}&#039;&#039;, or for any other variable for that matter, is that it allows for that property in the simulation to be changed just once in the input file, as opposed to the file being manually altered on every line that variable is called.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.6 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Plot Energy, Temperature and Pressure vs Time for timestep = 0.001&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_0.001all.png|thumb|500px|center|&#039;&#039;&#039;Figure 2.1:&#039;&#039;&#039; &#039;&#039;The data sets from the δt=0.001 initial simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_IntroEnergy.png|thumb|500px|center|&#039;&#039;&#039;Figure 2.2:&#039;&#039;&#039; &#039;&#039;All initial timestep data, Total Energy vs Time&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The timestep chosen for ongoing calculations was 0.0025. The reason being that it was one of only two that provided data showing convergence within the full simulation time (Energy vs Time graph). Of these two timesteps - 0.0025 and 0.001 - the 0.0025 is the better choice to progres with due to it&#039;s slight advantage in computational efficiency. The larger the time step, the fewer data points collected.&lt;br /&gt;
&lt;br /&gt;
[A note should be made about te 0.15 timestep - This is quite clearly a bad choice because instead of converging it diverged...]&lt;br /&gt;
&lt;br /&gt;
== 3 Simmulations under specific conditions ==&lt;br /&gt;
==== 3.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature, T* = 1.5), and two reasonable pressures in Lennard-Jones units.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run these simulations to plot the &#039;Equations of State&#039; [Below].&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The 10 phase points used inn this task were determined by the 5 temperatures (T): 1.6, 1.8, 2.0, 2.2, 2.4 and the pressures (p) 2.4, 2.8. The timestep (δt) chosen was again 0.0025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Npt_1.6_2.4.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Npt_1.6_2.4.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 3.2 Task ====&lt;br /&gt;
&lt;br /&gt;
The temperature ideally needs to be maintained as close to the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, as possible. This is done by multplying every velocity, by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &#039;target temperature&#039; is as stipulated in the input script&lt;br /&gt;
&lt;br /&gt;
The instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, will fluctuate  due to approximations made in the algorithm. &lt;br /&gt;
*If &amp;lt;math&amp;gt;T &amp;gt; \mathfrak{T}&amp;lt;/math&amp;gt;, the E&amp;lt;sub&amp;gt;K&amp;lt;/sub&amp;gt; is too high and thus &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be less than 1.&lt;br /&gt;
*If, by contrast, &amp;lt;math&amp;gt;T &amp;lt; \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;Equipartition theorem&#039; states that on average, every degree of freedom in a system at equilibrium will have K&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T/2 of energy. This sytem has 3 degrees of freedom and as such:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \mathbf{v}_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expressing in terms of the adjustment to target temperature as described above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma \mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Solve the equations for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find out the importance of the three numbers 100 1000 100000.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How often are values sampled for the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How many measurments contribute to the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 {...VARIABLES...}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How much time will this simulate?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Using the output of the simulations in 3.1, plot density as a unction of temperature, for both pressures - (Incl. Error bars + Ideal Gas). Is the simulated density higher or lower than Ideal? Why? Finaly, does the discrepancy increase or decrease w. pressure?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_NpT1.png|thumb|500px|center|&#039;&#039;&#039;Figure 3.1:&#039;&#039;&#039; &#039;&#039;A plot of Average Density vs Average Temperature for two different pressures&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 4 Calculation of heat capacities using statistical physics ==&lt;br /&gt;
==== 4.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simulations and plot C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V as a function of temperature. Is this as expected?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Cv_2.0_0.2.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Cv_2.0_0.2.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
For this section, 5 simulations were run for each of the two densities: 0.2, 0.8. These simulations corresponded to each of the respective temperatures: 2.0, 2.2, 2.4, 2.6, 2.8 (in reduced units). The desired results of these simulations were the calculated values of the Heat Capacity at constant volume, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;. The results can be seen in Figure 4.1 as a funtion of the average temperatures.&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Cv graph1.png|thumb|500px|center|&#039;&#039;&#039;Figure 4.1:&#039;&#039;&#039; &#039;&#039;A plot comparing Heat Capacity/Volume vs Average Temperature for two different densities&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
These graphs do indeed follow the trend expected, that is similar to the trend seen in a crystalline solid for example. The Heat Capacity is proportional to 1/T&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; [As seen in the Equations below] and as such a negative trend should be observed. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With reagrds to density, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V increases as the density increases - which is again as expected - because heat capacity is dependant on the amount of material per volume, and thus a denser material (with the same volume) has more mass or moles per unit voulume.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 5 Radial Distribution Functions ==&lt;br /&gt;
==== 5.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; From simulations of the Lennard-Jones system in the three phases, Compute &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; in VMD. Discuss the differences in the 3 RDFs and thus what this means about the structure in each phase.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the solid phase, illustrate which lattics sites the first 3 peaks correspond to. What is the Lattice spacing? What is the Coordination number for each of the first three peaks?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The initial parameters for the simulations, in order to specify the correct phases were:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; Temperature: (For all phases) = 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Densities: (Solid) = 1.50, (Liquid) = 0.85, (Vapour) = 0.01 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Finally, to provide the initial positions of atoms, the simple cubic model was used for Liquid and Vapour, but for Solid FCC was used.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These parameters were calculated by examining the Lennar-Jones phase diagram found in literature. [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 &amp;lt;sup&amp;gt;[2] &amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_g(r).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.1:&#039;&#039;&#039; &#039;&#039;The Radial Distribution Functions of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Int(g(r))dr.png|thumb|500px|center|&#039;&#039;&#039;Figure 5.2:&#039;&#039;&#039; &#039;&#039;The Integrals of the RDFs of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Solid3(g(r)).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.3:&#039;&#039;&#039; &#039;&#039;The RDF of the solid, paying particular attention to the first 3 peaks&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 6 Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
==== 6.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simlations for the three phases, to calculate the mean squared displacement and velocity autocorrelation functions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 6.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Measure D from it&#039;s connection to the MSD, for simulations and data for approx. one million atom simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equation for the Diffusion Coefficient, &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
However, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be much more simply estimated by fitting the linear section of a Total MSD vs Timestep graph and dividing by 6.&lt;br /&gt;
This gives the following values for D (in reduced units) for the smaller simulations carried out by myself:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.31x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.33&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 1.55&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.1-6.3]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_my_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.1:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Solid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.2:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Liquid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.3:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Vapour simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
In comparison below are the values for D (in reduced units) for the larger (approx. 1 million atom) data supplied:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.71x10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.75&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 6.28&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.4-6.6]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_mil_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.4:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Solid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_mil_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.5:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Liquid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsDil_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.6:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Vapour MSD data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 7 References ==&lt;br /&gt;
 1.  LAMMPS Manual, http://lammps.sandia.gov/doc/Section_commands.html#lammps-input-script , accessed November 2016&lt;br /&gt;
 2.  JP Hansen, L Verlet, Phys Rev, 184, 1969, http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:JmsD_IntroEnergy.png&amp;diff=589972</id>
		<title>File:JmsD IntroEnergy.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:JmsD_IntroEnergy.png&amp;diff=589972"/>
		<updated>2017-02-24T10:35:22Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589890</id>
		<title>Rep:Mod:Yr3LiquidSimJmsD</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589890"/>
		<updated>2017-02-24T10:22:55Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: /* 2.6 Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Jack Dawson - Yr3 Comp: Liquid Sim.=&lt;br /&gt;
&lt;br /&gt;
== 1 Theory ==&lt;br /&gt;
&lt;br /&gt;
==== 1.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Compltete the Classical Harmonic Osciallator Spreadsheet&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_HO.xls|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For δt=0.01, estimate the positions of maximum error and fit accordingly.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Max Error Graph.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.1:&#039;&#039;&#039; &#039;&#039;A plot of the error in VV algorithm data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
Figure 1.1 shows how the maximum error increases linearly. This can be rationalised by the fact that each cycle of simulation follows on from the last, so the error of the new cycle is combined to the uncertainty in a previous calculation for an older timestep and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Experiment to find the timestep range to ensure the total energy does not change by more than 1% over the course of the simulation. Why is this important?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In simulations such as this, the physical model is considered an isolated system. We are modeling the changes in velocity and thus kinetic energy changes of induvidual particles/atoms over a total timeframe at constant timesteps. As such, the particles are moving around, interacting, transfering energy between each other. However, unless we are changing variables such as Temperature, Number of particles, Volume (density) etc. during a simulation, the overall energy should remain constant. Therefore it is important to monitor the total energy to ensure our model is fitting with our physical understanding.&lt;br /&gt;
&lt;br /&gt;
From experimentation, it can be seen that to limit this total energy change over a simulation, the time step should really be smaller than 0.3. It can be seen in Figure 1.2 how the peaks and thus total energy begin to fluctuate significantly more for 0.3 and above. &lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_En_err_w_timestep.png|thumb|500px|center|&#039;&#039;&#039;Figure 1.2:&#039;&#039;&#039; &#039;&#039;Energy vs Time: a) δt=0.01, b) δt=0.03, c) δt=0.03&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Maths based upon a single Lennard-Jones interaction&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
[[File:JmsD_Maths_1.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.3:&#039;&#039;&#039; &#039;&#039;Answers to the LJ based maths task&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.5 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the number of water molecules in 1 mL under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;Density of water = 1 g/ml&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Molecular weight of wate = 18 g/mol&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Moles in 1 ml, n = 1/18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Number of molecules = n x N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 1/18 x 6.022x10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;3.35x10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;10000/N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = moles of water, n&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Mass of 10000 water molecules, m = n x 18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;The volume, V = m / 1 g/ml &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;2.99x10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.6 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?.  &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The particle should end up in position (0.2,0.1,0.7) after the application of periodic boundary conditions. &lt;br /&gt;
&lt;br /&gt;
This is because, if the number of particles in the box remains constant, if a particle excit the box on one face, it will return from the opposite. In this case, if the particle starts at (0.5,0.5,0.5) in the cubic box ((0,0,0):(1,1,1)) and moves along the vector (0.7,0.6,0.2), it will reappear from the other face, positioned now at (0.2,0.1,0.7).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.7 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; The LJ parameters for argon are &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; = 0.34 nm, &amp;lt;math&amp;gt;\epsilon\ /\ k_B&amp;lt;/math&amp;gt; = 120 K. If the LJ cutoff is r* = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T*=1.5 in real units?  &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;r = 1.088 x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; m&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;T = 180 K&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; = 0.014 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2 Equilibriation ==&lt;br /&gt;
==== 2.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Why do random starting coords cause problems in simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
If particles are placed randomly, there is chance for multiple particles to be placed in the same positions, or at least close too each other. It two particles are close or overlap, there would be very strong resulting interactions. These large forces would caus the model to deviate from its classical behaviour, and will affect properties from energy, to timestep.&lt;br /&gt;
&lt;br /&gt;
Therefore it is wise to start a liquid or gas simulation as a &#039;melt&#039; from particles on lattice points (which can allow random positioning to some degree), e.g. Simple cubic. This ensures particles will begin a suitable distance away from each other.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Prove that lattice spacing of 1.07722 gives a number density of 0.8&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; If lattice spacing is 1.07722, Volume of one cube = 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; If number density is Number / Volume, and there is one particle per cube, number density = 1 / Volume&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; 1 / 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.79999 &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;If instead FCC, and number density of 1.2, what is the length of the cubic uni cell?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; First calculate Volume of the cell: V = Number / number density &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; The Number of particles in a FCC unit cell are 4, so V = 4 / 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; The cube root of the volume will give side length...&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; (4/1.2)&amp;lt;sup&amp;gt;1/3&amp;lt;/sup&amp;gt; = 1.4938 &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the FCC latice, how many atoms would be created by create_atoms&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Assuming no other parameters  (i.e. the box size [Below]) have changed...&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
There should be 4000 atoms created.&lt;br /&gt;
&lt;br /&gt;
If there are 1000 atoms in a 10x10x10 box for a sc lattice that has one atom per unit cell, a lattice such as FCC that has 4 atoms per unit cell should yield 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find and explain the purpose of:&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;mass&#039;&#039; - Sets the mass for the types of atoms, argument(1) is the type, argument(2) is the mass.&lt;br /&gt;
*&#039;&#039;pair_style&#039;&#039; - Calculates the pair interactions (pair potentials defined as interactions between atoms within a certain distance), argument(1) &amp;quot;lj/cut&amp;quot; means this line refers to the global cutoff for all Lennard-Jones interactions, argument(2) defines the distance.&lt;br /&gt;
*&#039;&#039;pair_coeff&#039;&#039; - Provides the interaction coefficients for the interactions between atoms, arguments(1 &amp;amp; 2) refer to the attoms that interact (* means all types 1-&amp;gt;N), and arguments (3 &amp;amp; 4) are those coefficients.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.5 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Given that we are specifying x&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; and v&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt;, which integration algorithm is to be used?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; The Velocity-Verlet Algorithm &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.6 Task ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The purpose of using &#039;&#039;${timestep}&#039;&#039;, or for any other variable for that matter, is that it allows for that property in the simulation to be changed just once in the input file, as opposed to the file being manually altered on every line that variable is called.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.6 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Plot Energy, Temperature and Pressure vs Time for timestep = 0.001&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_0.001all.png|thumb|800px|center|&#039;&#039;&#039;Figure 2.1:&#039;&#039;&#039; &#039;&#039;The data sets from the δt=0.001 initial simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The timestep chosen for ongoing calculations was 0.0025. The reason being that it was one of only two that provided data showing convergence within the full simulation time (Energy vs Time graph). Of these two timesteps - 0.0025 and 0.001 - the 0.0025 is the better choice to progres with due to it&#039;s slight advantage in computational efficiency. The larger the time step, the fewer data points collected.&lt;br /&gt;
&lt;br /&gt;
[A note should be made about te 0.15 timestep - This is quite clearly a bad choice because instead of converging it diverged...]&lt;br /&gt;
&lt;br /&gt;
== 3 Simmulations under specific conditions ==&lt;br /&gt;
==== 3.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature, T* = 1.5), and two reasonable pressures in Lennard-Jones units.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run these simulations to plot the &#039;Equations of State&#039; [Below].&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The 10 phase points used inn this task were determined by the 5 temperatures (T): 1.6, 1.8, 2.0, 2.2, 2.4 and the pressures (p) 2.4, 2.8. The timestep (δt) chosen was again 0.0025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Npt_1.6_2.4.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Npt_1.6_2.4.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 3.2 Task ====&lt;br /&gt;
&lt;br /&gt;
The temperature ideally needs to be maintained as close to the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, as possible. This is done by multplying every velocity, by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &#039;target temperature&#039; is as stipulated in the input script&lt;br /&gt;
&lt;br /&gt;
The instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, will fluctuate  due to approximations made in the algorithm. &lt;br /&gt;
*If &amp;lt;math&amp;gt;T &amp;gt; \mathfrak{T}&amp;lt;/math&amp;gt;, the E&amp;lt;sub&amp;gt;K&amp;lt;/sub&amp;gt; is too high and thus &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be less than 1.&lt;br /&gt;
*If, by contrast, &amp;lt;math&amp;gt;T &amp;lt; \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;Equipartition theorem&#039; states that on average, every degree of freedom in a system at equilibrium will have K&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T/2 of energy. This sytem has 3 degrees of freedom and as such:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \mathbf{v}_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expressing in terms of the adjustment to target temperature as described above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma \mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Solve the equations for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find out the importance of the three numbers 100 1000 100000.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How often are values sampled for the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How many measurments contribute to the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 {...VARIABLES...}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How much time will this simulate?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Using the output of the simulations in 3.1, plot density as a unction of temperature, for both pressures - (Incl. Error bars + Ideal Gas). Is the simulated density higher or lower than Ideal? Why? Finaly, does the discrepancy increase or decrease w. pressure?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_NpT1.png|thumb|500px|center|&#039;&#039;&#039;Figure 3.1:&#039;&#039;&#039; &#039;&#039;A plot of Average Density vs Average Temperature for two different pressures&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 4 Calculation of heat capacities using statistical physics ==&lt;br /&gt;
==== 4.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simulations and plot C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V as a function of temperature. Is this as expected?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Cv_2.0_0.2.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Cv_2.0_0.2.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
For this section, 5 simulations were run for each of the two densities: 0.2, 0.8. These simulations corresponded to each of the respective temperatures: 2.0, 2.2, 2.4, 2.6, 2.8 (in reduced units). The desired results of these simulations were the calculated values of the Heat Capacity at constant volume, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;. The results can be seen in Figure 4.1 as a funtion of the average temperatures.&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Cv graph1.png|thumb|500px|center|&#039;&#039;&#039;Figure 4.1:&#039;&#039;&#039; &#039;&#039;A plot comparing Heat Capacity/Volume vs Average Temperature for two different densities&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
These graphs do indeed follow the trend expected, that is similar to the trend seen in a crystalline solid for example. The Heat Capacity is proportional to 1/T&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; [As seen in the Equations below] and as such a negative trend should be observed. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With reagrds to density, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V increases as the density increases - which is again as expected - because heat capacity is dependant on the amount of material per volume, and thus a denser material (with the same volume) has more mass or moles per unit voulume.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 5 Radial Distribution Functions ==&lt;br /&gt;
==== 5.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; From simulations of the Lennard-Jones system in the three phases, Compute &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; in VMD. Discuss the differences in the 3 RDFs and thus what this means about the structure in each phase.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the solid phase, illustrate which lattics sites the first 3 peaks correspond to. What is the Lattice spacing? What is the Coordination number for each of the first three peaks?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The initial parameters for the simulations, in order to specify the correct phases were:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; Temperature: (For all phases) = 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Densities: (Solid) = 1.50, (Liquid) = 0.85, (Vapour) = 0.01 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Finally, to provide the initial positions of atoms, the simple cubic model was used for Liquid and Vapour, but for Solid FCC was used.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These parameters were calculated by examining the Lennar-Jones phase diagram found in literature. [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 &amp;lt;sup&amp;gt;[2] &amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_g(r).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.1:&#039;&#039;&#039; &#039;&#039;The Radial Distribution Functions of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Int(g(r))dr.png|thumb|500px|center|&#039;&#039;&#039;Figure 5.2:&#039;&#039;&#039; &#039;&#039;The Integrals of the RDFs of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Solid3(g(r)).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.3:&#039;&#039;&#039; &#039;&#039;The RDF of the solid, paying particular attention to the first 3 peaks&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 6 Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
==== 6.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simlations for the three phases, to calculate the mean squared displacement and velocity autocorrelation functions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 6.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Measure D from it&#039;s connection to the MSD, for simulations and data for approx. one million atom simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equation for the Diffusion Coefficient, &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
However, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be much more simply estimated by fitting the linear section of a Total MSD vs Timestep graph and dividing by 6.&lt;br /&gt;
This gives the following values for D (in reduced units) for the smaller simulations carried out by myself:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.31x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.33&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 1.55&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.1-6.3]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_my_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.1:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Solid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.2:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Liquid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.3:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Vapour simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
In comparison below are the values for D (in reduced units) for the larger (approx. 1 million atom) data supplied:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.71x10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.75&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 6.28&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.4-6.6]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_mil_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.4:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Solid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_mil_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.5:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Liquid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsDil_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.6:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Vapour MSD data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 7 References ==&lt;br /&gt;
 1.  LAMMPS Manual, http://lammps.sandia.gov/doc/Section_commands.html#lammps-input-script , accessed November 2016&lt;br /&gt;
 2.  JP Hansen, L Verlet, Phys Rev, 184, 1969, http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589826</id>
		<title>Rep:Mod:Yr3LiquidSimJmsD</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589826"/>
		<updated>2017-02-24T10:11:28Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: /* Jack Dawson - Yr3 Comp: Liquid Sim. */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Jack Dawson - Yr3 Comp: Liquid Sim.=&lt;br /&gt;
&lt;br /&gt;
== 1 Theory ==&lt;br /&gt;
&lt;br /&gt;
==== 1.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Compltete the Classical Harmonic Osciallator Spreadsheet&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_HO.xls|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For δt=0.01, estimate the positions of maximum error and fit accordingly.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Max Error Graph.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.1:&#039;&#039;&#039; &#039;&#039;A plot of the error in VV algorithm data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
Figure 1.1 shows how the maximum error increases linearly. This can be rationalised by the fact that each cycle of simulation follows on from the last, so the error of the new cycle is combined to the uncertainty in a previous calculation for an older timestep and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Experiment to find the timestep range to ensure the total energy does not change by more than 1% over the course of the simulation. Why is this important?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In simulations such as this, the physical model is considered an isolated system. We are modeling the changes in velocity and thus kinetic energy changes of induvidual particles/atoms over a total timeframe at constant timesteps. As such, the particles are moving around, interacting, transfering energy between each other. However, unless we are changing variables such as Temperature, Number of particles, Volume (density) etc. during a simulation, the overall energy should remain constant. Therefore it is important to monitor the total energy to ensure our model is fitting with our physical understanding.&lt;br /&gt;
&lt;br /&gt;
From experimentation, it can be seen that to limit this total energy change over a simulation, the time step should really be smaller than 0.3. It can be seen in Figure 1.2 how the peaks and thus total energy begin to fluctuate significantly more for 0.3 and above. &lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_En_err_w_timestep.png|thumb|500px|center|&#039;&#039;&#039;Figure 1.2:&#039;&#039;&#039; &#039;&#039;Energy vs Time: a) δt=0.01, b) δt=0.03, c) δt=0.03&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Maths based upon a single Lennard-Jones interaction&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
[[File:JmsD_Maths_1.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.3:&#039;&#039;&#039; &#039;&#039;Answers to the LJ based maths task&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.5 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the number of water molecules in 1 mL under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;Density of water = 1 g/ml&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Molecular weight of wate = 18 g/mol&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Moles in 1 ml, n = 1/18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Number of molecules = n x N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 1/18 x 6.022x10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;3.35x10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;10000/N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = moles of water, n&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Mass of 10000 water molecules, m = n x 18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;The volume, V = m / 1 g/ml &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;2.99x10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.6 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?.  &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The particle should end up in position (0.2,0.1,0.7) after the application of periodic boundary conditions. &lt;br /&gt;
&lt;br /&gt;
This is because, if the number of particles in the box remains constant, if a particle excit the box on one face, it will return from the opposite. In this case, if the particle starts at (0.5,0.5,0.5) in the cubic box ((0,0,0):(1,1,1)) and moves along the vector (0.7,0.6,0.2), it will reappear from the other face, positioned now at (0.2,0.1,0.7).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.7 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; The LJ parameters for argon are &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; = 0.34 nm, &amp;lt;math&amp;gt;\epsilon\ /\ k_B&amp;lt;/math&amp;gt; = 120 K. If the LJ cutoff is r* = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T*=1.5 in real units?  &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;r = 1.088 x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; m&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;T = 180 K&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; = 0.014 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2 Equilibriation ==&lt;br /&gt;
==== 2.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Why do random starting coords cause problems in simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
If particles are placed randomly, there is chance for multiple particles to be placed in the same positions, or at least close too each other. It two particles are close or overlap, there would be very strong resulting interactions. These large forces would caus the model to deviate from its classical behaviour, and will affect properties from energy, to timestep.&lt;br /&gt;
&lt;br /&gt;
Therefore it is wise to start a liquid or gas simulation as a &#039;melt&#039; from particles on lattice points (which can allow random positioning to some degree), e.g. Simple cubic. This ensures particles will begin a suitable distance away from each other.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Prove that lattice spacing of 1.07722 gives a number density of 0.8&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; If lattice spacing is 1.07722, Volume of one cube = 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; If number density is Number / Volume, and there is one particle per cube, number density = 1 / Volume&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; 1 / 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.79999 &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;If instead FCC, and number density of 1.2, what is the length of the cubic uni cell?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; First calculate Volume of the cell: V = Number / number density &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; The Number of particles in a FCC unit cell are 4, so V = 4 / 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; The cube root of the volume will give side length...&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; (4/1.2)&amp;lt;sup&amp;gt;1/3&amp;lt;/sup&amp;gt; = 1.4938 &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the FCC latice, how many atoms would be created by create_atoms&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Assuming no other parameters  (i.e. the box size [Below]) have changed...&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
There should be 4000 atoms created.&lt;br /&gt;
&lt;br /&gt;
If there are 1000 atoms in a 10x10x10 box for a sc lattice that has one atom per unit cell, a lattice such as FCC that has 4 atoms per unit cell should yield 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find and explain the purpose of:&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;mass&#039;&#039; - Sets the mass for the types of atoms, argument(1) is the type, argument(2) is the mass.&lt;br /&gt;
*&#039;&#039;pair_style&#039;&#039; - Calculates the pair interactions (pair potentials defined as interactions between atoms within a certain distance), argument(1) &amp;quot;lj/cut&amp;quot; means this line refers to the global cutoff for all Lennard-Jones interactions, argument(2) defines the distance.&lt;br /&gt;
*&#039;&#039;pair_coeff&#039;&#039; - Provides the interaction coefficients for the interactions between atoms, arguments(1 &amp;amp; 2) refer to the attoms that interact (* means all types 1-&amp;gt;N), and arguments (3 &amp;amp; 4) are those coefficients.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.5 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Given that we are specifying x&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; and v&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt;, which integration algorithm is to be used?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; The Velocity-Verlet Algorithm &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.6 Task ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The purpose of using &#039;&#039;${timestep}&#039;&#039;, or for any other variable for that matter, is that it allows for that property in the simulation to be changed just once in the input file, as opposed to the file being manually altered on every line that variable is called.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.6 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Plot Energy, Temperature and Pressure vs Time for timestep = 0.001&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_0.001all.png|thumb|800px|center|&#039;&#039;&#039;Figure 2.1:&#039;&#039;&#039; &#039;&#039;The data sets from the δt=0.001 initial simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 3 Simmulations under specific conditions ==&lt;br /&gt;
==== 3.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature, T* = 1.5), and two reasonable pressures in Lennard-Jones units.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run these simulations to plot the &#039;Equations of State&#039; [Below].&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The 10 phase points used inn this task were determined by the 5 temperatures (T): 1.6, 1.8, 2.0, 2.2, 2.4 and the pressures (p) 2.4, 2.8. The timestep (δt) chosen was again 0.0025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Npt_1.6_2.4.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Npt_1.6_2.4.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 3.2 Task ====&lt;br /&gt;
&lt;br /&gt;
The temperature ideally needs to be maintained as close to the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, as possible. This is done by multplying every velocity, by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &#039;target temperature&#039; is as stipulated in the input script&lt;br /&gt;
&lt;br /&gt;
The instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, will fluctuate  due to approximations made in the algorithm. &lt;br /&gt;
*If &amp;lt;math&amp;gt;T &amp;gt; \mathfrak{T}&amp;lt;/math&amp;gt;, the E&amp;lt;sub&amp;gt;K&amp;lt;/sub&amp;gt; is too high and thus &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be less than 1.&lt;br /&gt;
*If, by contrast, &amp;lt;math&amp;gt;T &amp;lt; \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;Equipartition theorem&#039; states that on average, every degree of freedom in a system at equilibrium will have K&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T/2 of energy. This sytem has 3 degrees of freedom and as such:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \mathbf{v}_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expressing in terms of the adjustment to target temperature as described above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma \mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Solve the equations for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find out the importance of the three numbers 100 1000 100000.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How often are values sampled for the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How many measurments contribute to the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 {...VARIABLES...}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How much time will this simulate?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Using the output of the simulations in 3.1, plot density as a unction of temperature, for both pressures - (Incl. Error bars + Ideal Gas). Is the simulated density higher or lower than Ideal? Why? Finaly, does the discrepancy increase or decrease w. pressure?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_NpT1.png|thumb|500px|center|&#039;&#039;&#039;Figure 3.1:&#039;&#039;&#039; &#039;&#039;A plot of Average Density vs Average Temperature for two different pressures&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 4 Calculation of heat capacities using statistical physics ==&lt;br /&gt;
==== 4.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simulations and plot C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V as a function of temperature. Is this as expected?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Cv_2.0_0.2.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Cv_2.0_0.2.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
For this section, 5 simulations were run for each of the two densities: 0.2, 0.8. These simulations corresponded to each of the respective temperatures: 2.0, 2.2, 2.4, 2.6, 2.8 (in reduced units). The desired results of these simulations were the calculated values of the Heat Capacity at constant volume, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;. The results can be seen in Figure 4.1 as a funtion of the average temperatures.&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Cv graph1.png|thumb|500px|center|&#039;&#039;&#039;Figure 4.1:&#039;&#039;&#039; &#039;&#039;A plot comparing Heat Capacity/Volume vs Average Temperature for two different densities&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
These graphs do indeed follow the trend expected, that is similar to the trend seen in a crystalline solid for example. The Heat Capacity is proportional to 1/T&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; [As seen in the Equations below] and as such a negative trend should be observed. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With reagrds to density, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V increases as the density increases - which is again as expected - because heat capacity is dependant on the amount of material per volume, and thus a denser material (with the same volume) has more mass or moles per unit voulume.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 5 Radial Distribution Functions ==&lt;br /&gt;
==== 5.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; From simulations of the Lennard-Jones system in the three phases, Compute &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; in VMD. Discuss the differences in the 3 RDFs and thus what this means about the structure in each phase.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the solid phase, illustrate which lattics sites the first 3 peaks correspond to. What is the Lattice spacing? What is the Coordination number for each of the first three peaks?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The initial parameters for the simulations, in order to specify the correct phases were:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; Temperature: (For all phases) = 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Densities: (Solid) = 1.50, (Liquid) = 0.85, (Vapour) = 0.01 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Finally, to provide the initial positions of atoms, the simple cubic model was used for Liquid and Vapour, but for Solid FCC was used.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These parameters were calculated by examining the Lennar-Jones phase diagram found in literature. [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 &amp;lt;sup&amp;gt;[2] &amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_g(r).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.1:&#039;&#039;&#039; &#039;&#039;The Radial Distribution Functions of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Int(g(r))dr.png|thumb|500px|center|&#039;&#039;&#039;Figure 5.2:&#039;&#039;&#039; &#039;&#039;The Integrals of the RDFs of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Solid3(g(r)).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.3:&#039;&#039;&#039; &#039;&#039;The RDF of the solid, paying particular attention to the first 3 peaks&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 6 Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
==== 6.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simlations for the three phases, to calculate the mean squared displacement and velocity autocorrelation functions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 6.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Measure D from it&#039;s connection to the MSD, for simulations and data for approx. one million atom simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equation for the Diffusion Coefficient, &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
However, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be much more simply estimated by fitting the linear section of a Total MSD vs Timestep graph and dividing by 6.&lt;br /&gt;
This gives the following values for D (in reduced units) for the smaller simulations carried out by myself:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.31x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.33&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 1.55&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.1-6.3]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_my_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.1:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Solid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.2:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Liquid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.3:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Vapour simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
In comparison below are the values for D (in reduced units) for the larger (approx. 1 million atom) data supplied:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.71x10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.75&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 6.28&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.4-6.6]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_mil_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.4:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Solid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_mil_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.5:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Liquid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsDil_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.6:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Vapour MSD data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 7 References ==&lt;br /&gt;
 1.  LAMMPS Manual, http://lammps.sandia.gov/doc/Section_commands.html#lammps-input-script , accessed November 2016&lt;br /&gt;
 2.  JP Hansen, L Verlet, Phys Rev, 184, 1969, http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:JmsD_0.001all.png&amp;diff=589820</id>
		<title>File:JmsD 0.001all.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:JmsD_0.001all.png&amp;diff=589820"/>
		<updated>2017-02-24T10:09:45Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589816</id>
		<title>Rep:Mod:Yr3LiquidSimJmsD</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589816"/>
		<updated>2017-02-24T10:09:17Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: /* Jack Dawson - Yr3 Comp: Liquid Sim. */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Jack Dawson - Yr3 Comp: Liquid Sim.=&lt;br /&gt;
&lt;br /&gt;
== 1 Theory ==&lt;br /&gt;
&lt;br /&gt;
==== 1.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Compltete the Classical Harmonic Osciallator Spreadsheet&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_HO.xls|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For δt=0.01, estimate the positions of maximum error and fit accordingly.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Max Error Graph.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.1:&#039;&#039;&#039; &#039;&#039;A plot of the error in VV algorithm data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
Figure 1.1 shows how the maximum error increases linearly. This can be rationalised by the fact that each cycle of simulation follows on from the last, so the error of the new cycle is combined to the uncertainty in a previous calculation for an older timestep and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Experiment to find the timestep range to ensure the total energy does not change by more than 1% over the course of the simulation. Why is this important?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In simulations such as this, the physical model is considered an isolated system. We are modeling the changes in velocity and thus kinetic energy changes of induvidual particles/atoms over a total timeframe at constant timesteps. As such, the particles are moving around, interacting, transfering energy between each other. However, unless we are changing variables such as Temperature, Number of particles, Volume (density) etc. during a simulation, the overall energy should remain constant. Therefore it is important to monitor the total energy to ensure our model is fitting with our physical understanding.&lt;br /&gt;
&lt;br /&gt;
From experimentation, it can be seen that to limit this total energy change over a simulation, the time step should really be smaller than 0.3. It can be seen in Figure 1.2 how the peaks and thus total energy begin to fluctuate significantly more for 0.3 and above. &lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_En_err_w_timestep.png|thumb|500px|center|&#039;&#039;&#039;Figure 1.2:&#039;&#039;&#039; &#039;&#039;Energy vs Time: a) δt=0.01, b) δt=0.03, c) δt=0.03&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Maths based upon a single Lennard-Jones interaction&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
[[File:JmsD_Maths_1.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.3:&#039;&#039;&#039; &#039;&#039;Answers to the LJ based maths task&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.5 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the number of water molecules in 1 mL under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;Density of water = 1 g/ml&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Molecular weight of wate = 18 g/mol&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Moles in 1 ml, n = 1/18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Number of molecules = n x N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 1/18 x 6.022x10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;3.35x10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;10000/N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = moles of water, n&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Mass of 10000 water molecules, m = n x 18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;The volume, V = m / 1 g/ml &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;2.99x10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.6 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?.  &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The particle should end up in position (0.2,0.1,0.7) after the application of periodic boundary conditions. &lt;br /&gt;
&lt;br /&gt;
This is because, if the number of particles in the box remains constant, if a particle excit the box on one face, it will return from the opposite. In this case, if the particle starts at (0.5,0.5,0.5) in the cubic box ((0,0,0):(1,1,1)) and moves along the vector (0.7,0.6,0.2), it will reappear from the other face, positioned now at (0.2,0.1,0.7).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.7 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; The LJ parameters for argon are &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; = 0.34 nm, &amp;lt;math&amp;gt;\epsilon\ /\ k_B&amp;lt;/math&amp;gt; = 120 K. If the LJ cutoff is r* = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T*=1.5 in real units?  &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;r = 1.088 x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; m&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;T = 180 K&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; = 0.014 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2 Equilibriation ==&lt;br /&gt;
==== 2.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Why do random starting coords cause problems in simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
If particles are placed randomly, there is chance for multiple particles to be placed in the same positions, or at least close too each other. It two particles are close or overlap, there would be very strong resulting interactions. These large forces would caus the model to deviate from its classical behaviour, and will affect properties from energy, to timestep.&lt;br /&gt;
&lt;br /&gt;
Therefore it is wise to start a liquid or gas simulation as a &#039;melt&#039; from particles on lattice points (which can allow random positioning to some degree), e.g. Simple cubic. This ensures particles will begin a suitable distance away from each other.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Prove that lattice spacing of 1.07722 gives a number density of 0.8&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; If lattice spacing is 1.07722, Volume of one cube = 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; If number density is Number / Volume, and there is one particle per cube, number density = 1 / Volume&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; 1 / 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.79999 &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;If instead FCC, and number density of 1.2, what is the length of the cubic uni cell?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; First calculate Volume of the cell: V = Number / number density &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; The Number of particles in a FCC unit cell are 4, so V = 4 / 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; The cube root of the volume will give side length...&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; (4/1.2)&amp;lt;sup&amp;gt;1/3&amp;lt;/sup&amp;gt; = 1.4938 &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the FCC latice, how many atoms would be created by create_atoms&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Assuming no other parameters  (i.e. the box size [Below]) have changed...&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
There should be 4000 atoms created.&lt;br /&gt;
&lt;br /&gt;
If there are 1000 atoms in a 10x10x10 box for a sc lattice that has one atom per unit cell, a lattice such as FCC that has 4 atoms per unit cell should yield 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find and explain the purpose of:&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;mass&#039;&#039; - Sets the mass for the types of atoms, argument(1) is the type, argument(2) is the mass.&lt;br /&gt;
*&#039;&#039;pair_style&#039;&#039; - Calculates the pair interactions (pair potentials defined as interactions between atoms within a certain distance), argument(1) &amp;quot;lj/cut&amp;quot; means this line refers to the global cutoff for all Lennard-Jones interactions, argument(2) defines the distance.&lt;br /&gt;
*&#039;&#039;pair_coeff&#039;&#039; - Provides the interaction coefficients for the interactions between atoms, arguments(1 &amp;amp; 2) refer to the attoms that interact (* means all types 1-&amp;gt;N), and arguments (3 &amp;amp; 4) are those coefficients.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.5 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Given that we are specifying x&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; and v&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt;, which integration algorithm is to be used?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; The Velocity-Verlet Algorithm &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.6 Task ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The purpose of using &#039;&#039;${timestep}&#039;&#039;, or for any other variable for that matter, is that it allows for that property in the simulation to be changed just once in the input file, as opposed to the file being manually altered on every line that variable is called.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.6 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Plot Energy, Temperature and Pressure vs Time for timestep = 0.001&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 3 Simmulations under specific conditions ==&lt;br /&gt;
==== 3.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature, T* = 1.5), and two reasonable pressures in Lennard-Jones units.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run these simulations to plot the &#039;Equations of State&#039; [Below].&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The 10 phase points used inn this task were determined by the 5 temperatures (T): 1.6, 1.8, 2.0, 2.2, 2.4 and the pressures (p) 2.4, 2.8. The timestep (δt) chosen was again 0.0025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Npt_1.6_2.4.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Npt_1.6_2.4.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 3.2 Task ====&lt;br /&gt;
&lt;br /&gt;
The temperature ideally needs to be maintained as close to the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, as possible. This is done by multplying every velocity, by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &#039;target temperature&#039; is as stipulated in the input script&lt;br /&gt;
&lt;br /&gt;
The instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, will fluctuate  due to approximations made in the algorithm. &lt;br /&gt;
*If &amp;lt;math&amp;gt;T &amp;gt; \mathfrak{T}&amp;lt;/math&amp;gt;, the E&amp;lt;sub&amp;gt;K&amp;lt;/sub&amp;gt; is too high and thus &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be less than 1.&lt;br /&gt;
*If, by contrast, &amp;lt;math&amp;gt;T &amp;lt; \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;Equipartition theorem&#039; states that on average, every degree of freedom in a system at equilibrium will have K&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T/2 of energy. This sytem has 3 degrees of freedom and as such:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \mathbf{v}_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expressing in terms of the adjustment to target temperature as described above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma \mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Solve the equations for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find out the importance of the three numbers 100 1000 100000.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How often are values sampled for the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How many measurments contribute to the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 {...VARIABLES...}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How much time will this simulate?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Using the output of the simulations in 3.1, plot density as a unction of temperature, for both pressures - (Incl. Error bars + Ideal Gas). Is the simulated density higher or lower than Ideal? Why? Finaly, does the discrepancy increase or decrease w. pressure?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_NpT1.png|thumb|500px|center|&#039;&#039;&#039;Figure 3.1:&#039;&#039;&#039; &#039;&#039;A plot of Average Density vs Average Temperature for two different pressures&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 4 Calculation of heat capacities using statistical physics ==&lt;br /&gt;
==== 4.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simulations and plot C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V as a function of temperature. Is this as expected?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Cv_2.0_0.2.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Cv_2.0_0.2.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
For this section, 5 simulations were run for each of the two densities: 0.2, 0.8. These simulations corresponded to each of the respective temperatures: 2.0, 2.2, 2.4, 2.6, 2.8 (in reduced units). The desired results of these simulations were the calculated values of the Heat Capacity at constant volume, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;. The results can be seen in Figure 4.1 as a funtion of the average temperatures.&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Cv graph1.png|thumb|500px|center|&#039;&#039;&#039;Figure 4.1:&#039;&#039;&#039; &#039;&#039;A plot comparing Heat Capacity/Volume vs Average Temperature for two different densities&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
These graphs do indeed follow the trend expected, that is similar to the trend seen in a crystalline solid for example. The Heat Capacity is proportional to 1/T&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; [As seen in the Equations below] and as such a negative trend should be observed. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With reagrds to density, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V increases as the density increases - which is again as expected - because heat capacity is dependant on the amount of material per volume, and thus a denser material (with the same volume) has more mass or moles per unit voulume.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 5 Radial Distribution Functions ==&lt;br /&gt;
==== 5.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; From simulations of the Lennard-Jones system in the three phases, Compute &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; in VMD. Discuss the differences in the 3 RDFs and thus what this means about the structure in each phase.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the solid phase, illustrate which lattics sites the first 3 peaks correspond to. What is the Lattice spacing? What is the Coordination number for each of the first three peaks?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The initial parameters for the simulations, in order to specify the correct phases were:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; Temperature: (For all phases) = 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Densities: (Solid) = 1.50, (Liquid) = 0.85, (Vapour) = 0.01 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Finally, to provide the initial positions of atoms, the simple cubic model was used for Liquid and Vapour, but for Solid FCC was used.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These parameters were calculated by examining the Lennar-Jones phase diagram found in literature. [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 &amp;lt;sup&amp;gt;[2] &amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_g(r).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.1:&#039;&#039;&#039; &#039;&#039;The Radial Distribution Functions of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Int(g(r))dr.png|thumb|500px|center|&#039;&#039;&#039;Figure 5.2:&#039;&#039;&#039; &#039;&#039;The Integrals of the RDFs of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Solid3(g(r)).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.3:&#039;&#039;&#039; &#039;&#039;The RDF of the solid, paying particular attention to the first 3 peaks&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 6 Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
==== 6.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simlations for the three phases, to calculate the mean squared displacement and velocity autocorrelation functions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 6.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Measure D from it&#039;s connection to the MSD, for simulations and data for approx. one million atom simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equation for the Diffusion Coefficient, &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
However, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be much more simply estimated by fitting the linear section of a Total MSD vs Timestep graph and dividing by 6.&lt;br /&gt;
This gives the following values for D (in reduced units) for the smaller simulations carried out by myself:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.31x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.33&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 1.55&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.1-6.3]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_my_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.1:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Solid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.2:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Liquid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.3:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Vapour simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
In comparison below are the values for D (in reduced units) for the larger (approx. 1 million atom) data supplied:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.71x10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.75&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 6.28&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.4-6.6]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_mil_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.4:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Solid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_mil_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.5:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Liquid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsDil_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.6:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Vapour MSD data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 7 References ==&lt;br /&gt;
 1.  LAMMPS Manual, http://lammps.sandia.gov/doc/Section_commands.html#lammps-input-script , accessed November 2016&lt;br /&gt;
 2.  JP Hansen, L Verlet, Phys Rev, 184, 1969, http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589695</id>
		<title>Rep:Mod:Yr3LiquidSimJmsD</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589695"/>
		<updated>2017-02-24T09:41:46Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: /* 2 Equilibriation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Jack Dawson - Yr3 Comp: Liquid Sim.=&lt;br /&gt;
&lt;br /&gt;
== 1 Theory ==&lt;br /&gt;
&lt;br /&gt;
==== 1.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Compltete the Classical Harmonic Osciallator Spreadsheet&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_HO.xls|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For δt=0.01, estimate the positions of maximum error and fit accordingly.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Max Error Graph.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.1:&#039;&#039;&#039; &#039;&#039;A plot of the error in VV algorithm data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
Figure 1.1 shows how the maximum error increases linearly. This can be rationalised by the fact that each cycle of simulation follows on from the last, so the error of the new cycle is combined to the uncertainty in a previous calculation for an older timestep and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Experiment to find the timestep range to ensure the total energy does not change by more than 1% over the course of the simulation. Why is this important?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In simulations such as this, the physical model is considered an isolated system. We are modeling the changes in velocity and thus kinetic energy changes of induvidual particles/atoms over a total timeframe at constant timesteps. As such, the particles are moving around, interacting, transfering energy between each other. However, unless we are changing variables such as Temperature, Number of particles, Volume (density) etc. during a simulation, the overall energy should remain constant. Therefore it is important to monitor the total energy to ensure our model is fitting with our physical understanding.&lt;br /&gt;
&lt;br /&gt;
From experimentation, it can be seen that to limit this total energy change over a simulation, the time step should really be smaller than 0.3. It can be seen in Figure 1.2 how the peaks and thus total energy begin to fluctuate significantly more for 0.3 and above. &lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_En_err_w_timestep.png|thumb|500px|center|&#039;&#039;&#039;Figure 1.2:&#039;&#039;&#039; &#039;&#039;Energy vs Time: a) δt=0.01, b) δt=0.03, c) δt=0.03&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Maths based upon a single Lennard-Jones interaction&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
[[File:JmsD_Maths_1.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.3:&#039;&#039;&#039; &#039;&#039;Answers to the LJ based maths task&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.5 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the number of water molecules in 1 mL under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;Density of water = 1 g/ml&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Molecular weight of wate = 18 g/mol&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Moles in 1 ml, n = 1/18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Number of molecules = n x N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 1/18 x 6.022x10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;3.35x10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;10000/N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = moles of water, n&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Mass of 10000 water molecules, m = n x 18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;The volume, V = m / 1 g/ml &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;2.99x10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.6 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?.  &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The particle should end up in position (0.2,0.1,0.7) after the application of periodic boundary conditions. &lt;br /&gt;
&lt;br /&gt;
This is because, if the number of particles in the box remains constant, if a particle excit the box on one face, it will return from the opposite. In this case, if the particle starts at (0.5,0.5,0.5) in the cubic box ((0,0,0):(1,1,1)) and moves along the vector (0.7,0.6,0.2), it will reappear from the other face, positioned now at (0.2,0.1,0.7).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.7 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; The LJ parameters for argon are &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; = 0.34 nm, &amp;lt;math&amp;gt;\epsilon\ /\ k_B&amp;lt;/math&amp;gt; = 120 K. If the LJ cutoff is r* = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T*=1.5 in real units?  &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;r = 1.088 x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; m&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;T = 180 K&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; = 0.014 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2 Equilibriation ==&lt;br /&gt;
==== 2.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Why do random starting coords cause problems in simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
If particles are placed randomly, there is chance for multiple particles to be placed in the same positions, or at least close too each other. It two particles are close or overlap, there would be very strong resulting interactions. These large forces would caus the model to deviate from its classical behaviour, and will affect properties from energy, to timestep.&lt;br /&gt;
&lt;br /&gt;
Therefore it is wise to start a liquid or gas simulation as a &#039;melt&#039; from particles on lattice points (which can allow random positioning to some degree), e.g. Simple cubic. This ensures particles will begin a suitable distance away from each other.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Prove that lattice spacing of 1.07722 gives a number density of 0.8&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; If lattice spacing is 1.07722, Volume of one cube = 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; If number density is Number / Volume, and there is one particle per cube, number density = 1 / Volume&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; 1 / 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.79999 &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;If instead FCC, and number density of 1.2, what is the length of the cubic uni cell?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; First calculate Volume of the cell: V = Number / number density &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; The Number of particles in a FCC unit cell are 4, so V = 4 / 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; The cube root of the volume will give side length...&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; (4/1.2)&amp;lt;sup&amp;gt;1/3&amp;lt;/sup&amp;gt; = 1.4938 &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the FCC latice, how many atoms would be created by create_atoms&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Assuming no other parameters  (i.e. the box size [Below]) have changed...&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
There should be 4000 atoms created.&lt;br /&gt;
&lt;br /&gt;
If there are 1000 atoms in a 10x10x10 box for a sc lattice that has one atom per unit cell, a lattice such as FCC that has 4 atoms per unit cell should yield 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find and explain the purpose of:&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;mass&#039;&#039; - Sets the mass for the types of atoms, argument(1) is the type, argument(2) is the mass.&lt;br /&gt;
*&#039;&#039;pair_style&#039;&#039; - Calculates the pair interactions (pair potentials defined as interactions between atoms within a certain distance), argument(1) &amp;quot;lj/cut&amp;quot; means this line refers to the global cutoff for all Lennard-Jones interactions, argument(2) defines the distance.&lt;br /&gt;
*&#039;&#039;pair_coeff&#039;&#039; - Provides the interaction coefficients for the interactions between atoms, arguments(1 &amp;amp; 2) refer to the attoms that interact (* means all types 1-&amp;gt;N), and arguments (3 &amp;amp; 4) are those coefficients.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.5 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Given that we are specifying x&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; and v&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt;, which integration algorithm is to be used?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; The Velocity-Verlet Algorithm &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.6 Task ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The purpose of using &#039;&#039;${timestep}&#039;&#039;, or for any other variable for that matter, is that it allows for that property in the simulation to be changed just once in the input file, as opposed to the file being manually altered on every line that variable is called.&lt;br /&gt;
&lt;br /&gt;
== 3 Simmulations under specific conditions ==&lt;br /&gt;
==== 3.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature, T* = 1.5), and two reasonable pressures in Lennard-Jones units.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run these simulations to plot the &#039;Equations of State&#039; [Below].&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The 10 phase points used inn this task were determined by the 5 temperatures (T): 1.6, 1.8, 2.0, 2.2, 2.4 and the pressures (p) 2.4, 2.8. The timestep (δt) chosen was again 0.0025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Npt_1.6_2.4.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Npt_1.6_2.4.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 3.2 Task ====&lt;br /&gt;
&lt;br /&gt;
The temperature ideally needs to be maintained as close to the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, as possible. This is done by multplying every velocity, by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &#039;target temperature&#039; is as stipulated in the input script&lt;br /&gt;
&lt;br /&gt;
The instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, will fluctuate  due to approximations made in the algorithm. &lt;br /&gt;
*If &amp;lt;math&amp;gt;T &amp;gt; \mathfrak{T}&amp;lt;/math&amp;gt;, the E&amp;lt;sub&amp;gt;K&amp;lt;/sub&amp;gt; is too high and thus &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be less than 1.&lt;br /&gt;
*If, by contrast, &amp;lt;math&amp;gt;T &amp;lt; \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;Equipartition theorem&#039; states that on average, every degree of freedom in a system at equilibrium will have K&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T/2 of energy. This sytem has 3 degrees of freedom and as such:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \mathbf{v}_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expressing in terms of the adjustment to target temperature as described above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma \mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Solve the equations for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find out the importance of the three numbers 100 1000 100000.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How often are values sampled for the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How many measurments contribute to the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 {...VARIABLES...}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How much time will this simulate?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Using the output of the simulations in 3.1, plot density as a unction of temperature, for both pressures - (Incl. Error bars + Ideal Gas). Is the simulated density higher or lower than Ideal? Why? Finaly, does the discrepancy increase or decrease w. pressure?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_NpT1.png|thumb|500px|center|&#039;&#039;&#039;Figure 3.1:&#039;&#039;&#039; &#039;&#039;A plot of Average Density vs Average Temperature for two different pressures&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 4 Calculation of heat capacities using statistical physics ==&lt;br /&gt;
==== 4.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simulations and plot C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V as a function of temperature. Is this as expected?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Cv_2.0_0.2.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Cv_2.0_0.2.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
For this section, 5 simulations were run for each of the two densities: 0.2, 0.8. These simulations corresponded to each of the respective temperatures: 2.0, 2.2, 2.4, 2.6, 2.8 (in reduced units). The desired results of these simulations were the calculated values of the Heat Capacity at constant volume, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;. The results can be seen in Figure 4.1 as a funtion of the average temperatures.&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Cv graph1.png|thumb|500px|center|&#039;&#039;&#039;Figure 4.1:&#039;&#039;&#039; &#039;&#039;A plot comparing Heat Capacity/Volume vs Average Temperature for two different densities&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
These graphs do indeed follow the trend expected, that is similar to the trend seen in a crystalline solid for example. The Heat Capacity is proportional to 1/T&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; [As seen in the Equations below] and as such a negative trend should be observed. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With reagrds to density, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V increases as the density increases - which is again as expected - because heat capacity is dependant on the amount of material per volume, and thus a denser material (with the same volume) has more mass or moles per unit voulume.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 5 Radial Distribution Functions ==&lt;br /&gt;
==== 5.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; From simulations of the Lennard-Jones system in the three phases, Compute &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; in VMD. Discuss the differences in the 3 RDFs and thus what this means about the structure in each phase.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the solid phase, illustrate which lattics sites the first 3 peaks correspond to. What is the Lattice spacing? What is the Coordination number for each of the first three peaks?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The initial parameters for the simulations, in order to specify the correct phases were:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; Temperature: (For all phases) = 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Densities: (Solid) = 1.50, (Liquid) = 0.85, (Vapour) = 0.01 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Finally, to provide the initial positions of atoms, the simple cubic model was used for Liquid and Vapour, but for Solid FCC was used.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These parameters were calculated by examining the Lennar-Jones phase diagram found in literature. [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 &amp;lt;sup&amp;gt;[2] &amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_g(r).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.1:&#039;&#039;&#039; &#039;&#039;The Radial Distribution Functions of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Int(g(r))dr.png|thumb|500px|center|&#039;&#039;&#039;Figure 5.2:&#039;&#039;&#039; &#039;&#039;The Integrals of the RDFs of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Solid3(g(r)).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.3:&#039;&#039;&#039; &#039;&#039;The RDF of the solid, paying particular attention to the first 3 peaks&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 6 Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
==== 6.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simlations for the three phases, to calculate the mean squared displacement and velocity autocorrelation functions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 6.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Measure D from it&#039;s connection to the MSD, for simulations and data for approx. one million atom simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equation for the Diffusion Coefficient, &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
However, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be much more simply estimated by fitting the linear section of a Total MSD vs Timestep graph and dividing by 6.&lt;br /&gt;
This gives the following values for D (in reduced units) for the smaller simulations carried out by myself:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.31x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.33&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 1.55&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.1-6.3]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_my_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.1:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Solid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.2:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Liquid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.3:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Vapour simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
In comparison below are the values for D (in reduced units) for the larger (approx. 1 million atom) data supplied:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.71x10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.75&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 6.28&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.4-6.6]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_mil_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.4:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Solid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_mil_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.5:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Liquid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsDil_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.6:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Vapour MSD data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 7 References ==&lt;br /&gt;
 1.  LAMMPS Manual, http://lammps.sandia.gov/doc/Section_commands.html#lammps-input-script , accessed November 2016&lt;br /&gt;
 2.  JP Hansen, L Verlet, Phys Rev, 184, 1969, http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589648</id>
		<title>Rep:Mod:Yr3LiquidSimJmsD</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589648"/>
		<updated>2017-02-24T09:26:46Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: /* 2 Equilibriation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Jack Dawson - Yr3 Comp: Liquid Sim.=&lt;br /&gt;
&lt;br /&gt;
== 1 Theory ==&lt;br /&gt;
&lt;br /&gt;
==== 1.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Compltete the Classical Harmonic Osciallator Spreadsheet&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_HO.xls|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For δt=0.01, estimate the positions of maximum error and fit accordingly.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Max Error Graph.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.1:&#039;&#039;&#039; &#039;&#039;A plot of the error in VV algorithm data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
Figure 1.1 shows how the maximum error increases linearly. This can be rationalised by the fact that each cycle of simulation follows on from the last, so the error of the new cycle is combined to the uncertainty in a previous calculation for an older timestep and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Experiment to find the timestep range to ensure the total energy does not change by more than 1% over the course of the simulation. Why is this important?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In simulations such as this, the physical model is considered an isolated system. We are modeling the changes in velocity and thus kinetic energy changes of induvidual particles/atoms over a total timeframe at constant timesteps. As such, the particles are moving around, interacting, transfering energy between each other. However, unless we are changing variables such as Temperature, Number of particles, Volume (density) etc. during a simulation, the overall energy should remain constant. Therefore it is important to monitor the total energy to ensure our model is fitting with our physical understanding.&lt;br /&gt;
&lt;br /&gt;
From experimentation, it can be seen that to limit this total energy change over a simulation, the time step should really be smaller than 0.3. It can be seen in Figure 1.2 how the peaks and thus total energy begin to fluctuate significantly more for 0.3 and above. &lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_En_err_w_timestep.png|thumb|500px|center|&#039;&#039;&#039;Figure 1.2:&#039;&#039;&#039; &#039;&#039;Energy vs Time: a) δt=0.01, b) δt=0.03, c) δt=0.03&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Maths based upon a single Lennard-Jones interaction&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
[[File:JmsD_Maths_1.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.3:&#039;&#039;&#039; &#039;&#039;Answers to the LJ based maths task&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.5 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the number of water molecules in 1 mL under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;Density of water = 1 g/ml&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Molecular weight of wate = 18 g/mol&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Moles in 1 ml, n = 1/18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Number of molecules = n x N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 1/18 x 6.022x10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;3.35x10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;10000/N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = moles of water, n&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Mass of 10000 water molecules, m = n x 18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;The volume, V = m / 1 g/ml &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;2.99x10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.6 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?.  &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The particle should end up in position (0.2,0.1,0.7) after the application of periodic boundary conditions. &lt;br /&gt;
&lt;br /&gt;
This is because, if the number of particles in the box remains constant, if a particle excit the box on one face, it will return from the opposite. In this case, if the particle starts at (0.5,0.5,0.5) in the cubic box ((0,0,0):(1,1,1)) and moves along the vector (0.7,0.6,0.2), it will reappear from the other face, positioned now at (0.2,0.1,0.7).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.7 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; The LJ parameters for argon are &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; = 0.34 nm, &amp;lt;math&amp;gt;\epsilon\ /\ k_B&amp;lt;/math&amp;gt; = 120 K. If the LJ cutoff is r* = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T*=1.5 in real units?  &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;r = 1.088 x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; m&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;T = 180 K&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; = 0.014 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2 Equilibriation ==&lt;br /&gt;
==== 2.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Why do random starting coords cause problems in simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
If particles are placed randomly, there is chance for multiple particles to be placed in the same positions, or at least close too each other. It two particles are close or overlap, there would be very strong resulting interactions. These large forces would caus the model to deviate from its classical behaviour, and will affect properties from energy, to timestep.&lt;br /&gt;
&lt;br /&gt;
Therefore it is wise to start a liquid or gas simulation as a &#039;melt&#039; from particles on lattice points (which can allow random positioning to some degree), e.g. Simple cubic. This ensures particles will begin a suitable distance away from each other.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Prove that lattice spacing of 1.07722 gives a number density of 0.8&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; If lattice spacing is 1.07722, Volume of one cube = 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; If number density is Number / Volume, and there is one particle per cube, number density = 1 / Volume&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; 1 / 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.79999 &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;If instead FCC, and number density of 1.2, what is the length of the cubic uni cell?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; First calculate Volume of the cell: V = Number / number density &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; The Number of particles in a FCC unit cell are 4, so V = 4 / 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; The cube root of the volume will give side length...&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; (4/1.2)&amp;lt;sup&amp;gt;1/3&amp;lt;/sup&amp;gt; = 1.4938 &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the FCC latice, how many atoms would be created by create_atoms&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Assuming no other parameters  (i.e. the box size [Below]) have changed...&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
There should be 4000 atoms created.&lt;br /&gt;
&lt;br /&gt;
If there are 1000 atoms in a 10x10x10 box for a sc lattice that has one atom per unit cell, a lattice such as FCC that has 4 atoms per unit cell should yield 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find and explain the purpose of:&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;mass&#039;&#039; - Sets the mass for the types of atoms, argument(1) is the type, argument(2) is the mass.&lt;br /&gt;
*&#039;&#039;pair_style&#039;&#039; - Calculates the pair interactions (pair potentials defined as interactions between atoms within a certain distance), argument(1) &amp;quot;lj/cut&amp;quot; means this line refers to the global cutoff for all Lennard-Jones interactions, argument(2) defines the distance.&lt;br /&gt;
*&#039;&#039;pair_coeff&#039;&#039; - Provides the interaction coefficients for the interactions between atoms, arguments(1 &amp;amp; 2) refer to the attoms that interact (* means all types 1-&amp;gt;N), and arguments (3 &amp;amp; 4) are those coefficients.&lt;br /&gt;
&lt;br /&gt;
== 3 Simmulations under specific conditions ==&lt;br /&gt;
==== 3.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature, T* = 1.5), and two reasonable pressures in Lennard-Jones units.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run these simulations to plot the &#039;Equations of State&#039; [Below].&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The 10 phase points used inn this task were determined by the 5 temperatures (T): 1.6, 1.8, 2.0, 2.2, 2.4 and the pressures (p) 2.4, 2.8. The timestep (δt) chosen was again 0.0025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Npt_1.6_2.4.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Npt_1.6_2.4.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 3.2 Task ====&lt;br /&gt;
&lt;br /&gt;
The temperature ideally needs to be maintained as close to the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, as possible. This is done by multplying every velocity, by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &#039;target temperature&#039; is as stipulated in the input script&lt;br /&gt;
&lt;br /&gt;
The instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, will fluctuate  due to approximations made in the algorithm. &lt;br /&gt;
*If &amp;lt;math&amp;gt;T &amp;gt; \mathfrak{T}&amp;lt;/math&amp;gt;, the E&amp;lt;sub&amp;gt;K&amp;lt;/sub&amp;gt; is too high and thus &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be less than 1.&lt;br /&gt;
*If, by contrast, &amp;lt;math&amp;gt;T &amp;lt; \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;Equipartition theorem&#039; states that on average, every degree of freedom in a system at equilibrium will have K&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T/2 of energy. This sytem has 3 degrees of freedom and as such:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \mathbf{v}_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expressing in terms of the adjustment to target temperature as described above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma \mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Solve the equations for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find out the importance of the three numbers 100 1000 100000.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How often are values sampled for the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How many measurments contribute to the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 {...VARIABLES...}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How much time will this simulate?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Using the output of the simulations in 3.1, plot density as a unction of temperature, for both pressures - (Incl. Error bars + Ideal Gas). Is the simulated density higher or lower than Ideal? Why? Finaly, does the discrepancy increase or decrease w. pressure?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_NpT1.png|thumb|500px|center|&#039;&#039;&#039;Figure 3.1:&#039;&#039;&#039; &#039;&#039;A plot of Average Density vs Average Temperature for two different pressures&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 4 Calculation of heat capacities using statistical physics ==&lt;br /&gt;
==== 4.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simulations and plot C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V as a function of temperature. Is this as expected?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Cv_2.0_0.2.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Cv_2.0_0.2.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
For this section, 5 simulations were run for each of the two densities: 0.2, 0.8. These simulations corresponded to each of the respective temperatures: 2.0, 2.2, 2.4, 2.6, 2.8 (in reduced units). The desired results of these simulations were the calculated values of the Heat Capacity at constant volume, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;. The results can be seen in Figure 4.1 as a funtion of the average temperatures.&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Cv graph1.png|thumb|500px|center|&#039;&#039;&#039;Figure 4.1:&#039;&#039;&#039; &#039;&#039;A plot comparing Heat Capacity/Volume vs Average Temperature for two different densities&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
These graphs do indeed follow the trend expected, that is similar to the trend seen in a crystalline solid for example. The Heat Capacity is proportional to 1/T&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; [As seen in the Equations below] and as such a negative trend should be observed. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With reagrds to density, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V increases as the density increases - which is again as expected - because heat capacity is dependant on the amount of material per volume, and thus a denser material (with the same volume) has more mass or moles per unit voulume.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 5 Radial Distribution Functions ==&lt;br /&gt;
==== 5.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; From simulations of the Lennard-Jones system in the three phases, Compute &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; in VMD. Discuss the differences in the 3 RDFs and thus what this means about the structure in each phase.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the solid phase, illustrate which lattics sites the first 3 peaks correspond to. What is the Lattice spacing? What is the Coordination number for each of the first three peaks?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The initial parameters for the simulations, in order to specify the correct phases were:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; Temperature: (For all phases) = 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Densities: (Solid) = 1.50, (Liquid) = 0.85, (Vapour) = 0.01 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Finally, to provide the initial positions of atoms, the simple cubic model was used for Liquid and Vapour, but for Solid FCC was used.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These parameters were calculated by examining the Lennar-Jones phase diagram found in literature. [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 &amp;lt;sup&amp;gt;[2] &amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_g(r).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.1:&#039;&#039;&#039; &#039;&#039;The Radial Distribution Functions of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Int(g(r))dr.png|thumb|500px|center|&#039;&#039;&#039;Figure 5.2:&#039;&#039;&#039; &#039;&#039;The Integrals of the RDFs of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Solid3(g(r)).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.3:&#039;&#039;&#039; &#039;&#039;The RDF of the solid, paying particular attention to the first 3 peaks&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 6 Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
==== 6.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simlations for the three phases, to calculate the mean squared displacement and velocity autocorrelation functions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 6.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Measure D from it&#039;s connection to the MSD, for simulations and data for approx. one million atom simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equation for the Diffusion Coefficient, &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
However, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be much more simply estimated by fitting the linear section of a Total MSD vs Timestep graph and dividing by 6.&lt;br /&gt;
This gives the following values for D (in reduced units) for the smaller simulations carried out by myself:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.31x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.33&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 1.55&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.1-6.3]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_my_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.1:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Solid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.2:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Liquid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.3:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Vapour simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
In comparison below are the values for D (in reduced units) for the larger (approx. 1 million atom) data supplied:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.71x10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.75&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 6.28&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.4-6.6]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_mil_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.4:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Solid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_mil_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.5:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Liquid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsDil_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.6:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Vapour MSD data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 7 References ==&lt;br /&gt;
 1.  LAMMPS Manual, http://lammps.sandia.gov/doc/Section_commands.html#lammps-input-script , accessed November 2016&lt;br /&gt;
 2.  JP Hansen, L Verlet, Phys Rev, 184, 1969, http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589616</id>
		<title>Rep:Mod:Yr3LiquidSimJmsD</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589616"/>
		<updated>2017-02-24T09:12:23Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: /* 2.1 Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Jack Dawson - Yr3 Comp: Liquid Sim.=&lt;br /&gt;
&lt;br /&gt;
== 1 Theory ==&lt;br /&gt;
&lt;br /&gt;
==== 1.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Compltete the Classical Harmonic Osciallator Spreadsheet&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_HO.xls|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For δt=0.01, estimate the positions of maximum error and fit accordingly.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Max Error Graph.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.1:&#039;&#039;&#039; &#039;&#039;A plot of the error in VV algorithm data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
Figure 1.1 shows how the maximum error increases linearly. This can be rationalised by the fact that each cycle of simulation follows on from the last, so the error of the new cycle is combined to the uncertainty in a previous calculation for an older timestep and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Experiment to find the timestep range to ensure the total energy does not change by more than 1% over the course of the simulation. Why is this important?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In simulations such as this, the physical model is considered an isolated system. We are modeling the changes in velocity and thus kinetic energy changes of induvidual particles/atoms over a total timeframe at constant timesteps. As such, the particles are moving around, interacting, transfering energy between each other. However, unless we are changing variables such as Temperature, Number of particles, Volume (density) etc. during a simulation, the overall energy should remain constant. Therefore it is important to monitor the total energy to ensure our model is fitting with our physical understanding.&lt;br /&gt;
&lt;br /&gt;
From experimentation, it can be seen that to limit this total energy change over a simulation, the time step should really be smaller than 0.3. It can be seen in Figure 1.2 how the peaks and thus total energy begin to fluctuate significantly more for 0.3 and above. &lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_En_err_w_timestep.png|thumb|500px|center|&#039;&#039;&#039;Figure 1.2:&#039;&#039;&#039; &#039;&#039;Energy vs Time: a) δt=0.01, b) δt=0.03, c) δt=0.03&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Maths based upon a single Lennard-Jones interaction&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
[[File:JmsD_Maths_1.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.3:&#039;&#039;&#039; &#039;&#039;Answers to the LJ based maths task&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.5 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the number of water molecules in 1 mL under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;Density of water = 1 g/ml&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Molecular weight of wate = 18 g/mol&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Moles in 1 ml, n = 1/18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Number of molecules = n x N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 1/18 x 6.022x10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;3.35x10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;10000/N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = moles of water, n&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Mass of 10000 water molecules, m = n x 18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;The volume, V = m / 1 g/ml &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;2.99x10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.6 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?.  &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The particle should end up in position (0.2,0.1,0.7) after the application of periodic boundary conditions. &lt;br /&gt;
&lt;br /&gt;
This is because, if the number of particles in the box remains constant, if a particle excit the box on one face, it will return from the opposite. In this case, if the particle starts at (0.5,0.5,0.5) in the cubic box ((0,0,0):(1,1,1)) and moves along the vector (0.7,0.6,0.2), it will reappear from the other face, positioned now at (0.2,0.1,0.7).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.7 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; The LJ parameters for argon are &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; = 0.34 nm, &amp;lt;math&amp;gt;\epsilon\ /\ k_B&amp;lt;/math&amp;gt; = 120 K. If the LJ cutoff is r* = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T*=1.5 in real units?  &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;r = 1.088 x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; m&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;T = 180 K&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; = 0.014 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2 Equilibriation ==&lt;br /&gt;
==== 2.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Why do random starting coords cause problems in simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
If particles are placed randomly, there is chance for multiple particles to be placed in the same positions, or at least close too each other. It two particles are close or overlap, there would be very strong resulting interactions. These large forces would caus the model to deviate from its classical behaviour, and will affect properties from energy, to timestep.&lt;br /&gt;
&lt;br /&gt;
Therefore it is wise to start a liquid or gas simulation as a &#039;melt&#039; from particles on lattice points (which can allow random positioning to some degree), e.g. Simple cubic. This ensures particles will begin a suitable distance away from each other.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Prove that lattice spacing of 1.07722 gives a number density of 0.8&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; If lattice spacing is 1.07722, Volume of one cube = 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; If number density is Number / Volume, and there is one particle per cube, number density = 1 / Volume&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; 1 / 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.79999 &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;If instead FCC, and number density of 1.2, what is the length of the cubic uni cell?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; First calculate Volume of the cell: V = Number / number density &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; The Number of particles in a FCC unit cell are 4, so V = 4 / 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; The cube root of the volume will give side length...&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; (4/1.2)&amp;lt;sup&amp;gt;1/3&amp;lt;/sup&amp;gt; = 1.4938 &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the FCC latice, how many atoms would be created by create_atoms&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Assuming no other parameters  (i.e. the box size [Below]) have changed...&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
There should be 4000 atoms created.&lt;br /&gt;
&lt;br /&gt;
If there are 1000 atoms in a 10x10x10 box for a sc lattice that has one atom per unit cell, a lattice such as FCC that has 4 atoms per unit cell should yield 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
== 3 Simmulations under specific conditions ==&lt;br /&gt;
==== 3.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature, T* = 1.5), and two reasonable pressures in Lennard-Jones units.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run these simulations to plot the &#039;Equations of State&#039; [Below].&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The 10 phase points used inn this task were determined by the 5 temperatures (T): 1.6, 1.8, 2.0, 2.2, 2.4 and the pressures (p) 2.4, 2.8. The timestep (δt) chosen was again 0.0025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Npt_1.6_2.4.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Npt_1.6_2.4.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 3.2 Task ====&lt;br /&gt;
&lt;br /&gt;
The temperature ideally needs to be maintained as close to the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, as possible. This is done by multplying every velocity, by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &#039;target temperature&#039; is as stipulated in the input script&lt;br /&gt;
&lt;br /&gt;
The instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, will fluctuate  due to approximations made in the algorithm. &lt;br /&gt;
*If &amp;lt;math&amp;gt;T &amp;gt; \mathfrak{T}&amp;lt;/math&amp;gt;, the E&amp;lt;sub&amp;gt;K&amp;lt;/sub&amp;gt; is too high and thus &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be less than 1.&lt;br /&gt;
*If, by contrast, &amp;lt;math&amp;gt;T &amp;lt; \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;Equipartition theorem&#039; states that on average, every degree of freedom in a system at equilibrium will have K&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T/2 of energy. This sytem has 3 degrees of freedom and as such:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \mathbf{v}_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expressing in terms of the adjustment to target temperature as described above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma \mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Solve the equations for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find out the importance of the three numbers 100 1000 100000.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How often are values sampled for the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How many measurments contribute to the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 {...VARIABLES...}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How much time will this simulate?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Using the output of the simulations in 3.1, plot density as a unction of temperature, for both pressures - (Incl. Error bars + Ideal Gas). Is the simulated density higher or lower than Ideal? Why? Finaly, does the discrepancy increase or decrease w. pressure?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_NpT1.png|thumb|500px|center|&#039;&#039;&#039;Figure 3.1:&#039;&#039;&#039; &#039;&#039;A plot of Average Density vs Average Temperature for two different pressures&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 4 Calculation of heat capacities using statistical physics ==&lt;br /&gt;
==== 4.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simulations and plot C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V as a function of temperature. Is this as expected?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Cv_2.0_0.2.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Cv_2.0_0.2.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
For this section, 5 simulations were run for each of the two densities: 0.2, 0.8. These simulations corresponded to each of the respective temperatures: 2.0, 2.2, 2.4, 2.6, 2.8 (in reduced units). The desired results of these simulations were the calculated values of the Heat Capacity at constant volume, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;. The results can be seen in Figure 4.1 as a funtion of the average temperatures.&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Cv graph1.png|thumb|500px|center|&#039;&#039;&#039;Figure 4.1:&#039;&#039;&#039; &#039;&#039;A plot comparing Heat Capacity/Volume vs Average Temperature for two different densities&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
These graphs do indeed follow the trend expected, that is similar to the trend seen in a crystalline solid for example. The Heat Capacity is proportional to 1/T&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; [As seen in the Equations below] and as such a negative trend should be observed. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With reagrds to density, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V increases as the density increases - which is again as expected - because heat capacity is dependant on the amount of material per volume, and thus a denser material (with the same volume) has more mass or moles per unit voulume.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 5 Radial Distribution Functions ==&lt;br /&gt;
==== 5.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; From simulations of the Lennard-Jones system in the three phases, Compute &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; in VMD. Discuss the differences in the 3 RDFs and thus what this means about the structure in each phase.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the solid phase, illustrate which lattics sites the first 3 peaks correspond to. What is the Lattice spacing? What is the Coordination number for each of the first three peaks?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The initial parameters for the simulations, in order to specify the correct phases were:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; Temperature: (For all phases) = 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Densities: (Solid) = 1.50, (Liquid) = 0.85, (Vapour) = 0.01 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Finally, to provide the initial positions of atoms, the simple cubic model was used for Liquid and Vapour, but for Solid FCC was used.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These parameters were calculated by examining the Lennar-Jones phase diagram found in literature. [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 &amp;lt;sup&amp;gt;[2] &amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_g(r).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.1:&#039;&#039;&#039; &#039;&#039;The Radial Distribution Functions of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Int(g(r))dr.png|thumb|500px|center|&#039;&#039;&#039;Figure 5.2:&#039;&#039;&#039; &#039;&#039;The Integrals of the RDFs of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Solid3(g(r)).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.3:&#039;&#039;&#039; &#039;&#039;The RDF of the solid, paying particular attention to the first 3 peaks&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 6 Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
==== 6.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simlations for the three phases, to calculate the mean squared displacement and velocity autocorrelation functions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 6.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Measure D from it&#039;s connection to the MSD, for simulations and data for approx. one million atom simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equation for the Diffusion Coefficient, &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
However, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be much more simply estimated by fitting the linear section of a Total MSD vs Timestep graph and dividing by 6.&lt;br /&gt;
This gives the following values for D (in reduced units) for the smaller simulations carried out by myself:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.31x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.33&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 1.55&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.1-6.3]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_my_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.1:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Solid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.2:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Liquid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.3:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Vapour simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
In comparison below are the values for D (in reduced units) for the larger (approx. 1 million atom) data supplied:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.71x10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.75&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 6.28&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.4-6.6]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_mil_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.4:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Solid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_mil_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.5:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Liquid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsDil_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.6:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Vapour MSD data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 7 References ==&lt;br /&gt;
 1.  LAMMPS Manual, http://lammps.sandia.gov/doc/Section_commands.html#lammps-input-script , accessed November 2016&lt;br /&gt;
 2.  JP Hansen, L Verlet, Phys Rev, 184, 1969, http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589604</id>
		<title>Rep:Mod:Yr3LiquidSimJmsD</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589604"/>
		<updated>2017-02-24T09:02:26Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: /* 2.1 Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Jack Dawson - Yr3 Comp: Liquid Sim.=&lt;br /&gt;
&lt;br /&gt;
== 1 Theory ==&lt;br /&gt;
&lt;br /&gt;
==== 1.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Compltete the Classical Harmonic Osciallator Spreadsheet&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_HO.xls|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For δt=0.01, estimate the positions of maximum error and fit accordingly.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Max Error Graph.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.1:&#039;&#039;&#039; &#039;&#039;A plot of the error in VV algorithm data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
Figure 1.1 shows how the maximum error increases linearly. This can be rationalised by the fact that each cycle of simulation follows on from the last, so the error of the new cycle is combined to the uncertainty in a previous calculation for an older timestep and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Experiment to find the timestep range to ensure the total energy does not change by more than 1% over the course of the simulation. Why is this important?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In simulations such as this, the physical model is considered an isolated system. We are modeling the changes in velocity and thus kinetic energy changes of induvidual particles/atoms over a total timeframe at constant timesteps. As such, the particles are moving around, interacting, transfering energy between each other. However, unless we are changing variables such as Temperature, Number of particles, Volume (density) etc. during a simulation, the overall energy should remain constant. Therefore it is important to monitor the total energy to ensure our model is fitting with our physical understanding.&lt;br /&gt;
&lt;br /&gt;
From experimentation, it can be seen that to limit this total energy change over a simulation, the time step should really be smaller than 0.3. It can be seen in Figure 1.2 how the peaks and thus total energy begin to fluctuate significantly more for 0.3 and above. &lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_En_err_w_timestep.png|thumb|500px|center|&#039;&#039;&#039;Figure 1.2:&#039;&#039;&#039; &#039;&#039;Energy vs Time: a) δt=0.01, b) δt=0.03, c) δt=0.03&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Maths based upon a single Lennard-Jones interaction&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
[[File:JmsD_Maths_1.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.3:&#039;&#039;&#039; &#039;&#039;Answers to the LJ based maths task&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.5 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the number of water molecules in 1 mL under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;Density of water = 1 g/ml&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Molecular weight of wate = 18 g/mol&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Moles in 1 ml, n = 1/18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Number of molecules = n x N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 1/18 x 6.022x10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;3.35x10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;10000/N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = moles of water, n&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Mass of 10000 water molecules, m = n x 18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;The volume, V = m / 1 g/ml &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;2.99x10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.6 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?.  &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The particle should end up in position (0.2,0.1,0.7) after the application of periodic boundary conditions. &lt;br /&gt;
&lt;br /&gt;
This is because, if the number of particles in the box remains constant, if a particle excit the box on one face, it will return from the opposite. In this case, if the particle starts at (0.5,0.5,0.5) in the cubic box ((0,0,0):(1,1,1)) and moves along the vector (0.7,0.6,0.2), it will reappear from the other face, positioned now at (0.2,0.1,0.7).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.7 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; The LJ parameters for argon are &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; = 0.34 nm, &amp;lt;math&amp;gt;\epsilon\ /\ k_B&amp;lt;/math&amp;gt; = 120 K. If the LJ cutoff is r* = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T*=1.5 in real units?  &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;r = 1.088 x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; m&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;T = 180 K&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; = 0.014 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2 Equilibriation ==&lt;br /&gt;
==== 2.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Why do random starting coords cause problems in simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
If particles are placed randomly, there is chance for multiple particles to be placed in the same positions, or at least close too each other. It two particles are close or overlap, there would be very strong resulting interactions. These large forces would caus the model to deviate from its classical behaviour, and will affect properties from energy, to timestep.&lt;br /&gt;
&lt;br /&gt;
Therefore it is wise to start a liquid or gas simulation as a &#039;melt&#039; from particles on lattice points (which can allow random positioning to some degree), e.g. Simple cubic. This ensures particles will begin a suitable distance away from each other.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Prove that lattice spacing of 1.07722 gives a number density of 0.8&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; If lattice spacing is 1.07722, Volume of one cube = 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; If number density is Number / Volume, and there is one particle per cube, number density = 1 / Volume&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; 1 / 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.79999 &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;If instead FCC, and number density of 1.2, what is the length of the cubic uni cell?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; First calculate Volume of the cell: V = Number / number density &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; The Number of particles in a FCC unit cell are 4, so V = 4 / 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; The cube root of the volume will give side length...&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; (4/1.2)&amp;lt;sup&amp;gt;1/3&amp;lt;/sup&amp;gt; = 1.4938 &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 3 Simmulations under specific conditions ==&lt;br /&gt;
==== 3.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature, T* = 1.5), and two reasonable pressures in Lennard-Jones units.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run these simulations to plot the &#039;Equations of State&#039; [Below].&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The 10 phase points used inn this task were determined by the 5 temperatures (T): 1.6, 1.8, 2.0, 2.2, 2.4 and the pressures (p) 2.4, 2.8. The timestep (δt) chosen was again 0.0025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Npt_1.6_2.4.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Npt_1.6_2.4.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 3.2 Task ====&lt;br /&gt;
&lt;br /&gt;
The temperature ideally needs to be maintained as close to the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, as possible. This is done by multplying every velocity, by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &#039;target temperature&#039; is as stipulated in the input script&lt;br /&gt;
&lt;br /&gt;
The instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, will fluctuate  due to approximations made in the algorithm. &lt;br /&gt;
*If &amp;lt;math&amp;gt;T &amp;gt; \mathfrak{T}&amp;lt;/math&amp;gt;, the E&amp;lt;sub&amp;gt;K&amp;lt;/sub&amp;gt; is too high and thus &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be less than 1.&lt;br /&gt;
*If, by contrast, &amp;lt;math&amp;gt;T &amp;lt; \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;Equipartition theorem&#039; states that on average, every degree of freedom in a system at equilibrium will have K&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T/2 of energy. This sytem has 3 degrees of freedom and as such:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \mathbf{v}_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expressing in terms of the adjustment to target temperature as described above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma \mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Solve the equations for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find out the importance of the three numbers 100 1000 100000.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How often are values sampled for the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How many measurments contribute to the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 {...VARIABLES...}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How much time will this simulate?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Using the output of the simulations in 3.1, plot density as a unction of temperature, for both pressures - (Incl. Error bars + Ideal Gas). Is the simulated density higher or lower than Ideal? Why? Finaly, does the discrepancy increase or decrease w. pressure?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_NpT1.png|thumb|500px|center|&#039;&#039;&#039;Figure 3.1:&#039;&#039;&#039; &#039;&#039;A plot of Average Density vs Average Temperature for two different pressures&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 4 Calculation of heat capacities using statistical physics ==&lt;br /&gt;
==== 4.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simulations and plot C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V as a function of temperature. Is this as expected?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Cv_2.0_0.2.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Cv_2.0_0.2.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
For this section, 5 simulations were run for each of the two densities: 0.2, 0.8. These simulations corresponded to each of the respective temperatures: 2.0, 2.2, 2.4, 2.6, 2.8 (in reduced units). The desired results of these simulations were the calculated values of the Heat Capacity at constant volume, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;. The results can be seen in Figure 4.1 as a funtion of the average temperatures.&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Cv graph1.png|thumb|500px|center|&#039;&#039;&#039;Figure 4.1:&#039;&#039;&#039; &#039;&#039;A plot comparing Heat Capacity/Volume vs Average Temperature for two different densities&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
These graphs do indeed follow the trend expected, that is similar to the trend seen in a crystalline solid for example. The Heat Capacity is proportional to 1/T&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; [As seen in the Equations below] and as such a negative trend should be observed. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With reagrds to density, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V increases as the density increases - which is again as expected - because heat capacity is dependant on the amount of material per volume, and thus a denser material (with the same volume) has more mass or moles per unit voulume.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 5 Radial Distribution Functions ==&lt;br /&gt;
==== 5.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; From simulations of the Lennard-Jones system in the three phases, Compute &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; in VMD. Discuss the differences in the 3 RDFs and thus what this means about the structure in each phase.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the solid phase, illustrate which lattics sites the first 3 peaks correspond to. What is the Lattice spacing? What is the Coordination number for each of the first three peaks?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The initial parameters for the simulations, in order to specify the correct phases were:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; Temperature: (For all phases) = 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Densities: (Solid) = 1.50, (Liquid) = 0.85, (Vapour) = 0.01 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Finally, to provide the initial positions of atoms, the simple cubic model was used for Liquid and Vapour, but for Solid FCC was used.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These parameters were calculated by examining the Lennar-Jones phase diagram found in literature. [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 &amp;lt;sup&amp;gt;[2] &amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_g(r).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.1:&#039;&#039;&#039; &#039;&#039;The Radial Distribution Functions of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Int(g(r))dr.png|thumb|500px|center|&#039;&#039;&#039;Figure 5.2:&#039;&#039;&#039; &#039;&#039;The Integrals of the RDFs of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Solid3(g(r)).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.3:&#039;&#039;&#039; &#039;&#039;The RDF of the solid, paying particular attention to the first 3 peaks&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 6 Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
==== 6.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simlations for the three phases, to calculate the mean squared displacement and velocity autocorrelation functions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 6.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Measure D from it&#039;s connection to the MSD, for simulations and data for approx. one million atom simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equation for the Diffusion Coefficient, &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
However, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be much more simply estimated by fitting the linear section of a Total MSD vs Timestep graph and dividing by 6.&lt;br /&gt;
This gives the following values for D (in reduced units) for the smaller simulations carried out by myself:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.31x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.33&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 1.55&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.1-6.3]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_my_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.1:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Solid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.2:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Liquid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.3:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Vapour simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
In comparison below are the values for D (in reduced units) for the larger (approx. 1 million atom) data supplied:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.71x10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.75&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 6.28&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.4-6.6]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_mil_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.4:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Solid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_mil_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.5:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Liquid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsDil_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.6:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Vapour MSD data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 7 References ==&lt;br /&gt;
 1.  LAMMPS Manual, http://lammps.sandia.gov/doc/Section_commands.html#lammps-input-script , accessed November 2016&lt;br /&gt;
 2.  JP Hansen, L Verlet, Phys Rev, 184, 1969, http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589600</id>
		<title>Rep:Mod:Yr3LiquidSimJmsD</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589600"/>
		<updated>2017-02-24T08:52:24Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: /* 2.1 Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Jack Dawson - Yr3 Comp: Liquid Sim.=&lt;br /&gt;
&lt;br /&gt;
== 1 Theory ==&lt;br /&gt;
&lt;br /&gt;
==== 1.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Compltete the Classical Harmonic Osciallator Spreadsheet&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_HO.xls|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For δt=0.01, estimate the positions of maximum error and fit accordingly.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Max Error Graph.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.1:&#039;&#039;&#039; &#039;&#039;A plot of the error in VV algorithm data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
Figure 1.1 shows how the maximum error increases linearly. This can be rationalised by the fact that each cycle of simulation follows on from the last, so the error of the new cycle is combined to the uncertainty in a previous calculation for an older timestep and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Experiment to find the timestep range to ensure the total energy does not change by more than 1% over the course of the simulation. Why is this important?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In simulations such as this, the physical model is considered an isolated system. We are modeling the changes in velocity and thus kinetic energy changes of induvidual particles/atoms over a total timeframe at constant timesteps. As such, the particles are moving around, interacting, transfering energy between each other. However, unless we are changing variables such as Temperature, Number of particles, Volume (density) etc. during a simulation, the overall energy should remain constant. Therefore it is important to monitor the total energy to ensure our model is fitting with our physical understanding.&lt;br /&gt;
&lt;br /&gt;
From experimentation, it can be seen that to limit this total energy change over a simulation, the time step should really be smaller than 0.3. It can be seen in Figure 1.2 how the peaks and thus total energy begin to fluctuate significantly more for 0.3 and above. &lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_En_err_w_timestep.png|thumb|500px|center|&#039;&#039;&#039;Figure 1.2:&#039;&#039;&#039; &#039;&#039;Energy vs Time: a) δt=0.01, b) δt=0.03, c) δt=0.03&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Maths based upon a single Lennard-Jones interaction&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
[[File:JmsD_Maths_1.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.3:&#039;&#039;&#039; &#039;&#039;Answers to the LJ based maths task&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.5 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the number of water molecules in 1 mL under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;Density of water = 1 g/ml&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Molecular weight of wate = 18 g/mol&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Moles in 1 ml, n = 1/18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Number of molecules = n x N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 1/18 x 6.022x10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;3.35x10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;10000/N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = moles of water, n&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Mass of 10000 water molecules, m = n x 18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;The volume, V = m / 1 g/ml &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;2.99x10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.6 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?.  &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The particle should end up in position (0.2,0.1,0.7) after the application of periodic boundary conditions. &lt;br /&gt;
&lt;br /&gt;
This is because, if the number of particles in the box remains constant, if a particle excit the box on one face, it will return from the opposite. In this case, if the particle starts at (0.5,0.5,0.5) in the cubic box ((0,0,0):(1,1,1)) and moves along the vector (0.7,0.6,0.2), it will reappear from the other face, positioned now at (0.2,0.1,0.7).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.7 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; The LJ parameters for argon are &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; = 0.34 nm, &amp;lt;math&amp;gt;\epsilon\ /\ k_B&amp;lt;/math&amp;gt; = 120 K. If the LJ cutoff is r* = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T*=1.5 in real units?  &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;r = 1.088 x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; m&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;T = 180 K&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; = 0.014 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2 Equilibriation ==&lt;br /&gt;
==== 2.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Why do random starting coords cause problems in simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
If particles are placed randomly, there is chance for multiple particles to be placed in the same positions, or at least close too each other. It two particles are close or overlap, there would be very strong resulting interactions. These large forces would caus the model to deviate from its classical behaviour, and will affect properties from energy, to timestep.&lt;br /&gt;
&lt;br /&gt;
Therefore it is wise to start a liquid or gas simulation as a &#039;melt&#039; from particles on lattice points (which can allow random positioning to some degree), e.g. Simple cubic. This ensures particles will begin a suitable distance away from each other.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Prove that lattice spacing of 1.07722 gives a number density of 0.8&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt; If lattice spacing is 1.07722, Volume of one cube = 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; If number density is Number / Volume, and there is one particle per cube, number density = 1 / Volume&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; 1 / 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 0.79999 &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 3 Simmulations under specific conditions ==&lt;br /&gt;
==== 3.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature, T* = 1.5), and two reasonable pressures in Lennard-Jones units.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run these simulations to plot the &#039;Equations of State&#039; [Below].&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The 10 phase points used inn this task were determined by the 5 temperatures (T): 1.6, 1.8, 2.0, 2.2, 2.4 and the pressures (p) 2.4, 2.8. The timestep (δt) chosen was again 0.0025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Npt_1.6_2.4.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Npt_1.6_2.4.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 3.2 Task ====&lt;br /&gt;
&lt;br /&gt;
The temperature ideally needs to be maintained as close to the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, as possible. This is done by multplying every velocity, by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &#039;target temperature&#039; is as stipulated in the input script&lt;br /&gt;
&lt;br /&gt;
The instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, will fluctuate  due to approximations made in the algorithm. &lt;br /&gt;
*If &amp;lt;math&amp;gt;T &amp;gt; \mathfrak{T}&amp;lt;/math&amp;gt;, the E&amp;lt;sub&amp;gt;K&amp;lt;/sub&amp;gt; is too high and thus &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be less than 1.&lt;br /&gt;
*If, by contrast, &amp;lt;math&amp;gt;T &amp;lt; \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;Equipartition theorem&#039; states that on average, every degree of freedom in a system at equilibrium will have K&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T/2 of energy. This sytem has 3 degrees of freedom and as such:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \mathbf{v}_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expressing in terms of the adjustment to target temperature as described above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma \mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Solve the equations for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find out the importance of the three numbers 100 1000 100000.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How often are values sampled for the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How many measurments contribute to the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 {...VARIABLES...}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How much time will this simulate?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Using the output of the simulations in 3.1, plot density as a unction of temperature, for both pressures - (Incl. Error bars + Ideal Gas). Is the simulated density higher or lower than Ideal? Why? Finaly, does the discrepancy increase or decrease w. pressure?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_NpT1.png|thumb|500px|center|&#039;&#039;&#039;Figure 3.1:&#039;&#039;&#039; &#039;&#039;A plot of Average Density vs Average Temperature for two different pressures&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 4 Calculation of heat capacities using statistical physics ==&lt;br /&gt;
==== 4.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simulations and plot C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V as a function of temperature. Is this as expected?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Cv_2.0_0.2.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Cv_2.0_0.2.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
For this section, 5 simulations were run for each of the two densities: 0.2, 0.8. These simulations corresponded to each of the respective temperatures: 2.0, 2.2, 2.4, 2.6, 2.8 (in reduced units). The desired results of these simulations were the calculated values of the Heat Capacity at constant volume, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;. The results can be seen in Figure 4.1 as a funtion of the average temperatures.&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Cv graph1.png|thumb|500px|center|&#039;&#039;&#039;Figure 4.1:&#039;&#039;&#039; &#039;&#039;A plot comparing Heat Capacity/Volume vs Average Temperature for two different densities&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
These graphs do indeed follow the trend expected, that is similar to the trend seen in a crystalline solid for example. The Heat Capacity is proportional to 1/T&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; [As seen in the Equations below] and as such a negative trend should be observed. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With reagrds to density, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V increases as the density increases - which is again as expected - because heat capacity is dependant on the amount of material per volume, and thus a denser material (with the same volume) has more mass or moles per unit voulume.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 5 Radial Distribution Functions ==&lt;br /&gt;
==== 5.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; From simulations of the Lennard-Jones system in the three phases, Compute &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; in VMD. Discuss the differences in the 3 RDFs and thus what this means about the structure in each phase.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the solid phase, illustrate which lattics sites the first 3 peaks correspond to. What is the Lattice spacing? What is the Coordination number for each of the first three peaks?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The initial parameters for the simulations, in order to specify the correct phases were:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; Temperature: (For all phases) = 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Densities: (Solid) = 1.50, (Liquid) = 0.85, (Vapour) = 0.01 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Finally, to provide the initial positions of atoms, the simple cubic model was used for Liquid and Vapour, but for Solid FCC was used.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These parameters were calculated by examining the Lennar-Jones phase diagram found in literature. [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 &amp;lt;sup&amp;gt;[2] &amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_g(r).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.1:&#039;&#039;&#039; &#039;&#039;The Radial Distribution Functions of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Int(g(r))dr.png|thumb|500px|center|&#039;&#039;&#039;Figure 5.2:&#039;&#039;&#039; &#039;&#039;The Integrals of the RDFs of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Solid3(g(r)).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.3:&#039;&#039;&#039; &#039;&#039;The RDF of the solid, paying particular attention to the first 3 peaks&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 6 Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
==== 6.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simlations for the three phases, to calculate the mean squared displacement and velocity autocorrelation functions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 6.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Measure D from it&#039;s connection to the MSD, for simulations and data for approx. one million atom simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equation for the Diffusion Coefficient, &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
However, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be much more simply estimated by fitting the linear section of a Total MSD vs Timestep graph and dividing by 6.&lt;br /&gt;
This gives the following values for D (in reduced units) for the smaller simulations carried out by myself:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.31x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.33&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 1.55&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.1-6.3]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_my_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.1:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Solid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.2:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Liquid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.3:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Vapour simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
In comparison below are the values for D (in reduced units) for the larger (approx. 1 million atom) data supplied:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.71x10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.75&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 6.28&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.4-6.6]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_mil_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.4:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Solid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_mil_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.5:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Liquid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsDil_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.6:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Vapour MSD data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 7 References ==&lt;br /&gt;
 1.  LAMMPS Manual, http://lammps.sandia.gov/doc/Section_commands.html#lammps-input-script , accessed November 2016&lt;br /&gt;
 2.  JP Hansen, L Verlet, Phys Rev, 184, 1969, http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589598</id>
		<title>Rep:Mod:Yr3LiquidSimJmsD</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589598"/>
		<updated>2017-02-24T08:41:29Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: /* Jack Dawson - Yr3 Comp: Liquid Sim. */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Jack Dawson - Yr3 Comp: Liquid Sim.=&lt;br /&gt;
&lt;br /&gt;
== 1 Theory ==&lt;br /&gt;
&lt;br /&gt;
==== 1.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Compltete the Classical Harmonic Osciallator Spreadsheet&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_HO.xls|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For δt=0.01, estimate the positions of maximum error and fit accordingly.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Max Error Graph.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.1:&#039;&#039;&#039; &#039;&#039;A plot of the error in VV algorithm data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
Figure 1.1 shows how the maximum error increases linearly. This can be rationalised by the fact that each cycle of simulation follows on from the last, so the error of the new cycle is combined to the uncertainty in a previous calculation for an older timestep and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Experiment to find the timestep range to ensure the total energy does not change by more than 1% over the course of the simulation. Why is this important?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In simulations such as this, the physical model is considered an isolated system. We are modeling the changes in velocity and thus kinetic energy changes of induvidual particles/atoms over a total timeframe at constant timesteps. As such, the particles are moving around, interacting, transfering energy between each other. However, unless we are changing variables such as Temperature, Number of particles, Volume (density) etc. during a simulation, the overall energy should remain constant. Therefore it is important to monitor the total energy to ensure our model is fitting with our physical understanding.&lt;br /&gt;
&lt;br /&gt;
From experimentation, it can be seen that to limit this total energy change over a simulation, the time step should really be smaller than 0.3. It can be seen in Figure 1.2 how the peaks and thus total energy begin to fluctuate significantly more for 0.3 and above. &lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_En_err_w_timestep.png|thumb|500px|center|&#039;&#039;&#039;Figure 1.2:&#039;&#039;&#039; &#039;&#039;Energy vs Time: a) δt=0.01, b) δt=0.03, c) δt=0.03&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Maths based upon a single Lennard-Jones interaction&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
[[File:JmsD_Maths_1.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.3:&#039;&#039;&#039; &#039;&#039;Answers to the LJ based maths task&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.5 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the number of water molecules in 1 mL under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;Density of water = 1 g/ml&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Molecular weight of wate = 18 g/mol&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Moles in 1 ml, n = 1/18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Number of molecules = n x N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 1/18 x 6.022x10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;3.35x10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;10000/N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = moles of water, n&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Mass of 10000 water molecules, m = n x 18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;The volume, V = m / 1 g/ml &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;2.99x10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.6 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?.  &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The particle should end up in position (0.2,0.1,0.7) after the application of periodic boundary conditions. &lt;br /&gt;
&lt;br /&gt;
This is because, if the number of particles in the box remains constant, if a particle excit the box on one face, it will return from the opposite. In this case, if the particle starts at (0.5,0.5,0.5) in the cubic box ((0,0,0):(1,1,1)) and moves along the vector (0.7,0.6,0.2), it will reappear from the other face, positioned now at (0.2,0.1,0.7).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.7 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; The LJ parameters for argon are &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; = 0.34 nm, &amp;lt;math&amp;gt;\epsilon\ /\ k_B&amp;lt;/math&amp;gt; = 120 K. If the LJ cutoff is r* = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T*=1.5 in real units?  &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;r = 1.088 x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; m&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;T = 180 K&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; = 0.014 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2 Equilibriation ==&lt;br /&gt;
==== 2.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Why do random starting coords cause problems in simulations&amp;gt;&#039;&#039;&#039;&#039;&lt;br /&gt;
If particles are placed randomly, there is chance for multiple particles to be placed in the same positions, or at least close too each other. It two particles are close or overlap, there would be very strong resulting interactions. These large forces would caus the model to deviate from its classical behaviour, and will affect properties from energy, to timestep.&lt;br /&gt;
&lt;br /&gt;
Therefore it is wise to start a liquid or gas simulation as a &#039;melt&#039; from particles on lattice points (which can allow random positioning to some degree), e.g. Simple cubic. This ensures particles will begin a suitable distance away from each other.&lt;br /&gt;
&lt;br /&gt;
== 3 Simmulations under specific conditions ==&lt;br /&gt;
==== 3.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature, T* = 1.5), and two reasonable pressures in Lennard-Jones units.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run these simulations to plot the &#039;Equations of State&#039; [Below].&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The 10 phase points used inn this task were determined by the 5 temperatures (T): 1.6, 1.8, 2.0, 2.2, 2.4 and the pressures (p) 2.4, 2.8. The timestep (δt) chosen was again 0.0025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Npt_1.6_2.4.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Npt_1.6_2.4.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 3.2 Task ====&lt;br /&gt;
&lt;br /&gt;
The temperature ideally needs to be maintained as close to the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, as possible. This is done by multplying every velocity, by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &#039;target temperature&#039; is as stipulated in the input script&lt;br /&gt;
&lt;br /&gt;
The instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, will fluctuate  due to approximations made in the algorithm. &lt;br /&gt;
*If &amp;lt;math&amp;gt;T &amp;gt; \mathfrak{T}&amp;lt;/math&amp;gt;, the E&amp;lt;sub&amp;gt;K&amp;lt;/sub&amp;gt; is too high and thus &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be less than 1.&lt;br /&gt;
*If, by contrast, &amp;lt;math&amp;gt;T &amp;lt; \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;Equipartition theorem&#039; states that on average, every degree of freedom in a system at equilibrium will have K&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T/2 of energy. This sytem has 3 degrees of freedom and as such:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \mathbf{v}_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expressing in terms of the adjustment to target temperature as described above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma \mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Solve the equations for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find out the importance of the three numbers 100 1000 100000.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How often are values sampled for the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How many measurments contribute to the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 {...VARIABLES...}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How much time will this simulate?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Using the output of the simulations in 3.1, plot density as a unction of temperature, for both pressures - (Incl. Error bars + Ideal Gas). Is the simulated density higher or lower than Ideal? Why? Finaly, does the discrepancy increase or decrease w. pressure?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_NpT1.png|thumb|500px|center|&#039;&#039;&#039;Figure 3.1:&#039;&#039;&#039; &#039;&#039;A plot of Average Density vs Average Temperature for two different pressures&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 4 Calculation of heat capacities using statistical physics ==&lt;br /&gt;
==== 4.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simulations and plot C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V as a function of temperature. Is this as expected?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Cv_2.0_0.2.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Cv_2.0_0.2.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
For this section, 5 simulations were run for each of the two densities: 0.2, 0.8. These simulations corresponded to each of the respective temperatures: 2.0, 2.2, 2.4, 2.6, 2.8 (in reduced units). The desired results of these simulations were the calculated values of the Heat Capacity at constant volume, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;. The results can be seen in Figure 4.1 as a funtion of the average temperatures.&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Cv graph1.png|thumb|500px|center|&#039;&#039;&#039;Figure 4.1:&#039;&#039;&#039; &#039;&#039;A plot comparing Heat Capacity/Volume vs Average Temperature for two different densities&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
These graphs do indeed follow the trend expected, that is similar to the trend seen in a crystalline solid for example. The Heat Capacity is proportional to 1/T&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; [As seen in the Equations below] and as such a negative trend should be observed. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With reagrds to density, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V increases as the density increases - which is again as expected - because heat capacity is dependant on the amount of material per volume, and thus a denser material (with the same volume) has more mass or moles per unit voulume.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 5 Radial Distribution Functions ==&lt;br /&gt;
==== 5.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; From simulations of the Lennard-Jones system in the three phases, Compute &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; in VMD. Discuss the differences in the 3 RDFs and thus what this means about the structure in each phase.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the solid phase, illustrate which lattics sites the first 3 peaks correspond to. What is the Lattice spacing? What is the Coordination number for each of the first three peaks?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The initial parameters for the simulations, in order to specify the correct phases were:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; Temperature: (For all phases) = 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Densities: (Solid) = 1.50, (Liquid) = 0.85, (Vapour) = 0.01 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Finally, to provide the initial positions of atoms, the simple cubic model was used for Liquid and Vapour, but for Solid FCC was used.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These parameters were calculated by examining the Lennar-Jones phase diagram found in literature. [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 &amp;lt;sup&amp;gt;[2] &amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_g(r).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.1:&#039;&#039;&#039; &#039;&#039;The Radial Distribution Functions of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Int(g(r))dr.png|thumb|500px|center|&#039;&#039;&#039;Figure 5.2:&#039;&#039;&#039; &#039;&#039;The Integrals of the RDFs of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Solid3(g(r)).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.3:&#039;&#039;&#039; &#039;&#039;The RDF of the solid, paying particular attention to the first 3 peaks&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 6 Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
==== 6.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simlations for the three phases, to calculate the mean squared displacement and velocity autocorrelation functions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 6.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Measure D from it&#039;s connection to the MSD, for simulations and data for approx. one million atom simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equation for the Diffusion Coefficient, &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
However, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be much more simply estimated by fitting the linear section of a Total MSD vs Timestep graph and dividing by 6.&lt;br /&gt;
This gives the following values for D (in reduced units) for the smaller simulations carried out by myself:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.31x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.33&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 1.55&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.1-6.3]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_my_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.1:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Solid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.2:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Liquid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.3:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Vapour simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
In comparison below are the values for D (in reduced units) for the larger (approx. 1 million atom) data supplied:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.71x10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.75&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 6.28&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.4-6.6]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_mil_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.4:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Solid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_mil_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.5:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Liquid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsDil_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.6:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Vapour MSD data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 7 References ==&lt;br /&gt;
 1.  LAMMPS Manual, http://lammps.sandia.gov/doc/Section_commands.html#lammps-input-script , accessed November 2016&lt;br /&gt;
 2.  JP Hansen, L Verlet, Phys Rev, 184, 1969, http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589597</id>
		<title>Rep:Mod:Yr3LiquidSimJmsD</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589597"/>
		<updated>2017-02-24T08:31:05Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: /* 1.7 Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Jack Dawson - Yr3 Comp: Liquid Sim.=&lt;br /&gt;
&lt;br /&gt;
== 1 Theory ==&lt;br /&gt;
&lt;br /&gt;
==== 1.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Compltete the Classical Harmonic Osciallator Spreadsheet&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_HO.xls|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For δt=0.01, estimate the positions of maximum error and fit accordingly.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Max Error Graph.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.1:&#039;&#039;&#039; &#039;&#039;A plot of the error in VV algorithm data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
Figure 1.1 shows how the maximum error increases linearly. This can be rationalised by the fact that each cycle of simulation follows on from the last, so the error of the new cycle is combined to the uncertainty in a previous calculation for an older timestep and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Experiment to find the timestep range to ensure the total energy does not change by more than 1% over the course of the simulation. Why is this important?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In simulations such as this, the physical model is considered an isolated system. We are modeling the changes in velocity and thus kinetic energy changes of induvidual particles/atoms over a total timeframe at constant timesteps. As such, the particles are moving around, interacting, transfering energy between each other. However, unless we are changing variables such as Temperature, Number of particles, Volume (density) etc. during a simulation, the overall energy should remain constant. Therefore it is important to monitor the total energy to ensure our model is fitting with our physical understanding.&lt;br /&gt;
&lt;br /&gt;
From experimentation, it can be seen that to limit this total energy change over a simulation, the time step should really be smaller than 0.3. It can be seen in Figure 1.2 how the peaks and thus total energy begin to fluctuate significantly more for 0.3 and above. &lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_En_err_w_timestep.png|thumb|500px|center|&#039;&#039;&#039;Figure 1.2:&#039;&#039;&#039; &#039;&#039;Energy vs Time: a) δt=0.01, b) δt=0.03, c) δt=0.03&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Maths based upon a single Lennard-Jones interaction&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
[[File:JmsD_Maths_1.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.3:&#039;&#039;&#039; &#039;&#039;Answers to the LJ based maths task&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.5 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the number of water molecules in 1 mL under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;Density of water = 1 g/ml&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Molecular weight of wate = 18 g/mol&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Moles in 1 ml, n = 1/18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Number of molecules = n x N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 1/18 x 6.022x10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;3.35x10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;10000/N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = moles of water, n&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Mass of 10000 water molecules, m = n x 18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;The volume, V = m / 1 g/ml &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;2.99x10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.6 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?.  &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The particle should end up in position (0.2,0.1,0.7) after the application of periodic boundary conditions. &lt;br /&gt;
&lt;br /&gt;
This is because, if the number of particles in the box remains constant, if a particle excit the box on one face, it will return from the opposite. In this case, if the particle starts at (0.5,0.5,0.5) in the cubic box ((0,0,0):(1,1,1)) and moves along the vector (0.7,0.6,0.2), it will reappear from the other face, positioned now at (0.2,0.1,0.7).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.7 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; The LJ parameters for argon are &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; = 0.34 nm, &amp;lt;math&amp;gt;\epsilon\ /\ k_B&amp;lt;/math&amp;gt; = 120 K. If the LJ cutoff is r* = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T*=1.5 in real units?  &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;r = 1.088 x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; m&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;T = 180 K&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; = 0.014 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 2 Equilibriation ==&lt;br /&gt;
&lt;br /&gt;
== 3 Simmulations under specific conditions ==&lt;br /&gt;
==== 3.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature, T* = 1.5), and two reasonable pressures in Lennard-Jones units.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run these simulations to plot the &#039;Equations of State&#039; [Below].&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The 10 phase points used inn this task were determined by the 5 temperatures (T): 1.6, 1.8, 2.0, 2.2, 2.4 and the pressures (p) 2.4, 2.8. The timestep (δt) chosen was again 0.0025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Npt_1.6_2.4.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Npt_1.6_2.4.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 3.2 Task ====&lt;br /&gt;
&lt;br /&gt;
The temperature ideally needs to be maintained as close to the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, as possible. This is done by multplying every velocity, by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &#039;target temperature&#039; is as stipulated in the input script&lt;br /&gt;
&lt;br /&gt;
The instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, will fluctuate  due to approximations made in the algorithm. &lt;br /&gt;
*If &amp;lt;math&amp;gt;T &amp;gt; \mathfrak{T}&amp;lt;/math&amp;gt;, the E&amp;lt;sub&amp;gt;K&amp;lt;/sub&amp;gt; is too high and thus &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be less than 1.&lt;br /&gt;
*If, by contrast, &amp;lt;math&amp;gt;T &amp;lt; \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;Equipartition theorem&#039; states that on average, every degree of freedom in a system at equilibrium will have K&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T/2 of energy. This sytem has 3 degrees of freedom and as such:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \mathbf{v}_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expressing in terms of the adjustment to target temperature as described above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma \mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Solve the equations for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find out the importance of the three numbers 100 1000 100000.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How often are values sampled for the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How many measurments contribute to the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 {...VARIABLES...}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How much time will this simulate?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Using the output of the simulations in 3.1, plot density as a unction of temperature, for both pressures - (Incl. Error bars + Ideal Gas). Is the simulated density higher or lower than Ideal? Why? Finaly, does the discrepancy increase or decrease w. pressure?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_NpT1.png|thumb|500px|center|&#039;&#039;&#039;Figure 3.1:&#039;&#039;&#039; &#039;&#039;A plot of Average Density vs Average Temperature for two different pressures&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 4 Calculation of heat capacities using statistical physics ==&lt;br /&gt;
==== 4.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simulations and plot C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V as a function of temperature. Is this as expected?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Cv_2.0_0.2.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Cv_2.0_0.2.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
For this section, 5 simulations were run for each of the two densities: 0.2, 0.8. These simulations corresponded to each of the respective temperatures: 2.0, 2.2, 2.4, 2.6, 2.8 (in reduced units). The desired results of these simulations were the calculated values of the Heat Capacity at constant volume, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;. The results can be seen in Figure 4.1 as a funtion of the average temperatures.&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Cv graph1.png|thumb|500px|center|&#039;&#039;&#039;Figure 4.1:&#039;&#039;&#039; &#039;&#039;A plot comparing Heat Capacity/Volume vs Average Temperature for two different densities&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
These graphs do indeed follow the trend expected, that is similar to the trend seen in a crystalline solid for example. The Heat Capacity is proportional to 1/T&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; [As seen in the Equations below] and as such a negative trend should be observed. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With reagrds to density, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V increases as the density increases - which is again as expected - because heat capacity is dependant on the amount of material per volume, and thus a denser material (with the same volume) has more mass or moles per unit voulume.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 5 Radial Distribution Functions ==&lt;br /&gt;
==== 5.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; From simulations of the Lennard-Jones system in the three phases, Compute &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; in VMD. Discuss the differences in the 3 RDFs and thus what this means about the structure in each phase.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the solid phase, illustrate which lattics sites the first 3 peaks correspond to. What is the Lattice spacing? What is the Coordination number for each of the first three peaks?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The initial parameters for the simulations, in order to specify the correct phases were:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; Temperature: (For all phases) = 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Densities: (Solid) = 1.50, (Liquid) = 0.85, (Vapour) = 0.01 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Finally, to provide the initial positions of atoms, the simple cubic model was used for Liquid and Vapour, but for Solid FCC was used.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These parameters were calculated by examining the Lennar-Jones phase diagram found in literature. [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 &amp;lt;sup&amp;gt;[2] &amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_g(r).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.1:&#039;&#039;&#039; &#039;&#039;The Radial Distribution Functions of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Int(g(r))dr.png|thumb|500px|center|&#039;&#039;&#039;Figure 5.2:&#039;&#039;&#039; &#039;&#039;The Integrals of the RDFs of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Solid3(g(r)).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.3:&#039;&#039;&#039; &#039;&#039;The RDF of the solid, paying particular attention to the first 3 peaks&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 6 Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
==== 6.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simlations for the three phases, to calculate the mean squared displacement and velocity autocorrelation functions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 6.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Measure D from it&#039;s connection to the MSD, for simulations and data for approx. one million atom simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equation for the Diffusion Coefficient, &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
However, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be much more simply estimated by fitting the linear section of a Total MSD vs Timestep graph and dividing by 6.&lt;br /&gt;
This gives the following values for D (in reduced units) for the smaller simulations carried out by myself:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.31x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.33&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 1.55&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.1-6.3]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_my_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.1:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Solid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.2:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Liquid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.3:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Vapour simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
In comparison below are the values for D (in reduced units) for the larger (approx. 1 million atom) data supplied:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.71x10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.75&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 6.28&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.4-6.6]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_mil_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.4:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Solid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_mil_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.5:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Liquid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsDil_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.6:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Vapour MSD data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 7 References ==&lt;br /&gt;
 1.  LAMMPS Manual, http://lammps.sandia.gov/doc/Section_commands.html#lammps-input-script , accessed November 2016&lt;br /&gt;
 2.  JP Hansen, L Verlet, Phys Rev, 184, 1969, http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589595</id>
		<title>Rep:Mod:Yr3LiquidSimJmsD</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589595"/>
		<updated>2017-02-24T08:25:12Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: /* 1 Theory */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Jack Dawson - Yr3 Comp: Liquid Sim.=&lt;br /&gt;
&lt;br /&gt;
== 1 Theory ==&lt;br /&gt;
&lt;br /&gt;
==== 1.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Compltete the Classical Harmonic Osciallator Spreadsheet&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_HO.xls|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For δt=0.01, estimate the positions of maximum error and fit accordingly.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Max Error Graph.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.1:&#039;&#039;&#039; &#039;&#039;A plot of the error in VV algorithm data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
Figure 1.1 shows how the maximum error increases linearly. This can be rationalised by the fact that each cycle of simulation follows on from the last, so the error of the new cycle is combined to the uncertainty in a previous calculation for an older timestep and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Experiment to find the timestep range to ensure the total energy does not change by more than 1% over the course of the simulation. Why is this important?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In simulations such as this, the physical model is considered an isolated system. We are modeling the changes in velocity and thus kinetic energy changes of induvidual particles/atoms over a total timeframe at constant timesteps. As such, the particles are moving around, interacting, transfering energy between each other. However, unless we are changing variables such as Temperature, Number of particles, Volume (density) etc. during a simulation, the overall energy should remain constant. Therefore it is important to monitor the total energy to ensure our model is fitting with our physical understanding.&lt;br /&gt;
&lt;br /&gt;
From experimentation, it can be seen that to limit this total energy change over a simulation, the time step should really be smaller than 0.3. It can be seen in Figure 1.2 how the peaks and thus total energy begin to fluctuate significantly more for 0.3 and above. &lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_En_err_w_timestep.png|thumb|500px|center|&#039;&#039;&#039;Figure 1.2:&#039;&#039;&#039; &#039;&#039;Energy vs Time: a) δt=0.01, b) δt=0.03, c) δt=0.03&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Maths based upon a single Lennard-Jones interaction&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
[[File:JmsD_Maths_1.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.3:&#039;&#039;&#039; &#039;&#039;Answers to the LJ based maths task&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.5 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the number of water molecules in 1 mL under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;Density of water = 1 g/ml&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Molecular weight of wate = 18 g/mol&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Moles in 1 ml, n = 1/18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Number of molecules = n x N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 1/18 x 6.022x10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;3.35x10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;10000/N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = moles of water, n&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Mass of 10000 water molecules, m = n x 18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;The volume, V = m / 1 g/ml &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;2.99x10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.6 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?.  &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The particle should end up in position (0.2,0.1,0.7) after the application of periodic boundary conditions. &lt;br /&gt;
&lt;br /&gt;
This is because, if the number of particles in the box remains constant, if a particle excit the box on one face, it will return from the opposite. In this case, if the particle starts at (0.5,0.5,0.5) in the cubic box ((0,0,0):(1,1,1)) and moves along the vector (0.7,0.6,0.2), it will reappear from the other face, positioned now at (0.2,0.1,0.7).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.7 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; The LJ parameters for argon are &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; = 0.34 nm, &amp;lt;math&amp;gt;\epsilon\ /\ k_B&amp;lt;/math&amp;gt; = 120 K. If the LJ cutoff is r* = 3.2, what is it in real units? What is the well depth in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;? What is the reduced temperature T*=1.5 in real units?  &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 2 Equilibriation ==&lt;br /&gt;
&lt;br /&gt;
== 3 Simmulations under specific conditions ==&lt;br /&gt;
==== 3.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature, T* = 1.5), and two reasonable pressures in Lennard-Jones units.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run these simulations to plot the &#039;Equations of State&#039; [Below].&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The 10 phase points used inn this task were determined by the 5 temperatures (T): 1.6, 1.8, 2.0, 2.2, 2.4 and the pressures (p) 2.4, 2.8. The timestep (δt) chosen was again 0.0025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Npt_1.6_2.4.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Npt_1.6_2.4.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 3.2 Task ====&lt;br /&gt;
&lt;br /&gt;
The temperature ideally needs to be maintained as close to the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, as possible. This is done by multplying every velocity, by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &#039;target temperature&#039; is as stipulated in the input script&lt;br /&gt;
&lt;br /&gt;
The instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, will fluctuate  due to approximations made in the algorithm. &lt;br /&gt;
*If &amp;lt;math&amp;gt;T &amp;gt; \mathfrak{T}&amp;lt;/math&amp;gt;, the E&amp;lt;sub&amp;gt;K&amp;lt;/sub&amp;gt; is too high and thus &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be less than 1.&lt;br /&gt;
*If, by contrast, &amp;lt;math&amp;gt;T &amp;lt; \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;Equipartition theorem&#039; states that on average, every degree of freedom in a system at equilibrium will have K&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T/2 of energy. This sytem has 3 degrees of freedom and as such:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \mathbf{v}_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expressing in terms of the adjustment to target temperature as described above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma \mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Solve the equations for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find out the importance of the three numbers 100 1000 100000.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How often are values sampled for the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How many measurments contribute to the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 {...VARIABLES...}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How much time will this simulate?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Using the output of the simulations in 3.1, plot density as a unction of temperature, for both pressures - (Incl. Error bars + Ideal Gas). Is the simulated density higher or lower than Ideal? Why? Finaly, does the discrepancy increase or decrease w. pressure?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_NpT1.png|thumb|500px|center|&#039;&#039;&#039;Figure 3.1:&#039;&#039;&#039; &#039;&#039;A plot of Average Density vs Average Temperature for two different pressures&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 4 Calculation of heat capacities using statistical physics ==&lt;br /&gt;
==== 4.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simulations and plot C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V as a function of temperature. Is this as expected?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Cv_2.0_0.2.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Cv_2.0_0.2.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
For this section, 5 simulations were run for each of the two densities: 0.2, 0.8. These simulations corresponded to each of the respective temperatures: 2.0, 2.2, 2.4, 2.6, 2.8 (in reduced units). The desired results of these simulations were the calculated values of the Heat Capacity at constant volume, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;. The results can be seen in Figure 4.1 as a funtion of the average temperatures.&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Cv graph1.png|thumb|500px|center|&#039;&#039;&#039;Figure 4.1:&#039;&#039;&#039; &#039;&#039;A plot comparing Heat Capacity/Volume vs Average Temperature for two different densities&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
These graphs do indeed follow the trend expected, that is similar to the trend seen in a crystalline solid for example. The Heat Capacity is proportional to 1/T&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; [As seen in the Equations below] and as such a negative trend should be observed. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With reagrds to density, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V increases as the density increases - which is again as expected - because heat capacity is dependant on the amount of material per volume, and thus a denser material (with the same volume) has more mass or moles per unit voulume.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 5 Radial Distribution Functions ==&lt;br /&gt;
==== 5.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; From simulations of the Lennard-Jones system in the three phases, Compute &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; in VMD. Discuss the differences in the 3 RDFs and thus what this means about the structure in each phase.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the solid phase, illustrate which lattics sites the first 3 peaks correspond to. What is the Lattice spacing? What is the Coordination number for each of the first three peaks?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The initial parameters for the simulations, in order to specify the correct phases were:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; Temperature: (For all phases) = 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Densities: (Solid) = 1.50, (Liquid) = 0.85, (Vapour) = 0.01 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Finally, to provide the initial positions of atoms, the simple cubic model was used for Liquid and Vapour, but for Solid FCC was used.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These parameters were calculated by examining the Lennar-Jones phase diagram found in literature. [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 &amp;lt;sup&amp;gt;[2] &amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_g(r).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.1:&#039;&#039;&#039; &#039;&#039;The Radial Distribution Functions of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Int(g(r))dr.png|thumb|500px|center|&#039;&#039;&#039;Figure 5.2:&#039;&#039;&#039; &#039;&#039;The Integrals of the RDFs of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Solid3(g(r)).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.3:&#039;&#039;&#039; &#039;&#039;The RDF of the solid, paying particular attention to the first 3 peaks&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 6 Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
==== 6.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simlations for the three phases, to calculate the mean squared displacement and velocity autocorrelation functions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 6.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Measure D from it&#039;s connection to the MSD, for simulations and data for approx. one million atom simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equation for the Diffusion Coefficient, &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
However, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be much more simply estimated by fitting the linear section of a Total MSD vs Timestep graph and dividing by 6.&lt;br /&gt;
This gives the following values for D (in reduced units) for the smaller simulations carried out by myself:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.31x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.33&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 1.55&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.1-6.3]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_my_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.1:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Solid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.2:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Liquid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.3:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Vapour simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
In comparison below are the values for D (in reduced units) for the larger (approx. 1 million atom) data supplied:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.71x10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.75&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 6.28&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.4-6.6]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_mil_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.4:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Solid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_mil_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.5:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Liquid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsDil_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.6:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Vapour MSD data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 7 References ==&lt;br /&gt;
 1.  LAMMPS Manual, http://lammps.sandia.gov/doc/Section_commands.html#lammps-input-script , accessed November 2016&lt;br /&gt;
 2.  JP Hansen, L Verlet, Phys Rev, 184, 1969, http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589594</id>
		<title>Rep:Mod:Yr3LiquidSimJmsD</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589594"/>
		<updated>2017-02-24T08:20:11Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: /* 1.6 Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Jack Dawson - Yr3 Comp: Liquid Sim.=&lt;br /&gt;
&lt;br /&gt;
== 1 Theory ==&lt;br /&gt;
&lt;br /&gt;
==== 1.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Compltete the Classical Harmonic Osciallator Spreadsheet&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_HO.xls|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For δt=0.01, estimate the positions of maximum error and fit accordingly.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Max Error Graph.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.1:&#039;&#039;&#039; &#039;&#039;A plot of the error in VV algorithm data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
Figure 1.1 shows how the maximum error increases linearly. This can be rationalised by the fact that each cycle of simulation follows on from the last, so the error of the new cycle is combined to the uncertainty in a previous calculation for an older timestep and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Experiment to find the timestep range to ensure the total energy does not change by more than 1% over the course of the simulation. Why is this important?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In simulations such as this, the physical model is considered an isolated system. We are modeling the changes in velocity and thus kinetic energy changes of induvidual particles/atoms over a total timeframe at constant timesteps. As such, the particles are moving around, interacting, transfering energy between each other. However, unless we are changing variables such as Temperature, Number of particles, Volume (density) etc. during a simulation, the overall energy should remain constant. Therefore it is important to monitor the total energy to ensure our model is fitting with our physical understanding.&lt;br /&gt;
&lt;br /&gt;
From experimentation, it can be seen that to limit this total energy change over a simulation, the time step should really be smaller than 0.3. It can be seen in Figure 1.2 how the peaks and thus total energy begin to fluctuate significantly more for 0.3 and above. &lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_En_err_w_timestep.png|thumb|500px|center|&#039;&#039;&#039;Figure 1.2:&#039;&#039;&#039; &#039;&#039;Energy vs Time: a) δt=0.01, b) δt=0.03, c) δt=0.03&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Maths based upon a single Lennard-Jones interaction&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
[[File:JmsD_Maths_1.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.3:&#039;&#039;&#039; &#039;&#039;Answers to the LJ based maths task&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.5 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the number of water molecules in 1 mL under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;Density of water = 1 g/ml&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Molecular weight of wate = 18 g/mol&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Moles in 1 ml, n = 1/18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Number of molecules = n x N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 1/18 x 6.022x10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;3.35x10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;10000/N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = moles of water, n&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Mass of 10000 water molecules, m = n x 18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;The volume, V = m / 1 g/ml &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;2.99x10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.6 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?.  &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The particle should end up in position (0.2,0.1,0.7) after the application of periodic boundary conditions. &lt;br /&gt;
&lt;br /&gt;
This is because, if the number of particles in the box remains constant, if a particle excit the box on one face, it will return from the opposite. In this case, if the particle starts at (0.5,0.5,0.5) in the cubic box ((0,0,0):(1,1,1)) and moves along the vector (0.7,0.6,0.2), it will reappear from the other face, positioned now at (0.2,0.1,0.7).&lt;br /&gt;
&lt;br /&gt;
== 2 Equilibriation ==&lt;br /&gt;
&lt;br /&gt;
== 3 Simmulations under specific conditions ==&lt;br /&gt;
==== 3.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature, T* = 1.5), and two reasonable pressures in Lennard-Jones units.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run these simulations to plot the &#039;Equations of State&#039; [Below].&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The 10 phase points used inn this task were determined by the 5 temperatures (T): 1.6, 1.8, 2.0, 2.2, 2.4 and the pressures (p) 2.4, 2.8. The timestep (δt) chosen was again 0.0025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Npt_1.6_2.4.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Npt_1.6_2.4.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 3.2 Task ====&lt;br /&gt;
&lt;br /&gt;
The temperature ideally needs to be maintained as close to the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, as possible. This is done by multplying every velocity, by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &#039;target temperature&#039; is as stipulated in the input script&lt;br /&gt;
&lt;br /&gt;
The instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, will fluctuate  due to approximations made in the algorithm. &lt;br /&gt;
*If &amp;lt;math&amp;gt;T &amp;gt; \mathfrak{T}&amp;lt;/math&amp;gt;, the E&amp;lt;sub&amp;gt;K&amp;lt;/sub&amp;gt; is too high and thus &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be less than 1.&lt;br /&gt;
*If, by contrast, &amp;lt;math&amp;gt;T &amp;lt; \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;Equipartition theorem&#039; states that on average, every degree of freedom in a system at equilibrium will have K&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T/2 of energy. This sytem has 3 degrees of freedom and as such:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \mathbf{v}_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expressing in terms of the adjustment to target temperature as described above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma \mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Solve the equations for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find out the importance of the three numbers 100 1000 100000.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How often are values sampled for the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How many measurments contribute to the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 {...VARIABLES...}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How much time will this simulate?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Using the output of the simulations in 3.1, plot density as a unction of temperature, for both pressures - (Incl. Error bars + Ideal Gas). Is the simulated density higher or lower than Ideal? Why? Finaly, does the discrepancy increase or decrease w. pressure?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_NpT1.png|thumb|500px|center|&#039;&#039;&#039;Figure 3.1:&#039;&#039;&#039; &#039;&#039;A plot of Average Density vs Average Temperature for two different pressures&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 4 Calculation of heat capacities using statistical physics ==&lt;br /&gt;
==== 4.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simulations and plot C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V as a function of temperature. Is this as expected?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Cv_2.0_0.2.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Cv_2.0_0.2.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
For this section, 5 simulations were run for each of the two densities: 0.2, 0.8. These simulations corresponded to each of the respective temperatures: 2.0, 2.2, 2.4, 2.6, 2.8 (in reduced units). The desired results of these simulations were the calculated values of the Heat Capacity at constant volume, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;. The results can be seen in Figure 4.1 as a funtion of the average temperatures.&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Cv graph1.png|thumb|500px|center|&#039;&#039;&#039;Figure 4.1:&#039;&#039;&#039; &#039;&#039;A plot comparing Heat Capacity/Volume vs Average Temperature for two different densities&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
These graphs do indeed follow the trend expected, that is similar to the trend seen in a crystalline solid for example. The Heat Capacity is proportional to 1/T&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; [As seen in the Equations below] and as such a negative trend should be observed. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With reagrds to density, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V increases as the density increases - which is again as expected - because heat capacity is dependant on the amount of material per volume, and thus a denser material (with the same volume) has more mass or moles per unit voulume.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 5 Radial Distribution Functions ==&lt;br /&gt;
==== 5.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; From simulations of the Lennard-Jones system in the three phases, Compute &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; in VMD. Discuss the differences in the 3 RDFs and thus what this means about the structure in each phase.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the solid phase, illustrate which lattics sites the first 3 peaks correspond to. What is the Lattice spacing? What is the Coordination number for each of the first three peaks?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The initial parameters for the simulations, in order to specify the correct phases were:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; Temperature: (For all phases) = 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Densities: (Solid) = 1.50, (Liquid) = 0.85, (Vapour) = 0.01 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Finally, to provide the initial positions of atoms, the simple cubic model was used for Liquid and Vapour, but for Solid FCC was used.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These parameters were calculated by examining the Lennar-Jones phase diagram found in literature. [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 &amp;lt;sup&amp;gt;[2] &amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_g(r).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.1:&#039;&#039;&#039; &#039;&#039;The Radial Distribution Functions of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Int(g(r))dr.png|thumb|500px|center|&#039;&#039;&#039;Figure 5.2:&#039;&#039;&#039; &#039;&#039;The Integrals of the RDFs of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Solid3(g(r)).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.3:&#039;&#039;&#039; &#039;&#039;The RDF of the solid, paying particular attention to the first 3 peaks&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 6 Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
==== 6.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simlations for the three phases, to calculate the mean squared displacement and velocity autocorrelation functions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 6.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Measure D from it&#039;s connection to the MSD, for simulations and data for approx. one million atom simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equation for the Diffusion Coefficient, &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
However, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be much more simply estimated by fitting the linear section of a Total MSD vs Timestep graph and dividing by 6.&lt;br /&gt;
This gives the following values for D (in reduced units) for the smaller simulations carried out by myself:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.31x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.33&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 1.55&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.1-6.3]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_my_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.1:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Solid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.2:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Liquid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.3:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Vapour simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
In comparison below are the values for D (in reduced units) for the larger (approx. 1 million atom) data supplied:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.71x10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.75&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 6.28&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.4-6.6]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_mil_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.4:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Solid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_mil_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.5:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Liquid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsDil_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.6:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Vapour MSD data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 7 References ==&lt;br /&gt;
 1.  LAMMPS Manual, http://lammps.sandia.gov/doc/Section_commands.html#lammps-input-script , accessed November 2016&lt;br /&gt;
 2.  JP Hansen, L Verlet, Phys Rev, 184, 1969, http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589591</id>
		<title>Rep:Mod:Yr3LiquidSimJmsD</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589591"/>
		<updated>2017-02-24T08:12:58Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: /* 1 Theory */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Jack Dawson - Yr3 Comp: Liquid Sim.=&lt;br /&gt;
&lt;br /&gt;
== 1 Theory ==&lt;br /&gt;
&lt;br /&gt;
==== 1.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Compltete the Classical Harmonic Osciallator Spreadsheet&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_HO.xls|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For δt=0.01, estimate the positions of maximum error and fit accordingly.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Max Error Graph.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.1:&#039;&#039;&#039; &#039;&#039;A plot of the error in VV algorithm data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
Figure 1.1 shows how the maximum error increases linearly. This can be rationalised by the fact that each cycle of simulation follows on from the last, so the error of the new cycle is combined to the uncertainty in a previous calculation for an older timestep and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Experiment to find the timestep range to ensure the total energy does not change by more than 1% over the course of the simulation. Why is this important?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In simulations such as this, the physical model is considered an isolated system. We are modeling the changes in velocity and thus kinetic energy changes of induvidual particles/atoms over a total timeframe at constant timesteps. As such, the particles are moving around, interacting, transfering energy between each other. However, unless we are changing variables such as Temperature, Number of particles, Volume (density) etc. during a simulation, the overall energy should remain constant. Therefore it is important to monitor the total energy to ensure our model is fitting with our physical understanding.&lt;br /&gt;
&lt;br /&gt;
From experimentation, it can be seen that to limit this total energy change over a simulation, the time step should really be smaller than 0.3. It can be seen in Figure 1.2 how the peaks and thus total energy begin to fluctuate significantly more for 0.3 and above. &lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_En_err_w_timestep.png|thumb|500px|center|&#039;&#039;&#039;Figure 1.2:&#039;&#039;&#039; &#039;&#039;Energy vs Time: a) δt=0.01, b) δt=0.03, c) δt=0.03&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Maths based upon a single Lennard-Jones interaction&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
[[File:JmsD_Maths_1.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.3:&#039;&#039;&#039; &#039;&#039;Answers to the LJ based maths task&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.5 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the number of water molecules in 1 mL under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;Density of water = 1 g/ml&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Molecular weight of wate = 18 g/mol&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Moles in 1 ml, n = 1/18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Number of molecules = n x N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 1/18 x 6.022x10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;3.35x10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;10000/N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = moles of water, n&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Mass of 10000 water molecules, m = n x 18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;The volume, V = m / 1 g/ml &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;2.99x10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.6 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?.  &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 2 Equilibriation ==&lt;br /&gt;
&lt;br /&gt;
== 3 Simmulations under specific conditions ==&lt;br /&gt;
==== 3.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature, T* = 1.5), and two reasonable pressures in Lennard-Jones units.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run these simulations to plot the &#039;Equations of State&#039; [Below].&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The 10 phase points used inn this task were determined by the 5 temperatures (T): 1.6, 1.8, 2.0, 2.2, 2.4 and the pressures (p) 2.4, 2.8. The timestep (δt) chosen was again 0.0025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Npt_1.6_2.4.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Npt_1.6_2.4.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 3.2 Task ====&lt;br /&gt;
&lt;br /&gt;
The temperature ideally needs to be maintained as close to the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, as possible. This is done by multplying every velocity, by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &#039;target temperature&#039; is as stipulated in the input script&lt;br /&gt;
&lt;br /&gt;
The instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, will fluctuate  due to approximations made in the algorithm. &lt;br /&gt;
*If &amp;lt;math&amp;gt;T &amp;gt; \mathfrak{T}&amp;lt;/math&amp;gt;, the E&amp;lt;sub&amp;gt;K&amp;lt;/sub&amp;gt; is too high and thus &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be less than 1.&lt;br /&gt;
*If, by contrast, &amp;lt;math&amp;gt;T &amp;lt; \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;Equipartition theorem&#039; states that on average, every degree of freedom in a system at equilibrium will have K&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T/2 of energy. This sytem has 3 degrees of freedom and as such:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \mathbf{v}_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expressing in terms of the adjustment to target temperature as described above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma \mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Solve the equations for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find out the importance of the three numbers 100 1000 100000.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How often are values sampled for the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How many measurments contribute to the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 {...VARIABLES...}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How much time will this simulate?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Using the output of the simulations in 3.1, plot density as a unction of temperature, for both pressures - (Incl. Error bars + Ideal Gas). Is the simulated density higher or lower than Ideal? Why? Finaly, does the discrepancy increase or decrease w. pressure?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_NpT1.png|thumb|500px|center|&#039;&#039;&#039;Figure 3.1:&#039;&#039;&#039; &#039;&#039;A plot of Average Density vs Average Temperature for two different pressures&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 4 Calculation of heat capacities using statistical physics ==&lt;br /&gt;
==== 4.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simulations and plot C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V as a function of temperature. Is this as expected?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Cv_2.0_0.2.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Cv_2.0_0.2.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
For this section, 5 simulations were run for each of the two densities: 0.2, 0.8. These simulations corresponded to each of the respective temperatures: 2.0, 2.2, 2.4, 2.6, 2.8 (in reduced units). The desired results of these simulations were the calculated values of the Heat Capacity at constant volume, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;. The results can be seen in Figure 4.1 as a funtion of the average temperatures.&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Cv graph1.png|thumb|500px|center|&#039;&#039;&#039;Figure 4.1:&#039;&#039;&#039; &#039;&#039;A plot comparing Heat Capacity/Volume vs Average Temperature for two different densities&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
These graphs do indeed follow the trend expected, that is similar to the trend seen in a crystalline solid for example. The Heat Capacity is proportional to 1/T&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; [As seen in the Equations below] and as such a negative trend should be observed. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With reagrds to density, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V increases as the density increases - which is again as expected - because heat capacity is dependant on the amount of material per volume, and thus a denser material (with the same volume) has more mass or moles per unit voulume.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 5 Radial Distribution Functions ==&lt;br /&gt;
==== 5.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; From simulations of the Lennard-Jones system in the three phases, Compute &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; in VMD. Discuss the differences in the 3 RDFs and thus what this means about the structure in each phase.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the solid phase, illustrate which lattics sites the first 3 peaks correspond to. What is the Lattice spacing? What is the Coordination number for each of the first three peaks?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The initial parameters for the simulations, in order to specify the correct phases were:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; Temperature: (For all phases) = 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Densities: (Solid) = 1.50, (Liquid) = 0.85, (Vapour) = 0.01 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Finally, to provide the initial positions of atoms, the simple cubic model was used for Liquid and Vapour, but for Solid FCC was used.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These parameters were calculated by examining the Lennar-Jones phase diagram found in literature. [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 &amp;lt;sup&amp;gt;[2] &amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_g(r).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.1:&#039;&#039;&#039; &#039;&#039;The Radial Distribution Functions of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Int(g(r))dr.png|thumb|500px|center|&#039;&#039;&#039;Figure 5.2:&#039;&#039;&#039; &#039;&#039;The Integrals of the RDFs of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Solid3(g(r)).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.3:&#039;&#039;&#039; &#039;&#039;The RDF of the solid, paying particular attention to the first 3 peaks&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 6 Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
==== 6.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simlations for the three phases, to calculate the mean squared displacement and velocity autocorrelation functions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 6.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Measure D from it&#039;s connection to the MSD, for simulations and data for approx. one million atom simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equation for the Diffusion Coefficient, &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
However, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be much more simply estimated by fitting the linear section of a Total MSD vs Timestep graph and dividing by 6.&lt;br /&gt;
This gives the following values for D (in reduced units) for the smaller simulations carried out by myself:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.31x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.33&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 1.55&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.1-6.3]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_my_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.1:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Solid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.2:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Liquid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.3:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Vapour simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
In comparison below are the values for D (in reduced units) for the larger (approx. 1 million atom) data supplied:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.71x10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.75&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 6.28&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.4-6.6]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_mil_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.4:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Solid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_mil_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.5:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Liquid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsDil_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.6:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Vapour MSD data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 7 References ==&lt;br /&gt;
 1.  LAMMPS Manual, http://lammps.sandia.gov/doc/Section_commands.html#lammps-input-script , accessed November 2016&lt;br /&gt;
 2.  JP Hansen, L Verlet, Phys Rev, 184, 1969, http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589590</id>
		<title>Rep:Mod:Yr3LiquidSimJmsD</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589590"/>
		<updated>2017-02-24T08:10:13Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: /* 1.5 Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Jack Dawson - Yr3 Comp: Liquid Sim.=&lt;br /&gt;
&lt;br /&gt;
== 1 Theory ==&lt;br /&gt;
&lt;br /&gt;
==== 1.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Compltete the Classical Harmonic Osciallator Spreadsheet&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_HO.xls|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For δt=0.01, estimate the positions of maximum error and fit accordingly.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Max Error Graph.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.1:&#039;&#039;&#039; &#039;&#039;A plot of the error in VV algorithm data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
Figure 1.1 shows how the maximum error increases linearly. This can be rationalised by the fact that each cycle of simulation follows on from the last, so the error of the new cycle is combined to the uncertainty in a previous calculation for an older timestep and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Experiment to find the timestep range to ensure the total energy does not change by more than 1% over the course of the simulation. Why is this important?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In simulations such as this, the physical model is considered an isolated system. We are modeling the changes in velocity and thus kinetic energy changes of induvidual particles/atoms over a total timeframe at constant timesteps. As such, the particles are moving around, interacting, transfering energy between each other. However, unless we are changing variables such as Temperature, Number of particles, Volume (density) etc. during a simulation, the overall energy should remain constant. Therefore it is important to monitor the total energy to ensure our model is fitting with our physical understanding.&lt;br /&gt;
&lt;br /&gt;
From experimentation, it can be seen that to limit this total energy change over a simulation, the time step should really be smaller than 0.3. It can be seen in Figure 1.2 how the peaks and thus total energy begin to fluctuate significantly more for 0.3 and above. &lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_En_err_w_timestep.png|thumb|500px|center|&#039;&#039;&#039;Figure 1.2:&#039;&#039;&#039; &#039;&#039;Energy vs Time: a) δt=0.01, b) δt=0.03, c) δt=0.03&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Maths based upon a single Lennard-Jones interaction&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
[[File:JmsD_Maths_1.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.3:&#039;&#039;&#039; &#039;&#039;Answers to the LJ based maths task&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.5 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the number of water molecules in 1 mL under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;Density of water = 1 g/ml&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Molecular weight of wate = 18 g/mol&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Moles in 1 ml, n = 1/18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Number of molecules = n x N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 1/18 x 6.022x10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;3.35x10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;10000/N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = moles of water, n&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Mass of 10000 water molecules, m = n x 18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;The volume, V = m / 1 g/ml &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;2.99x10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 2 Equilibriation ==&lt;br /&gt;
&lt;br /&gt;
== 3 Simmulations under specific conditions ==&lt;br /&gt;
==== 3.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature, T* = 1.5), and two reasonable pressures in Lennard-Jones units.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run these simulations to plot the &#039;Equations of State&#039; [Below].&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The 10 phase points used inn this task were determined by the 5 temperatures (T): 1.6, 1.8, 2.0, 2.2, 2.4 and the pressures (p) 2.4, 2.8. The timestep (δt) chosen was again 0.0025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Npt_1.6_2.4.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Npt_1.6_2.4.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 3.2 Task ====&lt;br /&gt;
&lt;br /&gt;
The temperature ideally needs to be maintained as close to the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, as possible. This is done by multplying every velocity, by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &#039;target temperature&#039; is as stipulated in the input script&lt;br /&gt;
&lt;br /&gt;
The instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, will fluctuate  due to approximations made in the algorithm. &lt;br /&gt;
*If &amp;lt;math&amp;gt;T &amp;gt; \mathfrak{T}&amp;lt;/math&amp;gt;, the E&amp;lt;sub&amp;gt;K&amp;lt;/sub&amp;gt; is too high and thus &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be less than 1.&lt;br /&gt;
*If, by contrast, &amp;lt;math&amp;gt;T &amp;lt; \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;Equipartition theorem&#039; states that on average, every degree of freedom in a system at equilibrium will have K&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T/2 of energy. This sytem has 3 degrees of freedom and as such:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \mathbf{v}_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expressing in terms of the adjustment to target temperature as described above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma \mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Solve the equations for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find out the importance of the three numbers 100 1000 100000.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How often are values sampled for the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How many measurments contribute to the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 {...VARIABLES...}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How much time will this simulate?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Using the output of the simulations in 3.1, plot density as a unction of temperature, for both pressures - (Incl. Error bars + Ideal Gas). Is the simulated density higher or lower than Ideal? Why? Finaly, does the discrepancy increase or decrease w. pressure?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_NpT1.png|thumb|500px|center|&#039;&#039;&#039;Figure 3.1:&#039;&#039;&#039; &#039;&#039;A plot of Average Density vs Average Temperature for two different pressures&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 4 Calculation of heat capacities using statistical physics ==&lt;br /&gt;
==== 4.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simulations and plot C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V as a function of temperature. Is this as expected?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Cv_2.0_0.2.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Cv_2.0_0.2.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
For this section, 5 simulations were run for each of the two densities: 0.2, 0.8. These simulations corresponded to each of the respective temperatures: 2.0, 2.2, 2.4, 2.6, 2.8 (in reduced units). The desired results of these simulations were the calculated values of the Heat Capacity at constant volume, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;. The results can be seen in Figure 4.1 as a funtion of the average temperatures.&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Cv graph1.png|thumb|500px|center|&#039;&#039;&#039;Figure 4.1:&#039;&#039;&#039; &#039;&#039;A plot comparing Heat Capacity/Volume vs Average Temperature for two different densities&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
These graphs do indeed follow the trend expected, that is similar to the trend seen in a crystalline solid for example. The Heat Capacity is proportional to 1/T&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; [As seen in the Equations below] and as such a negative trend should be observed. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With reagrds to density, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V increases as the density increases - which is again as expected - because heat capacity is dependant on the amount of material per volume, and thus a denser material (with the same volume) has more mass or moles per unit voulume.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 5 Radial Distribution Functions ==&lt;br /&gt;
==== 5.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; From simulations of the Lennard-Jones system in the three phases, Compute &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; in VMD. Discuss the differences in the 3 RDFs and thus what this means about the structure in each phase.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the solid phase, illustrate which lattics sites the first 3 peaks correspond to. What is the Lattice spacing? What is the Coordination number for each of the first three peaks?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The initial parameters for the simulations, in order to specify the correct phases were:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; Temperature: (For all phases) = 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Densities: (Solid) = 1.50, (Liquid) = 0.85, (Vapour) = 0.01 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Finally, to provide the initial positions of atoms, the simple cubic model was used for Liquid and Vapour, but for Solid FCC was used.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These parameters were calculated by examining the Lennar-Jones phase diagram found in literature. [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 &amp;lt;sup&amp;gt;[2] &amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_g(r).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.1:&#039;&#039;&#039; &#039;&#039;The Radial Distribution Functions of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Int(g(r))dr.png|thumb|500px|center|&#039;&#039;&#039;Figure 5.2:&#039;&#039;&#039; &#039;&#039;The Integrals of the RDFs of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Solid3(g(r)).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.3:&#039;&#039;&#039; &#039;&#039;The RDF of the solid, paying particular attention to the first 3 peaks&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 6 Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
==== 6.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simlations for the three phases, to calculate the mean squared displacement and velocity autocorrelation functions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 6.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Measure D from it&#039;s connection to the MSD, for simulations and data for approx. one million atom simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equation for the Diffusion Coefficient, &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
However, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be much more simply estimated by fitting the linear section of a Total MSD vs Timestep graph and dividing by 6.&lt;br /&gt;
This gives the following values for D (in reduced units) for the smaller simulations carried out by myself:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.31x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.33&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 1.55&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.1-6.3]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_my_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.1:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Solid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.2:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Liquid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.3:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Vapour simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
In comparison below are the values for D (in reduced units) for the larger (approx. 1 million atom) data supplied:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.71x10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.75&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 6.28&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.4-6.6]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_mil_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.4:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Solid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_mil_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.5:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Liquid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsDil_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.6:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Vapour MSD data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 7 References ==&lt;br /&gt;
 1.  LAMMPS Manual, http://lammps.sandia.gov/doc/Section_commands.html#lammps-input-script , accessed November 2016&lt;br /&gt;
 2.  JP Hansen, L Verlet, Phys Rev, 184, 1969, http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589588</id>
		<title>Rep:Mod:Yr3LiquidSimJmsD</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589588"/>
		<updated>2017-02-24T08:03:41Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: /* 1 Theory */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Jack Dawson - Yr3 Comp: Liquid Sim.=&lt;br /&gt;
&lt;br /&gt;
== 1 Theory ==&lt;br /&gt;
&lt;br /&gt;
==== 1.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Compltete the Classical Harmonic Osciallator Spreadsheet&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_HO.xls|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For δt=0.01, estimate the positions of maximum error and fit accordingly.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Max Error Graph.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.1:&#039;&#039;&#039; &#039;&#039;A plot of the error in VV algorithm data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
Figure 1.1 shows how the maximum error increases linearly. This can be rationalised by the fact that each cycle of simulation follows on from the last, so the error of the new cycle is combined to the uncertainty in a previous calculation for an older timestep and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Experiment to find the timestep range to ensure the total energy does not change by more than 1% over the course of the simulation. Why is this important?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In simulations such as this, the physical model is considered an isolated system. We are modeling the changes in velocity and thus kinetic energy changes of induvidual particles/atoms over a total timeframe at constant timesteps. As such, the particles are moving around, interacting, transfering energy between each other. However, unless we are changing variables such as Temperature, Number of particles, Volume (density) etc. during a simulation, the overall energy should remain constant. Therefore it is important to monitor the total energy to ensure our model is fitting with our physical understanding.&lt;br /&gt;
&lt;br /&gt;
From experimentation, it can be seen that to limit this total energy change over a simulation, the time step should really be smaller than 0.3. It can be seen in Figure 1.2 how the peaks and thus total energy begin to fluctuate significantly more for 0.3 and above. &lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_En_err_w_timestep.png|thumb|500px|center|&#039;&#039;&#039;Figure 1.2:&#039;&#039;&#039; &#039;&#039;Energy vs Time: a) δt=0.01, b) δt=0.03, c) δt=0.03&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Maths based upon a single Lennard-Jones interaction&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
[[File:JmsD_Maths_1.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.3:&#039;&#039;&#039; &#039;&#039;Answers to the LJ based maths task&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.5 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Estimate the number of water molecules in 1 mL under standard conditions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;Density of water = 1 g/ml&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Molecular weight of wate = 18 g/mol&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Moles in 1 ml, n = 1/18&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Number of molecules = n x N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; = 1/18 x 6.022x10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;3.35x10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 2 Equilibriation ==&lt;br /&gt;
&lt;br /&gt;
== 3 Simmulations under specific conditions ==&lt;br /&gt;
==== 3.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature, T* = 1.5), and two reasonable pressures in Lennard-Jones units.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run these simulations to plot the &#039;Equations of State&#039; [Below].&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The 10 phase points used inn this task were determined by the 5 temperatures (T): 1.6, 1.8, 2.0, 2.2, 2.4 and the pressures (p) 2.4, 2.8. The timestep (δt) chosen was again 0.0025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Npt_1.6_2.4.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Npt_1.6_2.4.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 3.2 Task ====&lt;br /&gt;
&lt;br /&gt;
The temperature ideally needs to be maintained as close to the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, as possible. This is done by multplying every velocity, by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &#039;target temperature&#039; is as stipulated in the input script&lt;br /&gt;
&lt;br /&gt;
The instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, will fluctuate  due to approximations made in the algorithm. &lt;br /&gt;
*If &amp;lt;math&amp;gt;T &amp;gt; \mathfrak{T}&amp;lt;/math&amp;gt;, the E&amp;lt;sub&amp;gt;K&amp;lt;/sub&amp;gt; is too high and thus &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be less than 1.&lt;br /&gt;
*If, by contrast, &amp;lt;math&amp;gt;T &amp;lt; \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;Equipartition theorem&#039; states that on average, every degree of freedom in a system at equilibrium will have K&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T/2 of energy. This sytem has 3 degrees of freedom and as such:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \mathbf{v}_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expressing in terms of the adjustment to target temperature as described above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma \mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Solve the equations for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find out the importance of the three numbers 100 1000 100000.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How often are values sampled for the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How many measurments contribute to the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 {...VARIABLES...}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How much time will this simulate?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Using the output of the simulations in 3.1, plot density as a unction of temperature, for both pressures - (Incl. Error bars + Ideal Gas). Is the simulated density higher or lower than Ideal? Why? Finaly, does the discrepancy increase or decrease w. pressure?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_NpT1.png|thumb|500px|center|&#039;&#039;&#039;Figure 3.1:&#039;&#039;&#039; &#039;&#039;A plot of Average Density vs Average Temperature for two different pressures&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 4 Calculation of heat capacities using statistical physics ==&lt;br /&gt;
==== 4.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simulations and plot C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V as a function of temperature. Is this as expected?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Cv_2.0_0.2.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Cv_2.0_0.2.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
For this section, 5 simulations were run for each of the two densities: 0.2, 0.8. These simulations corresponded to each of the respective temperatures: 2.0, 2.2, 2.4, 2.6, 2.8 (in reduced units). The desired results of these simulations were the calculated values of the Heat Capacity at constant volume, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;. The results can be seen in Figure 4.1 as a funtion of the average temperatures.&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Cv graph1.png|thumb|500px|center|&#039;&#039;&#039;Figure 4.1:&#039;&#039;&#039; &#039;&#039;A plot comparing Heat Capacity/Volume vs Average Temperature for two different densities&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
These graphs do indeed follow the trend expected, that is similar to the trend seen in a crystalline solid for example. The Heat Capacity is proportional to 1/T&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; [As seen in the Equations below] and as such a negative trend should be observed. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With reagrds to density, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V increases as the density increases - which is again as expected - because heat capacity is dependant on the amount of material per volume, and thus a denser material (with the same volume) has more mass or moles per unit voulume.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 5 Radial Distribution Functions ==&lt;br /&gt;
==== 5.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; From simulations of the Lennard-Jones system in the three phases, Compute &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; in VMD. Discuss the differences in the 3 RDFs and thus what this means about the structure in each phase.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the solid phase, illustrate which lattics sites the first 3 peaks correspond to. What is the Lattice spacing? What is the Coordination number for each of the first three peaks?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The initial parameters for the simulations, in order to specify the correct phases were:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; Temperature: (For all phases) = 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Densities: (Solid) = 1.50, (Liquid) = 0.85, (Vapour) = 0.01 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Finally, to provide the initial positions of atoms, the simple cubic model was used for Liquid and Vapour, but for Solid FCC was used.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These parameters were calculated by examining the Lennar-Jones phase diagram found in literature. [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 &amp;lt;sup&amp;gt;[2] &amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_g(r).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.1:&#039;&#039;&#039; &#039;&#039;The Radial Distribution Functions of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Int(g(r))dr.png|thumb|500px|center|&#039;&#039;&#039;Figure 5.2:&#039;&#039;&#039; &#039;&#039;The Integrals of the RDFs of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Solid3(g(r)).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.3:&#039;&#039;&#039; &#039;&#039;The RDF of the solid, paying particular attention to the first 3 peaks&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 6 Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
==== 6.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simlations for the three phases, to calculate the mean squared displacement and velocity autocorrelation functions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 6.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Measure D from it&#039;s connection to the MSD, for simulations and data for approx. one million atom simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equation for the Diffusion Coefficient, &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
However, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be much more simply estimated by fitting the linear section of a Total MSD vs Timestep graph and dividing by 6.&lt;br /&gt;
This gives the following values for D (in reduced units) for the smaller simulations carried out by myself:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.31x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.33&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 1.55&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.1-6.3]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_my_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.1:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Solid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.2:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Liquid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.3:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Vapour simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
In comparison below are the values for D (in reduced units) for the larger (approx. 1 million atom) data supplied:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.71x10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.75&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 6.28&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.4-6.6]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_mil_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.4:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Solid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_mil_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.5:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Liquid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsDil_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.6:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Vapour MSD data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 7 References ==&lt;br /&gt;
 1.  LAMMPS Manual, http://lammps.sandia.gov/doc/Section_commands.html#lammps-input-script , accessed November 2016&lt;br /&gt;
 2.  JP Hansen, L Verlet, Phys Rev, 184, 1969, http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589583</id>
		<title>Rep:Mod:Yr3LiquidSimJmsD</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589583"/>
		<updated>2017-02-24T07:51:43Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: /* 1.3 Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Jack Dawson - Yr3 Comp: Liquid Sim.=&lt;br /&gt;
&lt;br /&gt;
== 1 Theory ==&lt;br /&gt;
&lt;br /&gt;
==== 1.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Compltete the Classical Harmonic Osciallator Spreadsheet&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_HO.xls|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For δt=0.01, estimate the positions of maximum error and fit accordingly.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Max Error Graph.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.1:&#039;&#039;&#039; &#039;&#039;A plot of the error in VV algorithm data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
Figure 1.1 shows how the maximum error increases linearly. This can be rationalised by the fact that each cycle of simulation follows on from the last, so the error of the new cycle is combined to the uncertainty in a previous calculation for an older timestep and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Experiment to find the timestep range to ensure the total energy does not change by more than 1% over the course of the simulation. Why is this important?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In simulations such as this, the physical model is considered an isolated system. We are modeling the changes in velocity and thus kinetic energy changes of induvidual particles/atoms over a total timeframe at constant timesteps. As such, the particles are moving around, interacting, transfering energy between each other. However, unless we are changing variables such as Temperature, Number of particles, Volume (density) etc. during a simulation, the overall energy should remain constant. Therefore it is important to monitor the total energy to ensure our model is fitting with our physical understanding.&lt;br /&gt;
&lt;br /&gt;
From experimentation, it can be seen that to limit this total energy change over a simulation, the time step should really be smaller than 0.3. It can be seen in Figure 1.2 how the peaks and thus total energy begin to fluctuate significantly more for 0.3 and above. &lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_En_err_w_timestep.png|thumb|500px|center|&#039;&#039;&#039;Figure 1.2:&#039;&#039;&#039; &#039;&#039;Energy vs Time: a) δt=0.01, b) δt=0.03, c) δt=0.03&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Maths based upon a single Lennard-Jones interaction&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
[[File:JmsD_Maths_1.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.3:&#039;&#039;&#039; &#039;&#039;Answers to the LJ based maths task&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 2 Equilibriation ==&lt;br /&gt;
&lt;br /&gt;
== 3 Simmulations under specific conditions ==&lt;br /&gt;
==== 3.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature, T* = 1.5), and two reasonable pressures in Lennard-Jones units.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run these simulations to plot the &#039;Equations of State&#039; [Below].&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The 10 phase points used inn this task were determined by the 5 temperatures (T): 1.6, 1.8, 2.0, 2.2, 2.4 and the pressures (p) 2.4, 2.8. The timestep (δt) chosen was again 0.0025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Npt_1.6_2.4.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Npt_1.6_2.4.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 3.2 Task ====&lt;br /&gt;
&lt;br /&gt;
The temperature ideally needs to be maintained as close to the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, as possible. This is done by multplying every velocity, by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &#039;target temperature&#039; is as stipulated in the input script&lt;br /&gt;
&lt;br /&gt;
The instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, will fluctuate  due to approximations made in the algorithm. &lt;br /&gt;
*If &amp;lt;math&amp;gt;T &amp;gt; \mathfrak{T}&amp;lt;/math&amp;gt;, the E&amp;lt;sub&amp;gt;K&amp;lt;/sub&amp;gt; is too high and thus &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be less than 1.&lt;br /&gt;
*If, by contrast, &amp;lt;math&amp;gt;T &amp;lt; \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;Equipartition theorem&#039; states that on average, every degree of freedom in a system at equilibrium will have K&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T/2 of energy. This sytem has 3 degrees of freedom and as such:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \mathbf{v}_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expressing in terms of the adjustment to target temperature as described above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma \mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Solve the equations for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find out the importance of the three numbers 100 1000 100000.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How often are values sampled for the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How many measurments contribute to the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 {...VARIABLES...}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How much time will this simulate?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Using the output of the simulations in 3.1, plot density as a unction of temperature, for both pressures - (Incl. Error bars + Ideal Gas). Is the simulated density higher or lower than Ideal? Why? Finaly, does the discrepancy increase or decrease w. pressure?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_NpT1.png|thumb|500px|center|&#039;&#039;&#039;Figure 3.1:&#039;&#039;&#039; &#039;&#039;A plot of Average Density vs Average Temperature for two different pressures&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 4 Calculation of heat capacities using statistical physics ==&lt;br /&gt;
==== 4.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simulations and plot C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V as a function of temperature. Is this as expected?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Cv_2.0_0.2.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Cv_2.0_0.2.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
For this section, 5 simulations were run for each of the two densities: 0.2, 0.8. These simulations corresponded to each of the respective temperatures: 2.0, 2.2, 2.4, 2.6, 2.8 (in reduced units). The desired results of these simulations were the calculated values of the Heat Capacity at constant volume, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;. The results can be seen in Figure 4.1 as a funtion of the average temperatures.&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Cv graph1.png|thumb|500px|center|&#039;&#039;&#039;Figure 4.1:&#039;&#039;&#039; &#039;&#039;A plot comparing Heat Capacity/Volume vs Average Temperature for two different densities&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
These graphs do indeed follow the trend expected, that is similar to the trend seen in a crystalline solid for example. The Heat Capacity is proportional to 1/T&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; [As seen in the Equations below] and as such a negative trend should be observed. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With reagrds to density, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V increases as the density increases - which is again as expected - because heat capacity is dependant on the amount of material per volume, and thus a denser material (with the same volume) has more mass or moles per unit voulume.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 5 Radial Distribution Functions ==&lt;br /&gt;
==== 5.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; From simulations of the Lennard-Jones system in the three phases, Compute &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; in VMD. Discuss the differences in the 3 RDFs and thus what this means about the structure in each phase.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the solid phase, illustrate which lattics sites the first 3 peaks correspond to. What is the Lattice spacing? What is the Coordination number for each of the first three peaks?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The initial parameters for the simulations, in order to specify the correct phases were:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; Temperature: (For all phases) = 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Densities: (Solid) = 1.50, (Liquid) = 0.85, (Vapour) = 0.01 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Finally, to provide the initial positions of atoms, the simple cubic model was used for Liquid and Vapour, but for Solid FCC was used.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These parameters were calculated by examining the Lennar-Jones phase diagram found in literature. [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 &amp;lt;sup&amp;gt;[2] &amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_g(r).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.1:&#039;&#039;&#039; &#039;&#039;The Radial Distribution Functions of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Int(g(r))dr.png|thumb|500px|center|&#039;&#039;&#039;Figure 5.2:&#039;&#039;&#039; &#039;&#039;The Integrals of the RDFs of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Solid3(g(r)).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.3:&#039;&#039;&#039; &#039;&#039;The RDF of the solid, paying particular attention to the first 3 peaks&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 6 Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
==== 6.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simlations for the three phases, to calculate the mean squared displacement and velocity autocorrelation functions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 6.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Measure D from it&#039;s connection to the MSD, for simulations and data for approx. one million atom simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equation for the Diffusion Coefficient, &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
However, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be much more simply estimated by fitting the linear section of a Total MSD vs Timestep graph and dividing by 6.&lt;br /&gt;
This gives the following values for D (in reduced units) for the smaller simulations carried out by myself:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.31x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.33&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 1.55&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.1-6.3]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_my_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.1:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Solid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.2:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Liquid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.3:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Vapour simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
In comparison below are the values for D (in reduced units) for the larger (approx. 1 million atom) data supplied:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.71x10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.75&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 6.28&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.4-6.6]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_mil_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.4:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Solid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_mil_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.5:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Liquid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsDil_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.6:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Vapour MSD data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 7 References ==&lt;br /&gt;
 1.  LAMMPS Manual, http://lammps.sandia.gov/doc/Section_commands.html#lammps-input-script , accessed November 2016&lt;br /&gt;
 2.  JP Hansen, L Verlet, Phys Rev, 184, 1969, http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589582</id>
		<title>Rep:Mod:Yr3LiquidSimJmsD</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589582"/>
		<updated>2017-02-24T07:49:11Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: /* 1.3 Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Jack Dawson - Yr3 Comp: Liquid Sim.=&lt;br /&gt;
&lt;br /&gt;
== 1 Theory ==&lt;br /&gt;
&lt;br /&gt;
==== 1.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Compltete the Classical Harmonic Osciallator Spreadsheet&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_HO.xls|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For δt=0.01, estimate the positions of maximum error and fit accordingly.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Max Error Graph.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.1:&#039;&#039;&#039; &#039;&#039;A plot of the error in VV algorithm data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
Figure 1.1 shows how the maximum error increases linearly. This can be rationalised by the fact that each cycle of simulation follows on from the last, so the error of the new cycle is combined to the uncertainty in a previous calculation for an older timestep and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Experiment to find the timestep range to ensure the total energy does not change by more than 1% over the course of the simulation. Why is this important?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In simulations such as this, the physical model is considered an isolated system. We are modeling the changes in velocity and thus kinetic energy changes of induvidual particles/atoms over a total timeframe at constant timesteps. As such, the particles are moving around, interacting, transfering energy between each other. However, unless we are changing variables such as Temperature, Number of particles, Volume (density) etc. during a simulation, the overall energy should remain constant. Therefore it is important to monitor the total energy to ensure our model is fitting with our physical understanding.&lt;br /&gt;
&lt;br /&gt;
From experimentation, it can be seen that to limit this total energy change over a simulation, the time step should really be smaller than 0.3. It can be seen in Figure 1.2 how the peaks and thus total energy begin to fluctuate significantly more for 0.3 and above. &lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_En_err_w_timestep.png|thumb|500px|center|&#039;&#039;&#039;Figure 1.2:&#039;&#039;&#039; &#039;&#039;Energy vs Time: a) δt=0.01, b) δt=0.03, c) δt=0.03&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Maths based upon a ingle Lennard-Jones interaction&#039;&#039;&#039;&#039;&#039; &lt;br /&gt;
[[File:JmsD_Maths_1.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.3:&#039;&#039;&#039; &#039;&#039;Answers to the LJ based maths task&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 2 Equilibriation ==&lt;br /&gt;
&lt;br /&gt;
== 3 Simmulations under specific conditions ==&lt;br /&gt;
==== 3.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature, T* = 1.5), and two reasonable pressures in Lennard-Jones units.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run these simulations to plot the &#039;Equations of State&#039; [Below].&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The 10 phase points used inn this task were determined by the 5 temperatures (T): 1.6, 1.8, 2.0, 2.2, 2.4 and the pressures (p) 2.4, 2.8. The timestep (δt) chosen was again 0.0025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Npt_1.6_2.4.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Npt_1.6_2.4.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 3.2 Task ====&lt;br /&gt;
&lt;br /&gt;
The temperature ideally needs to be maintained as close to the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, as possible. This is done by multplying every velocity, by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &#039;target temperature&#039; is as stipulated in the input script&lt;br /&gt;
&lt;br /&gt;
The instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, will fluctuate  due to approximations made in the algorithm. &lt;br /&gt;
*If &amp;lt;math&amp;gt;T &amp;gt; \mathfrak{T}&amp;lt;/math&amp;gt;, the E&amp;lt;sub&amp;gt;K&amp;lt;/sub&amp;gt; is too high and thus &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be less than 1.&lt;br /&gt;
*If, by contrast, &amp;lt;math&amp;gt;T &amp;lt; \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;Equipartition theorem&#039; states that on average, every degree of freedom in a system at equilibrium will have K&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T/2 of energy. This sytem has 3 degrees of freedom and as such:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \mathbf{v}_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expressing in terms of the adjustment to target temperature as described above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma \mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Solve the equations for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find out the importance of the three numbers 100 1000 100000.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How often are values sampled for the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How many measurments contribute to the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 {...VARIABLES...}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How much time will this simulate?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Using the output of the simulations in 3.1, plot density as a unction of temperature, for both pressures - (Incl. Error bars + Ideal Gas). Is the simulated density higher or lower than Ideal? Why? Finaly, does the discrepancy increase or decrease w. pressure?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_NpT1.png|thumb|500px|center|&#039;&#039;&#039;Figure 3.1:&#039;&#039;&#039; &#039;&#039;A plot of Average Density vs Average Temperature for two different pressures&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 4 Calculation of heat capacities using statistical physics ==&lt;br /&gt;
==== 4.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simulations and plot C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V as a function of temperature. Is this as expected?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Cv_2.0_0.2.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Cv_2.0_0.2.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
For this section, 5 simulations were run for each of the two densities: 0.2, 0.8. These simulations corresponded to each of the respective temperatures: 2.0, 2.2, 2.4, 2.6, 2.8 (in reduced units). The desired results of these simulations were the calculated values of the Heat Capacity at constant volume, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;. The results can be seen in Figure 4.1 as a funtion of the average temperatures.&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Cv graph1.png|thumb|500px|center|&#039;&#039;&#039;Figure 4.1:&#039;&#039;&#039; &#039;&#039;A plot comparing Heat Capacity/Volume vs Average Temperature for two different densities&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
These graphs do indeed follow the trend expected, that is similar to the trend seen in a crystalline solid for example. The Heat Capacity is proportional to 1/T&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; [As seen in the Equations below] and as such a negative trend should be observed. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With reagrds to density, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V increases as the density increases - which is again as expected - because heat capacity is dependant on the amount of material per volume, and thus a denser material (with the same volume) has more mass or moles per unit voulume.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 5 Radial Distribution Functions ==&lt;br /&gt;
==== 5.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; From simulations of the Lennard-Jones system in the three phases, Compute &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; in VMD. Discuss the differences in the 3 RDFs and thus what this means about the structure in each phase.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the solid phase, illustrate which lattics sites the first 3 peaks correspond to. What is the Lattice spacing? What is the Coordination number for each of the first three peaks?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The initial parameters for the simulations, in order to specify the correct phases were:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; Temperature: (For all phases) = 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Densities: (Solid) = 1.50, (Liquid) = 0.85, (Vapour) = 0.01 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Finally, to provide the initial positions of atoms, the simple cubic model was used for Liquid and Vapour, but for Solid FCC was used.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These parameters were calculated by examining the Lennar-Jones phase diagram found in literature. [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 &amp;lt;sup&amp;gt;[2] &amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_g(r).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.1:&#039;&#039;&#039; &#039;&#039;The Radial Distribution Functions of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Int(g(r))dr.png|thumb|500px|center|&#039;&#039;&#039;Figure 5.2:&#039;&#039;&#039; &#039;&#039;The Integrals of the RDFs of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Solid3(g(r)).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.3:&#039;&#039;&#039; &#039;&#039;The RDF of the solid, paying particular attention to the first 3 peaks&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 6 Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
==== 6.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simlations for the three phases, to calculate the mean squared displacement and velocity autocorrelation functions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 6.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Measure D from it&#039;s connection to the MSD, for simulations and data for approx. one million atom simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equation for the Diffusion Coefficient, &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
However, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be much more simply estimated by fitting the linear section of a Total MSD vs Timestep graph and dividing by 6.&lt;br /&gt;
This gives the following values for D (in reduced units) for the smaller simulations carried out by myself:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.31x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.33&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 1.55&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.1-6.3]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_my_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.1:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Solid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.2:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Liquid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.3:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Vapour simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
In comparison below are the values for D (in reduced units) for the larger (approx. 1 million atom) data supplied:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.71x10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.75&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 6.28&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.4-6.6]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_mil_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.4:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Solid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_mil_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.5:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Liquid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsDil_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.6:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Vapour MSD data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 7 References ==&lt;br /&gt;
 1.  LAMMPS Manual, http://lammps.sandia.gov/doc/Section_commands.html#lammps-input-script , accessed November 2016&lt;br /&gt;
 2.  JP Hansen, L Verlet, Phys Rev, 184, 1969, http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589581</id>
		<title>Rep:Mod:Yr3LiquidSimJmsD</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589581"/>
		<updated>2017-02-24T07:48:46Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: /* 1.3 Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Jack Dawson - Yr3 Comp: Liquid Sim.=&lt;br /&gt;
&lt;br /&gt;
== 1 Theory ==&lt;br /&gt;
&lt;br /&gt;
==== 1.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Compltete the Classical Harmonic Osciallator Spreadsheet&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_HO.xls|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For δt=0.01, estimate the positions of maximum error and fit accordingly.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Max Error Graph.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.1:&#039;&#039;&#039; &#039;&#039;A plot of the error in VV algorithm data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
Figure 1.1 shows how the maximum error increases linearly. This can be rationalised by the fact that each cycle of simulation follows on from the last, so the error of the new cycle is combined to the uncertainty in a previous calculation for an older timestep and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Experiment to find the timestep range to ensure the total energy does not change by more than 1% over the course of the simulation. Why is this important?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In simulations such as this, the physical model is considered an isolated system. We are modeling the changes in velocity and thus kinetic energy changes of induvidual particles/atoms over a total timeframe at constant timesteps. As such, the particles are moving around, interacting, transfering energy between each other. However, unless we are changing variables such as Temperature, Number of particles, Volume (density) etc. during a simulation, the overall energy should remain constant. Therefore it is important to monitor the total energy to ensure our model is fitting with our physical understanding.&lt;br /&gt;
&lt;br /&gt;
From experimentation, it can be seen that to limit this total energy change over a simulation, the time step should really be smaller than 0.3. It can be seen in Figure 1.2 how the peaks and thus total energy begin to fluctuate significantly more for 0.3 and above. &lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_En_err_w_timestep.png|thumb|500px|center|&#039;&#039;&#039;Figure 1.2:&#039;&#039;&#039; &#039;&#039;Energy vs Time: a) δt=0.01, b) δt=0.03, c) δt=0.03&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Maths based upon a ingle Lennard-Jones interaction&#039;&#039;&#039;&#039;&#039; &lt;br /&gt;
[[File:JmsD_Maths_1.png|thumb|700px|center|&#039;&#039;&#039;Figure 1.3:&#039;&#039;&#039; &#039;&#039;Answers to the LJ based maths task&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 2 Equilibriation ==&lt;br /&gt;
&lt;br /&gt;
== 3 Simmulations under specific conditions ==&lt;br /&gt;
==== 3.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature, T* = 1.5), and two reasonable pressures in Lennard-Jones units.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run these simulations to plot the &#039;Equations of State&#039; [Below].&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The 10 phase points used inn this task were determined by the 5 temperatures (T): 1.6, 1.8, 2.0, 2.2, 2.4 and the pressures (p) 2.4, 2.8. The timestep (δt) chosen was again 0.0025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Npt_1.6_2.4.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Npt_1.6_2.4.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 3.2 Task ====&lt;br /&gt;
&lt;br /&gt;
The temperature ideally needs to be maintained as close to the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, as possible. This is done by multplying every velocity, by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &#039;target temperature&#039; is as stipulated in the input script&lt;br /&gt;
&lt;br /&gt;
The instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, will fluctuate  due to approximations made in the algorithm. &lt;br /&gt;
*If &amp;lt;math&amp;gt;T &amp;gt; \mathfrak{T}&amp;lt;/math&amp;gt;, the E&amp;lt;sub&amp;gt;K&amp;lt;/sub&amp;gt; is too high and thus &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be less than 1.&lt;br /&gt;
*If, by contrast, &amp;lt;math&amp;gt;T &amp;lt; \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;Equipartition theorem&#039; states that on average, every degree of freedom in a system at equilibrium will have K&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T/2 of energy. This sytem has 3 degrees of freedom and as such:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \mathbf{v}_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expressing in terms of the adjustment to target temperature as described above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma \mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Solve the equations for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find out the importance of the three numbers 100 1000 100000.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How often are values sampled for the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How many measurments contribute to the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 {...VARIABLES...}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How much time will this simulate?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Using the output of the simulations in 3.1, plot density as a unction of temperature, for both pressures - (Incl. Error bars + Ideal Gas). Is the simulated density higher or lower than Ideal? Why? Finaly, does the discrepancy increase or decrease w. pressure?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_NpT1.png|thumb|500px|center|&#039;&#039;&#039;Figure 3.1:&#039;&#039;&#039; &#039;&#039;A plot of Average Density vs Average Temperature for two different pressures&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 4 Calculation of heat capacities using statistical physics ==&lt;br /&gt;
==== 4.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simulations and plot C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V as a function of temperature. Is this as expected?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Cv_2.0_0.2.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Cv_2.0_0.2.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
For this section, 5 simulations were run for each of the two densities: 0.2, 0.8. These simulations corresponded to each of the respective temperatures: 2.0, 2.2, 2.4, 2.6, 2.8 (in reduced units). The desired results of these simulations were the calculated values of the Heat Capacity at constant volume, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;. The results can be seen in Figure 4.1 as a funtion of the average temperatures.&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Cv graph1.png|thumb|500px|center|&#039;&#039;&#039;Figure 4.1:&#039;&#039;&#039; &#039;&#039;A plot comparing Heat Capacity/Volume vs Average Temperature for two different densities&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
These graphs do indeed follow the trend expected, that is similar to the trend seen in a crystalline solid for example. The Heat Capacity is proportional to 1/T&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; [As seen in the Equations below] and as such a negative trend should be observed. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With reagrds to density, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V increases as the density increases - which is again as expected - because heat capacity is dependant on the amount of material per volume, and thus a denser material (with the same volume) has more mass or moles per unit voulume.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 5 Radial Distribution Functions ==&lt;br /&gt;
==== 5.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; From simulations of the Lennard-Jones system in the three phases, Compute &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; in VMD. Discuss the differences in the 3 RDFs and thus what this means about the structure in each phase.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the solid phase, illustrate which lattics sites the first 3 peaks correspond to. What is the Lattice spacing? What is the Coordination number for each of the first three peaks?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The initial parameters for the simulations, in order to specify the correct phases were:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; Temperature: (For all phases) = 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Densities: (Solid) = 1.50, (Liquid) = 0.85, (Vapour) = 0.01 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Finally, to provide the initial positions of atoms, the simple cubic model was used for Liquid and Vapour, but for Solid FCC was used.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These parameters were calculated by examining the Lennar-Jones phase diagram found in literature. [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 &amp;lt;sup&amp;gt;[2] &amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_g(r).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.1:&#039;&#039;&#039; &#039;&#039;The Radial Distribution Functions of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Int(g(r))dr.png|thumb|500px|center|&#039;&#039;&#039;Figure 5.2:&#039;&#039;&#039; &#039;&#039;The Integrals of the RDFs of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Solid3(g(r)).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.3:&#039;&#039;&#039; &#039;&#039;The RDF of the solid, paying particular attention to the first 3 peaks&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 6 Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
==== 6.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simlations for the three phases, to calculate the mean squared displacement and velocity autocorrelation functions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 6.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Measure D from it&#039;s connection to the MSD, for simulations and data for approx. one million atom simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equation for the Diffusion Coefficient, &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
However, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be much more simply estimated by fitting the linear section of a Total MSD vs Timestep graph and dividing by 6.&lt;br /&gt;
This gives the following values for D (in reduced units) for the smaller simulations carried out by myself:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.31x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.33&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 1.55&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.1-6.3]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_my_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.1:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Solid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.2:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Liquid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.3:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Vapour simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
In comparison below are the values for D (in reduced units) for the larger (approx. 1 million atom) data supplied:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.71x10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.75&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 6.28&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.4-6.6]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_mil_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.4:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Solid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_mil_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.5:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Liquid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsDil_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.6:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Vapour MSD data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 7 References ==&lt;br /&gt;
 1.  LAMMPS Manual, http://lammps.sandia.gov/doc/Section_commands.html#lammps-input-script , accessed November 2016&lt;br /&gt;
 2.  JP Hansen, L Verlet, Phys Rev, 184, 1969, http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589580</id>
		<title>Rep:Mod:Yr3LiquidSimJmsD</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589580"/>
		<updated>2017-02-24T07:48:29Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: /* 1 Theory */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Jack Dawson - Yr3 Comp: Liquid Sim.=&lt;br /&gt;
&lt;br /&gt;
== 1 Theory ==&lt;br /&gt;
&lt;br /&gt;
==== 1.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Compltete the Classical Harmonic Osciallator Spreadsheet&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_HO.xls|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For δt=0.01, estimate the positions of maximum error and fit accordingly.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Max Error Graph.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.1:&#039;&#039;&#039; &#039;&#039;A plot of the error in VV algorithm data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
Figure 1.1 shows how the maximum error increases linearly. This can be rationalised by the fact that each cycle of simulation follows on from the last, so the error of the new cycle is combined to the uncertainty in a previous calculation for an older timestep and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Experiment to find the timestep range to ensure the total energy does not change by more than 1% over the course of the simulation. Why is this important?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In simulations such as this, the physical model is considered an isolated system. We are modeling the changes in velocity and thus kinetic energy changes of induvidual particles/atoms over a total timeframe at constant timesteps. As such, the particles are moving around, interacting, transfering energy between each other. However, unless we are changing variables such as Temperature, Number of particles, Volume (density) etc. during a simulation, the overall energy should remain constant. Therefore it is important to monitor the total energy to ensure our model is fitting with our physical understanding.&lt;br /&gt;
&lt;br /&gt;
From experimentation, it can be seen that to limit this total energy change over a simulation, the time step should really be smaller than 0.3. It can be seen in Figure 1.2 how the peaks and thus total energy begin to fluctuate significantly more for 0.3 and above. &lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_En_err_w_timestep.png|thumb|500px|center|&#039;&#039;&#039;Figure 1.2:&#039;&#039;&#039; &#039;&#039;Energy vs Time: a) δt=0.01, b) δt=0.03, c) δt=0.03&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Maths based upon a ingle Lennard-Jones interaction&#039;&#039;&#039;&#039;&#039; &lt;br /&gt;
[[File:JmsD_Maths_1.png|thumb|600px|center|&#039;&#039;&#039;Figure 1.3:&#039;&#039;&#039; &#039;&#039;Answers to the LJ based maths task&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 2 Equilibriation ==&lt;br /&gt;
&lt;br /&gt;
== 3 Simmulations under specific conditions ==&lt;br /&gt;
==== 3.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature, T* = 1.5), and two reasonable pressures in Lennard-Jones units.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run these simulations to plot the &#039;Equations of State&#039; [Below].&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The 10 phase points used inn this task were determined by the 5 temperatures (T): 1.6, 1.8, 2.0, 2.2, 2.4 and the pressures (p) 2.4, 2.8. The timestep (δt) chosen was again 0.0025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Npt_1.6_2.4.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Npt_1.6_2.4.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 3.2 Task ====&lt;br /&gt;
&lt;br /&gt;
The temperature ideally needs to be maintained as close to the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, as possible. This is done by multplying every velocity, by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &#039;target temperature&#039; is as stipulated in the input script&lt;br /&gt;
&lt;br /&gt;
The instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, will fluctuate  due to approximations made in the algorithm. &lt;br /&gt;
*If &amp;lt;math&amp;gt;T &amp;gt; \mathfrak{T}&amp;lt;/math&amp;gt;, the E&amp;lt;sub&amp;gt;K&amp;lt;/sub&amp;gt; is too high and thus &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be less than 1.&lt;br /&gt;
*If, by contrast, &amp;lt;math&amp;gt;T &amp;lt; \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;Equipartition theorem&#039; states that on average, every degree of freedom in a system at equilibrium will have K&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T/2 of energy. This sytem has 3 degrees of freedom and as such:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \mathbf{v}_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expressing in terms of the adjustment to target temperature as described above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma \mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Solve the equations for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find out the importance of the three numbers 100 1000 100000.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How often are values sampled for the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How many measurments contribute to the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 {...VARIABLES...}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How much time will this simulate?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Using the output of the simulations in 3.1, plot density as a unction of temperature, for both pressures - (Incl. Error bars + Ideal Gas). Is the simulated density higher or lower than Ideal? Why? Finaly, does the discrepancy increase or decrease w. pressure?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_NpT1.png|thumb|500px|center|&#039;&#039;&#039;Figure 3.1:&#039;&#039;&#039; &#039;&#039;A plot of Average Density vs Average Temperature for two different pressures&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 4 Calculation of heat capacities using statistical physics ==&lt;br /&gt;
==== 4.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simulations and plot C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V as a function of temperature. Is this as expected?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Cv_2.0_0.2.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Cv_2.0_0.2.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
For this section, 5 simulations were run for each of the two densities: 0.2, 0.8. These simulations corresponded to each of the respective temperatures: 2.0, 2.2, 2.4, 2.6, 2.8 (in reduced units). The desired results of these simulations were the calculated values of the Heat Capacity at constant volume, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;. The results can be seen in Figure 4.1 as a funtion of the average temperatures.&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Cv graph1.png|thumb|500px|center|&#039;&#039;&#039;Figure 4.1:&#039;&#039;&#039; &#039;&#039;A plot comparing Heat Capacity/Volume vs Average Temperature for two different densities&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
These graphs do indeed follow the trend expected, that is similar to the trend seen in a crystalline solid for example. The Heat Capacity is proportional to 1/T&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; [As seen in the Equations below] and as such a negative trend should be observed. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With reagrds to density, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V increases as the density increases - which is again as expected - because heat capacity is dependant on the amount of material per volume, and thus a denser material (with the same volume) has more mass or moles per unit voulume.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 5 Radial Distribution Functions ==&lt;br /&gt;
==== 5.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; From simulations of the Lennard-Jones system in the three phases, Compute &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; in VMD. Discuss the differences in the 3 RDFs and thus what this means about the structure in each phase.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the solid phase, illustrate which lattics sites the first 3 peaks correspond to. What is the Lattice spacing? What is the Coordination number for each of the first three peaks?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The initial parameters for the simulations, in order to specify the correct phases were:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; Temperature: (For all phases) = 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Densities: (Solid) = 1.50, (Liquid) = 0.85, (Vapour) = 0.01 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Finally, to provide the initial positions of atoms, the simple cubic model was used for Liquid and Vapour, but for Solid FCC was used.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These parameters were calculated by examining the Lennar-Jones phase diagram found in literature. [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 &amp;lt;sup&amp;gt;[2] &amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_g(r).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.1:&#039;&#039;&#039; &#039;&#039;The Radial Distribution Functions of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Int(g(r))dr.png|thumb|500px|center|&#039;&#039;&#039;Figure 5.2:&#039;&#039;&#039; &#039;&#039;The Integrals of the RDFs of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Solid3(g(r)).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.3:&#039;&#039;&#039; &#039;&#039;The RDF of the solid, paying particular attention to the first 3 peaks&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 6 Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
==== 6.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simlations for the three phases, to calculate the mean squared displacement and velocity autocorrelation functions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 6.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Measure D from it&#039;s connection to the MSD, for simulations and data for approx. one million atom simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equation for the Diffusion Coefficient, &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
However, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be much more simply estimated by fitting the linear section of a Total MSD vs Timestep graph and dividing by 6.&lt;br /&gt;
This gives the following values for D (in reduced units) for the smaller simulations carried out by myself:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.31x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.33&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 1.55&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.1-6.3]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_my_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.1:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Solid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.2:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Liquid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.3:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Vapour simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
In comparison below are the values for D (in reduced units) for the larger (approx. 1 million atom) data supplied:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.71x10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.75&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 6.28&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.4-6.6]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_mil_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.4:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Solid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_mil_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.5:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Liquid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsDil_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.6:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Vapour MSD data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 7 References ==&lt;br /&gt;
 1.  LAMMPS Manual, http://lammps.sandia.gov/doc/Section_commands.html#lammps-input-script , accessed November 2016&lt;br /&gt;
 2.  JP Hansen, L Verlet, Phys Rev, 184, 1969, http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:JmsD_Maths_1.png&amp;diff=589579</id>
		<title>File:JmsD Maths 1.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:JmsD_Maths_1.png&amp;diff=589579"/>
		<updated>2017-02-24T07:44:02Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589568</id>
		<title>Rep:Mod:Yr3LiquidSimJmsD</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589568"/>
		<updated>2017-02-24T06:20:13Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: /* 1.3 Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Jack Dawson - Yr3 Comp: Liquid Sim.=&lt;br /&gt;
&lt;br /&gt;
== 1 Theory ==&lt;br /&gt;
==== 1.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Compltete the Classical Harmonic Osciallator Spreadsheet&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_HO.xls|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 1.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For δt=0.01, estimate the positions of maximum error and fit accordingly.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Max Error Graph.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.1:&#039;&#039;&#039; &#039;&#039;A plot of the error in VV algorithm data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
Figure 1.1 shows how the maximum error increases linearly. This can be rationalised by the fact that each cycle of simulation follows on from the last, so the error of the new cycle is combined to the uncertainty in a previous calculation for an older timestep and so on.&lt;br /&gt;
&lt;br /&gt;
==== 1.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Experiment to find the timestep range to ensure the total energy does not change by more than 1% over the course of the simulation. Why is this important?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In simulations such as this, the physical model is considered an isolated system. We are modeling the changes in velocity and thus kinetic energy changes of induvidual particles/atoms over a total timeframe at constant timesteps. As such, the particles are moving around, interacting, transfering energy between each other. However, unless we are changing variables such as Temperature, Number of particles, Volume (density) etc. during a simulation, the overall energy should remain constant. Therefore it is important to monitor the total energy to ensure our model is fitting with our physical understanding.&lt;br /&gt;
&lt;br /&gt;
From experimentation, it can be seen that to limit this total energy change over a simulation, the time step should really be smaller than 0.3. It can be seen in Figure 1.2 how the peaks and thus total energy begin to fluctuate significantly more for 0.3 and above. &lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_En_err_w_timestep.png|thumb|500px|center|&#039;&#039;&#039;Figure 1.2:&#039;&#039;&#039; &#039;&#039;Energy vs Time: a) δt=0.01, b) δt=0.03, c) δt=0.03&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 2 Equilibriation ==&lt;br /&gt;
&lt;br /&gt;
== 3 Simmulations under specific conditions ==&lt;br /&gt;
==== 3.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature, T* = 1.5), and two reasonable pressures in Lennard-Jones units.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run these simulations to plot the &#039;Equations of State&#039; [Below].&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The 10 phase points used inn this task were determined by the 5 temperatures (T): 1.6, 1.8, 2.0, 2.2, 2.4 and the pressures (p) 2.4, 2.8. The timestep (δt) chosen was again 0.0025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Npt_1.6_2.4.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Npt_1.6_2.4.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 3.2 Task ====&lt;br /&gt;
&lt;br /&gt;
The temperature ideally needs to be maintained as close to the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, as possible. This is done by multplying every velocity, by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &#039;target temperature&#039; is as stipulated in the input script&lt;br /&gt;
&lt;br /&gt;
The instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, will fluctuate  due to approximations made in the algorithm. &lt;br /&gt;
*If &amp;lt;math&amp;gt;T &amp;gt; \mathfrak{T}&amp;lt;/math&amp;gt;, the E&amp;lt;sub&amp;gt;K&amp;lt;/sub&amp;gt; is too high and thus &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be less than 1.&lt;br /&gt;
*If, by contrast, &amp;lt;math&amp;gt;T &amp;lt; \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;Equipartition theorem&#039; states that on average, every degree of freedom in a system at equilibrium will have K&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T/2 of energy. This sytem has 3 degrees of freedom and as such:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \mathbf{v}_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expressing in terms of the adjustment to target temperature as described above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma \mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Solve the equations for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find out the importance of the three numbers 100 1000 100000.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How often are values sampled for the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How many measurments contribute to the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 {...VARIABLES...}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How much time will this simulate?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Using the output of the simulations in 3.1, plot density as a unction of temperature, for both pressures - (Incl. Error bars + Ideal Gas). Is the simulated density higher or lower than Ideal? Why? Finaly, does the discrepancy increase or decrease w. pressure?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_NpT1.png|thumb|500px|center|&#039;&#039;&#039;Figure 3.1:&#039;&#039;&#039; &#039;&#039;A plot of Average Density vs Average Temperature for two different pressures&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 4 Calculation of heat capacities using statistical physics ==&lt;br /&gt;
==== 4.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simulations and plot C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V as a function of temperature. Is this as expected?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Cv_2.0_0.2.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Cv_2.0_0.2.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
For this section, 5 simulations were run for each of the two densities: 0.2, 0.8. These simulations corresponded to each of the respective temperatures: 2.0, 2.2, 2.4, 2.6, 2.8 (in reduced units). The desired results of these simulations were the calculated values of the Heat Capacity at constant volume, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;. The results can be seen in Figure 4.1 as a funtion of the average temperatures.&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Cv graph1.png|thumb|500px|center|&#039;&#039;&#039;Figure 4.1:&#039;&#039;&#039; &#039;&#039;A plot comparing Heat Capacity/Volume vs Average Temperature for two different densities&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
These graphs do indeed follow the trend expected, that is similar to the trend seen in a crystalline solid for example. The Heat Capacity is proportional to 1/T&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; [As seen in the Equations below] and as such a negative trend should be observed. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With reagrds to density, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V increases as the density increases - which is again as expected - because heat capacity is dependant on the amount of material per volume, and thus a denser material (with the same volume) has more mass or moles per unit voulume.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 5 Radial Distribution Functions ==&lt;br /&gt;
==== 5.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; From simulations of the Lennard-Jones system in the three phases, Compute &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; in VMD. Discuss the differences in the 3 RDFs and thus what this means about the structure in each phase.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the solid phase, illustrate which lattics sites the first 3 peaks correspond to. What is the Lattice spacing? What is the Coordination number for each of the first three peaks?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The initial parameters for the simulations, in order to specify the correct phases were:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; Temperature: (For all phases) = 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Densities: (Solid) = 1.50, (Liquid) = 0.85, (Vapour) = 0.01 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Finally, to provide the initial positions of atoms, the simple cubic model was used for Liquid and Vapour, but for Solid FCC was used.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These parameters were calculated by examining the Lennar-Jones phase diagram found in literature. [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 &amp;lt;sup&amp;gt;[2] &amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_g(r).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.1:&#039;&#039;&#039; &#039;&#039;The Radial Distribution Functions of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Int(g(r))dr.png|thumb|500px|center|&#039;&#039;&#039;Figure 5.2:&#039;&#039;&#039; &#039;&#039;The Integrals of the RDFs of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Solid3(g(r)).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.3:&#039;&#039;&#039; &#039;&#039;The RDF of the solid, paying particular attention to the first 3 peaks&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 6 Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
==== 6.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simlations for the three phases, to calculate the mean squared displacement and velocity autocorrelation functions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 6.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Measure D from it&#039;s connection to the MSD, for simulations and data for approx. one million atom simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equation for the Diffusion Coefficient, &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
However, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be much more simply estimated by fitting the linear section of a Total MSD vs Timestep graph and dividing by 6.&lt;br /&gt;
This gives the following values for D (in reduced units) for the smaller simulations carried out by myself:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.31x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.33&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 1.55&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.1-6.3]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_my_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.1:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Solid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.2:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Liquid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.3:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Vapour simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
In comparison below are the values for D (in reduced units) for the larger (approx. 1 million atom) data supplied:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.71x10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.75&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 6.28&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.4-6.6]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_mil_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.4:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Solid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_mil_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.5:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Liquid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsDil_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.6:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Vapour MSD data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 7 References ==&lt;br /&gt;
 1.  LAMMPS Manual, http://lammps.sandia.gov/doc/Section_commands.html#lammps-input-script , accessed November 2016&lt;br /&gt;
 2.  JP Hansen, L Verlet, Phys Rev, 184, 1969, http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589567</id>
		<title>Rep:Mod:Yr3LiquidSimJmsD</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589567"/>
		<updated>2017-02-24T06:19:53Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: /* 1.2 Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Jack Dawson - Yr3 Comp: Liquid Sim.=&lt;br /&gt;
&lt;br /&gt;
== 1 Theory ==&lt;br /&gt;
==== 1.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Compltete the Classical Harmonic Osciallator Spreadsheet&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_HO.xls|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 1.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For δt=0.01, estimate the positions of maximum error and fit accordingly.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Max Error Graph.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.1:&#039;&#039;&#039; &#039;&#039;A plot of the error in VV algorithm data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
Figure 1.1 shows how the maximum error increases linearly. This can be rationalised by the fact that each cycle of simulation follows on from the last, so the error of the new cycle is combined to the uncertainty in a previous calculation for an older timestep and so on.&lt;br /&gt;
&lt;br /&gt;
==== 1.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Experiment to find the timestep range to ensure the total energy does not change by more than 1% over the course of the simulation. Why is this important?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In simulations such as this, the physical model is considered an isolated system. We are modeling the changes in velocity and thus kinetic energy changes of induvidual particles/atoms over a total timeframe at constant timesteps. As such, the particles are moving around, interacting, transfering energy between each other. However, unless we are changing variables such as Temperature, Number of particles, Volume (density) etc. during a simulation, the overall energy should remain constant. Therefore it is important to monitor the total energy to ensure our model is fitting with our physical understanding.&lt;br /&gt;
&lt;br /&gt;
From experimentation, it can be seen that to limit this total energy change over a simulation, the time step should really be smaller than 0.3. It can be seen in Figure 1.2 how the peaks and thus total energy begin to fluctuate significantly more for 0.3 and above. &lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_En_err_w_timestep.png|thumb|50000px|center|&#039;&#039;&#039;Figure 1.2:&#039;&#039;&#039; &#039;&#039;Energy vs Time: a) δt=0.01, b) δt=0.03, c) δt=0.03&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 2 Equilibriation ==&lt;br /&gt;
&lt;br /&gt;
== 3 Simmulations under specific conditions ==&lt;br /&gt;
==== 3.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature, T* = 1.5), and two reasonable pressures in Lennard-Jones units.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run these simulations to plot the &#039;Equations of State&#039; [Below].&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The 10 phase points used inn this task were determined by the 5 temperatures (T): 1.6, 1.8, 2.0, 2.2, 2.4 and the pressures (p) 2.4, 2.8. The timestep (δt) chosen was again 0.0025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Npt_1.6_2.4.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Npt_1.6_2.4.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 3.2 Task ====&lt;br /&gt;
&lt;br /&gt;
The temperature ideally needs to be maintained as close to the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, as possible. This is done by multplying every velocity, by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &#039;target temperature&#039; is as stipulated in the input script&lt;br /&gt;
&lt;br /&gt;
The instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, will fluctuate  due to approximations made in the algorithm. &lt;br /&gt;
*If &amp;lt;math&amp;gt;T &amp;gt; \mathfrak{T}&amp;lt;/math&amp;gt;, the E&amp;lt;sub&amp;gt;K&amp;lt;/sub&amp;gt; is too high and thus &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be less than 1.&lt;br /&gt;
*If, by contrast, &amp;lt;math&amp;gt;T &amp;lt; \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;Equipartition theorem&#039; states that on average, every degree of freedom in a system at equilibrium will have K&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T/2 of energy. This sytem has 3 degrees of freedom and as such:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \mathbf{v}_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expressing in terms of the adjustment to target temperature as described above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma \mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Solve the equations for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find out the importance of the three numbers 100 1000 100000.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How often are values sampled for the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How many measurments contribute to the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 {...VARIABLES...}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How much time will this simulate?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Using the output of the simulations in 3.1, plot density as a unction of temperature, for both pressures - (Incl. Error bars + Ideal Gas). Is the simulated density higher or lower than Ideal? Why? Finaly, does the discrepancy increase or decrease w. pressure?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_NpT1.png|thumb|500px|center|&#039;&#039;&#039;Figure 3.1:&#039;&#039;&#039; &#039;&#039;A plot of Average Density vs Average Temperature for two different pressures&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 4 Calculation of heat capacities using statistical physics ==&lt;br /&gt;
==== 4.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simulations and plot C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V as a function of temperature. Is this as expected?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Cv_2.0_0.2.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Cv_2.0_0.2.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
For this section, 5 simulations were run for each of the two densities: 0.2, 0.8. These simulations corresponded to each of the respective temperatures: 2.0, 2.2, 2.4, 2.6, 2.8 (in reduced units). The desired results of these simulations were the calculated values of the Heat Capacity at constant volume, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;. The results can be seen in Figure 4.1 as a funtion of the average temperatures.&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Cv graph1.png|thumb|500px|center|&#039;&#039;&#039;Figure 4.1:&#039;&#039;&#039; &#039;&#039;A plot comparing Heat Capacity/Volume vs Average Temperature for two different densities&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
These graphs do indeed follow the trend expected, that is similar to the trend seen in a crystalline solid for example. The Heat Capacity is proportional to 1/T&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; [As seen in the Equations below] and as such a negative trend should be observed. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With reagrds to density, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V increases as the density increases - which is again as expected - because heat capacity is dependant on the amount of material per volume, and thus a denser material (with the same volume) has more mass or moles per unit voulume.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 5 Radial Distribution Functions ==&lt;br /&gt;
==== 5.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; From simulations of the Lennard-Jones system in the three phases, Compute &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; in VMD. Discuss the differences in the 3 RDFs and thus what this means about the structure in each phase.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the solid phase, illustrate which lattics sites the first 3 peaks correspond to. What is the Lattice spacing? What is the Coordination number for each of the first three peaks?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The initial parameters for the simulations, in order to specify the correct phases were:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; Temperature: (For all phases) = 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Densities: (Solid) = 1.50, (Liquid) = 0.85, (Vapour) = 0.01 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Finally, to provide the initial positions of atoms, the simple cubic model was used for Liquid and Vapour, but for Solid FCC was used.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These parameters were calculated by examining the Lennar-Jones phase diagram found in literature. [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 &amp;lt;sup&amp;gt;[2] &amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_g(r).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.1:&#039;&#039;&#039; &#039;&#039;The Radial Distribution Functions of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Int(g(r))dr.png|thumb|500px|center|&#039;&#039;&#039;Figure 5.2:&#039;&#039;&#039; &#039;&#039;The Integrals of the RDFs of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Solid3(g(r)).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.3:&#039;&#039;&#039; &#039;&#039;The RDF of the solid, paying particular attention to the first 3 peaks&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 6 Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
==== 6.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simlations for the three phases, to calculate the mean squared displacement and velocity autocorrelation functions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 6.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Measure D from it&#039;s connection to the MSD, for simulations and data for approx. one million atom simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equation for the Diffusion Coefficient, &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
However, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be much more simply estimated by fitting the linear section of a Total MSD vs Timestep graph and dividing by 6.&lt;br /&gt;
This gives the following values for D (in reduced units) for the smaller simulations carried out by myself:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.31x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.33&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 1.55&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.1-6.3]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_my_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.1:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Solid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.2:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Liquid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.3:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Vapour simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
In comparison below are the values for D (in reduced units) for the larger (approx. 1 million atom) data supplied:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.71x10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.75&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 6.28&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.4-6.6]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_mil_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.4:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Solid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_mil_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.5:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Liquid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsDil_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.6:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Vapour MSD data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 7 References ==&lt;br /&gt;
 1.  LAMMPS Manual, http://lammps.sandia.gov/doc/Section_commands.html#lammps-input-script , accessed November 2016&lt;br /&gt;
 2.  JP Hansen, L Verlet, Phys Rev, 184, 1969, http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589565</id>
		<title>Rep:Mod:Yr3LiquidSimJmsD</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589565"/>
		<updated>2017-02-24T06:16:06Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: /* 1 Theory */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Jack Dawson - Yr3 Comp: Liquid Sim.=&lt;br /&gt;
&lt;br /&gt;
== 1 Theory ==&lt;br /&gt;
==== 1.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Compltete the Classical Harmonic Osciallator Spreadsheet&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_HO.xls|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 1.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For δt=0.01, estimate the positions of maximum error and fit accordingly.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Max Error Graph.png|thumb|800px|center|&#039;&#039;&#039;Figure 1.1:&#039;&#039;&#039; &#039;&#039;A plot of the error in VV algorithm data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==== 1.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Experiment to find the timestep range to ensure the total energy does not change by more than 1% over the course of the simulation. Why is this important?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In simulations such as this, the physical model is considered an isolated system. We are modeling the changes in velocity and thus kinetic energy changes of induvidual particles/atoms over a total timeframe at constant timesteps. As such, the particles are moving around, interacting, transfering energy between each other. However, unless we are changing variables such as Temperature, Number of particles, Volume (density) etc. during a simulation, the overall energy should remain constant. Therefore it is important to monitor the total energy to ensure our model is fitting with our physical understanding.&lt;br /&gt;
&lt;br /&gt;
From experimentation, it can be seen that to limit this total energy change over a simulation, the time step should really be smaller than 0.3. It can be seen in Figure 1.2 how the peaks and thus total energy begin to fluctuate significantly more for 0.3 and above. &lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_En_err_w_timestep.png|thumb|50000px|center|&#039;&#039;&#039;Figure 1.2:&#039;&#039;&#039; &#039;&#039;Energy vs Time: a) δt=0.01, b) δt=0.03, c) δt=0.03&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 2 Equilibriation ==&lt;br /&gt;
&lt;br /&gt;
== 3 Simmulations under specific conditions ==&lt;br /&gt;
==== 3.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature, T* = 1.5), and two reasonable pressures in Lennard-Jones units.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run these simulations to plot the &#039;Equations of State&#039; [Below].&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The 10 phase points used inn this task were determined by the 5 temperatures (T): 1.6, 1.8, 2.0, 2.2, 2.4 and the pressures (p) 2.4, 2.8. The timestep (δt) chosen was again 0.0025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Npt_1.6_2.4.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Npt_1.6_2.4.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 3.2 Task ====&lt;br /&gt;
&lt;br /&gt;
The temperature ideally needs to be maintained as close to the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, as possible. This is done by multplying every velocity, by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &#039;target temperature&#039; is as stipulated in the input script&lt;br /&gt;
&lt;br /&gt;
The instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, will fluctuate  due to approximations made in the algorithm. &lt;br /&gt;
*If &amp;lt;math&amp;gt;T &amp;gt; \mathfrak{T}&amp;lt;/math&amp;gt;, the E&amp;lt;sub&amp;gt;K&amp;lt;/sub&amp;gt; is too high and thus &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be less than 1.&lt;br /&gt;
*If, by contrast, &amp;lt;math&amp;gt;T &amp;lt; \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;Equipartition theorem&#039; states that on average, every degree of freedom in a system at equilibrium will have K&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T/2 of energy. This sytem has 3 degrees of freedom and as such:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \mathbf{v}_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expressing in terms of the adjustment to target temperature as described above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma \mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Solve the equations for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find out the importance of the three numbers 100 1000 100000.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How often are values sampled for the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How many measurments contribute to the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 {...VARIABLES...}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How much time will this simulate?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Using the output of the simulations in 3.1, plot density as a unction of temperature, for both pressures - (Incl. Error bars + Ideal Gas). Is the simulated density higher or lower than Ideal? Why? Finaly, does the discrepancy increase or decrease w. pressure?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_NpT1.png|thumb|500px|center|&#039;&#039;&#039;Figure 3.1:&#039;&#039;&#039; &#039;&#039;A plot of Average Density vs Average Temperature for two different pressures&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 4 Calculation of heat capacities using statistical physics ==&lt;br /&gt;
==== 4.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simulations and plot C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V as a function of temperature. Is this as expected?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Cv_2.0_0.2.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Cv_2.0_0.2.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
For this section, 5 simulations were run for each of the two densities: 0.2, 0.8. These simulations corresponded to each of the respective temperatures: 2.0, 2.2, 2.4, 2.6, 2.8 (in reduced units). The desired results of these simulations were the calculated values of the Heat Capacity at constant volume, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;. The results can be seen in Figure 4.1 as a funtion of the average temperatures.&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Cv graph1.png|thumb|500px|center|&#039;&#039;&#039;Figure 4.1:&#039;&#039;&#039; &#039;&#039;A plot comparing Heat Capacity/Volume vs Average Temperature for two different densities&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
These graphs do indeed follow the trend expected, that is similar to the trend seen in a crystalline solid for example. The Heat Capacity is proportional to 1/T&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; [As seen in the Equations below] and as such a negative trend should be observed. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With reagrds to density, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V increases as the density increases - which is again as expected - because heat capacity is dependant on the amount of material per volume, and thus a denser material (with the same volume) has more mass or moles per unit voulume.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 5 Radial Distribution Functions ==&lt;br /&gt;
==== 5.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; From simulations of the Lennard-Jones system in the three phases, Compute &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; in VMD. Discuss the differences in the 3 RDFs and thus what this means about the structure in each phase.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the solid phase, illustrate which lattics sites the first 3 peaks correspond to. What is the Lattice spacing? What is the Coordination number for each of the first three peaks?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The initial parameters for the simulations, in order to specify the correct phases were:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; Temperature: (For all phases) = 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Densities: (Solid) = 1.50, (Liquid) = 0.85, (Vapour) = 0.01 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Finally, to provide the initial positions of atoms, the simple cubic model was used for Liquid and Vapour, but for Solid FCC was used.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These parameters were calculated by examining the Lennar-Jones phase diagram found in literature. [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 &amp;lt;sup&amp;gt;[2] &amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_g(r).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.1:&#039;&#039;&#039; &#039;&#039;The Radial Distribution Functions of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Int(g(r))dr.png|thumb|500px|center|&#039;&#039;&#039;Figure 5.2:&#039;&#039;&#039; &#039;&#039;The Integrals of the RDFs of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Solid3(g(r)).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.3:&#039;&#039;&#039; &#039;&#039;The RDF of the solid, paying particular attention to the first 3 peaks&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 6 Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
==== 6.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simlations for the three phases, to calculate the mean squared displacement and velocity autocorrelation functions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 6.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Measure D from it&#039;s connection to the MSD, for simulations and data for approx. one million atom simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equation for the Diffusion Coefficient, &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
However, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be much more simply estimated by fitting the linear section of a Total MSD vs Timestep graph and dividing by 6.&lt;br /&gt;
This gives the following values for D (in reduced units) for the smaller simulations carried out by myself:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.31x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.33&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 1.55&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.1-6.3]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_my_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.1:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Solid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.2:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Liquid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.3:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Vapour simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
In comparison below are the values for D (in reduced units) for the larger (approx. 1 million atom) data supplied:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.71x10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.75&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 6.28&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.4-6.6]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_mil_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.4:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Solid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_mil_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.5:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Liquid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsDil_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.6:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Vapour MSD data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 7 References ==&lt;br /&gt;
 1.  LAMMPS Manual, http://lammps.sandia.gov/doc/Section_commands.html#lammps-input-script , accessed November 2016&lt;br /&gt;
 2.  JP Hansen, L Verlet, Phys Rev, 184, 1969, http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:JmsD_En_err_w_timestep.png&amp;diff=589563</id>
		<title>File:JmsD En err w timestep.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:JmsD_En_err_w_timestep.png&amp;diff=589563"/>
		<updated>2017-02-24T06:11:44Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589561</id>
		<title>Rep:Mod:Yr3LiquidSimJmsD</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589561"/>
		<updated>2017-02-24T06:10:52Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: /* Jack Dawson - Yr3 Comp: Liquid Sim. */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Jack Dawson - Yr3 Comp: Liquid Sim.=&lt;br /&gt;
&lt;br /&gt;
== 1 Theory ==&lt;br /&gt;
==== 1.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Compltete the Classical Harmonic Osciallator Spreadsheet&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_HO.xls|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 1.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For δt=0.01, estimate the positions of maximum error and fit accordingly.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Max Error Graph.png|thumb|800px|center|&#039;&#039;&#039;Figure 1:&#039;&#039;&#039; &#039;&#039;A plot of the error in VV algorithm data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==== 1.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Experiment to find the timestep range to ensure the total energy does not change by more than 1% over the course of the simulation. Why is this important?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In simulations such as this, the physical model is considered an isolated system. We are modeling the changes in velocity and thus kinetic energy changes of induvidual particles/atoms over a total timeframe at constant timesteps. As such, the particles are moving around, interacting, transfering energy between each other. However, unless we are changing variables such as Temperature, Number of particles, Volume (density) etc. during a simulation, the overall energy should remain constant. Therefore it is important to monitor the total energy to ensure our model is fitting with our physical understanding.&lt;br /&gt;
&lt;br /&gt;
From experimentation, it can be seen that to limit this total energy change over a simulation, the time step should really be smaller than 0.3.&lt;br /&gt;
&lt;br /&gt;
== 2 Equilibriation ==&lt;br /&gt;
&lt;br /&gt;
== 3 Simmulations under specific conditions ==&lt;br /&gt;
==== 3.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature, T* = 1.5), and two reasonable pressures in Lennard-Jones units.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run these simulations to plot the &#039;Equations of State&#039; [Below].&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The 10 phase points used inn this task were determined by the 5 temperatures (T): 1.6, 1.8, 2.0, 2.2, 2.4 and the pressures (p) 2.4, 2.8. The timestep (δt) chosen was again 0.0025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Npt_1.6_2.4.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Npt_1.6_2.4.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 3.2 Task ====&lt;br /&gt;
&lt;br /&gt;
The temperature ideally needs to be maintained as close to the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, as possible. This is done by multplying every velocity, by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &#039;target temperature&#039; is as stipulated in the input script&lt;br /&gt;
&lt;br /&gt;
The instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, will fluctuate  due to approximations made in the algorithm. &lt;br /&gt;
*If &amp;lt;math&amp;gt;T &amp;gt; \mathfrak{T}&amp;lt;/math&amp;gt;, the E&amp;lt;sub&amp;gt;K&amp;lt;/sub&amp;gt; is too high and thus &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be less than 1.&lt;br /&gt;
*If, by contrast, &amp;lt;math&amp;gt;T &amp;lt; \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;Equipartition theorem&#039; states that on average, every degree of freedom in a system at equilibrium will have K&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T/2 of energy. This sytem has 3 degrees of freedom and as such:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \mathbf{v}_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expressing in terms of the adjustment to target temperature as described above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma \mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Solve the equations for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find out the importance of the three numbers 100 1000 100000.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How often are values sampled for the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How many measurments contribute to the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 {...VARIABLES...}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How much time will this simulate?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Using the output of the simulations in 3.1, plot density as a unction of temperature, for both pressures - (Incl. Error bars + Ideal Gas). Is the simulated density higher or lower than Ideal? Why? Finaly, does the discrepancy increase or decrease w. pressure?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_NpT1.png|thumb|500px|center|&#039;&#039;&#039;Figure 3.1:&#039;&#039;&#039; &#039;&#039;A plot of Average Density vs Average Temperature for two different pressures&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 4 Calculation of heat capacities using statistical physics ==&lt;br /&gt;
==== 4.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simulations and plot C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V as a function of temperature. Is this as expected?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Cv_2.0_0.2.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Cv_2.0_0.2.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
For this section, 5 simulations were run for each of the two densities: 0.2, 0.8. These simulations corresponded to each of the respective temperatures: 2.0, 2.2, 2.4, 2.6, 2.8 (in reduced units). The desired results of these simulations were the calculated values of the Heat Capacity at constant volume, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;. The results can be seen in Figure 4.1 as a funtion of the average temperatures.&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Cv graph1.png|thumb|500px|center|&#039;&#039;&#039;Figure 4.1:&#039;&#039;&#039; &#039;&#039;A plot comparing Heat Capacity/Volume vs Average Temperature for two different densities&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
These graphs do indeed follow the trend expected, that is similar to the trend seen in a crystalline solid for example. The Heat Capacity is proportional to 1/T&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; [As seen in the Equations below] and as such a negative trend should be observed. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With reagrds to density, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V increases as the density increases - which is again as expected - because heat capacity is dependant on the amount of material per volume, and thus a denser material (with the same volume) has more mass or moles per unit voulume.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 5 Radial Distribution Functions ==&lt;br /&gt;
==== 5.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; From simulations of the Lennard-Jones system in the three phases, Compute &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; in VMD. Discuss the differences in the 3 RDFs and thus what this means about the structure in each phase.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the solid phase, illustrate which lattics sites the first 3 peaks correspond to. What is the Lattice spacing? What is the Coordination number for each of the first three peaks?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The initial parameters for the simulations, in order to specify the correct phases were:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; Temperature: (For all phases) = 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Densities: (Solid) = 1.50, (Liquid) = 0.85, (Vapour) = 0.01 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Finally, to provide the initial positions of atoms, the simple cubic model was used for Liquid and Vapour, but for Solid FCC was used.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These parameters were calculated by examining the Lennar-Jones phase diagram found in literature. [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 &amp;lt;sup&amp;gt;[2] &amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_g(r).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.1:&#039;&#039;&#039; &#039;&#039;The Radial Distribution Functions of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Int(g(r))dr.png|thumb|500px|center|&#039;&#039;&#039;Figure 5.2:&#039;&#039;&#039; &#039;&#039;The Integrals of the RDFs of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Solid3(g(r)).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.3:&#039;&#039;&#039; &#039;&#039;The RDF of the solid, paying particular attention to the first 3 peaks&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 6 Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
==== 6.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simlations for the three phases, to calculate the mean squared displacement and velocity autocorrelation functions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 6.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Measure D from it&#039;s connection to the MSD, for simulations and data for approx. one million atom simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equation for the Diffusion Coefficient, &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
However, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be much more simply estimated by fitting the linear section of a Total MSD vs Timestep graph and dividing by 6.&lt;br /&gt;
This gives the following values for D (in reduced units) for the smaller simulations carried out by myself:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.31x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.33&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 1.55&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.1-6.3]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_my_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.1:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Solid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.2:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Liquid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.3:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Vapour simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
In comparison below are the values for D (in reduced units) for the larger (approx. 1 million atom) data supplied:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.71x10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.75&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 6.28&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.4-6.6]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_mil_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.4:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Solid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_mil_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.5:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Liquid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsDil_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.6:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Vapour MSD data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 7 References ==&lt;br /&gt;
 1.  LAMMPS Manual, http://lammps.sandia.gov/doc/Section_commands.html#lammps-input-script , accessed November 2016&lt;br /&gt;
 2.  JP Hansen, L Verlet, Phys Rev, 184, 1969, http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589542</id>
		<title>Rep:Mod:Yr3LiquidSimJmsD</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589542"/>
		<updated>2017-02-24T05:32:49Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: /* 6.2 Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Jack Dawson - Yr3 Comp: Liquid Sim.=&lt;br /&gt;
&lt;br /&gt;
== 1 Theory ==&lt;br /&gt;
==== 1.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Compltete the Classical Harmonic Osciallator Spreadsheet&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
[[File:JmsD_HO.xls|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 1.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For δt=0.01, estimate the positions of maximum error and fit accordingly.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
[[File:JmsD Max Error Graph.png|thumb|800px|center|&#039;&#039;&#039;Figure 1:&#039;&#039;&#039; &#039;&#039;A plot of the error in VV algorithm data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==== 1.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Experiment to find the timestep to ensure the total energy does not change by more than 1% over the course of the simulation. Why is this important?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 2 Equilibriation ==&lt;br /&gt;
&lt;br /&gt;
== 3 Simmulations under specific conditions ==&lt;br /&gt;
==== 3.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature, T* = 1.5), and two reasonable pressures in Lennard-Jones units.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run these simulations to plot the &#039;Equations of State&#039; [Below].&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The 10 phase points used inn this task were determined by the 5 temperatures (T): 1.6, 1.8, 2.0, 2.2, 2.4 and the pressures (p) 2.4, 2.8. The timestep (δt) chosen was again 0.0025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Npt_1.6_2.4.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Npt_1.6_2.4.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 3.2 Task ====&lt;br /&gt;
&lt;br /&gt;
The temperature ideally needs to be maintained as close to the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, as possible. This is done by multplying every velocity, by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &#039;target temperature&#039; is as stipulated in the input script&lt;br /&gt;
&lt;br /&gt;
The instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, will fluctuate  due to approximations made in the algorithm. &lt;br /&gt;
*If &amp;lt;math&amp;gt;T &amp;gt; \mathfrak{T}&amp;lt;/math&amp;gt;, the E&amp;lt;sub&amp;gt;K&amp;lt;/sub&amp;gt; is too high and thus &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be less than 1.&lt;br /&gt;
*If, by contrast, &amp;lt;math&amp;gt;T &amp;lt; \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;Equipartition theorem&#039; states that on average, every degree of freedom in a system at equilibrium will have K&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T/2 of energy. This sytem has 3 degrees of freedom and as such:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \mathbf{v}_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expressing in terms of the adjustment to target temperature as described above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma \mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Solve the equations for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find out the importance of the three numbers 100 1000 100000.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How often are values sampled for the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How many measurments contribute to the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 {...VARIABLES...}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How much time will this simulate?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Using the output of the simulations in 3.1, plot density as a unction of temperature, for both pressures - (Incl. Error bars + Ideal Gas). Is the simulated density higher or lower than Ideal? Why? Finaly, does the discrepancy increase or decrease w. pressure?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_NpT1.png|thumb|500px|center|&#039;&#039;&#039;Figure 3.1:&#039;&#039;&#039; &#039;&#039;A plot of Average Density vs Average Temperature for two different pressures&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 4 Calculation of heat capacities using statistical physics ==&lt;br /&gt;
==== 4.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simulations and plot C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V as a function of temperature. Is this as expected?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Cv_2.0_0.2.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Cv_2.0_0.2.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
For this section, 5 simulations were run for each of the two densities: 0.2, 0.8. These simulations corresponded to each of the respective temperatures: 2.0, 2.2, 2.4, 2.6, 2.8 (in reduced units). The desired results of these simulations were the calculated values of the Heat Capacity at constant volume, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;. The results can be seen in Figure 4.1 as a funtion of the average temperatures.&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Cv graph1.png|thumb|500px|center|&#039;&#039;&#039;Figure 4.1:&#039;&#039;&#039; &#039;&#039;A plot comparing Heat Capacity/Volume vs Average Temperature for two different densities&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
These graphs do indeed follow the trend expected, that is similar to the trend seen in a crystalline solid for example. The Heat Capacity is proportional to 1/T&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; [As seen in the Equations below] and as such a negative trend should be observed. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With reagrds to density, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V increases as the density increases - which is again as expected - because heat capacity is dependant on the amount of material per volume, and thus a denser material (with the same volume) has more mass or moles per unit voulume.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 5 Radial Distribution Functions ==&lt;br /&gt;
==== 5.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; From simulations of the Lennard-Jones system in the three phases, Compute &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; in VMD. Discuss the differences in the 3 RDFs and thus what this means about the structure in each phase.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the solid phase, illustrate which lattics sites the first 3 peaks correspond to. What is the Lattice spacing? What is the Coordination number for each of the first three peaks?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The initial parameters for the simulations, in order to specify the correct phases were:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; Temperature: (For all phases) = 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Densities: (Solid) = 1.50, (Liquid) = 0.85, (Vapour) = 0.01 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Finally, to provide the initial positions of atoms, the simple cubic model was used for Liquid and Vapour, but for Solid FCC was used.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These parameters were calculated by examining the Lennar-Jones phase diagram found in literature. [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 &amp;lt;sup&amp;gt;[2] &amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_g(r).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.1:&#039;&#039;&#039; &#039;&#039;The Radial Distribution Functions of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Int(g(r))dr.png|thumb|500px|center|&#039;&#039;&#039;Figure 5.2:&#039;&#039;&#039; &#039;&#039;The Integrals of the RDFs of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Solid3(g(r)).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.3:&#039;&#039;&#039; &#039;&#039;The RDF of the solid, paying particular attention to the first 3 peaks&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 6 Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
==== 6.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simlations for the three phases, to calculate the mean squared displacement and velocity autocorrelation functions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 6.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Measure D from it&#039;s connection to the MSD, for simulations and data for approx. one million atom simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equation for the Diffusion Coefficient, &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
However, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be much more simply estimated by fitting the linear section of a Total MSD vs Timestep graph and dividing by 6.&lt;br /&gt;
This gives the following values for D (in reduced units) for the smaller simulations carried out by myself:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.31x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.33&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 1.55&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.1-6.3]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_my_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.1:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Solid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.2:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Liquid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.3:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Vapour simulation&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
In comparison below are the values for D (in reduced units) for the larger (approx. 1 million atom) data supplied:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.71x10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.75&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 6.28&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.4-6.6]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_mil_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.4:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Solid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_mil_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.5:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Liquid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsDil_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.6:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Vapour MSD data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 7 References ==&lt;br /&gt;
 1.  LAMMPS Manual, http://lammps.sandia.gov/doc/Section_commands.html#lammps-input-script , accessed November 2016&lt;br /&gt;
 2.  JP Hansen, L Verlet, Phys Rev, 184, 1969, http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589539</id>
		<title>Rep:Mod:Yr3LiquidSimJmsD</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589539"/>
		<updated>2017-02-24T05:30:49Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Jack Dawson - Yr3 Comp: Liquid Sim.=&lt;br /&gt;
&lt;br /&gt;
== 1 Theory ==&lt;br /&gt;
==== 1.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Compltete the Classical Harmonic Osciallator Spreadsheet&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
[[File:JmsD_HO.xls|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 1.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For δt=0.01, estimate the positions of maximum error and fit accordingly.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
[[File:JmsD Max Error Graph.png|thumb|800px|center|&#039;&#039;&#039;Figure 1:&#039;&#039;&#039; &#039;&#039;A plot of the error in VV algorithm data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==== 1.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Experiment to find the timestep to ensure the total energy does not change by more than 1% over the course of the simulation. Why is this important?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 2 Equilibriation ==&lt;br /&gt;
&lt;br /&gt;
== 3 Simmulations under specific conditions ==&lt;br /&gt;
==== 3.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature, T* = 1.5), and two reasonable pressures in Lennard-Jones units.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run these simulations to plot the &#039;Equations of State&#039; [Below].&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The 10 phase points used inn this task were determined by the 5 temperatures (T): 1.6, 1.8, 2.0, 2.2, 2.4 and the pressures (p) 2.4, 2.8. The timestep (δt) chosen was again 0.0025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Npt_1.6_2.4.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Npt_1.6_2.4.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 3.2 Task ====&lt;br /&gt;
&lt;br /&gt;
The temperature ideally needs to be maintained as close to the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, as possible. This is done by multplying every velocity, by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &#039;target temperature&#039; is as stipulated in the input script&lt;br /&gt;
&lt;br /&gt;
The instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, will fluctuate  due to approximations made in the algorithm. &lt;br /&gt;
*If &amp;lt;math&amp;gt;T &amp;gt; \mathfrak{T}&amp;lt;/math&amp;gt;, the E&amp;lt;sub&amp;gt;K&amp;lt;/sub&amp;gt; is too high and thus &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be less than 1.&lt;br /&gt;
*If, by contrast, &amp;lt;math&amp;gt;T &amp;lt; \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;Equipartition theorem&#039; states that on average, every degree of freedom in a system at equilibrium will have K&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T/2 of energy. This sytem has 3 degrees of freedom and as such:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \mathbf{v}_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expressing in terms of the adjustment to target temperature as described above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma \mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Solve the equations for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find out the importance of the three numbers 100 1000 100000.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How often are values sampled for the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How many measurments contribute to the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 {...VARIABLES...}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How much time will this simulate?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Using the output of the simulations in 3.1, plot density as a unction of temperature, for both pressures - (Incl. Error bars + Ideal Gas). Is the simulated density higher or lower than Ideal? Why? Finaly, does the discrepancy increase or decrease w. pressure?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_NpT1.png|thumb|500px|center|&#039;&#039;&#039;Figure 3.1:&#039;&#039;&#039; &#039;&#039;A plot of Average Density vs Average Temperature for two different pressures&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 4 Calculation of heat capacities using statistical physics ==&lt;br /&gt;
==== 4.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simulations and plot C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V as a function of temperature. Is this as expected?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Cv_2.0_0.2.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Cv_2.0_0.2.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
For this section, 5 simulations were run for each of the two densities: 0.2, 0.8. These simulations corresponded to each of the respective temperatures: 2.0, 2.2, 2.4, 2.6, 2.8 (in reduced units). The desired results of these simulations were the calculated values of the Heat Capacity at constant volume, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;. The results can be seen in Figure 4.1 as a funtion of the average temperatures.&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Cv graph1.png|thumb|500px|center|&#039;&#039;&#039;Figure 4.1:&#039;&#039;&#039; &#039;&#039;A plot comparing Heat Capacity/Volume vs Average Temperature for two different densities&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
These graphs do indeed follow the trend expected, that is similar to the trend seen in a crystalline solid for example. The Heat Capacity is proportional to 1/T&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; [As seen in the Equations below] and as such a negative trend should be observed. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With reagrds to density, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V increases as the density increases - which is again as expected - because heat capacity is dependant on the amount of material per volume, and thus a denser material (with the same volume) has more mass or moles per unit voulume.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 5 Radial Distribution Functions ==&lt;br /&gt;
==== 5.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; From simulations of the Lennard-Jones system in the three phases, Compute &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; in VMD. Discuss the differences in the 3 RDFs and thus what this means about the structure in each phase.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the solid phase, illustrate which lattics sites the first 3 peaks correspond to. What is the Lattice spacing? What is the Coordination number for each of the first three peaks?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The initial parameters for the simulations, in order to specify the correct phases were:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; Temperature: (For all phases) = 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Densities: (Solid) = 1.50, (Liquid) = 0.85, (Vapour) = 0.01 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Finally, to provide the initial positions of atoms, the simple cubic model was used for Liquid and Vapour, but for Solid FCC was used.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These parameters were calculated by examining the Lennar-Jones phase diagram found in literature. [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 &amp;lt;sup&amp;gt;[2] &amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_g(r).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.1:&#039;&#039;&#039; &#039;&#039;The Radial Distribution Functions of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Int(g(r))dr.png|thumb|500px|center|&#039;&#039;&#039;Figure 5.2:&#039;&#039;&#039; &#039;&#039;The Integrals of the RDFs of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Solid3(g(r)).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.3:&#039;&#039;&#039; &#039;&#039;The RDF of the solid, paying particular attention to the first 3 peaks&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 6 Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
==== 6.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simlations for the three phases, to calculate the mean squared displacement and velocity autocorrelation functions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 6.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Measure D from it&#039;s connection to the MSD, for simulations and data for approx. one million atom simulations&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equation for the Diffusion Coefficient, &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
However, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be much more simply estimated by fitting the linear section of a Total MSD vs Timestep graph and dividing by 6.&lt;br /&gt;
This gives the following values for D (in reduced units) for the smaller simulations carried out by myself:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.31x10&amp;lt;sup&amp;gt;-10&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.33&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 1.55&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.1-6.3]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_my_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.1:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Solid simulation&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_my_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.2:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Liquid simulation&#039;&#039;]&lt;br /&gt;
[[File:JmsD_my_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.3:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for my Vapour simulation&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
In comparison below are the values for D (in reduced units) for the larger (approx. 1 million atom) data supplied:&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Solid&amp;lt;/sub&amp;gt; = 1.71x10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Liquid&amp;lt;/sub&amp;gt; = 1.75&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; D&amp;lt;sub&amp;gt;Vapour&amp;lt;/sub&amp;gt; = 6.28&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[The graphs for these calculations can be seen in Figures 6.4-6.6]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_mil_sol_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.4:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Solid MSD data&#039;&#039;]]&lt;br /&gt;
[[File:JmsD_mil_liq_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.5:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Liquid MSD data&#039;&#039;]&lt;br /&gt;
[[File:JmsD_mil_vap_D.png|thumb|500px|center|&#039;&#039;&#039;Figure 6.6:&#039;&#039;&#039; &#039;&#039;The Total MSD vs timestep (with fitting) for supplied Vapour MSD data&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
== 7 References ==&lt;br /&gt;
 1.  LAMMPS Manual, http://lammps.sandia.gov/doc/Section_commands.html#lammps-input-script , accessed November 2016&lt;br /&gt;
 2.  JP Hansen, L Verlet, Phys Rev, 184, 1969, http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:JmsD_my_vap_D.png&amp;diff=589527</id>
		<title>File:JmsD my vap D.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:JmsD_my_vap_D.png&amp;diff=589527"/>
		<updated>2017-02-24T05:05:08Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:JmsD_my_sol_D.png&amp;diff=589526</id>
		<title>File:JmsD my sol D.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:JmsD_my_sol_D.png&amp;diff=589526"/>
		<updated>2017-02-24T05:04:45Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:JmsD_my_liq_D.png&amp;diff=589525</id>
		<title>File:JmsD my liq D.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:JmsD_my_liq_D.png&amp;diff=589525"/>
		<updated>2017-02-24T05:04:23Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:JmsDil_vap_D.png&amp;diff=589524</id>
		<title>File:JmsDil vap D.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:JmsDil_vap_D.png&amp;diff=589524"/>
		<updated>2017-02-24T05:03:05Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:JmsD_mil_sol_D.png&amp;diff=589522</id>
		<title>File:JmsD mil sol D.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:JmsD_mil_sol_D.png&amp;diff=589522"/>
		<updated>2017-02-24T05:02:33Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:JmsD_mil_liq_D.png&amp;diff=589521</id>
		<title>File:JmsD mil liq D.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:JmsD_mil_liq_D.png&amp;diff=589521"/>
		<updated>2017-02-24T05:01:57Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589518</id>
		<title>Rep:Mod:Yr3LiquidSimJmsD</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589518"/>
		<updated>2017-02-24T04:59:40Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: /* 6.1 Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Jack Dawson - Yr3 Comp: Liquid Sim.=&lt;br /&gt;
&lt;br /&gt;
== 1 Theory ==&lt;br /&gt;
==== 1.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Compltete the Classical Harmonic Osciallator Spreadsheet&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
[[File:JmsD_HO.xls|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 1.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For δt=0.01, estimate the positions of maximum error and fit accordingly.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
[[File:JmsD Max Error Graph.png|thumb|800px|center|&#039;&#039;&#039;Figure 1:&#039;&#039;&#039; &#039;&#039;A plot of the error in VV algorithm data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==== 1.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Experiment to find the timestep to ensure the total energy does not change by more than 1% over the course of the simulation. Why is this important?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 2 Equilibriation ==&lt;br /&gt;
&lt;br /&gt;
== 3 Simmulations under specific conditions ==&lt;br /&gt;
==== 3.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature, T* = 1.5), and two reasonable pressures in Lennard-Jones units.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run these simulations to plot the &#039;Equations of State&#039; [Below].&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The 10 phase points used inn this task were determined by the 5 temperatures (T): 1.6, 1.8, 2.0, 2.2, 2.4 and the pressures (p) 2.4, 2.8. The timestep (δt) chosen was again 0.0025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Npt_1.6_2.4.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Npt_1.6_2.4.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 3.2 Task ====&lt;br /&gt;
&lt;br /&gt;
The temperature ideally needs to be maintained as close to the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, as possible. This is done by multplying every velocity, by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &#039;target temperature&#039; is as stipulated in the input script&lt;br /&gt;
&lt;br /&gt;
The instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, will fluctuate  due to approximations made in the algorithm. &lt;br /&gt;
*If &amp;lt;math&amp;gt;T &amp;gt; \mathfrak{T}&amp;lt;/math&amp;gt;, the E&amp;lt;sub&amp;gt;K&amp;lt;/sub&amp;gt; is too high and thus &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be less than 1.&lt;br /&gt;
*If, by contrast, &amp;lt;math&amp;gt;T &amp;lt; \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;Equipartition theorem&#039; states that on average, every degree of freedom in a system at equilibrium will have K&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T/2 of energy. This sytem has 3 degrees of freedom and as such:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \mathbf{v}_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expressing in terms of the adjustment to target temperature as described above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma \mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Solve the equations for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find out the importance of the three numbers 100 1000 100000.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How often are values sampled for the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How many measurments contribute to the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 {...VARIABLES...}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How much time will this simulate?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Using the output of the simulations in 3.1, plot density as a unction of temperature, for both pressures - (Incl. Error bars + Ideal Gas). Is the simulated density higher or lower than Ideal? Why? Finaly, does the discrepancy increase or decrease w. pressure?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_NpT1.png|thumb|500px|center|&#039;&#039;&#039;Figure 3.1:&#039;&#039;&#039; &#039;&#039;A plot of Average Density vs Average Temperature for two different pressures&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 4 Calculation of heat capacities using statistical physics ==&lt;br /&gt;
==== 4.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simulations and plot C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V as a function of temperature. Is this as expected?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Cv_2.0_0.2.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Cv_2.0_0.2.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
For this section, 5 simulations were run for each of the two densities: 0.2, 0.8. These simulations corresponded to each of the respective temperatures: 2.0, 2.2, 2.4, 2.6, 2.8 (in reduced units). The desired results of these simulations were the calculated values of the Heat Capacity at constant volume, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;. The results can be seen in Figure 4.1 as a funtion of the average temperatures.&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Cv graph1.png|thumb|500px|center|&#039;&#039;&#039;Figure 4.1:&#039;&#039;&#039; &#039;&#039;A plot comparing Heat Capacity/Volume vs Average Temperature for two different densities&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
These graphs do indeed follow the trend expected, that is similar to the trend seen in a crystalline solid for example. The Heat Capacity is proportional to 1/T&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; [As seen in the Equations below] and as such a negative trend should be observed. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With reagrds to density, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V increases as the density increases - which is again as expected - because heat capacity is dependant on the amount of material per volume, and thus a denser material (with the same volume) has more mass or moles per unit voulume.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 5 Radial Distribution Functions ==&lt;br /&gt;
==== 5.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; From simulations of the Lennard-Jones system in the three phases, Compute &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; in VMD. Discuss the differences in the 3 RDFs and thus what this means about the structure in each phase.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the solid phase, illustrate which lattics sites the first 3 peaks correspond to. What is the Lattice spacing? What is the Coordination number for each of the first three peaks?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The initial parameters for the simulations, in order to specify the correct phases were:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; Temperature: (For all phases) = 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Densities: (Solid) = 1.50, (Liquid) = 0.85, (Vapour) = 0.01 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Finally, to provide the initial positions of atoms, the simple cubic model was used for Liquid and Vapour, but for Solid FCC was used.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These parameters were calculated by examining the Lennar-Jones phase diagram found in literature. [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 &amp;lt;sup&amp;gt;[2] &amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_g(r).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.1:&#039;&#039;&#039; &#039;&#039;The Radial Distribution Functions of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Int(g(r))dr.png|thumb|500px|center|&#039;&#039;&#039;Figure 5.2:&#039;&#039;&#039; &#039;&#039;The Integrals of the RDFs of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Solid3(g(r)).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.3:&#039;&#039;&#039; &#039;&#039;The RDF of the solid, paying particular attention to the first 3 peaks&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 6 Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
==== 6.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simlations for the three phases, to calculate the mean squared displacement and velocity autocorrelation functions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
== 7 References ==&lt;br /&gt;
 1.  LAMMPS Manual, http://lammps.sandia.gov/doc/Section_commands.html#lammps-input-script , accessed November 2016&lt;br /&gt;
 2.  JP Hansen, L Verlet, Phys Rev, 184, 1969, http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589464</id>
		<title>Rep:Mod:Yr3LiquidSimJmsD</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:Yr3LiquidSimJmsD&amp;diff=589464"/>
		<updated>2017-02-24T03:45:35Z</updated>

		<summary type="html">&lt;p&gt;Jmd114: /* 5 Radial Distribution Functions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Jack Dawson - Yr3 Comp: Liquid Sim.=&lt;br /&gt;
&lt;br /&gt;
== 1 Theory ==&lt;br /&gt;
==== 1.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Compltete the Classical Harmonic Osciallator Spreadsheet&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
[[File:JmsD_HO.xls|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 1.2 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For δt=0.01, estimate the positions of maximum error and fit accordingly.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
[[File:JmsD Max Error Graph.png|thumb|800px|center|&#039;&#039;&#039;Figure 1:&#039;&#039;&#039; &#039;&#039;A plot of the error in VV algorithm data&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==== 1.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Experiment to find the timestep to ensure the total energy does not change by more than 1% over the course of the simulation. Why is this important?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 2 Equilibriation ==&lt;br /&gt;
&lt;br /&gt;
== 3 Simmulations under specific conditions ==&lt;br /&gt;
==== 3.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature, T* = 1.5), and two reasonable pressures in Lennard-Jones units.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run these simulations to plot the &#039;Equations of State&#039; [Below].&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The 10 phase points used inn this task were determined by the 5 temperatures (T): 1.6, 1.8, 2.0, 2.2, 2.4 and the pressures (p) 2.4, 2.8. The timestep (δt) chosen was again 0.0025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Npt_1.6_2.4.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Npt_1.6_2.4.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
==== 3.2 Task ====&lt;br /&gt;
&lt;br /&gt;
The temperature ideally needs to be maintained as close to the target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, as possible. This is done by multplying every velocity, by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &#039;target temperature&#039; is as stipulated in the input script&lt;br /&gt;
&lt;br /&gt;
The instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, will fluctuate  due to approximations made in the algorithm. &lt;br /&gt;
*If &amp;lt;math&amp;gt;T &amp;gt; \mathfrak{T}&amp;lt;/math&amp;gt;, the E&amp;lt;sub&amp;gt;K&amp;lt;/sub&amp;gt; is too high and thus &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be less than 1.&lt;br /&gt;
*If, by contrast, &amp;lt;math&amp;gt;T &amp;lt; \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be greater than 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;Equipartition theorem&#039; states that on average, every degree of freedom in a system at equilibrium will have K&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T/2 of energy. This sytem has 3 degrees of freedom and as such:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \mathbf{v}_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expressing in terms of the adjustment to target temperature as described above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma \mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Solve the equations for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\mathbf{v}_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.3 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Find out the importance of the three numbers 100 1000 100000.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How often are values sampled for the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How many measurments contribute to the average?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 {...VARIABLES...}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;How much time will this simulate?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3.4 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Using the output of the simulations in 3.1, plot density as a unction of temperature, for both pressures - (Incl. Error bars + Ideal Gas). Is the simulated density higher or lower than Ideal? Why? Finaly, does the discrepancy increase or decrease w. pressure?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_NpT1.png|thumb|500px|center|&#039;&#039;&#039;Figure 3.1:&#039;&#039;&#039; &#039;&#039;A plot of Average Density vs Average Temperature for two different pressures&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 4 Calculation of heat capacities using statistical physics ==&lt;br /&gt;
==== 4.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simulations and plot C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V as a function of temperature. Is this as expected?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD_Cv_2.0_0.2.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD_Cv_2.0_0.2.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
For this section, 5 simulations were run for each of the two densities: 0.2, 0.8. These simulations corresponded to each of the respective temperatures: 2.0, 2.2, 2.4, 2.6, 2.8 (in reduced units). The desired results of these simulations were the calculated values of the Heat Capacity at constant volume, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;. The results can be seen in Figure 4.1 as a funtion of the average temperatures.&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD Cv graph1.png|thumb|500px|center|&#039;&#039;&#039;Figure 4.1:&#039;&#039;&#039; &#039;&#039;A plot comparing Heat Capacity/Volume vs Average Temperature for two different densities&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
These graphs do indeed follow the trend expected, that is similar to the trend seen in a crystalline solid for example. The Heat Capacity is proportional to 1/T&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; [As seen in the Equations below] and as such a negative trend should be observed. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With reagrds to density, C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;/V increases as the density increases - which is again as expected - because heat capacity is dependant on the amount of material per volume, and thus a denser material (with the same volume) has more mass or moles per unit voulume.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 5 Radial Distribution Functions ==&lt;br /&gt;
==== 5.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; From simulations of the Lennard-Jones system in the three phases, Compute &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; in VMD. Discuss the differences in the 3 RDFs and thus what this means about the structure in each phase.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;For the solid phase, illustrate which lattics sites the first 3 peaks correspond to. What is the Lattice spacing? What is the Coordination number for each of the first three peaks?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The initial parameters for the simulations, in order to specify the correct phases were:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; Temperature: (For all phases) = 1.2 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Densities: (Solid) = 1.50, (Liquid) = 0.85, (Vapour) = 0.01 &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; Finally, to provide the initial positions of atoms, the simple cubic model was used for Liquid and Vapour, but for Solid FCC was used.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These parameters were calculated by examining the Lennar-Jones phase diagram found in literature. [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 &amp;lt;sup&amp;gt;[2] &amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_g(r).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.1:&#039;&#039;&#039; &#039;&#039;The Radial Distribution Functions of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Int(g(r))dr.png|thumb|500px|center|&#039;&#039;&#039;Figure 5.2:&#039;&#039;&#039; &#039;&#039;The Integrals of the RDFs of the three states&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
[[File:JmsD_Solid3(g(r)).png|thumb|500px|center|&#039;&#039;&#039;Figure 5.3:&#039;&#039;&#039; &#039;&#039;The RDF of the solid, paying particular attention to the first 3 peaks&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
== 6 Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
==== 6.1 Task ====&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Run simlations for the three phases, to calculate the mean squared displacement and velocity autocorrelation functions.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Example input file: [[File:JmsD.in|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
Example output file: [[File:JmsD.log|thumb|1250px|center|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 7 References ==&lt;br /&gt;
 1.  LAMMPS Manual, http://lammps.sandia.gov/doc/Section_commands.html#lammps-input-script , accessed November 2016&lt;br /&gt;
 2.  JP Hansen, L Verlet, Phys Rev, 184, 1969, http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151&lt;/div&gt;</summary>
		<author><name>Jmd114</name></author>
	</entry>
</feed>